diff --git a/.gitignore b/.gitignore
index b2434334bb..0c9f941a97 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,7 +10,6 @@ src/physics/clubb
src/physics/cosp2/src
src/physics/silhs
src/chemistry/geoschem/geoschem_src
-src/hemco
src/physics/pumas
src/physics/pumas-frozen
src/dynamics/fv3/atmos_cubed_sphere
diff --git a/Externals.cfg b/Externals.cfg
index 1e96526479..dfe04d45c4 100644
--- a/Externals.cfg
+++ b/Externals.cfg
@@ -1,5 +1,5 @@
[ccs_config]
-tag = ccs_config_cesm0.0.49
+tag = ccs_config_cesm0.0.82
protocol = git
repo_url = https://github.com/ESMCI/ccs_config_cesm
local_path = ccs_config
@@ -13,7 +13,7 @@ local_path = components/cice5
required = True
[cice6]
-tag = cesm_cice6_2_0_35
+tag = cesm_cice6_4_1_10
protocol = git
repo_url = https://github.com/ESCOMP/CESM_CICE
local_path = components/cice
@@ -21,14 +21,14 @@ externals = Externals.cfg
required = True
[cmeps]
-tag = cmeps0.14.12
+tag = cmeps0.14.43
protocol = git
repo_url = https://github.com/ESCOMP/CMEPS.git
local_path = components/cmeps
required = True
[cdeps]
-tag = cdeps0.12.67
+tag = cdeps1.0.24
protocol = git
repo_url = https://github.com/ESCOMP/CDEPS.git
local_path = components/cdeps
@@ -36,14 +36,14 @@ externals = Externals_CDEPS.cfg
required = True
[cpl7]
-tag = cpl7.0.15
+tag = cpl77.0.7
protocol = git
repo_url = https://github.com/ESCOMP/CESM_CPL7andDataComps
local_path = components/cpl7
required = True
[share]
-tag = share1.0.16
+tag = share1.0.17
protocol = git
repo_url = https://github.com/ESCOMP/CESM_share
local_path = share
@@ -57,21 +57,21 @@ local_path = libraries/mct
required = True
[parallelio]
-tag = pio2_5_9
+tag = pio2_6_2
protocol = git
repo_url = https://github.com/NCAR/ParallelIO
local_path = libraries/parallelio
required = True
[cime]
-tag = cime6.0.82
+tag = cime6.0.175
protocol = git
repo_url = https://github.com/ESMCI/cime
local_path = cime
required = True
[cism]
-tag = cismwrap_2_1_95
+tag = cismwrap_2_1_96
protocol = git
repo_url = https://github.com/ESCOMP/CISM-wrapper
local_path = components/cism
@@ -79,7 +79,7 @@ externals = Externals_CISM.cfg
required = True
[clm]
-tag = ctsm5.1.dev114
+tag = ctsm5.1.dev142
protocol = git
repo_url = https://github.com/ESCOMP/CTSM
local_path = components/clm
@@ -96,7 +96,7 @@ externals = Externals_FMS.cfg
required = True
[mosart]
-tag = mosart1_0_47
+tag = mosart1_0_48
protocol = git
repo_url = https://github.com/ESCOMP/MOSART
local_path = components/mosart
diff --git a/Externals_CAM.cfg b/Externals_CAM.cfg
index 94ddf36c77..3b9952f6e9 100644
--- a/Externals_CAM.cfg
+++ b/Externals_CAM.cfg
@@ -9,35 +9,30 @@ required = True
local_path = src/physics/carma/base
protocol = git
repo_url = https://github.com/ESCOMP/CARMA_base.git
-tag = carma4_00
+tag = carma4_01
required = True
[cosp2]
local_path = src/physics/cosp2/src
-protocol = svn
-repo_url = https://github.com/CFMIP/COSPv2.0/tags/
-tag = v2.1.4cesm/src
+protocol = git
+repo_url = https://github.com/CFMIP/COSPv2.0
+sparse = ../.cosp_sparse_checkout
+tag = v2.1.4cesm
required = True
[clubb]
local_path = src/physics/clubb
-protocol = svn
-repo_url = https://github.com/larson-group/clubb_release/tags/
-tag = clubb_4ncar_20221129_59cb19f/src/CLUBB_core
-required = True
-
-[silhs]
-local_path = src/physics/silhs
-protocol = svn
-repo_url = https://github.com/larson-group/clubb_release/tags/
-tag = clubb_4ncar_20221129_59cb19f/src/SILHS
+protocol = git
+repo_url = https://github.com/larson-group/clubb_release
+sparse = ../.clubb_sparse_checkout
+tag = clubb_4ncar_20221129_59cb19f_20230330_branchtag
required = True
[pumas]
local_path = src/physics/pumas
protocol = git
repo_url = https://github.com/ESCOMP/PUMAS
-tag = pumas_cam-release_v1.28
+tag = pumas_cam-release_v1.35
required = True
[pumas-frozen]
@@ -51,13 +46,13 @@ required = True
local_path = src/physics/ali_arms
protocol = git
repo_url = https://github.com/ESCOMP/ALI-ARMS
-tag = ALI_ARMS_v1.0.0
+tag = ALI_ARMS_v1.0.1
required = True
[atmos_phys]
-tag = atmos_phys0_00_011
+tag = atmos_phys0_02_000
protocol = git
-repo_url = https://github.com/NCAR/atmospheric_physics
+repo_url = https://github.com/ESCOMP/atmospheric_physics
required = True
local_path = src/atmos_phys
@@ -73,19 +68,19 @@ local_path = src/dynamics/mpas/dycore
protocol = git
repo_url = https://github.com/MPAS-Dev/MPAS-Model.git
sparse = ../.mpas_sparse_checkout
-hash = ff76a231
+hash = b8c33daa
required = True
[geoschem]
-tag = 14.1.1
+local_path = src/chemistry/geoschem/geoschem_src
protocol = git
repo_url = https://github.com/geoschem/geos-chem.git
-local_path = src/chemistry/geoschem/geoschem_src
+tag = 14.1.2
required = True
[hemco]
local_path = src/hemco
-tag = hemco-cesm1_1_2_hemco3_6_2
+tag = hemco-cesm1_2_1_hemco3_6_3_cesm
protocol = git
repo_url = https://github.com/ESCOMP/HEMCO_CESM.git
required = True
diff --git a/bld/build-namelist b/bld/build-namelist
index a0fd01542f..a6ab292ed4 100755
--- a/bld/build-namelist
+++ b/bld/build-namelist
@@ -3,8 +3,7 @@
#
# build-namelist
#
-# This script builds the namelists for the standalone CAM configuration of
-# CESM.
+# This script builds the namelists for the CAM component of CESM.
#
# build-namelist is designed to be used in conjuction with configure.
# By default configure produces a config_cache.xml file that contains all
@@ -49,7 +48,7 @@ OPTIONS
-case "name" Case identifier up to 32 characters
-config "filepath" Read the given configuration cache file to determine the configuration
of the CAM executable. Default: "config_cache.xml".
- -csmdata "dir" Root directory of CCSM input data.
+ -csmdata "dir" Root directory of CESM input data.
Can also be set by using the CSMDATA environment variable.
-dir "directory" Directory where output namelist files for each component will be
written, i.e., atm_in, drv_in, ice_in, lnd_in, rof_in, and ocn_in.
@@ -93,7 +92,7 @@ EOF
(my $ProgName = $0) =~ s!(.*)/!!; # name of this script
$ProgName = "CAM $ProgName"; # Since multiple components are now using a build-namelist
# utility add "CAM" qualifier to the name. This helps when
- # looking at error output from the whole CCSM system.
+ # looking at error output from the whole CESM system.
my $ProgDir = $1; # name of directory containing this script -- may be a
# relative or absolute path, or null if the script is in
# the user's PATH
@@ -183,7 +182,7 @@ EOF
if ($print>=2) { print "Using CAM configuration cache file $opts{'config'}$eol"; }
-# Check that the CCSM inputdata root directory has been specified.
+# Check that the CESM inputdata root directory has been specified.
my $inputdata_rootdir = undef;
if (defined($opts{'csmdata'})) {
$inputdata_rootdir = $opts{'csmdata'};
@@ -192,16 +191,16 @@ elsif (defined $ENV{'CSMDATA'}) {
$inputdata_rootdir = $ENV{'CSMDATA'};
}
else {
- die "$ProgName - ERROR: CCSM inputdata root directory must be specified by either -csmdata argument\n" .
+ die "$ProgName - ERROR: CESM inputdata root directory must be specified by either -csmdata argument\n" .
" or by the CSMDATA environment variable. :";
}
-if ($print>=2) { print "CCSM inputdata root directory: $inputdata_rootdir$eol"; }
+if ($print>=2) { print "CESM inputdata root directory: $inputdata_rootdir$eol"; }
# If the -test option is specified, then the inputdata root directory must be local or nfs mounted.
if ($opts{'test'}) {
(-d $inputdata_rootdir) or die <<"EOF";
-** $ProgName - ERROR: CCSM inputdata root is not a directory: \"$inputdata_rootdir\" **
+** $ProgName - ERROR: CESM inputdata root is not a directory: \"$inputdata_rootdir\" **
EOF
}
@@ -369,7 +368,9 @@ if (defined $opts{'case'}) { add_default($nl, 'case_name', 'val'=>$opts{'case'})
# Run type
if (defined $opts{'runtype'}) { add_default($nl, 'start_type', 'val'=>$opts{'runtype'}); }
-# Process the -namelist arg.
+# Process the -namelist argument. CIME uses this argument to pass the values that have been
+# set by the compset definition via the CAM_NAMELIST_OPTS variable, along with additional
+# settings made in the buildnml script.
if (defined $opts{'namelist'}) {
# Parse commandline namelist
@@ -387,7 +388,8 @@ if (defined $opts{'namelist'}) {
$nl->merge_nl($nl_arg_valid);
}
-# Process the -infile arg.
+# Process the -infile argument. CIME uses this argument to pass the contents of the user_nl_cam
+# file, along with additional settings made in the buildnml script.
if (defined $opts{'infile'}) {
# Parse namelist input from a file
@@ -405,6 +407,11 @@ if (defined $opts{'infile'}) {
$nl->merge_nl($nl_infile_valid);
}
+# Check for user input via the user_nl_cam file which is inconsistent with settings determined by
+# the compset definition.
+
+check_user_input($nl);
+
# Process the -use_case arg.
# Declare global symbol $uc_defaults even if it's not defined, because we check whether it's
# defined before using it in the get_default_value method below.
@@ -473,10 +480,26 @@ if ($phys eq 'adiabatic') {
++$phys_mode_flags;
}
my $ideal_mode = 0;
-if ($phys eq 'kessler' or $phys eq 'held_suarez' or $phys eq 'tj2016') {
+if ($phys eq 'kessler' or $phys eq 'held_suarez' or $phys eq 'tj2016' or $phys eq 'grayrad' ) {
$ideal_mode = 1;
++$phys_mode_flags;
}
+if ($phys eq 'grayrad' ) {
+ add_default($nl, 'frierson_albedo');
+ add_default($nl, 'frierson_c0');
+ add_default($nl, 'frierson_deltas');
+ add_default($nl, 'frierson_fb');
+ add_default($nl, 'frierson_linfrac');
+ add_default($nl, 'frierson_ri_c');
+ add_default($nl, 'frierson_tau_eqtr');
+ add_default($nl, 'frierson_tau_pole');
+ add_default($nl, 'frierson_tdlt');
+ add_default($nl, 'frierson_tmin');
+ add_default($nl, 'frierson_twidth');
+ add_default($nl, 'frierson_wetdrycoef');
+ add_default($nl, 'frierson_wind_min');
+ add_default($nl, 'frierson_z0');
+}
if ($phys_mode_flags > 1) {
die "$ProgName - ERROR: Only one of the variables atm_adiabatic, atm_ideal_phys, and aqua_planet can be set .true. \n";
}
@@ -553,17 +576,13 @@ if ( ($chem ne 'none') or ( $prog_species ) ){
my ( $gas_wetdep_list, $aer_wetdep_list, $aer_sol_facti, $aer_sol_factb, $aer_scav_coef,
$aer_drydep_list, $gas_drydep_list ) =
- set_dep_lists( $cfgdir, $chem_proc_src, $chem_src_dir, $nl, $print );
+ set_dep_lists( $chem, $cfgdir, $chem_proc_src, $chem_src_dir, $nl, $print );
if (length($gas_wetdep_list)>2){
add_default($nl, 'gas_wetdep_method' );
add_default($nl, 'gas_wetdep_list', 'val'=>$gas_wetdep_list );
}
- if ($chem =~ /geoschem/) {
- $prescribe_aerosols = $FALSE;
- }
-
if (length($aer_wetdep_list)>2){
# determine if prescribed aerosols are not needed ...
if ($aer_wetdep_list =~ /so4/i &&
@@ -594,10 +613,6 @@ if ( ($chem ne 'none') or ( $prog_species ) ){
if (length($aer_drydep_list)>2){
add_default($nl, 'aer_drydep_list', 'val'=>$aer_drydep_list );
}
- $nl->set_variable_value('aerosol_nl', 'aer_drydep_list', $aer_drydep_list);
- $nl->set_variable_value('aerosol_nl', 'aer_wetdep_list', $aer_wetdep_list);
- $nl->set_variable_value('drydep_inparm', 'drydep_list', $gas_drydep_list);
- $nl->set_variable_value('wetdep_inparm', 'gas_wetdep_list', $gas_wetdep_list);
}
if ($chem) {
# drydep_srf_file is only needed for prognostic MAM when the grid is unstructured.
@@ -851,7 +866,7 @@ if (($chem =~ /waccm_ma/ or $chem =~ /waccm_tsmlt/) and !$chem_rad_passive) {
elsif (($chem =~ /trop_strat/ or $chem =~ /geoschem/) and !$chem_rad_passive) {
$radval .= ",'N:O2:O2','A:CO2:CO2'";
}
-elsif ($co2_cycle and !$co2_cycle_rad_passive) {
+elsif (($co2_cycle and !$co2_cycle_rad_passive) or ($chem =~ /ghg_mam4/)) {
$radval .= ",'N:O2:O2','A:CO2:CO2'";
}
else {
@@ -877,7 +892,7 @@ if ($rad_prog_ozone) {
die "ERROR: can not set ozone rad_climate specification\n";
}
-if ((($chem =~ /waccm_ma/) or ($chem =~ /waccm_sc_mam/) or ($chem =~ /waccm_tsmlt/) or ($chem =~ /trop_strat/)) and !$chem_rad_passive ) {
+if ((($chem =~ /ghg_mam4/) or ($chem =~ /waccm_ma/) or ($chem =~ /waccm_sc_mam/) or ($chem =~ /waccm_tsmlt/) or ($chem =~ /trop_strat/)) and !$chem_rad_passive ) {
$radval .= ",'A:N2O:N2O','A:CH4:CH4','N:CFC11STAR:CFC11','A:CFC12:CFC12'";
} elsif ($prog_ghg1 and $prog_ghg2 and !$chem_rad_passive ) {
$radval .= ",'A:N2O:N2O','A:CH4:CH4','A:CFC11:CFC11','A:CFC12:CFC12'";
@@ -1662,7 +1677,16 @@ if ($chem =~ /waccm_sc/) {
add_default($nl, 'h2orates');
add_default($nl, 'solar_parms_data_file');
}
-
+if ($chem =~ /ghg_mam4/) {
+ add_default($nl, 'h2orates');
+ my $flbc_list = "'CH4','N2O','CO2','CFC11','CFC12'";
+ add_default($nl, 'flbc_list', 'val'=>$flbc_list);
+ unless (defined $nl->get_value('flbc_type')) {
+ add_default($nl, 'flbc_type', 'val'=>'CYCLICAL');
+ add_default($nl, 'flbc_cycle_yr', 'val'=>'2000');
+ }
+ add_default($nl, 'flbc_file');
+}
if ( $prog_species ) {
my $ddval;
my $emisval;
@@ -2019,10 +2043,6 @@ if ($chem =~ /geoschem/) {
my @files;
# Datasets
- #@files = ( 'soil_erod_file', 'flbc_file',
- # 'xs_coef_file','xs_short_file',
- # 'xs_long_file', 'rsf_file',
- # 'exo_coldens_file', 'sulf_file' );
@files = ( 'soil_erod_file', 'flbc_file' );
foreach my $file (@files) {
add_default($nl, $file);
@@ -2350,21 +2370,21 @@ if (($chem =~ /_mam4/ or $chem =~ /_mam5/) and ($phys =~ /cam6/ or $phys =~ /cam
$first = 0;
}
}
- if ($chem eq 'trop_mam4' or $chem eq 'waccm_sc_mam4') {
+ if ($chem eq 'trop_mam4' or $chem eq 'waccm_sc_mam4'or $chem eq 'ghg_mam4') {
# SOA yields (used for the interactive emissions) have been calculated based on the VBS yields in CAM-chem.
# Duseong S. Jo, et al. to be submitted to GMD, 2023 -- see https://github.com/ESCOMP/CAM/pull/727 discussion for additional detail.
- my %soae_fctrs = ('BENZENE_an_srf_file' => '3.4192D0',
- 'BENZENE_bb_srf_file' => '3.4192D0',
- 'ISOP_bb_srf_file' => '0.9058D0',
- 'MTERP_bb_srf_file' => '5.8638D0',
- 'TOLUENE_an_srf_file' => '9.4429D0',
- 'TOLUENE_bb_srf_file' => '9.4429D0',
- 'XYLENES_an_srf_file' => '7.3804D0',
- 'XYLENES_bb_srf_file' => '7.3804D0',
- 'IVOC_an_srf_file' => '8.6158D0',
- 'IVOC_bb_srf_file' => '8.6158D0',
- 'SVOC_an_srf_file' => '16.7388D0',
- 'SVOC_bb_srf_file' => '16.7388D0');
+ my %soae_fctrs = ('BENZENE_an_srf_file' => '2.5592D0',
+ 'BENZENE_bb_srf_file' => '2.5592D0',
+ 'ISOP_bb_srf_file' => '0.5954D0',
+ 'MTERP_bb_srf_file' => '5.1004D0',
+ 'TOLUENE_an_srf_file' => '8.2367D0',
+ 'TOLUENE_bb_srf_file' => '8.2367D0',
+ 'XYLENES_an_srf_file' => '6.5013D0',
+ 'XYLENES_bb_srf_file' => '6.5013D0',
+ 'IVOC_an_srf_file' => '8.5371D0',
+ 'IVOC_bb_srf_file' => '8.5371D0',
+ 'SVOC_an_srf_file' => '16.650D0',
+ 'SVOC_bb_srf_file' => '16.650D0');
foreach my $id (sort keys %soae_fctrs) {
my $rel_filepath = get_default_value($id, \%verhash);
my $abs_filepath = set_abs_filepath($rel_filepath, $inputdata_rootdir);
@@ -2393,13 +2413,18 @@ if (($chem =~ /_mam4/ or $chem =~ /_mam5/) and ($phys =~ /cam6/ or $phys =~ /cam
'num_a2_cv_ext_file' => 'num_a2',
);
- # aircraft emissions
- if ($chem !~ /trop_mam/ and $chem !~ /waccm_sc/) {
+ # air craft emissions
+ if ($chem !~ /trop_mam/ and $chem !~ /ghg_mam/ and $chem !~ /waccm_sc/) {
%species = (%species,
'bc_a4_ar_ext_file' => 'bc_a4',
'num_a4_ar_ext_file' => 'num_a4',
'no2_ar_ext_file' => 'NO2',
'so2_ar_ext_file' => 'SO2' );
+ } elsif ($chem =~ /ghg_mam/) {
+ %species = (%species,
+ 'bc_a4_ar_ext_file' => 'bc_a4',
+ 'num_a4_ar_ext_file' => 'num_a4',
+ 'so2_ar_ext_file' => 'SO2' );
}
# for transient cases include volcanic emissions
@@ -2441,7 +2466,7 @@ if (($chem =~ /_mam4/ or $chem =~ /_mam5/) and ($phys =~ /cam6/ or $phys =~ /cam
$first = 0;
}
}
- if ($chem !~ /geoschem/) {
+ if ($chem !~ /geoschem/) {
add_default($nl, 'ext_frc_specifier', 'val'=>$val);
unless (defined $nl->get_value('ext_frc_type')) {
add_default($nl, 'ext_frc_type', 'val'=>"'CYCLICAL'");
@@ -2450,13 +2475,13 @@ if (($chem =~ /_mam4/ or $chem =~ /_mam5/) and ($phys =~ /cam6/ or $phys =~ /cam
}
# MEGAN emissions
- if (($chem eq 'trop_mam4' or $chem eq 'waccm_sc_mam4') and !$aqua_mode and !$scam){
- my $val = "'SOAE = 0.9058*isoprene + 5.8638*(carene_3 + pinene_a + thujene_a + bornene +',"
+ if (($chem eq 'trop_mam4' or $chem eq 'waccm_sc_mam4' or $chem eq 'ghg_mam4') and !$aqua_mode and !$scam){
+ my $val = "'SOAE = 0.5954*isoprene + 5.1004*(carene_3 + pinene_a + thujene_a + bornene +',"
. "' terpineol_4 + terpineol_a + terpinyl_ACT_a + myrtenal + sabinene + pinene_b + camphene +',"
. "' fenchene_a + limonene + phellandrene_a + terpinene_a + terpinene_g + terpinolene +',"
. "' phellandrene_b + linalool + ionone_b + geranyl_acetone + neryl_acetone + jasmone +',"
. "' verbenene + ipsenol + myrcene + ocimene_t_b + ocimene_al + ocimene_c_b + 2met_nonatriene) + ',"
- . "' 13.4042*(farnescene_a + caryophyllene_b + acoradiene + aromadendrene + bergamotene_a +',"
+ . "' 12.3942*(farnescene_a + caryophyllene_b + acoradiene + aromadendrene + bergamotene_a +',"
. "' bergamotene_b + bisabolene_a + bisabolene_b + bourbonene_b + cadinene_d + cadinene_g +',"
. "' cedrene_a + copaene_a + cubebene_a + cubebene_b + elemene_b + farnescene_b +',"
. "' germacrene_B + germacrene_D + gurjunene_b + humulene_a + humulene_g + isolongifolene +',"
@@ -2601,10 +2626,10 @@ if (($chem =~ /_mam4/ or $chem =~ /_mam5/) and ($phys =~ /cam6/ or $phys =~ /cam
}
}
-if ($chem eq 'trop_mam4' or $chem eq 'waccm_sc_mam4') {
+if (($chem eq 'trop_mam4') or ($chem eq 'waccm_sc_mam4') or ($chem eq 'ghg_mam4')) {
# Prescribed species
- if ($chem eq 'waccm_sc_mam4') {
+ if (($chem eq 'waccm_sc_mam4')or($chem eq 'ghg_mam4')) {
add_default($nl, 'tracer_cnst_specifier', 'val'=>"'O3','OH','NO3','HO2','HALONS'");
add_default($nl, 'tracer_cnst_file');
add_default($nl, 'tracer_cnst_datapath');
@@ -2731,7 +2756,7 @@ if ($waccmx){
$maxzen = 116.;
} elsif ($chem =~ "trop_strat" or $chem =~ "waccm_") {
$maxzen = 97.01;
-} elsif ($chem =~ "trop_mam" or $chem =~ "trop_mozart") {
+} elsif ($chem =~ "trop_mam" or $chem =~ "trop_mozart" or $chem =~ "ghg_mam") {
$maxzen = 88.85;
}
if ($maxzen>0.0) {
@@ -2922,16 +2947,39 @@ else {
add_default($nl, 'use_hemco');
if ($nl->get_value('use_hemco') =~ m/$TRUE/io) {
add_default($nl, 'cam_physics_mesh');
+ add_default($nl, 'hemco_data_root');
add_default($nl, 'hemco_config_file');
+ add_default($nl, 'hemco_diagn_file');
add_default($nl, 'hemco_grid_xdim');
add_default($nl, 'hemco_grid_ydim');
- # In a compset with %HEMCO modifier enabled, set the value
- # of the use_hemco variable to true
- #
- # use_hemco is in &phys_ctl_nl so that the relevant routine calls
- # can be controlled in physpkg and at levels below
- $nl->set_variable_value('phys_ctl_nl', 'use_hemco', '.true.');
+ # Remove these variables if present in the namelist since they are
+ # ignored at runtime when HEMCO is used.
+ $nl->delete_variable('chem_inparm', 'ext_frc_specifier');
+ $nl->delete_variable('chem_inparm', 'srf_emis_specifier');
+
+ if ($chem =~ /geoschem/) {
+
+ # For now, HEMCO config and diagnostic configuration files are always used from
+ # the case directory. Exit if user has specified other paths in the user namelist
+ # because it will not work.
+ if ($nl->get_value('hemco_config_file') ne "'" . $inputdata_rootdir . "/HEMCO_Config.rc'") {
+ die "CAM Namelist ERROR: When running with GEOS-Chem chemistry, hemco_config_file\n".
+ "must not be manually set in the namelist. Instead, modify (or symlink from) the HEMCO_Config.rc\n".
+ "in the case directory, which will be copied to the run directory when submitting.\n".
+ "Then remove the hemco_config_file option from the user namelist.\n";
+ }
+
+ if ($nl->get_value('hemco_diagn_file') ne "'" . $inputdata_rootdir . "/HEMCO_Diagn.rc'") {
+ die "CAM Namelist ERROR: When running with GEOS-Chem chemistry, hemco_diagn_file\n".
+ "must not be manually set in the namelist. Instead, modify (or symlink from) the HEMCO_Diagn.rc\n".
+ "in the case directory, which will be copied to the run directory when submitting.\n".
+ "Then remove the hemco_diagn_file option from the user namelist.\n";
+ }
+
+ $nl->set_variable_value('hemco_nl', 'hemco_config_file', "'HEMCO_Config.rc'");
+ $nl->set_variable_value('hemco_nl', 'hemco_diagn_file', "'HEMCO_Diagn.rc'");
+ }
}
# Physics options
@@ -3109,7 +3157,6 @@ if ($cfg->get('microphys') =~ /^mg/) {
add_default($nl, 'nucleate_ice_subgrid_strat');
add_default($nl, 'nucleate_ice_use_troplev');
add_default($nl, 'cld_macmic_num_steps', 'dtime'=>$dtime);
- add_default($nl, 'micro_mg_dcs');
add_default($nl, 'micro_mg_precip_frac_method');
add_default($nl, 'micro_mg_berg_eff_factor');
add_default($nl, 'nucleate_ice_incloud');
@@ -3128,15 +3175,54 @@ if ($cfg->get('microphys') =~ /^mg/) {
add_default($nl, 'micro_mg_iaccr_factor');
add_default($nl, 'micro_mg_max_nicons');
- # For CESM2, the decision was made to set micro_do_sb_physics to false
- add_default($nl, 'micro_do_sb_physics', 'val'=>'.false.');
# namelist options for pumas tag release_v1.22 or later
# (currently only in the cam_dev physics package)
if ($phys =~ /cam_dev/) {
+ add_default($nl, 'micro_mg_warm_rain');
add_default($nl, 'micro_mg_accre_sees_auto');
+ add_default($nl, 'micro_mg_vtrms_factor');
add_default($nl, 'micro_mg_implicit_fall');
+ add_default($nl, 'pumas_stochastic_tau_kernel_filename', 'val'=>"$cfgdir/../src/physics/pumas/KBARF_tau_kernel.dat");
+
+ #set path for stochastic_tau_kernel_filename
+ my $cam_dir = $cfg->get('cam_dir');
+ add_default($nl, 'pumas_stochastic_tau_kernel_filename');
+ my $rel_path = $nl->get_value('pumas_stochastic_tau_kernel_filename');
+ my $abs_path = quote_string(set_abs_filepath($rel_path, $cam_dir));
+ #overwrite the relative pathname with the absolute pathname
+ $nl->set_variable_value('pumas_stochastic_tau_nl', 'pumas_stochastic_tau_kernel_filename', $abs_path);
+
+ }else {
+ # For CESM2, the decision was made to set micro_do_sb_physics to false
+ # This variable is replaced with micro_mg_warm_rain in cam_dev runs
+ add_default($nl, 'micro_do_sb_physics', 'val'=>'.false.');
+ }
+
+ # tunings for micro_mg_dcs
+ my $microphys = $cfg->get('microphys');
+ my $hgrid = $cfg->get('hgrid');
+ my $silhs = $cfg->get('silhs');
+
+ my $micro_mg_dcs = '400.D-6'; # default for cam5/mg1
+
+ if ($microphys =~ /mg2|mg3/) {
+ if ($silhs eq '1') {
+ $micro_mg_dcs = '390.D-6'; # default for SIHLS
+ }
+ elsif ($hgrid =~ /1.9x2.5/ and $phys eq 'cam6') {
+ $micro_mg_dcs = '200.D-6'; # default for FV 2-deg
+ }
+ elsif ($phys eq 'cam6') {
+ $micro_mg_dcs = '500.D-6'; # default for cam6
+ }
+ elsif ($phys eq 'cam_dev') {
+ $micro_mg_dcs = '500.D-6'; # default for cam_dev
+ }
}
+
+
+ add_default($nl, 'micro_mg_dcs', 'val'=>$micro_mg_dcs);
}
# Aerosol Namelist options
@@ -3145,6 +3231,7 @@ add_default($nl, 'microp_aero_npccn_scale');
add_default($nl, 'microp_aero_wsub_scale');
add_default($nl, 'microp_aero_wsubi_scale');
add_default($nl, 'microp_aero_wsub_min');
+add_default($nl, 'microp_aero_wsub_min_asf');
add_default($nl, 'microp_aero_wsubi_min');
# Ice nucleation options
@@ -3154,6 +3241,11 @@ if (!$simple_phys) {
} else {
add_default($nl, 'use_hetfrz_classnuc', 'val'=>'.false.');
}
+ if ($nl->get_value('use_hetfrz_classnuc') =~ m/$TRUE/io) {
+ # set default scaling factors if het frz is turned on
+ add_default($nl, 'hetfrz_bc_scalfac');
+ add_default($nl, 'hetfrz_dust_scalfac');
+ }
add_default($nl, 'use_preexisting_ice');
if ($chem =~ /_mam7/) {
if ($nl->get_value('use_preexisting_ice') =~ m/$TRUE/io) {
@@ -3391,6 +3483,9 @@ if ($clubb_sgs =~ /$TRUE/io) {
add_default($nl, 'clubb_mf_L0');
add_default($nl, 'clubb_mf_ent0');
add_default($nl, 'clubb_mf_nup');
+
+ #Turn on HB scheme where CLUBB not active
+ add_default($nl, 'do_hb_above_clubb');
}
# Force exit if running cam_dev and CLUBB is off
@@ -3468,7 +3563,10 @@ if (!$simple_phys) {
add_default($nl, 'cldfrc2m_rhmaxi');
add_default($nl, 'cldfrc2m_rhminis');
add_default($nl, 'cldfrc2m_rhmaxis');
+ add_default($nl, 'cldfrc2m_qist_min');
+ add_default($nl, 'cldfrc2m_qist_max');
add_default($nl, 'cldfrc2m_do_subgrid_growth');
+ add_default($nl, 'cldfrc2m_do_avg_aist_algs');
}
my $rk_strat_polstrat_rhmin = $nl->get_value('rk_strat_polstrat_rhmin');
@@ -3485,7 +3583,6 @@ if (!$simple_phys) {
add_default($nl, 'zmconv_ke');
add_default($nl, 'zmconv_ke_lnd');
add_default($nl, 'zmconv_org');
- add_default($nl, 'zmconv_microp');
add_default($nl, 'zmconv_num_cin');
add_default($nl, 'zmconv_dmpdz');
add_default($nl, 'zmconv_tiedke_add');
@@ -3550,14 +3647,16 @@ if ( length($nl->get_value('soil_erod_file'))>0 ) {
else {
if ($chem =~ /trop_strat/ or $chem =~ /geoschem/ or $chem =~ /waccm_ma/ or $chem =~ /waccm_tsmlt/ or $chem =~ /trop_mozart/) {
add_default($nl, 'dust_emis_fact', 'ver'=>'chem');
- # set scaling of lightning NOx production
- add_default($nl, 'lght_no_prd_factor' );
}
else {
add_default($nl, 'dust_emis_fact');
}
}
}
+if (chem_has_species($cfg, 'NO')) {
+ # set scaling of lightning NOx production
+ add_default($nl, 'lght_no_prd_factor' );
+}
# Seasalt emissions tuning factor
if ($chem =~ /_mam(\d)/) {
@@ -3637,6 +3736,11 @@ if ($waccm_phys or
}
add_default($nl, 'gw_qbo_hdepth_scaling', 'val'=>$hdepth_scaling);
add_default($nl, 'gw_top_taper');
+} elsif ($phys =~ /cam_dev/) {
+ # cam_dev settings for nlev<60 (Other cam_dev set above)
+ add_default($nl, 'use_gw_front' , 'val'=>'.true.');
+ add_default($nl, 'use_gw_convect_dp', 'val'=>'.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.');
@@ -3692,6 +3796,7 @@ if ($do_gw_front_igw) {
if ($do_gw_front or $do_gw_front_igw) {
add_default($nl, 'frontgfc');
+ add_default($nl, 'front_gaussian_width');
}
if ($do_gw_convect_dp) {
@@ -3709,8 +3814,8 @@ if ($do_gw_rdg_beta) {
die "$ProgName - ERROR: beta ridge scheme requires data from a topo file.\n";
}
add_default($nl, 'n_rdg_beta', 'val'=>'10');
- add_default($nl, 'effgw_rdg_beta', 'val'=>'1.0D0');
- add_default($nl, 'effgw_rdg_beta_max', 'val'=>'1.0D0');
+ add_default($nl, 'effgw_rdg_beta');
+ add_default($nl, 'effgw_rdg_beta_max');
add_default($nl, 'trpd_leewv_rdg_beta', 'val'=>'.false.');
add_default($nl, 'rdg_beta_cd_llb', 'val'=>'1.0D0');
}
@@ -3766,7 +3871,9 @@ if (($do_gw_rdg_beta or $do_gw_rdg_gamma)) {
# use tau_0_ubc = .false. to avoid changing answers.
if ((not $waccm_phys) and
($do_gw_front or $do_gw_front_igw or
- $do_gw_convect_dp or $do_gw_convect_sh)) {
+ $do_gw_convect_dp or $do_gw_convect_sh )) {
+ add_default($nl, 'tau_0_ubc', 'val'=>'.true.');
+} elsif ($phys =~ /cam_dev/) {
add_default($nl, 'tau_0_ubc', 'val'=>'.true.');
} elsif (!$simple_phys) {
add_default($nl, 'tau_0_ubc', 'val'=>'.false.');
@@ -3933,7 +4040,6 @@ if ($dyn =~ /se/) {
my @vars = qw(
se_ftype
se_horz_num_threads
- se_lcp_moist
se_large_Courant_incr
se_hypervis_subcycle
se_hypervis_subcycle_sponge
@@ -3961,8 +4067,8 @@ if ($dyn =~ /se/) {
se_fvm_supercycling_jet
se_kmin_jet
se_kmax_jet
- se_phys_dyn_cp
se_molecular_diff
+ se_pgf_formulation
);
my %opts;
@@ -4051,6 +4157,7 @@ if ($dyn =~ /mpas/) {
add_default($nl, 'mpas_zd');
add_default($nl, 'mpas_xnutr');
add_default($nl, 'mpas_cam_coef');
+ add_default($nl, 'mpas_cam_damping_levels');
add_default($nl, 'mpas_print_detailed_minmax_vel');
add_default($nl, 'mpas_rayleigh_damp_u');
add_default($nl, 'mpas_rayleigh_damp_u_timescale_days');
@@ -4186,6 +4293,21 @@ add_default($nl, 'cam_snapshot_before_num');
add_default($nl, 'cam_snapshot_after_num');
check_snapshot_settings();
+if ($opts{'cmeps'}) {
+ # advertise the nature of ozone data passed to surface models
+ if ($rad_prog_ozone) {
+ add_default($nl, 'atm_ozone_frequency', 'val'=>'subdaily');
+ } else {
+ add_default($nl, 'atm_ozone_frequency', 'val'=>'multiday_average');
+ }
+ # for lightning flash freq to CTSM
+ if ($simple_phys or $aqua_mode) {
+ add_default($nl, 'atm_provides_lightning', 'val'=>'.false.');
+ } else {
+ add_default($nl, 'atm_provides_lightning', 'val'=>'.true.');
+ }
+}
+
#-----------------------------------------------------------------------------------------------
# Write output files
@@ -4202,16 +4324,8 @@ my %nl_group = ();
foreach my $name (@nl_groups) { $nl_group{$name} = ''; }
# Dry deposition, MEGAN VOC emis and ozone namelists
-@comp_groups = qw(drydep_inparm megan_emis_nl fire_emis_nl carma_inparm ndep_inparm ozone_coupling_nl);
+@comp_groups = qw(drydep_inparm megan_emis_nl fire_emis_nl carma_inparm ndep_inparm ozone_coupling_nl lightning_coupling_nl);
-# nature of ozone data passed to surface models -- only if cmeps (nuopc) coupling is used
-if ($opts{'cmeps'}) {
- if ($rad_prog_ozone) {
- add_default($nl, 'atm_ozone_frequency', 'val'=>'subdaily');
- } else {
- add_default($nl, 'atm_ozone_frequency', 'val'=>'multiday_average');
- }
-}
$outfile = "$opts{'dir'}/drv_flds_in";
$nl->write($outfile, 'groups'=>\@comp_groups);
if ($print>=1) {
@@ -4367,7 +4481,7 @@ sub add_default {
#
# ***** N.B. ***** This routine assumes the following variables are in package main::
# $definition -- the namelist definition object
-# $inputdata_rootdir -- CCSM inputdata root directory
+# $inputdata_rootdir -- CESM inputdata root directory
my $nl = shift; # namelist object
my $var = shift; # name of namelist variable
@@ -4420,7 +4534,7 @@ sub add_default {
# The default values for input pathnames are relative. If the namelist
# variable is defined to be an absolute pathname, then prepend
- # the CCSM inputdata root directory.
+ # the CESM inputdata root directory.
if ($is_input_pathname eq 'abs') {
$val = set_abs_filepath($val, $inputdata_rootdir);
}
@@ -4590,6 +4704,37 @@ sub fv3_decomp_set{
#-----------------------------------------------------------------------------------------------
+sub check_user_input {
+
+# Check that user input in the user_nl_cam file is consistent with input that has been set by
+# the compset definition via CAM_NAMELIST_OPTS. This routine is called after build-namelist has
+# processed both the -namelist argument which contains the input from CAM_NAMELIST_OPTS, and
+# the -infile argument which contains input from user_nl_cam.
+#
+# Checks for specific inconsistencies are added here by CAM developers as deemed useful for
+# improving robustness of the user interface.
+
+ my $nl = shift; # namelist object
+
+ # When HEMCO is being used any emissions or external forcings specified by the
+ # srf_emis_specifier and ext_frc_specifier variables will be ignored at runtime.
+ # Check here that these variable are not set if the compset definition sets
+ # use_hemco=.true.
+
+ my $hemco = $nl->get_value('use_hemco');
+ if (defined $hemco and $hemco =~ m/$TRUE/io) {
+ if (defined $nl->get_value('srf_emis_specifier') or
+ defined $nl->get_value('ext_frc_specifier') ) {
+ die "$ProgName - ERROR: It is not allowed to set either srf_emis_specifier \n",
+ " or ext_frc_specifier when HEMCO is used.\n";
+ }
+ }
+
+
+}
+
+#-----------------------------------------------------------------------------------------------
+
sub check_input_files {
# For each variable in the namelist which is an input dataset, or contains filepaths
@@ -4755,7 +4900,7 @@ sub check_input_files {
# If $name2 starts with a slash, then it is an absolute filepath.
# If $name2 starts with a $, then it is an unresolved filepath
- # (generated when run from CCSM scripts).
+ # (generated when run from CIME scripts).
# Otherwise check for more fields
if ($name2 =~ m:^[/\$]:) {
@@ -4895,6 +5040,8 @@ sub check_snapshot_settings {
push (@validList_bc, ("'kessler_tend'"));
} elsif ($phys eq 'tj2016') {
push (@validList_bc, ("'thatcher_jablonowski_precip_tend'"));
+ } elsif ($phys eq 'grayrad') {
+ push (@validList_bc, ("'frierson_tend'"));
}
if ($chem ne 'none') {
push (@validList_bc, ("'chem_timestep_tend'"));
@@ -5013,38 +5160,6 @@ sub check_snapshot_settings {
#-----------------------------------------------------------------------------------------------
-sub strip_rootdir {
-
-# Strip a root directory from the begining of a filepath.
-# Allow for the possibility that the root directory is specified as a shell variable
-# to support a CCSM script requirement.
-
- my ($filepath, $rootdir) = @_;
-
- # Check whether the rootdir is specified as a shell variable.
- if ($rootdir =~ m/^\$(\w*)/) {
-
- my $rootname = $1;
-
- # Strip off the root directory with the following regexp that
- # avoids the problem of $rootdir being interpolated to a scalar variable
- # name...
- #$filepath =~ s:^\$$rootname::;
-
- # The CCSM scripts are currently set up to expect the shell variable in the
- # output file that contains the list of inputdata files. So in this case
- # do nothing.
-
- }
- else {
- # Strip off the rootdir specified as a resolved pathname
- $filepath =~ s:^$rootdir::;
- }
- return $filepath;
-}
-
-#-----------------------------------------------------------------------------------------------
-
sub set_abs_filepath {
# check whether the input filepath is an absolute path, and if it isn't then
diff --git a/bld/config_files/definition.xml b/bld/config_files/definition.xml
index 4b3afd38fa..7f3ed23873 100644
--- a/bld/config_files/definition.xml
+++ b/bld/config_files/definition.xml
@@ -46,25 +46,27 @@ Switch to turn on analytic initial conditions for the dynamics state:
0 => no
1 => yes.
+
+Model top specifier - set by compset definition
+ lt: ~ 40 km top
+ mt: ~ 80 km top
+
Option to turn on waccmx thermosphere/ionosphere extension: 0 => no, 1 => yes
Ionosphere model used in WACCMX.
-
-Switch to turn on Harmonized Emissions Component (HEMCO): 0 => no, 1 => yes
-
-
-Physics package: cam3, cam4, cam5, cam6, cam_dev, held_suarez, adiabatic, kessler, tj2016, spcam_sam1mom, spcam_m2005.
+
+Physics package: cam3, cam4, cam5, cam6, cam_dev, held_suarez, adiabatic, kessler, tj2016, grayrad, spcam_sam1mom, spcam_m2005.
Switch to turn on Harmonized Emissions Component (HEMCO) for chemistry: 0 => no, 1 => yes.
-
+
Microphysics package: rk (Rasch and Kristjansson), mg1 (Morrison and
Gettelman two moment scheme CAM5.1), mg2 (Morrison and Gettelman second
-version CAM6), mg3 (MG scheme 3rd version, graupel), SPCAM_m2005, SPCAM_sam1mom.
+version CAM6), mg3 (MG scheme 3rd version, graupel), PUMAS, SPCAM_m2005, SPCAM_sam1mom.
Macrophysics package: RK, Park, CLUBB_SGS, SPCAM_sam1mom, SPCAM_m2005.
@@ -101,8 +103,8 @@ meteor_smoke (Meteor Smoke), mixed_sulfate (Meteor Smoke and Sulfate), pmc (Pola
sulfate (Sulfate Aerosols), tholin (early earth haze), test_detrain (Detrainment), test_growth (Particle Growth), test_passive (Passive Dust),
test_radiative (Radiatively Active Dust), test_swelling (Sea Salt), test_tracers (Asian Monsoon), test_tracers2 (Guam).
-
- Chemistry package: none,terminator,trop_mam3,trop_mam4,trop_mam7,trop_mozart,trop_strat_mam4_ts2,trop_strat_mam4_vbs,trop_strat_mam4_vbsext,trop_strat_mam5_ts2,trop_strat_mam5_vbs,trop_strat_mam5_vbsext,waccm_ma,waccm_mad,waccm_ma_sulfur,waccm_sc,waccm_sc_mam4,waccm_mad_mam4,waccm_ma_mam4,waccm_tsmlt_mam4,waccm_tsmlt_mam4_vbsext,waccm_mad_mam5,waccm_ma_mam5,waccm_tsmlt_mam5,waccm_tsmlt_mam5_vbsext,geoschem_mam4
+
+ Chemistry package: none,ghg_mam4,terminator,trop_mam3,trop_mam4,trop_mam7,trop_mozart,trop_strat_mam4_ts2,trop_strat_mam4_vbs,trop_strat_mam4_vbsext,trop_strat_mam5_ts2,trop_strat_mam5_vbs,trop_strat_mam5_vbsext,waccm_ma,waccm_mad,waccm_ma_sulfur,waccm_sc,waccm_sc_mam4,waccm_mad_mam4,waccm_ma_mam4,waccm_tsmlt_mam4,waccm_tsmlt_mam4_vbsext,waccm_mad_mam5,waccm_ma_mam5,waccm_tsmlt_mam5,waccm_tsmlt_mam5_vbsext,geoschem_mam4
Prognostic mozart species packages: list of any subset of the following: DST,SSLT,SO4,GHG,OC,BC,CARBON16
diff --git a/bld/configure b/bld/configure
index d3e0e8e2c6..a87590de73 100755
--- a/bld/configure
+++ b/bld/configure
@@ -63,7 +63,7 @@ OPTIONS
test_tracers, test_tracers2].
Default: none.
-chem Build CAM with specified prognostic chemistry package
- [ none | terminator | trop_mam3 | trop_mam4 | trop_mam7 | trop_mozart | trop_strat_mam4_ts2 |
+ [ none | ghg_mam4 | terminator | trop_mam3 | trop_mam4 | trop_mam7 | trop_mozart | trop_strat_mam4_ts2 |
trop_strat_mam4_vbs | trop_strat_mam4_vbsext | trop_strat_mam5_ts2 | trop_strat_mam5_vbs |
trop_strat_mam5_vbsext | waccm_ma | waccm_mad | waccm_ma_sulfur | waccm_sc | waccm_sc_mam4 |
waccm_mad_mam4 | waccm_ma_mam4 | waccm_tsmlt_mam4 | waccm_tsmlt_mam4_vbsext | waccm_mad_mam5 |
@@ -80,7 +80,6 @@ OPTIONS
-cpl Coupling framework [mct | nuopc]. Default: mct.
-dyn Dynamical core option: [eul | fv | se | fv3 | mpas]. Default: fv.
-edit_chem_mech Invokes CAMCHEM_EDITOR to allow the user to edit the chemistry mechanism file
- -hemco Switch enables the use of the Harmonized Emissions Component.
-hgrid Specify horizontal grid. Use nlatxnlon for spectral grids;
dlatxdlon for fv grids (dlat and dlon are the grid cell size
in degrees for latitude and longitude respectively); nexnp for
@@ -89,7 +88,8 @@ OPTIONS
-macrophys Specify the macrophysics option [rk | park | clubb_sgs].
-max_n_rad_cnst Maximum number of constituents that are either radiatively
active, or in any single diagnostic list for the radiation.
- -microphys Specify the microphysics option [mg1 | mg2 | mg3| rk].
+ -microphys Specify the microphysics option [mg1 | mg2 | mg3| rk | pumas].
+ -model_top Specify the model_top option [ lt | mt ].
-nadv Set total number of advected species to .
-nadv_tt Set number of advected test tracers .
-nlev Set number of levels to .
@@ -98,7 +98,7 @@ OPTIONS
-pcols Set maximum number of columns in a chunk to .
-pergro Switch enables building CAM for perturbation growth tests.
-phys Physics option [cam3 | cam4 | cam5 | cam6 | cam_dev |
- held_suarez | adiabatic | kessler | tj2016 |
+ held_suarez | adiabatic | kessler | tj2016 | grayrad
spcam_sam1mom | spcam_m2005]. Default: cam6
-prog_species Comma-separate list of prognostic mozart species packages.
Currently available: DST,SSLT,SO4,GHG,OC,BC,CARBON16
@@ -140,10 +140,6 @@ OPTIONS
-verbose [or -v] Turn on verbose echoing of settings made by configure.
-version Echo the CVS tag name used to check out this CAM distribution.
- Options for surface components used in standalone CAM mode:
-
- -ocn Build CAM with ocean model [docn | dom | som | socn | aquaplanet | pop]. Default: aquaplanet
-
Options for building CAM via standalone scripts:
-cam_bld Directory where CAM will be built. This is where configure will write the
@@ -267,7 +263,6 @@ GetOptions(
"fv3core_libdir=s" => \$opts{'fv3core_libdir'},
"gmake=s" => \$opts{'gmake'},
"h|help" => \$opts{'help'},
- "hemco" => \$opts{'hemco'},
"hgrid=s" => \$opts{'hgrid'},
"ionosphere=s" => \$opts{'ionosphere'},
"lapack_libdir=s" => \$opts{'lapack_libdir'},
@@ -277,6 +272,7 @@ GetOptions(
"max_n_rad_cnst=s" => \$opts{'max_n_rad_cnst'},
"mct_libdir=s" => \$opts{'mct_libdir'},
"microphys=s" => \$opts{'microphys'},
+ "model_top=s" => \$opts{'model_top'},
"mpas_libdir=s" => \$opts{'mpas_libdir'},
"mpi_inc=s" => \$opts{'mpi_inc'},
"mpi_lib=s" => \$opts{'mpi_lib'},
@@ -563,7 +559,7 @@ if ($print>=2) { print "Physics package: $phys_pkg$eol"; }
# Set flag to indicate a simple physics option
my $simple_phys = 0;
-if ($phys_pkg =~ m/^adiabatic$|^held_suarez$|^kessler$|^tj2016$/) {
+if ($phys_pkg =~ m/^adiabatic$|^held_suarez$|^kessler$|^tj2016$|^grayrad$/) {
$simple_phys = 1;
}
@@ -596,10 +592,9 @@ if (defined $opts{'chem'}) {
# If the user has specified a simple physics package...
if ($simple_phys) {
- # the only valid chemistry options are 'none', 'terminator' and 'geoschem'
- if (($chem_pkg ne 'none') and ($chem_pkg ne 'terminator') and !($chem_pkg =~ 'geoschem')) {
+ if (($chem_pkg ne 'none') and ($chem_pkg ne 'terminator')) {
die "configure ERROR: -phys=$phys_pkg -chem=$chem_pkg\n".
- " -chem can only be set to 'none', 'terminator' or 'geoschem'.\n";
+ " -chem can only be set to 'none' or 'terminator'.\n";
}
}
elsif ($phys_pkg =~ m/^cam3$|^cam4$|^spcam_sam1mom$/) {
@@ -680,6 +675,17 @@ my $max_n_rad_cnst = $cfg_ref->get('max_n_rad_cnst');
if ($print>=2) { print "Maximum radiatively active tracers: $max_n_rad_cnst$eol"; }
+#-----------------------------------------------------------------------------------------------
+# model_top - not set by default
+my $model_top = 'none';
+$cfg_ref->set('model_top', $model_top);
+
+# user override
+if (defined $opts{'model_top'}) {
+ $cfg_ref->set('model_top', $opts{'model_top'});
+}
+if ($print>=2) { print "model_top: $model_top$eol"; }
+
#-----------------------------------------------------------------------------------------------
# waccm physics
my $waccm_phys = 0;
@@ -832,6 +838,10 @@ if (defined $opts{'microphys'}) {
$microphys_pkg = lc($opts{'microphys'});
}
+if($microphys_pkg eq 'pumas') {
+ $microphys_pkg = 'mg3';
+}
+
$cfg_ref->set('microphys', $microphys_pkg);
if ($print>=2) { print "Microphysics package: $microphys_pkg$eol"; }
@@ -850,7 +860,7 @@ if ($carma_pkg =~ m/cirrus/i) {
unless ($microphys_pkg =~ /^mg/) {
die <<"EOF";
** ERROR: microphysics package set to: $microphys_pkg
-** The CARMA cirrus model only works with MG microphysics.
+** The CARMA cirrus model only works with MG or PUMAS microphysics.
EOF
}
}
@@ -877,7 +887,7 @@ if (defined $opts{'clubb_sgs'}) {
if ($clubb_sgs and not ($microphys_pkg =~ m/^mg/ )) {
die <<"EOF";
** ERROR: microphysics package set to: $microphys_pkg
-** CLUBB_SGS only works with MG microphysics.
+** CLUBB_SGS only works with MG or PUMAS microphysics.
EOF
}
@@ -1017,7 +1027,7 @@ if ($pbl_pkg =~ m/uw/i) {
unless ($microphys_pkg =~ /^mg/) {
die <<"EOF";
** ERROR: microphysics package set to: $microphys_pkg
-** The UW PBL scheme only works with MG microphysics.
+** The UW PBL scheme only works with MG or PUMAS microphysics.
EOF
}
}
@@ -1397,10 +1407,12 @@ if ($chem_pkg =~ '_mam3') {
$chem_cppdefs = ' -DMODAL_AERO -DMODAL_AERO_7MODE ';
}
-# Set GEOS-Chem CPP definitions here
+# Customize GEOS-Chem advected species and chemistry CPP definitions
if ($chem_pkg =~ 'geoschem') {
- $chem_cppdefs .= ' -DEXTERNAL_GRID -DEXTERNAL_FORCING -DLINUX_IFORT -DUSE_REAL8 -DMODEL_ -DMODEL_CESM';
- $chem_nadv = 267; # includes GC advected species (233), CO2 (1), and MAM aerosols (33)
+ $chem_cppdefs .= ' -DEXTERNAL_GRID -DEXTERNAL_FORCING ';
+ if ($chem_pkg =~ '_mam4') {
+ $chem_nadv = 267; # includes GC advected species (233), CO2 (1), and MAM aerosols (33)
+ }
}
# hplin 3/13/23 fjx in cc
@@ -1567,14 +1579,6 @@ else {
$nadv = $cfg_ref->get('nadv');
if ($print>=2) { print "Total advected constituents: $nadv$eol"; }
-#-----------------------------------------------------------------------------------------------
-
-# This switch controls namelist generation only, HEMCO is now always built.
-if (defined $opts{'hemco'}) {
- $cfg_ref->set('hemco', $opts{'hemco'});
-}
-my $hemco = $cfg_ref->get('hemco');
-
#-----------------------------------------------------------------------------------------------
# Makefile configuration #######################################################################
#-----------------------------------------------------------------------------------------------
@@ -1683,7 +1687,7 @@ elsif ($fc =~ /nvfor/) { $fc_type = 'nvhpc'; }
# User override for Fortran compiler type
if (defined $opts{'fc_type'}) { $fc_type = $opts{'fc_type'}; }
-if ($fc_type == "oneapi") {$fc_type = 'intel'; }
+if ($fc_type eq "oneapi") {$fc_type = 'intel'; }
if ($fc_type) {
$cfg_ref->set('fc_type', $fc_type);
if ($print>=2) { print "Fortran compiler type: $fc_type$eol"; }
@@ -1935,6 +1939,9 @@ if ($silhs == 1) {
$cfg_cppdefs .= ' -DSILHS';
}
+# Simple Models
+if ($simple_phys) { $cfg_cppdefs .= ' -DSIMPLE'; }
+
# UNICON
if ($unicon) { $cfg_cppdefs .= ' -DUSE_UNICON'; }
@@ -1946,6 +1953,12 @@ if ($unicon) { $cfg_cppdefs .= ' -DUSE_UNICON'; }
# HEMCO_CESM - indicates CESM model environment. Deprecated, will be removed soon.
$cfg_cppdefs .= ' -DMODEL_ -DMODEL_CESM -DHEMCO_CESM -DUSE_REAL8 ';
+# Compiler CPP definitions for GEOS-Chem
+if ($chem_pkg =~ 'geoschem') {
+ if ($fc_type eq 'intel') { $cfg_cppdefs .= ' -DLINUX_IFORT'; }
+ elsif ($fc_type eq 'gnu') { $cfg_cppdefs .= ' -DLINUX_GFORTRAN'; }
+}
+
#-----------------------------------------------------------------------------------------------
# CPP defines to put on Makefile
@@ -2102,7 +2115,6 @@ sub write_filepath
my $waccm_phys = $cfg_ref->get('waccm_phys');
my $waccmx = $cfg_ref->get('waccmx');
my $ionos = $cfg_ref->get('ionosphere');
- my $hemco = $cfg_ref->get('hemco');
my $carma = $cfg_ref->get('carma');
my $rad = $cfg_ref->get('rad');
my $dyn = $cfg_ref->get('dyn');
@@ -2166,32 +2178,32 @@ sub write_filepath
}
if ($chem_src_dir) {
print $fh "$chem_src_dir\n";
- if ($chem_pkg =~ 'geoschem') {
- print $fh "$chem_src_dir/geoschem_src/GeosCore\n";
- print $fh "$chem_src_dir/geoschem_src/GeosUtil\n";
- print $fh "$chem_src_dir/geoschem_src/Headers\n";
- print $fh "$chem_src_dir/geoschem_src/ISORROPIA\n";
- print $fh "$chem_src_dir/geoschem_src/KPP/fullchem\n";
- if ($chem =~ /_mam/) {
- print $fh "$camsrcdir/src/chemistry/modal_aero\n";
- print $fh "$camsrcdir/src/chemistry/aerosol\n";
- }
- # Also build Mozart for dependencies elsewhere in CESM
- # Some modules ignored since also in GEOS-Chem
- print $fh "$camsrcdir/src/chemistry/pp_none\n";
- print $fh "$camsrcdir/src/chemistry/mozart\n";
- }
- else {
- # build GEOS-Chem source always in order to have
- # access to Fast-JX in other modules. hplin 3/13/23
- print $fh "$camsrcdir/src/chemistry/geoschem/geoschem_src/GeosCore\n";
- print $fh "$camsrcdir/src/chemistry/geoschem/geoschem_src/GeosUtil\n";
- print $fh "$camsrcdir/src/chemistry/geoschem/geoschem_src/Headers\n";
- print $fh "$camsrcdir/src/chemistry/geoschem/geoschem_src/ISORROPIA\n";
- print $fh "$camsrcdir/src/chemistry/geoschem/geoschem_src/KPP/fullchem\n";
- }
}
+ # GEOS-Chem must be prior to Mozart
+ if ($chem_pkg =~ 'geoschem') {
+ print $fh "$chem_src_dir/geoschem_src/GeosCore\n";
+ print $fh "$chem_src_dir/geoschem_src/GeosUtil\n";
+ print $fh "$chem_src_dir/geoschem_src/Headers\n";
+ print $fh "$chem_src_dir/geoschem_src/ISORROPIA\n";
+ print $fh "$chem_src_dir/geoschem_src/KPP/fullchem\n";
+ print $fh "$camsrcdir/src/chemistry/pp_none\n";
+ }
+
+ # hplin 2/2/24 cc-fjx
+ print $fh "$chem_src_dir/geoschem_src/GeosCore\n";
+ print $fh "$chem_src_dir/geoschem_src/GeosUtil\n";
+ print $fh "$chem_src_dir/geoschem_src/Headers\n";
+ print $fh "$chem_src_dir/geoschem_src/ISORROPIA\n";
+ print $fh "$chem_src_dir/geoschem_src/KPP/fullchem\n";
+
+ if ($chem =~ /_mam/) {
+ print $fh "$camsrcdir/src/chemistry/modal_aero\n";
+ } else {
+ print $fh "$camsrcdir/src/chemistry/bulk_aero\n";
+ }
+ print $fh "$camsrcdir/src/chemistry/aerosol\n";
+
if ($waccmx) {
print $fh "$camsrcdir/src/physics/waccmx\n";
if ($ionos =~ /wxie/) {
@@ -2206,18 +2218,6 @@ sub write_filepath
}
print $fh "$camsrcdir/src/ionosphere\n";
- # -- Added by MSL - 1/2018
- # -- Updated by TMMF - 11/2019
- if (!($chem_pkg =~ 'geoschem')) {
- print $fh "$camsrcdir/src/chemistry/mozart\n";
- if ($chem =~ /_mam/) {
- print $fh "$camsrcdir/src/chemistry/modal_aero\n";
- } else {
- print $fh "$camsrcdir/src/chemistry/bulk_aero\n";
- }
- print $fh "$camsrcdir/src/chemistry/aerosol\n";
- }
- # --
print $fh "$camsrcdir/src/chemistry/mozart\n";
print $fh "$camsrcdir/src/hemco\n";
@@ -2244,11 +2244,11 @@ sub write_filepath
}
if ($clubb_sgs) {
- print $fh "$camsrcdir/src/physics/clubb\n";
+ print $fh "$camsrcdir/src/physics/clubb/src/CLUBB_core\n";
}
if ($silhs) {
- print $fh "$camsrcdir/src/physics/silhs\n";
+ print $fh "$camsrcdir/src/physics/clubb/src/SILHS\n";
}
if ($phys_pkg eq 'cam_dev') {
@@ -2286,6 +2286,9 @@ sub write_filepath
# in the list of filepaths.
print $fh "$camsrcdir/src/physics/cam\n";
+ #Add the CCPP'ized subdirectories
+ print $fh "$camsrcdir/src/atmos_phys/zm\n";
+
# Dynamics package and test utilities
print $fh "$camsrcdir/src/dynamics/$dyn\n";
if($dyn eq 'se') {
@@ -2309,6 +2312,7 @@ sub write_filepath
print $fh "$camsrcdir/src/cpl/$cpl\n";
print $fh "$camsrcdir/src/control\n";
print $fh "$camsrcdir/src/utils\n";
+ print $fh "$camsrcdir/src/utils/cam_ccpp\n";
print $fh "$camsrcdir/src/atmos_phys/utilities\n";
@@ -2344,13 +2348,13 @@ sub write_cosp_makefile
CAM_BLD := $cam_bld
COSP_PATH := $cam_dir/src/physics/cosp2
-ISCCP_PATH := $cam_dir/src/physics/cosp2/src/simulator/icarus
-RS_PATH := $cam_dir/src/physics/cosp2/src/simulator/quickbeam
-RT_PATH := $cam_dir/src/physics/cosp2/src/simulator/rttov
-CS_PATH := $cam_dir/src/physics/cosp2/src/simulator/actsim
-MISR_PATH := $cam_dir/src/physics/cosp2/src/simulator/MISR_simulator
-MODIS_PATH := $cam_dir/src/physics/cosp2/src/simulator/MODIS_simulator
-PARASOL_PATH := $cam_dir/src/physics/cosp2/src/simulator/parasol
+ISCCP_PATH := $cam_dir/src/physics/cosp2/src/src/simulator/icarus
+RS_PATH := $cam_dir/src/physics/cosp2/src/src/simulator/quickbeam
+RT_PATH := $cam_dir/src/physics/cosp2/src/src/simulator/rttov
+CS_PATH := $cam_dir/src/physics/cosp2/src/src/simulator/actsim
+MISR_PATH := $cam_dir/src/physics/cosp2/src/src/simulator/MISR_simulator
+MODIS_PATH := $cam_dir/src/physics/cosp2/src/src/simulator/MODIS_simulator
+PARASOL_PATH := $cam_dir/src/physics/cosp2/src/src/simulator/parasol
EOF
diff --git a/bld/namelist_files/geoschem_master_aer_drydep_list.xml b/bld/namelist_files/geoschem_master_aer_drydep_list.xml
new file mode 100644
index 0000000000..a31d3ff31c
--- /dev/null
+++ b/bld/namelist_files/geoschem_master_aer_drydep_list.xml
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+ dst_a1
+ so4_a1
+ nh4_a1
+ pom_a1
+ pomff1_a1
+ pombb1_a1
+ soa_a1
+ bc_a1
+ ncl_a1
+ num_a1
+ so4_a2
+ nh4_a2
+ soa_a2
+ ncl_a2
+ dst_a2
+ num_a2
+ dst_a3
+ ncl_a3
+ so4_a3
+ pom_a3
+ bc_a3
+ num_a3
+ ncl_a4
+ so4_a4
+ pom_a4
+ pomff1_a4
+ pombb1_a4
+ bc_a4
+ nh4_a4
+ num_a4
+ dst_a5
+ so4_a5
+ nh4_a5
+ num_a5
+ ncl_a6
+ so4_a6
+ nh4_a6
+ num_a6
+ dst_a7
+ so4_a7
+ nh4_a7
+ num_a7
+ soa1_a1
+ soa1_a2
+ soa2_a1
+ soa2_a2
+ soa3_a1
+ soa3_a2
+ soa4_a1
+ soa4_a2
+ soa5_a1
+ soa5_a2
+ soaff1_a1
+ soaff2_a1
+ soaff3_a1
+ soaff4_a1
+ soaff5_a1
+ soabb1_a1
+ soabb2_a1
+ soabb3_a1
+ soabb4_a1
+ soabb5_a1
+ soabg1_a1
+ soabg2_a1
+ soabg3_a1
+ soabg4_a1
+ soabg5_a1
+ soaff1_a2
+ soaff2_a2
+ soaff3_a2
+ soaff4_a2
+ soaff5_a2
+ soabb1_a2
+ soabb2_a2
+ soabb3_a2
+ soabb4_a2
+ soabb5_a2
+ soabg1_a2
+ soabg2_a2
+ soabg3_a2
+ soabg4_a2
+ soabg5_a2
+
+
+
diff --git a/bld/namelist_files/geoschem_master_aer_wetdep_list.xml b/bld/namelist_files/geoschem_master_aer_wetdep_list.xml
new file mode 100644
index 0000000000..16391485fe
--- /dev/null
+++ b/bld/namelist_files/geoschem_master_aer_wetdep_list.xml
@@ -0,0 +1,89 @@
+
+
+
+
+ dst_a1
+ so4_a1
+ nh4_a1
+ pom_a1
+ pomff1_a1
+ pombb1_a1
+ soa_a1
+ bc_a1
+ ncl_a1
+ num_a1
+ so4_a2
+ nh4_a2
+ soa_a2
+ ncl_a2
+ dst_a2
+ num_a2
+ dst_a3
+ ncl_a3
+ so4_a3
+ pom_a3
+ bc_a3
+ num_a3
+ ncl_a4
+ so4_a4
+ pom_a4
+ pomff1_a4
+ pombb1_a4
+ bc_a4
+ nh4_a4
+ num_a4
+ dst_a5
+ so4_a5
+ nh4_a5
+ num_a5
+ ncl_a6
+ so4_a6
+ nh4_a6
+ num_a6
+ dst_a7
+ so4_a7
+ nh4_a7
+ num_a7
+ soa1_a1
+ soa1_a2
+ soa2_a1
+ soa2_a2
+ soa3_a1
+ soa3_a2
+ soa4_a1
+ soa4_a2
+ soa5_a1
+ soa5_a2
+ soaff1_a1
+ soaff2_a1
+ soaff3_a1
+ soaff4_a1
+ soaff5_a1
+ soabb1_a1
+ soabb2_a1
+ soabb3_a1
+ soabb4_a1
+ soabb5_a1
+ soabg1_a1
+ soabg2_a1
+ soabg3_a1
+ soabg4_a1
+ soabg5_a1
+ soaff1_a2
+ soaff2_a2
+ soaff3_a2
+ soaff4_a2
+ soaff5_a2
+ soabb1_a2
+ soabb2_a2
+ soabb3_a2
+ soabb4_a2
+ soabb5_a2
+ soabg1_a2
+ soabg2_a2
+ soabg3_a2
+ soabg4_a2
+ soabg5_a2
+
+
+
diff --git a/bld/namelist_files/geoschem_master_gas_drydep_list.xml b/bld/namelist_files/geoschem_master_gas_drydep_list.xml
new file mode 100644
index 0000000000..eebafa33a7
--- /dev/null
+++ b/bld/namelist_files/geoschem_master_gas_drydep_list.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+ ACET
+ ACTA
+ ALD2
+ AROMP4
+ AROMP5
+ ATOOH
+ BALD
+ BENZP
+ BR2
+ BRCL
+ BRNO3
+ BZCO3H
+ BZPAN
+ CH2O
+ CL2
+ CLNO2
+ CLNO3
+ CLO
+ CLOO
+ CSL
+ EOH
+ ETHLN
+ ETHN
+ ETHP
+ ETNO3
+ ETP
+ GLYC
+ GLYX
+ H2O2
+ HAC
+ HBR
+ HC5A
+ HCL
+ HCOOH
+ HI
+ HMHP
+ HMML
+ HNO3
+ HOBR
+ HOCL
+ HOI
+ HONIT
+ HPALD1
+ HPALD2
+ HPALD3
+ HPALD4
+ HPETHNL
+ I2
+ I2O2
+ I2O3
+ I2O4
+ IBR
+ ICHE
+ ICL
+ ICN
+ ICPDH
+ IDC
+ IDCHP
+ IDHDP
+ IDHPE
+ IDN
+ IEPOXA
+ IEPOXB
+ IEPOXD
+ IHN1
+ IHN2
+ IHN3
+ IHN4
+ INPB
+ INPD
+ IONO
+ IONO2
+ IPRNO3
+ ITCN
+ ITHN
+ LIMO
+ LVOC
+ LVOCOA
+ MACR
+ MACR1OOH
+ MAP
+ MCRDH
+ MCRENOL
+ MCRHN
+ MCRHNB
+ MCRHP
+ MCT
+ MENO3
+ MGLY
+ MOH
+ MONITS
+ MONITU
+ MPAN
+ MTPA
+ MTPO
+ MVK
+ MVKDH
+ MVKHC
+ MVKHCB
+ MVKHP
+ MVKN
+ MVKPC
+ N2O5
+ NH3
+ NO2
+ NPHEN
+ NPRNO3
+ O3
+ PAN
+ PHEN
+ PP
+ PPN
+ PROPNN
+ PRPN
+ PYAC
+ R4N2
+ R4P
+ RA3P
+ RB3P
+ RIPA
+ RIPB
+ RIPC
+ RIPD
+ RP
+ SO2
+ AERI
+ AONITA
+ ASOA1
+ ASOA2
+ ASOA3
+ ASOAN
+ ASOG1
+ ASOG2
+ ASOG3
+ BRSALA
+ BRSALC
+ INDIOL
+ IONITA
+ ISALA
+ ISALC
+ MONITA
+ MSA
+ NH4
+ NIT
+ NITS
+ SALAAL
+ SALACL
+ SALCAL
+ SALCCL
+ SO4S
+ SOAGX
+ SOAIE
+ TSOA0
+ TSOA1
+ TSOA2
+ TSOA3
+ TSOG0
+ TSOG1
+ TSOG2
+ TSOG3
+ PFE
+
+
+
diff --git a/bld/namelist_files/geoschem_master_gas_wetdep_list.xml b/bld/namelist_files/geoschem_master_gas_wetdep_list.xml
new file mode 100644
index 0000000000..419f518c32
--- /dev/null
+++ b/bld/namelist_files/geoschem_master_gas_wetdep_list.xml
@@ -0,0 +1,152 @@
+
+
+
+
+ ACTA
+ ALD2
+ AROMP4
+ AROMP5
+ ATOOH
+ BALD
+ BENZP
+ BR2
+ BRCL
+ BZCO3H
+ BZPAN
+ CH2O
+ CSL
+ EOH
+ ETHLN
+ ETHN
+ ETHP
+ ETP
+ GLYC
+ GLYX
+ H2O2
+ HAC
+ HBR
+ HC5A
+ HCL
+ HCOOH
+ HI
+ HMHP
+ HMML
+ HNO3
+ HOBR
+ HOCL
+ HOI
+ HONIT
+ HPETHNL
+ I2
+ I2O2
+ I2O3
+ I2O4
+ IBR
+ ICHE
+ ICL
+ ICN
+ ICPDH
+ IDCHP
+ IDHDP
+ IDHPE
+ IDN
+ IEPOXA
+ IEPOXB
+ IEPOXD
+ IHN1
+ IHN2
+ IHN3
+ IHN4
+ INPB
+ INPD
+ IONO
+ IONO2
+ ITCN
+ ITHN
+ LIMO
+ LVOC
+ LVOCOA
+ MACR1OOH
+ MAP
+ MCRDH
+ MCRENOL
+ MCRHN
+ MCRHNB
+ MCRHP
+ MCT
+ MEK
+ MGLY
+ MOH
+ MONITS
+ MONITU
+ MP
+ MPAN
+ MPN
+ MTPA
+ MTPO
+ MVK
+ MVKDH
+ MVKHC
+ MVKHCB
+ MVKHP
+ MVKN
+ MVKPC
+ NH3
+ NPHEN
+ PAN
+ PHEN
+ PP
+ PPN
+ PROPNN
+ PRPE
+ PRPN
+ PYAC
+ R4N2
+ R4P
+ RA3P
+ RB3P
+ RIPA
+ RIPB
+ RIPC
+ RIPD
+ RP
+ SO2
+ AERI
+ AONITA
+ ASOA1
+ ASOA2
+ ASOA3
+ ASOAN
+ ASOG1
+ ASOG2
+ ASOG3
+ BRSALA
+ BRSALC
+ INDIOL
+ IONITA
+ ISALA
+ ISALC
+ MONITA
+ MSA
+ NH4
+ NIT
+ NITS
+ SALAAL
+ SALACL
+ SALCAL
+ SALCCL
+ SO4S
+ SOAGX
+ SOAIE
+ TSOA0
+ TSOA1
+ TSOA2
+ TSOA3
+ TSOG0
+ TSOG1
+ TSOG2
+ TSOG3
+ PFE
+
+
+
diff --git a/bld/namelist_files/master_aer_drydep_list.xml b/bld/namelist_files/mozart_master_aer_drydep_list.xml
similarity index 100%
rename from bld/namelist_files/master_aer_drydep_list.xml
rename to bld/namelist_files/mozart_master_aer_drydep_list.xml
diff --git a/bld/namelist_files/master_aer_wetdep_list.xml b/bld/namelist_files/mozart_master_aer_wetdep_list.xml
similarity index 100%
rename from bld/namelist_files/master_aer_wetdep_list.xml
rename to bld/namelist_files/mozart_master_aer_wetdep_list.xml
diff --git a/bld/namelist_files/master_gas_drydep_list.xml b/bld/namelist_files/mozart_master_gas_drydep_list.xml
similarity index 100%
rename from bld/namelist_files/master_gas_drydep_list.xml
rename to bld/namelist_files/mozart_master_gas_drydep_list.xml
diff --git a/bld/namelist_files/master_gas_wetdep_list.xml b/bld/namelist_files/mozart_master_gas_wetdep_list.xml
similarity index 100%
rename from bld/namelist_files/master_gas_wetdep_list.xml
rename to bld/namelist_files/mozart_master_gas_wetdep_list.xml
diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml
index 70be678722..d2e028a388 100644
--- a/bld/namelist_files/namelist_defaults_cam.xml
+++ b/bld/namelist_files/namelist_defaults_cam.xml
@@ -48,6 +48,8 @@
atm/cam/inic/mpas/mpasa120_L32_notopo_coords_c201216.nc
atm/cam/inic/mpas/mpasa120_L32_topo_coords_c201022.nc
atm/cam/inic/mpas/mpasa120_L32_topo_coords_c201022.nc
+atm/cam/inic/mpas/mpasa60_L32_notopo_coords_c230707.nc
+atm/cam/inic/mpas/mpasa30_L32_notopo_coords_c230707.nc
atm/cam/inic/fv/cami_0000-01-01_0.23x0.31_L26_c100513.nc
@@ -78,6 +80,7 @@
atm/cam/inic/fv/f.e22.FC2010climo.f09_f09_mg17.cam6_2_022.001.cam.i.0016-01-01-00000_c200610.nc
atm/cam/inic/fv/f.e22.FC2010climo.f09_f09_mg17.cam6_2_022.001.cam.i.0016-01-01-00000_c200610.nc
atm/cam/inic/fv/f.e22.FC2010climo.f09_f09_mg17.cam6_2_022.001.cam.i.0016-01-01-00000_c200610.nc
+atm/cam/inic/fv/FC2000mam5_f10_0002-01-01_c221214.nc
atm/cam/inic/fv/cami-mam3_0000-01-01_0.9x1.25_L32_c141031.nc
atm/cam/inic/fv/cami-mam3_0000-01-01_1.9x2.5_L32_c150407.nc
atm/cam/inic/fv/cami-mam4_0000-01-01_10x15_L32_c170914.nc
@@ -122,8 +125,10 @@
atm/cam/inic/se/f.e22.FCnudged.ne0CONUSne30x8_ne0CONUSne30x8_mt12.cam6_2_032.002.cam.i.2013-01-01-00000_c200623.nc
atm/cam/inic/se/f.e22.FCnudged.ne0CONUSne30x8_ne0CONUSne30x8_mt12.cam6_2_032.002.cam.i.2013-01-01-00000_c200623.nc
atm/cam/inic/se/f.e22.FCnudged.ne30_ne30_mg17.release-cesm2.2.0_spinup.2010_2020.001.cam.i.2011-01-01-00000_L58_c220310.nc
-atm/cam/inic/se/FCMTHIST_ne30pg3_1980-01-01_c221214.nc
-atm/cam/inic/fv/FC2000mam5_f10_0002-01-01_c221214.nc
+atm/cam/inic/se/f.cam6_3_112.FCMTHIST_v0c.ne30.non-ogw-ubcT-effgw0.7.001.cam.i.1998-01-01-00000_c230810.nc
+
+atm/cam/inic/se/FLT_L58_ne30pg3_IC_c220623.nc
+atm/cam/inic/se/cam7_FMT_ne30pg3_mg17_L93_c221118.nc
atm/cam/chem/trop_mozart/ic/cami_0000-09-01_4x5_L26_c060217.nc
atm/cam/chem/trop_mozart/ic/cami_0000-09-01_10x15_L26_c060216.nc
@@ -135,6 +140,8 @@
atm/waccm/ic/aqua.cam6.waccmsc_1.9x2.5_L70.2000-01-01.c170123.nc
atm/waccm/ic/aqua.waccm_tsmlt_1.9x2.5_L70_c170814.nc
atm/waccm/ic/aqua.waccm_tsmlt_1.9x2.5_L70_c170814.nc
+atm/waccm/ic/aqua_waccm_ma_ne5np4_70L_c220729.nc
+atm/waccm/ic/aqua_waccm_ma_ne5np4_70L_c220729.nc
atm/waccm/ic/f2000.waccm-mam3_4x5_L70.cam2.i.0017-01-01.c121113.nc
atm/waccm/ic/f2000.waccm-mam3_10x15_L70.cam2.i.0017-01-01.c141016.nc
atm/waccm/ic/b1850.waccm-mam3_1.9x2.5_L70.cam2.i.0156-01-01.c120523.nc
@@ -160,6 +167,7 @@
atm/waccm/ic/waccmx_aqua_ne16np4_126L_c191108.nc
atm/waccm/ic/waccmx4_neutral_aquap_ne16np4_126lev_c200827.nc
atm/waccm/ic/fx2000_phys-ionos-cpl_ne30_spinup01.cam.i.0002-01-01-00000_c201014.nc
+atm/waccm/ic/waccmx_ne30pg3_c231005.nc
atm/cam/inic/fv3/aqua_0006-01-01_C24_L32_c200625.nc
atm/cam/inic/fv3/aqua_0006-01-01_C48_L32_c200625.nc
@@ -210,8 +218,12 @@
atm/cam/inic/gaus/cami_0000-09-01_8x16_L26_c030918.nc
atm/cam/inic/gaus/cami_0000-01-01_8x16_L30_c090102.nc
-
+atm/cam/inic/se/cam6_QPC6_topo_ne3pg3_mg37_L32_01-01-31_c221214.nc
+atm/cam/inic/se/cam6_QPC6_topo_ne3pg3_mg37_L58_01-01-31_c221214.nc
+atm/cam/inic/se/cam6_QPC6_topo_ne3pg3_mg37_L93_01-01-31_c221214.nc
atm/cam/inic/homme/cami-mam3_0000-01_ne5np4_L30.140707.nc
+atm/cam/inic/se/F2000climo_ne5pg3_mg37_L32_01-01-31_c230520.nc
+atm/cam/inic/se/F2000climo_ne5pg3_mg37_L58_01-01-31_c230520.nc
atm/cam/inic/se/ape_topo_cam4_ne16np4_L26_c171020.nc
atm/cam/inic/se/ape_topo_cam4_ne16np4_L30_c171020.nc
atm/cam/inic/se/ape_topo_cam4_ne16np4_L32_c171020.nc
@@ -241,6 +253,9 @@
atm/cam/inic/se/ape_cam5_ne30np4_L30_c170417.nc
atm/cam/inic/se/ape_cam5_ne120np4_L30_c170419.nc
+atm/cam/inic/se/cam6_QPC6_aqua_ne3pg3_mg37_L32_01-01-31_c221214.nc
+atm/cam/inic/se/cam6_QPC6_aqua_ne3pg3_mg37_L58_01-01-31_c221214.nc
+atm/cam/inic/se/cam6_QPC6_aqua_ne3pg3_mg37_L93_01-01-31_c221214.nc
atm/cam/inic/se/ape_cam6_ne5np4_L32_c170517.nc
atm/cam/inic/se/ape_cam6_ne16np4_L32_c170509.nc
atm/cam/inic/se/ape_cam6_ne30np4_L32_c170509.nc
@@ -254,11 +269,13 @@
atm/waccm/ic/wa3_ne5np4_1950_spinup.cam2.i.1960-01-01-00000_c150810.nc
atm/waccm/ic/FW2000_ne30_L70_01-01-0001_c200602.nc
atm/waccm/ic/FWsc2000climo_ne30pg3_L70_0002-01-01_c221103.nc
-atm/waccm/ic/FW2000_ne30pg3_L70_01-01-0001_c200602.nc
+atm/waccm/ic/FW2000.ne30pg3_ne30pg3_nlev70_c230906.nc
atm/waccm/ic/FWsc2000_ne30pg3_L110_01-01-0001_c200521.nc
atm/waccm/ic/FW2000_CONUS_30x8_L70_01-01-0001_c200602.nc
+atm/waccm/ic/mpasa120km.waccm_fulltopo_c220818.nc
+
atm/cam/inic/mpas/cami_01-01-2000_00Z_mpasa120_L32_CFSR_c210426.nc
atm/cam/inic/mpas/cami_01-01-2000_00Z_mpasa480_L32_CFSR_c211013.nc
@@ -300,9 +317,10 @@
atm/cam/topo/se/ne120pg2_nc3000_Co015_Fi001_PF_nullRR_Nsw010_20171012.nc
atm/cam/topo/se/ne240pg2_nc3000_Co008_Fi001_PF_nullRR_Nsw005_20171014.nc
+atm/cam/topo/se/ne3pg3_gmted2010_modis_bedmachine_nc0540_Laplace1000_noleak_20230209.nc
atm/cam/topo/se/ne5pg3_nc3000_Co360_Fi001_MulG_PF_nullRR_Nsw064_20170516.nc
atm/cam/topo/se/ne16pg3_nc3000_Co120_Fi001_PF_nullRR_Nsw084_20171012.nc
-atm/cam/topo/se/ne30pg3_nc3000_Co060_Fi001_PF_nullRR_Nsw042_20171014.nc
+atm/cam/topo/se/ne30pg3_gmted2010_modis_bedmachine_nc3000_Laplace0100_20230105.nc
atm/cam/topo/se/ne60pg3_nc3000_Co030_Fi001_PF_nullRR_Nsw021_20171012.nc
atm/cam/topo/se/ne120pg3_nc3000_Co015_Fi001_PF_nullRR_Nsw010_20171014.nc
atm/cam/topo/se/ne240pg3_nc3000_Co008_Fi001_PF_nullRR_Nsw005_20171015.nc
@@ -353,6 +371,24 @@
held_suarez_1994
moist_baroclinic_wave_dcmip2016
moist_baroclinic_wave_dcmip2016
+ moist_baroclinic_wave_dcmip2016
+
+
+
+ 1.0d-5
+ 3.21d-5
+ 1.0d0
+ 0.1d0
+ 0.310d0
+ 1.4d0
+ 6.0d0
+ 1.5d0
+ 0.1d0
+ 1.d7
+ 1.d0
+ 271.d0
+ 39.d0
+ 26.d0
@@ -572,6 +608,7 @@
atm/cam/ggas/ghg_hist_1765-2005_c091218.nc
atm/waccm/lb/LBC_1765-2100_1.9x2.5_CCMI_RCP60_za_RNOCStrend_c141002.nc
+atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180905.nc
atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_0.9x1.25_c20181011.nc
@@ -624,6 +661,7 @@
atm/waccm/phot/xh2o_c080826.nc
atm/waccm/phot/xh2o_c080826.nc
+atm/waccm/phot/xh2o_c080826.nc
atm/waccm/ub
@@ -681,6 +719,7 @@
3.00D-15
7.5D-16
3.0D-15
+ 30.D0
@@ -695,6 +734,8 @@
0.7D0
0.4D0
+0.30D0
+0.70D0
0.55D0
0.5D0
0.5D0
@@ -704,8 +745,17 @@
0.5D0
0.5D0
0.5D0
+
0.0625D0
+1.0D0
+0.5D0
+0.5D0
+
+1.0D0
+0.5D0
+0.5D0
+
0.03D0
@@ -740,9 +790,10 @@
.true.
.true.
.true.
-.true.
-.false.
+.true.
.false.
+.false.
+.false.
.false.
.false.
.false.
@@ -791,22 +842,15 @@
320x385
-atm/cam/coords/fv0.47x0.63_esmf_c210305.nc
-atm/cam/coords/fv0.9x1.25_esmf_c210305.nc
-atm/cam/coords/fv1.9x2.5_esmf_200428.nc
-atm/cam/coords/fv4x5_esmf_c210305.nc
-atm/cam/coords/ne5np4_esmf_20191204.nc
-atm/cam/coords/ne5np4.pg3_esmf_mesh_c210121.nc
-atm/cam/coords/ne16np4_esmf_c210305.nc
-atm/cam/coords/ne30np4_esmf_c210305.nc
-atm/cam/coords/ne30pg3_esmf_20200428.nc
-atm/cam/coords/fv0.9x1.25_esmf_c210305.nc
-atm/cam/coords/fv1.9x2.5_esmf_200428.nc
-atm/cam/coords/ne30np4_esmf_c210305.nc
-
-atm/cam/coords/fv0.9x1.25_esmf_c210305.nc
-atm/cam/coords/fv1.9x2.5_esmf_200428.nc
-atm/cam/coords/ne30np4_esmf_c210305.nc
+atm/cam/coords/fv0.47x0.63_esmf_c210305.nc
+atm/cam/coords/fv0.9x1.25_esmf_c210305.nc
+atm/cam/coords/fv1.9x2.5_esmf_200428.nc
+atm/cam/coords/fv4x5_esmf_c210305.nc
+atm/cam/coords/ne5np4_esmf_20191204.nc
+atm/cam/coords/ne5np4.pg3_esmf_mesh_c210121.nc
+atm/cam/coords/ne16np4_esmf_c210305.nc
+atm/cam/coords/ne30np4_esmf_c210305.nc
+atm/cam/coords/ne30pg3_esmf_20200428.nc
1.00D0
@@ -1274,6 +1318,11 @@
atm/cam/chem/emis/historical_ne30pg3/emissions-cmip6_so4_a1_anthro-ene_vertical_mol_175001-201412_ne30pg3_c20200103.nc
atm/cam/chem/emis/historical_ne30pg3/emissions-cmip6_num_so4_a1_anthro-ene_vertical_mol_175001-201412_ne30pg3_c20200103.nc
+atm/cam/chem/emis/historical_ne30pg3/emissions-cmip6_bc_a4_aircraft_vertical_1750-2015_ne30pg3_c20231112.nc
+atm/cam/chem/emis/historical_ne30pg3/emissions-cmip6_num_bc_a4_aircraft_vertical_1750-2015_ne30pg3_c20231112.nc
+atm/cam/chem/emis/historical_ne30pg3/emissions-cmip6_NO2_aircraft_vertical_1750-2015_ne30pg3_c20231112.nc
+atm/cam/chem/emis/historical_ne30pg3/emissions-cmip6_SO2_aircraft_vertical_1750-2015_ne30pg3_c20231112.nc
+
atm/cam/chem/emis/historical_ne30pg2/emissions-cmip6_DMS_other_surface_1750_2015_ne30pg2_c20200630.nc
@@ -1823,6 +1872,8 @@
halons_oxid_1.9x2.5zm_L66_1849-2099_c160714.nc
atm/waccm/halons
+halons_oxid_1.9x2.5zm_L66_1849-2099_c160714.nc
+atm/waccm/halons
CYCLICAL
2000
@@ -1857,8 +1908,11 @@
OFF
+atm/cam/chem/trop_mam/atmsrf_ne3np4.pg3_c221214.nc
atm/cam/chem/trop_mam/atmsrf_ne5np4_110920.nc
+atm/cam/chem/trop_mam/atmsrf_ne5pg3_201105.nc
atm/cam/chem/trop_mam/atmsrf_ne16np4_110920.nc
+atm/cam/chem/trop_mam/atmsrf_ne16pg3_c230520.nc
atm/cam/chem/trop_mam/atmsrf_ne30np4_110920.nc
atm/cam/chem/trop_mam/atmsrf_ne30np4.pg2_200108.nc
atm/cam/chem/trop_mam/atmsrf_ne30pg3_180522.nc
@@ -1886,7 +1940,7 @@
atm/cam/chem/trop_mozart/dvel/dep_data_c20221208.nc
-/glade/u/home/elundgren/drydep_henrys_law_nc/dep_data_file_geoschem.nc
+atm/cam/chem/geoschem/dvel/dep_data_file_geoschem_c230417.nc
atm/waccm/phot/effxstex.txt
@@ -1996,6 +2050,7 @@
6.0
1.0
0.5
+ 0.1
0.5
4.2
0.0
@@ -2014,6 +2069,7 @@
1.25
0.25
0.3
+ 0.1
0.3
0.0
0.4
@@ -2024,9 +2080,10 @@
.true.
.false.
0.308
- 0.280
- 0.270
+ 0.3
+ 0.280
0.32
+ 0.3
2
0.04
0.1
@@ -2048,10 +2105,11 @@
.true.
.true.
.true.
- .false.
- .false.
+ .true.
+ .true.
.false.
.false.
+ .true.
.false.
.false.
.false.
@@ -2077,7 +2135,9 @@
1
2.0
60.0
-
+.false.
+.true.
+.true.
.true.
0.2
@@ -2142,25 +2202,19 @@
SPCAM_m2005
SPCAM_sam1mom
MG
+MG
1
0
1
- 400.D-6
-
- 2
- 0
- 1
- 500.D-6
- 390.D-6
- 200.D-6
-
- 3
- 0
- 1
- 500.D-6
- 390.D-6
- 200.D-6
+
+ 2
+ 0
+ 1
+
+ 3
+ 0
+ 1
.false.
.true.
@@ -2188,11 +2242,16 @@
1.D0
1.D0
- 1.D0
+ 1.D0
+ 0.375D0
1.D0
0.2D0
+ 0.1D0
+
+ 0.1D0
+ 0.0D0
0.001D0
@@ -2200,7 +2259,7 @@
25.D-6
1.D0
- 1.D0
+ 1.D0
1.D0
1.D0
@@ -2213,6 +2272,7 @@
.true.
.true.
+ kk2000
.true.
1
@@ -2247,6 +2307,8 @@
.false.
.true.
.true.
+0.01D0
+0.05D0
.false.
.true.
@@ -2333,7 +2395,7 @@
0.55D0
0.22D0
0.70D0
-0.70D0
+0.80D0
0.8D0
0.8D0
0.8D0
@@ -2369,13 +2431,14 @@
-1.35D0
-1.62D0
-0.90D0
-1.00D0
-1.10D0
-1.2D0
-0.60D0
+1.35D0
+1.62D0
+0.90D0
+1.00D0
+1.5D0
+1.10D0
+1.2D0
+0.60D0
1.0D0
@@ -2603,12 +2666,19 @@
1.0D0
1.0D0
+1.e-7
+5.e-6
+5.e-3
+
.false.
.false.
.true.
.true.
+.false.
+.true.
+
5.0e-6
9.5e-6
@@ -2732,7 +2802,6 @@
.false.
.true.
- .false.
5
1
1
@@ -2868,14 +2937,16 @@
''
'O', 'O2', 'H', 'N2'
-'Q'
-'Q','CLDLIQ','RAINQM'
-'Q','CLDLIQ','CLDICE'
-'Q','CLDLIQ','CLDICE'
-'Q','CLDLIQ','CLDICE'
-'Q','CLDLIQ','CLDICE'
-'Q','CLDLIQ','CLDICE','RAINQM','SNOWQM'
-'Q','CLDLIQ','CLDICE','RAINQM','SNOWQM'
+'Q'
+'Q'
+'Q'
+'Q','CLDLIQ','RAINQM'
+'Q','CLDLIQ','CLDICE'
+'Q','CLDLIQ','CLDICE'
+'Q','CLDLIQ','CLDICE'
+'Q','CLDLIQ','CLDICE'
+'Q','CLDLIQ','CLDICE','RAINQM','SNOWQM'
+'Q','CLDLIQ','CLDICE','RAINQM','SNOWQM','GRAUQM'
@@ -2922,6 +2993,7 @@
1
3
1
+ 1
0
0
-10
@@ -2971,19 +3043,20 @@
+ 1
+3
2
- .true.
-
.true.
3.22D0
- 3
- 2
- 4
- 3
- 1
+ 3
+ 2
+ 4
+ 4
+ 3
+ 1
1
20
@@ -3002,8 +3075,6 @@
1.0e99
1.9
-1
-
-1
5.e15
@@ -3012,9 +3083,9 @@
-1
- 1.25e5
- 1.0e6
- 1.0e6
+ 1.25e5
+ 1.0e6
+ 1.0e6
0.0
1.0
@@ -3034,18 +3105,18 @@
2
1
- 3
- 5
- 3
- 5
- 3
- 10
+ 3
+ 5
+ 3
+ 5
+ 3
+ 10
7
3
4
- 6
+ 6
3
-1
@@ -3080,10 +3151,14 @@
2
1800.0D0
900.0D0
+ 600.D0
+ 450.0D0
+ 225.0D0
.true.
2
3
+ 4
0.0D0
0.0D0
0.0D0
@@ -3094,6 +3169,8 @@
480000.0D0
120000.0D0
+ 60000.0D0
+ 30000.0D0
0.05D0
10.0D0
@@ -3111,12 +3188,17 @@
0.125D0
.true.
0.1D0
+ 0.5D0
0.1D0
0.5D0
+ 0.0D0
.true.
22000.0D0
+ 80000.0D0
0.2D0
0.0D0
+ 0.2D0
+ 0
.true.
5.0
5
@@ -3140,6 +3222,16 @@
+
+ 'O3S_Loss = 2.0*O_O3 + O1D_H2O + HO2_O + HO2_O3 + OH_O + OH_O3 + H_O3 + 2.0*NO2_O + 2.0*jno3_b + 2.0*CLO_O + 2.0*jcl2o2 + ',
+ '2.0*CLO_CLOa + 2.0*CLO_CLOb + 2.0*BRO_CLOb + 2.0*BRO_CLOc + 2.0*BRO_BRO + 2.0*BRO_O + CLO_HO2 + BRO_HO2 + S_O3'
+
+
+ 'O3S_Loss = 2.0*O_O3 + O1D_H2O + HO2_O + HO2_O3 + OH_O + OH_O3 + H_O3 + 2.0*NO2_O + 2.0*jno3_b + 2.0*CLO_O + 2.0*jcl2o2 + ',
+ '2.0*CLO_CLOa + 2.0*CLO_CLOb + 2.0*BRO_CLOb + 2.0*BRO_CLOc + 2.0*BRO_BRO + 2.0*BRO_O + CLO_HO2 + BRO_HO2 + S_O3',
+ 'SolIonRate_Tot = jeuv_1 + jeuv_2 + jeuv_3 + jeuv_4 + jeuv_5 + jeuv_6 + jeuv_7 + jeuv_8 + jeuv_9 + jeuv_10 + jeuv_11 + ',
+ 'jeuv_14 + jeuv_15 + jeuv_16 + jeuv_17 + jeuv_18 + jeuv_19 + jeuv_20 + jeuv_21 + jeuv_22 + jeuv_23',
+
'O3_Prod = NO_HO2 + CH3O2_NO + HOCH2OO_NO + C2H5O2_NO + CH3CO3_NO + EO2_NO + C3H7O2_NO + PO2_NO + ',
'RO2_NO + ENEO2_NO + MACRO2_NOa + jhonitr + ',
@@ -3291,115 +3383,30 @@
' C3H6_O3 + ISOP_O3 + MVK_O3 + MACR_O3 + MTERP_O3 + BCARY_O3 + S_O3 + SO_O3'
-
-
-
-
-
-
-atm/cam/sst/sst_HadOIBl_bc_0.23x0.31_clim_c061106.nc
-atm/cam/sst/sst_HadOIBl_bc_0.47x0.63_clim_c061106.nc
-atm/cam/sst/sst_HadOIBl_bc_0.9x1.25_clim_c040926a.nc
-atm/cam/sst/sst_HadOIBl_bc_1.9x2.5_clim_c061031.nc
-atm/cam/sst/sst_HadOIBl_bc_2.5x3.33_clim_c091210.nc
-atm/cam/sst/sst_HadOIBl_bc_4x5_clim_c061031.nc
-atm/cam/sst/sst_HadOIBl_bc_10x15_clim_c050526.nc
-
-atm/cam/sst/sst_HadOIBl_bc_256x512_clim_c031031.nc
-atm/cam/sst/sst_HadOIBl_bc_128x256_clim_c050526.nc
-atm/cam/sst/sst_HadOIBl_bc_64x128_clim_c050526.nc
-atm/cam/sst/sst_HadOIBl_bc_48x96_clim_c050526.nc
-atm/cam/sst/sst_HadOIBl_bc_32x64_clim_c050526.nc
-atm/cam/sst/sst_HadOIBl_bc_8x16_clim_c050526.nc
-
-atm/cam/sst/sst_HadOIBl_bc_1x1_clim_c101029.nc
-atm/cam/sst/sst_HadOIBl_bc_1x1_clim_c101029.nc
-
-
-atm/cam/sst/sst_HadOIBl_bc_0.23x0.31_clim_pi_c091020.nc
-atm/cam/sst/sst_HadOIBl_bc_0.47x0.63_clim_pi_c100128.nc
-atm/cam/sst/sst_HadOIBl_bc_0.9x1.25_clim_pi_c100127.nc
-atm/cam/sst/sst_HadOIBl_bc_1.9x2.5_clim_pi_c100127.nc
-atm/cam/sst/sst_HadOIBl_bc_4x5_clim_pi_c100127.nc
-atm/cam/sst/sst_HadOIBl_bc_10x15_clim_pi_c100127.nc
-
-atm/cam/sst/sst_HadOIBl_bc_128x256_clim_pi_c100128.nc
-atm/cam/sst/sst_HadOIBl_bc_64x128_clim_pi_c100128.nc
-atm/cam/sst/sst_HadOIBl_bc_48x96_clim_pi_c100128.nc
-atm/cam/sst/sst_HadOIBl_bc_32x64_clim_pi_c100128.nc
-atm/cam/sst/sst_HadOIBl_bc_8x16_clim_pi_c100128.nc
-
-atm/cam/sst/sst_HadOIBl_bc_1x1_clim_pi_c100129.nc
-atm/cam/sst/sst_HadOIBl_bc_1x1_clim_pi_c100129.nc
-
-
-atm/cam/sst/sst_HadOIBl_bc_0.23x0.31_clim_pi_c091020.nc
-atm/cam/sst/sst_HadOIBl_bc_0.47x0.63_1850_2012_c130411.nc
-atm/cam/sst/sst_HadOIBl_bc_0.9x1.25_1850_2012_c130411.nc
-atm/cam/sst/sst_HadOIBl_bc_1.9x2.5_1850_2012_c130411.nc
-atm/cam/sst/sst_HadOIBl_bc_4x5_1850_2012_c130411.nc
-atm/cam/sst/sst_HadOIBl_bc_10x15_1850_2012_c130411.nc
-
-atm/cam/sst/sst_HadOIBl_bc_128x256_1850_2012_c130411.nc
-atm/cam/sst/sst_HadOIBl_bc_64x128_1850_2012_c130411.nc
-atm/cam/sst/sst_HadOIBl_bc_48x96_1850_2008_c100128.nc
-atm/cam/sst/sst_HadOIBl_bc_32x64_1850_2012_c130411.nc
-atm/cam/sst/sst_HadOIBl_bc_8x16_1850_2012_c130411.nc
-
-atm/cam/sst/sst_HadOIBl_bc_1x1_1850_2012_c130411.nc
-atm/cam/sst/sst_HadOIBl_bc_1x1_1850_2012_c130411.nc
-
-atm/cam/som/cam4.som.forcing.aquaplanet.QzaFix_h50Fix_TspunFix.fv19.nc
-
-
-ocn/docn7/domain.ocn.1x1.111007.nc
-ocn/docn7/domain.ocn.1x1.111007.nc
-
-
-atm/cam/ocnfrac/domain.camocn.128x256_USGS_070807.nc
-share/domains/domain.ocn.T42_gx1v7.180727.nc
-share/domains/domain.ocn.48x96_gx3v7_100114.nc
-atm/cam/ocnfrac/domain.camocn.32x64_USGS_070807.nc
-atm/cam/ocnfrac/domain.camocn.8x16_USGS_070807.nc
-
-atm/cam/ocnfrac/domain.camocn.0.23x0.31_gx1v6_101108.nc
-atm/cam/ocnfrac/domain.camocn.0.47x0.63_gx1v6_090408.nc
-share/domains/domain.ocn.fv0.9x1.25_gx1v7.151020.nc
-share/domains/domain.ocn.fv1.9x2.5_gx1v7.170518.nc
-share/domains/domain.ocn.4x5_gx3v7_100120.nc
-atm/cam/ocnfrac/domain.camocn.10x15_USGS_070807.nc
-
-share/domains/domain.ocn.C24_gx1v7_c200625.nc
-share/domains/domain.ocn.C48_gx1v7_c200625.nc
-share/domains/domain.ocn.C96_gx1v7_c200625.nc
-share/domains/domain.ocn.C192_gx1v7_c200625.nc
-share/domains/domain.ocn.C384_gx1v7_c200625.nc
-
-share/domains/domain.ocn.ne5np4_gx3v7.140810.nc
-share/domains/domain.ocn.ne16np4_gx1v7.171018.nc
-share/domains/domain.ocn.ne30_gx1v7.171003.nc
-share/domains/domain.ocn.ne60np4_gx1v6.121113.nc
-share/domains/domain.ocn.ne120np4_gx1v6.121113.nc
-share/domains/domain.ocn.ne240np4_gx1v6.111226.nc
-
-atm/cam/ocnfrac/domain.aqua.fv1.9x2.5.nc
-
.false.
-.true.
-/glade/work/hplin/hco_inputdata/HEMCO_Config_FCnudged.CC.c230306.rc
+atm/cam/geoschem/emis/ExtData/HEMCO
+atm/cam/geoschem/emis/HEMCO_Config.CC.CEDS_AEIC19.NEx.c230615.rc
+atm/cam/geoschem/emis/HEMCO_Diagn.3_5_0.c230307.rc
-1
144
91
+
+576
+361
+
+
288
201
+
288
201
+
144
91
diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml
index 09f8aa7277..a196908fef 100644
--- a/bld/namelist_files/namelist_definition.xml
+++ b/bld/namelist_files/namelist_definition.xml
@@ -54,6 +54,122 @@
that have only a small number of allowed values.
-->
+
+
+
+ Minimum Wind Threshold for surface flux calculations which is
+ added to avoid possible cases that would result in a division by zero.
+ Default: 1.0d-5
+
+
+
+ Surface Roughness Length for surface drag calculation.
+ Default: 3.21d-5
+
+
+
+ Critical Richardson Number for stable mixing cutoff.
+ Default: 1.0
+
+
+
+ Surface Layer Fraction of boundary layer depth.
+ The prescribed fraction of the boundary layer depth
+ for surface interactions.
+ Default: 0.1
+
+
+
+ Frierson Albedo: Frierson's Net Solar Flux=> 938.4 = 1360*(1.-0.31)
+ The Frierson model prescribes a net solar flux which incorporated the
+ effects of albedo. Rather than adhering to this formulation, the net
+ solar flux is obtained by a more common practice of specifying an albedo
+ value. For the approximate (simple) solar flux of 1360 W m-2, the albedo
+ value of 0.31 yields the value used by Frierson.
+ Default: 0.31
+
+
+
+ Latitudinal Variation of Shortwave Radiation.
+ Shortwave radiation contains no seasonal/diurnal variations and has a
+ Latitudinal variation specified by DeltaS according to:
+ R_solar = (R_net/4)*[1 + DeltaS*P_2(Lat)]
+ where P_2 is the second Legendre polynomial.
+ Default: 1.4
+
+
+
+ Longwave Optical Depth at Equator.
+ The optical depths are specified as a function of Latitude to approximate
+ the effects of water vapor according to:
+ Tau_0 = Tau_eqtr + (Tau_pole - Tau_eqtr)*sin^2(Lat)
+ Default: 6.0
+
+
+
+ Longwave Optical Depth at Poles.
+ The optical depths are specified as a function of Latitude to approximate
+ the effects of water vapor according to:
+ Tau_0 = Tau_eqtr + (Tau_pole - Tau_eqtr)*sin^2(Lat)
+ Default: 1.5
+
+
+
+ Linear Optical Depth Parameter for stratosphere.
+ The pressure dependence of optical depths that approximate the effects of
+ water vapor varies according to:
+ Tau = Tau_0*[ LinFrac*(P/P_s) + (1-LinFrac)*(P/P_s)^4 ]
+ Default: 0.1
+
+
+
+ Ocean Mixed-Layer Heat Capacity.
+ The ocean surface is a slab mixed layer with a specified heat capacity in units of J K-1 m-2
+ Default: 1.e7
+
+
+
+ Scale Factor for E0 (saturation vapor pressure) to contol wet/dry experiments.
+ WetDryCoef=0 corresponds to the atmosphere in the dry limit.
+ Friersons wet limit corresponds to WetDryCoef=10.
+ Default: 1.
+
+
+
+ Tsrf Initial Condition: Minimum SST (K).
+ The ocean temperatures are initailized with the values:
+ T_s = Tmin + Tdlt*exp[-0.5*(Lat/Twidth)^2]
+ Default: 271.
+
+
+
+ Tsrf Initial Condition: Equator-Pole SST difference (K).
+ The ocean temperatures are initailized with the values:
+ T_s = Tmin + Tdlt*exp[-0.5*(Lat/Twidth)^2]
+ Default: 39.
+
+
+
+ Tsrf Initial Condition: Latitudinal width parameter for sst (degrees latitude)
+ The ocean temperatures are initailized with the values:
+ T_s = Tmin + Tdlt*exp[-0.5*(Lat/Twidth)^2]
+ Default: 26.
+
+
+
+Width of gaussian used to create frontogenesis tau profile [m/s].
+Default: set by build-namelist.
+
+
Full pathname of Beres lookup table data file for gravity waves sourced
@@ -1733,7 +1855,7 @@ Default: none
+ group="cam_history_nl" valid_values="A,B,I,X,M,N,L,S" >
Sets the averaging flag for all variables on a particular history file
series. Valid values are:
@@ -1741,6 +1863,7 @@ series. Valid values are:
B ==> GMT 00:00:00 average
I ==> Instantaneous
M ==> Minimum
+ N ==> average over nsteps
X ==> Maximum
L ==> Local-time
S ==> Standard deviation
@@ -1759,6 +1882,15 @@ the {{ hilight }}fincl#{{ closehilight }} namelist items.
Default: FALSE
+
+If true then write the nstep==0 time sample to all history files except
+the monthly average file. This output is primarily useful for development
+and debugging as it captures changes to the model state made during the
+initialization phase of the run.
+Default: FALSE
+
+
List of fields to exclude from the 1st history file (by default the name
@@ -1832,6 +1964,7 @@ are:
B ==> GMT 00:00:00 average
I ==> Instantaneous
M ==> Minimum
+ N ==> average over nsteps
X ==> Maximum
L ==> Local-time
S ==> Standard deviation
@@ -1906,27 +2039,27 @@ if .true. then output CLUBBs radiative history statistics
Default: false
-
Same as {{ hilight }}fincl1{{ closehilight }}, but for CLUBB statistics on zt grid.
-
Same as {{ hilight }}fincl1{{ closehilight }}, but for CLUBB statistics on zm grid.
-
Same as {{ hilight }}fincl1{{ closehilight }}, but for CLUBB statistics on radiation zt grid.
-
Same as {{ hilight }}fincl1{{ closehilight }}, but for CLUBB statistics on radiation zm grid.
-
Same as {{ hilight }}fincl1{{ closehilight }}, but for CLUBB statistics on surface.
@@ -2607,6 +2740,12 @@ Unitless scaling factor for ice fall speed to account for sub-grid scale ice cry
Default: 1.0
+
+Unitless scaling factor for snow fall speed to account for sub-grid scale ice crystal shape variability.
+Default: 1.0
+
+
Unitless scaling factor for ice effective radius as seen by radiation. This scaling factor adjusts for sub-grid scale ice crystal shape variability.
@@ -2624,13 +2763,43 @@ Default: 1
Maximum allowed ice number concentration
Default: 1.0e8
-x
+
Do Seifert and Behang (2001) autoconversion and accretion physics when set to true.
Default: .false.
+
+Warm rain process
+sb2001 turns on alternative autoconversion and accretion scheme for liquid in microphysics (Seifert and Behang 2001)
+kk2000 uses original autoconversion and accretion scheme for liquid in microphysics
+tau replaces autoconversion and accretion with a faster emulator to generate machine learning training data
+emulated turns on use of machine learning for warm rain
+Default: set in namelist_defaults
+
+
+
+Neural net file for warm_rain machine learning
+
+
+
+Neural net input scaling values file for warm_rain machine learning
+
+
+
+Neural net output scaling values file for warm_rain machine learning
+
+
+
+Coefficients for the stochastic collection kernel used by the TAU stochastic collection code, invoked in PUMAS with micro_pumas_warm_rain = 'tau'
+
+
Do destruction of massless droplets
@@ -2792,7 +2961,7 @@ Default: 1.0
Unitless scaling factor for the liquid droplet subgrid scale vertical velocity during aerosol activation.
-Default: 1.0
+Default: set by build-namelist
-Minimum subgrid vertical velocity for liquid droplets during aerosol activation with units of (m s-1).
-Default: 0.2 m s-1
+Minimum subgrid vertical velocity (before scale factor) for liquid droplets during aerosol activation with units of (m s-1).
+Default: set by build-namelist
+
+
+
+Minimum subgrid vertical velocity (after scale factor) for liquid droplets during aerosol activation with units of (m s-1).
+Default: set by build-namelist
+
+Heterogeneous freezing scaling factor for black carbon aerosols.
+Default: 0.01
+
+
+
+Heterogeneous freezing scaling factor for dust aerosols.
+Default: 0.05
+
+
Switch to turn on treatment of pre-existing ice in the ice nucleation code.
@@ -3010,6 +3197,18 @@ rhi at which ice cloud fraction = 1 in the stratosphere.
Default: set by build-namelist
+
+Minimum in-stratus IWC constraint [ kg/kg ]
+Default: set by build-namelist
+
+
+
+Maximum in-stratus IWC constraint [ kg/kg ]
+Default: set by build-namelist
+
+
Use cloud fraction to determine whether to do growth of ice clouds below
@@ -3017,6 +3216,12 @@ RHice of 1 down to RHice = rhmini.
Default: .true. for CAM6; all others => .false.
+
+For small ice cloud concentrations, take the geometric mean of the iceopt=4 and iceopt=5 area fractions
+Default: .true. for CAM_DEV; all others .false.
+
+
Convective momentum transport parameter (upward)
@@ -3061,12 +3266,6 @@ if -zmconv_org is set in configure.
Default: .false., unless -zmconv_org set in configure
-
-Turn on convective microphysics
-Default: .false.
-
-
The number of negative buoyancy regions that are allowed before the convection top and CAPE calculations are completed.
@@ -3545,7 +3744,7 @@ Include effects of precip evaporation on turbulent moments
Switch for CLUBB_ADV parameter that turns on advection of CLUBB pdf moments by
-the dynamics core. Very experimental.
+the dynamics core. Very experimental.
@@ -3894,7 +4093,7 @@ xpyp only.
-Flag to apply a locally calculated ustar to momentum surface fluxes in the
+Flag to apply a locally calculated ustar to momentum surface fluxes in the
clubb interface.
@@ -3960,8 +4159,8 @@ Flag to turn on the clubb monotonic flux limiter for vm (meridional momemtum).
-Flag to use an "upwind" discretization rather than a centered discretization
-for the portion of the wp3 turbulent advection term for ADG1 that is linearized
+Flag to use an "upwind" discretization rather than a centered discretization
+for the portion of the wp3 turbulent advection term for ADG1 that is linearized
in terms of wp3(t+1). (Requires ADG1 PDF and l_standard_term_ta=true).
@@ -3988,7 +4187,7 @@ Flag to use smooth Heaviside 'Peskin' in computation of invrs_tau.
-Use the standard discretization for the turbulent advection terms. Setting to
+Use the standard discretization for the turbulent advection terms. Setting to
.false. means that a_1 and a_3 are pulled outside of the derivative in
advance_wp2_wp3_module.F90 and in advance_xp2_xpyp_module.F90.
@@ -4070,7 +4269,7 @@ production) term.
-Flag used to calculate convective velocity using a variable estimate of layer
+Flag used to calculate convective velocity using a variable estimate of layer
depth based on the depth over which wpthlp is positive near the ground when true
@@ -4748,7 +4947,7 @@ Default: TRUE
+ group="phys_ctl_nl" valid_values="cam3,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.
@@ -4764,7 +4963,7 @@ Default: set by build-namelist
-
-
-Full pathname to GEOS-Chem chemistry inputs directory
+
+
+
+
+Full pathname of HEMCO data root for use in reading HEMCO input files.
+(e.g., '$DIN_LOC_ROOT/atm/cam/geoschem/emis/ExtData/HEMCO').
Default: set by build-namelist.
-
Full pathname of the HEMCO_Config.rc input file used to configure HEMCO.
Default: set by build-namelist.
+
+Full pathname of the HEMCO_Diagn.rc input file used to configure HEMCO diagnostics.
+Default: set by build-namelist.
+
+
Number of x-dimensions in HEMCO internal grid.
@@ -4952,7 +5159,15 @@ Default: set by build-namelist.
Force emission year for HEMCO clock if positive. This will force cycling of data on this year.
-Default: set by build-namelist for climo cases, otherwise -1 to use model clock
+Default: set by build-namelist for climo cases, otherwise -1 to use model clock.
+
+
+
+
+
+Full pathname to GEOS-Chem chemistry inputs directory
+Default: set by build-namelist.
@@ -5026,6 +5241,13 @@ Bretherton; 'HBR' for Rasch modified version of 'HB'.
Default: set by build-namelist
+
+Logical: If True activate Holtslag and Boville vertical diffusion scheme where CLUBB is not active
+ (note that CLUBB top is dynamic in each column)
+Default: Set by build-namelist.
+
+
+
+History tape number thermo budget output is written to.
+Default: 1
+
+
+
+Produce output for the energy budget diagnostic package.
+Default: .false.
+
@@ -5427,7 +5660,7 @@ Default: false
+ group="aerosol_optics_nl" valid_values="" >
Full pathname of dataset for water refractive indices used in modal aerosol optics
Default: none
@@ -5789,7 +6022,7 @@ radiatively passive.
Default: FALSE
-
Wet deposition method used
MOZ --> mozart scheme is used
@@ -6225,14 +6458,8 @@ List of species that are constrained in the stratosphere.
Default: set by build-namelist.
-
-Full pathname of dataset for land mask applied to the lighting NOx production
-Default: set by build-namelist.
-
-
+ group="lightning_nl" valid_values="" >
Multiplication factor applied to the lighting NOx production
Default: 1.0.
@@ -7274,6 +7501,36 @@ List of nitrogen deposition fluxes to be sent from CAM to surface models.
Default: set by build-namelist.
+
+Year first to use in nitrogen deposition stream data. Set by case xml variable
+CAM_STREAM_NDEP_YEAR_FIRST
+
+
+
+Year last to use in nitrogen deposition stream data.
+Set by case xml variable CAM_STREAM_NDEP_YEAR_LAST
+
+
+
+Model year to align with CAM_STREAM_NDEP_YEAR_FIRST.
+Set by case xml variable CAM_STREAM_NDEP_YEAR_ALIGN
+
+
+
+NDEP stream data filename.
+Set by case xml variable CAM_STREAM_NDEP_DATA_FILENAME.
+
+
+
+NDEP mesh file corresponding to sream_ndep_data_filename.
+Set by case xml variable CAM_STREAM_NDEP_MESH_FILENAME.
+
+
File containing MEGAN emissions factors.
@@ -7310,6 +7567,12 @@ coarser temporal resolution.
Default: set by build-namelist.
+
+If TRUE atmosphere model will provide prognosed lightning flash frequency.
+Default: FALSE
+
+
-
-Scaling of temperature increment for different levels of
-thermal energy consistency.
-0: no scaling
-1: scale increment for cp consistency between dynamics and physics
-2: do 1 as well as take into account condensate effect on thermal energy
-Default: Set by build-namelist.
-
-
Hyperviscosity coefficient for u,v, T [m^4/s].
@@ -7720,7 +7973,7 @@ If < 0, se_sponge_del4_nu_fac is automatically set based on model top locatio
Default: Set by build-namelist.
-
Divergence damping hyperviscosity coefficient se_nu_div [m^4/s] for u,v is increased to
se_nu_p*se_sponge_del4_nu_div_fac following a hyperbolic tangent function
@@ -7734,7 +7987,7 @@ If < 0, se_sponge_del4_nu_div_fac is automatically set based on model top loc
Default: Set by build-namelist.
-
Level index around which increased del4 damping is centered.
@@ -7744,17 +7997,6 @@ If < 0, se_sponge_del4_lev is automatically set based on model top location.
Default: Set by build-namelist.
-
-If TRUE the continous equations the dynamical core is based on will conserve a
-comprehensive moist total energy
-If FALSE the continous equations the dynamical core is based on will conserve
-a total energy based on cp for dry air and no condensates (same total energy as
-CAM physics uses).
-For more details see Lauritzen et al., (2018;DOI:10.1029/2017MS001257)
-Default: TRUE
-
-
If TRUE the CSLAM algorithm will work for Courant number larger than 1 with
@@ -7979,6 +8221,21 @@ Normally equal to se_vert_num_threads.
Default: Set by build-namelist.
+
+
+ 1: Exner version of pressure gradient force (PGF)
+ see Appendix A in https://agupubs.onlinelibrary.wiley.com/doi/epdf/10.1029/2022MS003192
+
+ 2: Traditional pressure gradient formulation (grad p)
+
+ 3: Hybrid (formulation 1 where hybm>0 else formulation 2)
+ Use hybrid PGF option for WACCM-x to make WACCM-x consistent with PGF
+ used in CAM in the troposphere and traditional PGF formulation above
+
+ Default: Set by build-namelist.
+
+
@@ -8202,15 +8459,26 @@ Default: 0.2
-Coefficient for scaling the 2nd-order horizontal diffusion in the mpas_cam absorbing layer.
-A value of 1.0 will result in layered diffusion similar to CAM-SE and gives damping
-coefficients of 0.2216E7, 0.6482E6, 0.1927E6 in the top-most three layers on the dynamics
-variables u, w, and theta. The top 3 damping coefficients scale linearly with
-mpas_cam_coef. 0.0 disables SE like 2nd-order diffusion in the absorbing layer and is the
-current default. Sponge layer absorption can also be provided by Rayleigh damping.
+Coefficient for scaling the 2nd-order horizontal diffusion in the mpas_cam absorbing
+layer. The absorbing layer depth is controlled with mpas_cam_damping_levels. The damping
+coefficients scale linearly with mpas_cam_coef. A value of 0.0 (or
+mpas_cam_damping_levels=0) disables the 2nd-order diffusion in the absorbing layer. Sponge
+layer absorption can also be provided by Rayleigh damping.
+
+E.g. a value of 1.0 with mpas_cam_damping_levels=3 will result in damping coefficients of
+2E6 m^2/s, 6E5, 2E5 in the top-most three layers on the dynamics variables u, w, and
+theta.
Default: 0.0
+
+Number mpas_cam absorbing layers in which to apply 2nd-order horizontal diffusion.
+Viscocity linearly ramps to zero by layer number from the top. mpas_cam_damping_levels and
+mpas_cam_coef must both be greater than 0 for the diffusion to be enabled.
+Default: 0
+
+
Whether to apply Rayleigh damping on horizontal velocity in the top-most model levels.
@@ -8299,30 +8567,6 @@ us_standard_atmosphere: static atmospheric state (u,v)=0, standard lapse rate fo
Default: 'none'
-
-
-
-
-
-Full pathname of time-variant sea-surface temperature and sea-ice
-concentration boundary dataset.
-Default: set by build-namelist.
-
-
-
-Full pathname of
-Default: set by build-namelist.
-
-
-
-Full pathname of grid file for time-variant sea-surface temperature and sea-ice
-concentration boundary dataset.
-Default: set by build-namelist.
-
-
+
+
+
+
+
+
+
+Stream filename(s) for Nitrogen Deposition data
+
+
+
+Stream meshfile for Nitrogen Deposition data
+
+
+
+First year to loop over for Nitrogen Deposition data
+
+
+
+Last year to loop over for Nitrogen Deposition data
+
+
+
+Simulation year that aligns with stream_year_first_ndep value
+
+
diff --git a/bld/namelist_files/use_cases/1850-2005_cam5.xml b/bld/namelist_files/use_cases/1850-2005_cam5.xml
index 8a6c2a7f0c..5d4a572be0 100644
--- a/bld/namelist_files/use_cases/1850-2005_cam5.xml
+++ b/bld/namelist_files/use_cases/1850-2005_cam5.xml
@@ -56,35 +56,11 @@
INTERP_MISSING_MONTHS
- atm/cam/chem/trop_mozart_aero/oxid
- oxid_1.9x2.5_L26_1850-2005_c091123.nc
- INTERP_MISSING_MONTHS
+ atm/cam/chem/trop_mozart_aero/oxid
+ oxid_1.9x2.5_L26_1850-2005_c091123.nc
+ INTERP_MISSING_MONTHS
1850-2000
-
-.false.
-1850
-2012
-2008
-
-atm/cam/sst/sst_HadOIBl_bc_0.47x0.63_1850_2012_c130411.nc
-atm/cam/sst/sst_HadOIBl_bc_0.9x1.25_1850_2012_c130411.nc
-atm/cam/sst/sst_HadOIBl_bc_1.9x2.5_1850_2012_c130411.nc
-atm/cam/sst/sst_HadOIBl_bc_4x5_1850_2012_c130411.nc
-atm/cam/sst/sst_HadOIBl_bc_10x15_1850_2012_c130411.nc
-
-atm/cam/sst/sst_HadOIBl_bc_128x256_1850_2012_c130411.nc
-atm/cam/sst/sst_HadOIBl_bc_64x128_1850_2012_c130411.nc
-atm/cam/sst/sst_HadOIBl_bc_48x96_1850_2008_c100128.nc
-atm/cam/sst/sst_HadOIBl_bc_32x64_1850_2012_c130411.nc
-atm/cam/sst/sst_HadOIBl_bc_8x16_1850_2012_c130411.nc
-
-
-.true.
-0
-0
-atm/cam/sst/sst_HadOIBl_bc_0.23x0.31_clim_pi_c091020.nc
-
diff --git a/bld/namelist_files/use_cases/1850_cam_lt.xml b/bld/namelist_files/use_cases/1850_cam_lt.xml
new file mode 100644
index 0000000000..d8668677e5
--- /dev/null
+++ b/bld/namelist_files/use_cases/1850_cam_lt.xml
@@ -0,0 +1,64 @@
+
+
+
+
+atm/cam/solar/SolarForcingCMIP6piControl_c160921.nc
+ 18500101
+ FIXED
+
+
+atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180905.nc
+1850
+'CYCLICAL'
+'CO2','CH4','N2O','CFC11','CFC12','CFC11eq'
+
+
+'Q:H2O->UBC_FILE'
+atm/cam/chem/ubc/b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensAvg123.cam.h0zm.H2O.185001-201412_c230509cdf5.nc
+CYCLICAL
+1850
+
+
+ 'atm/cam/ozone_strataero'
+ 'ozone_strataero_cyclical_WACCM6_L70_CMIP6-piControl.001_y21-50avg_zm_5day_c180802.nc'
+ 'O3'
+ CYCLICAL
+ 1850
+
+
+ 1850
+ 'atm/cam/ozone_strataero'
+ 'ozone_strataero_cyclical_WACCM6_L70_CMIP6-piControl.001_y21-50avg_zm_5day_c180802.nc'
+ .true.
+ 'CYCLICAL'
+
+
+
+ 1850
+ 'atm/cam/tracer_cnst'
+ 'tracer_cnst_WACCM6_halons_3DmonthlyL70_1850climoCMIP6piControl001_y21-50avg_c180802.nc'
+ 'O3','OH','NO3','HO2','HALONS'
+ 'CYCLICAL'
+ ''
+
+
+ CYCLICAL
+ 1850
+
+ 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/historical_ne30pg3/emissions-cmip6_num_so4_a1_anthro-ene_vertical_mol_175001-201412_ne30pg3_c20200103.nc',
+ 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/historical_ne30pg3/emissions-cmip6_num_a1_so4_contvolcano_vertical_850-5000_ne30pg3_c20200125.nc',
+ 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/historical_ne30pg3/emissions-cmip6_num_a2_so4_contvolcano_vertical_850-5000_ne30pg3_c20200125.nc',
+ 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/historical_ne30pg3/emissions-cmip6_SO2_contvolcano_vertical_850-5000_ne30pg3_c20200125.nc',
+ 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/historical_ne30pg3/emissions-cmip6_so4_a1_anthro-ene_vertical_mol_175001-201412_ne30pg3_c20200103.nc',
+ 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/historical_ne30pg3/emissions-cmip6_so4_a1_contvolcano_vertical_850-5000_ne30pg3_c20200125.nc',
+ 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/historical_ne30pg3/emissions-cmip6_so4_a2_contvolcano_vertical_850-5000_ne30pg3_c20200125.nc'
+
+
+
+ CYCLICAL
+ 1850
+
+CYCLICAL
+1850
+
+
diff --git a/bld/namelist_files/use_cases/1850_cam_mt.xml b/bld/namelist_files/use_cases/1850_cam_mt.xml
new file mode 100644
index 0000000000..5a535f27be
--- /dev/null
+++ b/bld/namelist_files/use_cases/1850_cam_mt.xml
@@ -0,0 +1,59 @@
+
+
+
+
+atm/cam/solar/SolarForcingCMIP6piControl_c160921.nc
+ 18500101
+ FIXED
+
+
+atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180905.nc
+1850
+'CYCLICAL'
+'CO2','CH4','N2O','CFC11','CFC12','CFC11eq'
+
+
+
+ 'atm/cam/ozone_strataero'
+ 'ozone_strataero_cyclical_WACCM6_L70_CMIP6-piControl.001_y21-50avg_zm_5day_c180802.nc'
+ 'O3'
+ CYCLICAL
+ 1850
+
+
+ 1850
+ 'atm/cam/ozone_strataero'
+ 'ozone_strataero_cyclical_WACCM6_L70_CMIP6-piControl.001_y21-50avg_zm_5day_c180802.nc'
+ .true.
+ 'CYCLICAL'
+
+
+
+ 1850
+ 'atm/cam/tracer_cnst'
+ 'tracer_cnst_WACCM6_halons_3DmonthlyL70_1850climoCMIP6piControl001_y21-50avg_c180802.nc'
+ 'O3','OH','NO3','HO2','HALONS'
+ 'CYCLICAL'
+ ''
+
+
+ CYCLICAL
+ 1850
+
+ 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/historical_ne30pg3/emissions-cmip6_num_so4_a1_anthro-ene_vertical_mol_175001-201412_ne30pg3_c20200103.nc',
+ 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/historical_ne30pg3/emissions-cmip6_num_a1_so4_contvolcano_vertical_850-5000_ne30pg3_c20200125.nc',
+ 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/historical_ne30pg3/emissions-cmip6_num_a2_so4_contvolcano_vertical_850-5000_ne30pg3_c20200125.nc',
+ 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/historical_ne30pg3/emissions-cmip6_SO2_contvolcano_vertical_850-5000_ne30pg3_c20200125.nc',
+ 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/historical_ne30pg3/emissions-cmip6_so4_a1_anthro-ene_vertical_mol_175001-201412_ne30pg3_c20200103.nc',
+ 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/historical_ne30pg3/emissions-cmip6_so4_a1_contvolcano_vertical_850-5000_ne30pg3_c20200125.nc',
+ 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/historical_ne30pg3/emissions-cmip6_so4_a2_contvolcano_vertical_850-5000_ne30pg3_c20200125.nc'
+
+
+
+ CYCLICAL
+ 1850
+
+CYCLICAL
+1850
+
+
diff --git a/bld/namelist_files/use_cases/2000_cam4_trop_chem.xml b/bld/namelist_files/use_cases/2000_cam4_trop_chem.xml
index 3d96dd4c48..a47840883e 100644
--- a/bld/namelist_files/use_cases/2000_cam4_trop_chem.xml
+++ b/bld/namelist_files/use_cases/2000_cam4_trop_chem.xml
@@ -63,7 +63,7 @@
'C10H16', 'TERPO2', 'TERPOOH', 'TOLUENE', 'CRESOL', 'TOLO2', 'TOLOOH', 'XOH', 'BIGALD', 'GLYOXAL', 'PAN',
'ONIT', 'MPAN', 'ISOPNO3', 'ONITR', 'CB1', 'CB2', 'OC1', 'OC2', 'SOA', 'SO2', 'SO4', 'DMS', 'NH3', 'NH4', 'NH4NO3',
'SSLT01', 'SSLT02', 'SSLT03', 'SSLT04', 'DST01', 'DST02', 'DST03', 'DST04', 'Rn', 'Pb','HCN','CH3CN',
- 'SFNO','SFNO2','SFCO','SFBIGALK','SFBIGENE','SFC10H16','SFC2H4','SFC2H5OH','SFC2H6','SFC3H6','SFC3H8',
+ 'SFNO','SFCO','SFBIGALK','SFBIGENE','SFC10H16','SFC2H4','SFC2H5OH','SFC2H6','SFC3H6','SFC3H8',
'SFCH2O','SFCH3CHO','SFCH3COCH3','SFCH3OH','SFDMS','SFISOP','SFMEK','SFNH3',
'SFCB1','SFCB2','SFOC1','SFOC2','SFSO2','SFTOLUENE','SFHCN','SFCH3CN',
'DV_HCN','DV_CH3CN','WD_HCN','WD_CH3CN','WD_SO2','WD_HNO3','WD_H2O2','WD_CH2O',
diff --git a/bld/namelist_files/use_cases/2000_cam6.xml b/bld/namelist_files/use_cases/2000_cam6.xml
index 6b596bb795..05d019beb2 100644
--- a/bld/namelist_files/use_cases/2000_cam6.xml
+++ b/bld/namelist_files/use_cases/2000_cam6.xml
@@ -2,13 +2,15 @@
-
- 2000
- atm/cam/ozone
- tracer_cnst_CAM6chem_2000climo_3D_monthly_c171004.nc
- ''
- 'O3','OH','NO3','HO2'
- 'CYCLICAL'
+atm/cam/ozone
+tracer_cnst_CAM6chem_2000climo_3D_monthly_c171004.nc
+'O3','OH','NO3','HO2'
+atm/cam/tracer_cnst
+tracer_cnst_halons_3D_L70_1849-2015_CMIP6ensAvg_c180927.nc
+'O3','OH','NO3','HO2','HALONS'
+2000
+CYCLICAL
+''
2000
atm/cam/ozone
@@ -61,18 +63,18 @@
'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_so4_a1_anthro-ag-ship_surface_2000climo_0.9x1.25_c20170616.nc',
'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_so4_a1_bb_surface_2000climo_0.9x1.25_c20170322.nc',
'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_so4_a2_anthro-res_surface_2000climo_0.9x1.25_c20170616.nc',
- 'SOAE -> 4.4323D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_BENZENE_anthro_surface_2000climo_0.9x1.25_c20170608.nc',
- 'SOAE -> 4.4323D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_BENZENE_bb_surface_2000climo_0.9x1.25_c20170322.nc',
- 'SOAE -> 1.2021D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_ISOP_bb_surface_2000climo_0.9x1.25_c20170322.nc',
- 'SOAE -> 6.6625D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_MTERP_bb_surface_2000climo_0.9x1.25_c20170322.nc',
- 'SOAE -> 9.9042D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_TOLUENE_anthro_surface_2000climo_0.9x1.25_c20170608.nc',
- 'SOAE -> 9.9042D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_TOLUENE_bb_surface_2000climo_0.9x1.25_c20170322.nc',
- 'SOAE -> 8.3792D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_XYLENES_anthro_surface_2000climo_0.9x1.25_c20170608.nc',
- 'SOAE -> 8.3792D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_XYLENES_bb_surface_2000climo_0.9x1.25_c20170322.nc',
- 'SOAE -> 8.6865D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_IVOC_anthro_surface_2000climo_0.9x1.25_c20170608.nc',
- 'SOAE -> 8.6865D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_IVOC_bb_surface_2000climo_0.9x1.25_c20170322.nc',
- 'SOAE -> 16.8188D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_SVOC_anthro_surface_2000climo_0.9x1.25_c20170608.nc',
- 'SOAE -> 16.8188D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_SVOC_bb_surface_2000climo_0.9x1.25_c20170322.nc'
+ 'SOAE -> 2.5592D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_BENZENE_anthro_surface_2000climo_0.9x1.25_c20170608.nc',
+ 'SOAE -> 2.5592D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_BENZENE_bb_surface_2000climo_0.9x1.25_c20170322.nc',
+ 'SOAE -> 0.5954D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_ISOP_bb_surface_2000climo_0.9x1.25_c20170322.nc',
+ 'SOAE -> 5.1004D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_MTERP_bb_surface_2000climo_0.9x1.25_c20170322.nc',
+ 'SOAE -> 8.2367D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_TOLUENE_anthro_surface_2000climo_0.9x1.25_c20170608.nc',
+ 'SOAE -> 8.2367D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_TOLUENE_bb_surface_2000climo_0.9x1.25_c20170322.nc',
+ 'SOAE -> 6.5013D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_XYLENES_anthro_surface_2000climo_0.9x1.25_c20170608.nc',
+ 'SOAE -> 6.5013D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_XYLENES_bb_surface_2000climo_0.9x1.25_c20170322.nc',
+ 'SOAE -> 8.5371D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_IVOC_anthro_surface_2000climo_0.9x1.25_c20170608.nc',
+ 'SOAE -> 8.5371D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_IVOC_bb_surface_2000climo_0.9x1.25_c20170322.nc',
+ 'SOAE -> 16.650D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_SVOC_anthro_surface_2000climo_0.9x1.25_c20170608.nc',
+ 'SOAE -> 16.650D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_SVOC_bb_surface_2000climo_0.9x1.25_c20170322.nc'
diff --git a/bld/namelist_files/use_cases/2000_geoschem.xml b/bld/namelist_files/use_cases/2000_geoschem.xml
index e7be6f4774..7463a49361 100644
--- a/bld/namelist_files/use_cases/2000_geoschem.xml
+++ b/bld/namelist_files/use_cases/2000_geoschem.xml
@@ -6,13 +6,14 @@
-/glade/p/univ/umit0034/ExtData/CHEM_INPUTS/
+atm/cam/geoschem/ExtData/CHEM_INPUTS/
-/glade/p/univ/umit0034/Shared/GEOS-Chem/f.e20.FC2010.f09_f09.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc
+atm/cam/geoschem/initial_conditions/f.e20.FC2010.f09_f09.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc
-/glade/p/univ/umit0034/Shared/GEOS-Chem/f.e20.FC2010.f19_f19.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc
+atm/cam/geoschem/initial_conditions/f.e20.FC2010.f19_f19.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc
-/glade/u/home/elundgren/drydep_henrys_law_nc/dep_data_file_geoschem.nc
+HEMCO_Config.rc
+HEMCO_Diagn.rc
@@ -40,26 +41,6 @@
-
-
-
-'ACET','ACTA','ALD2','AROMP4','AROMP5','ATOOH','BALD','BENZP','BR2','BRCL','BRNO3','BZCO3H','BZPAN','CH2O','CL2','CLNO2','CLNO3','CLO','CLOO','CSL','EOH','ETHLN','ETHN','ETHP','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MCT','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPHEN','NPRNO3','O3','PAN','PHEN','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2'
-
-
-
-
-'ACTA','ALD2','AROMP4','AROMP5','ATOOH','BALD','BENZP','BR2','BRCL','BZCO3H','BZPAN','CH2O','CSL','EOH','ETHLN','ETHN','ETHP','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','LVOCOA','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MCT','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','NPHEN','PAN','PHEN','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2'
-
-
-
-'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2'
-
-
-
-'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2'
-
-
-
1,30,365,240,240,480,365,73,30
diff --git a/bld/namelist_files/use_cases/2000_trop_strat_vbs_cam6.xml b/bld/namelist_files/use_cases/2000_trop_strat_vbs_cam6.xml
index 0c7204fa5c..2ba0c53847 100644
--- a/bld/namelist_files/use_cases/2000_trop_strat_vbs_cam6.xml
+++ b/bld/namelist_files/use_cases/2000_trop_strat_vbs_cam6.xml
@@ -151,7 +151,7 @@
- 'CFC11STAR', 'AODDUST', 'AODDUST2', 'T', 'U', 'V', 'O3', 'OH', 'NO3', 'HO2',
+ 'CFC11STAR', 'AODDUST', 'AODDUST02', 'T', 'U', 'V', 'O3', 'OH', 'NO3', 'HO2',
'LNO_COL_PROD', 'NO2_CLXF', 'SFNO', 'SFNH3', 'BRO',
'CH3CL', 'CLO', 'CO2', 'HCL', 'HO2', 'HOCL', 'H2O', 'PHIS', 'Z3',
'BENZENE', 'C2H2', 'C2H4', 'C2H6', 'C3H8', 'CCL4', 'CFC11', 'CFC113', 'CFC12',
@@ -183,8 +183,8 @@
'SAD_SULFC', 'SAD_TROP', 'SAD_AERO', 'REFF_AERO', 'PDELDRY', 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'H2SO4M_C',
'HNO3_GAS', 'HNO3_STS', 'HNO3_NAT', 'VEL_NAT2', 'NITROP_PD', 'NOX', 'NOY', 'CLOX', 'CLOY',
'BROX', 'BROY', 'TCLY', 'TOTH', 'MASS', 'TBRY', 'HCL_GAS', 'wet_deposition_NHx_as_N', 'wet_deposition_NOy_as_N',
- 'HCL_GAS', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'ABSORB', 'AODVISdn', 'AODdnMODE1', 'AODVISstdn', 'AODNIRstdn',
- 'AODUVstdn', 'AODdnMODE2', 'AODdnMODE3', 'AODdnDUST1', 'AODdnDUST2', 'AODdnDUST3', 'AODVISstdn', 'AODUVstdn', 'AODNIRstdn',
+ 'HCL_GAS', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'ABSORB', 'AODVISdn', 'AODdn_aitken', 'AODVISstdn', 'AODNIRstdn',
+ 'AODUVstdn', 'AODdn_accum', 'AODdn_coarse', 'AODdnDUST01', 'AODdnDUST02', 'AODdnDUST03', 'AODVISstdn', 'AODUVstdn', 'AODNIRstdn',
'AODNIRstdn', 'AODVISdn', 'AODUVdn', 'EXTINCTdn', 'EXTxASYMdn', 'EXTINCTNIRdn', 'EXTINCTUVdn', 'WD_ALKNIT', 'WD_ALKOOH',
'WD_BENZOOH', 'WD_BRONO2', 'WD_BZOOH', 'WD_C2H5OH', 'WD_C2H5OOH', 'WD_C3H7OOH', 'WD_C6H5OOH', 'WD_CH2O', 'WD_CH3CHO',
'WD_CH3CN', 'WD_CH3COCHO', 'WD_CH3COOH', 'WD_CH3COOOH', 'WD_CH3COCH3', 'WD_CH3OH', 'WD_CH3OOH', 'WD_CLONO2', 'WD_COF2', 'WD_COFCL',
diff --git a/bld/namelist_files/use_cases/2010_cam6.xml b/bld/namelist_files/use_cases/2010_cam6.xml
index 3927830033..239f5436f6 100644
--- a/bld/namelist_files/use_cases/2010_cam6.xml
+++ b/bld/namelist_files/use_cases/2010_cam6.xml
@@ -58,18 +58,18 @@
'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_so4_a1_anthro-ag-ship_surface_2010climo_0.9x1.25_c20180918.nc',
'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_so4_a1_bb_surface_2010climo_0.9x1.25_c20180918.nc',
'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_so4_a2_anthro-res_surface_2010climo_0.9x1.25_c20180918.nc',
- 'SOAE -> 4.4323D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_BENZENE_anthro_surface_2010climo_0.9x1.25_c20180918.nc',
- 'SOAE -> 4.4323D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_BENZENE_bb_surface_2010climo_0.9x1.25_c20180918.nc',
- 'SOAE -> 1.2021D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_ISOP_bb_surface_2010climo_0.9x1.25_c20180918.nc',
- 'SOAE -> 6.6625D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_MTERP_bb_surface_2010climo_0.9x1.25_c20180918.nc',
- 'SOAE -> 9.9042D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_TOLUENE_anthro_surface_2010climo_0.9x1.25_c20180918.nc',
- 'SOAE -> 9.9042D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_TOLUENE_bb_surface_2010climo_0.9x1.25_c20180918.nc',
- 'SOAE -> 8.3792D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_XYLENES_anthro_surface_2010climo_0.9x1.25_c20180918.nc',
- 'SOAE -> 8.3792D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_XYLENES_bb_surface_2010climo_0.9x1.25_c20180918.nc',
- 'SOAE -> 8.6865D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_IVOC_anthro_surface_2010climo_0.9x1.25_c20180918.nc',
- 'SOAE -> 8.6865D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_IVOC_bb_surface_2010climo_0.9x1.25_c20180918.nc',
- 'SOAE -> 16.8188D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_SVOC_anthro_surface_2010climo_0.9x1.25_c20180918.nc',
- 'SOAE -> 16.8188D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_SVOC_bb_surface_2010climo_0.9x1.25_c20180918.nc'
+ 'SOAE -> 2.5592D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_BENZENE_anthro_surface_2010climo_0.9x1.25_c20180918.nc',
+ 'SOAE -> 2.5592D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_BENZENE_bb_surface_2010climo_0.9x1.25_c20180918.nc',
+ 'SOAE -> 0.5954D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_ISOP_bb_surface_2010climo_0.9x1.25_c20180918.nc',
+ 'SOAE -> 5.1004D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_MTERP_bb_surface_2010climo_0.9x1.25_c20180918.nc',
+ 'SOAE -> 8.2367D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_TOLUENE_anthro_surface_2010climo_0.9x1.25_c20180918.nc',
+ 'SOAE -> 8.2367D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_TOLUENE_bb_surface_2010climo_0.9x1.25_c20180918.nc',
+ 'SOAE -> 6.5013D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_XYLENES_anthro_surface_2010climo_0.9x1.25_c20180918.nc',
+ 'SOAE -> 6.5013D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_XYLENES_bb_surface_2010climo_0.9x1.25_c20180918.nc',
+ 'SOAE -> 8.5371D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_IVOC_anthro_surface_2010climo_0.9x1.25_c20180918.nc',
+ 'SOAE -> 8.5371D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_IVOC_bb_surface_2010climo_0.9x1.25_c20180918.nc',
+ 'SOAE -> 16.650D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_SVOC_anthro_surface_2010climo_0.9x1.25_c20180918.nc',
+ 'SOAE -> 16.650D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_SVOC_bb_surface_2010climo_0.9x1.25_c20180918.nc'
diff --git a/bld/namelist_files/use_cases/2010_geoschem.xml b/bld/namelist_files/use_cases/2010_geoschem.xml
index 56d1182cd8..2d3ee5db95 100644
--- a/bld/namelist_files/use_cases/2010_geoschem.xml
+++ b/bld/namelist_files/use_cases/2010_geoschem.xml
@@ -4,13 +4,15 @@
-/glade/p/univ/umit0034/ExtData/CHEM_INPUTS/
+atm/cam/geoschem/ExtData/CHEM_INPUTS/
-/glade/p/univ/umit0034/Shared/GEOS-Chem/f.e20.FC2010.f09_f09.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc
+atm/cam/geoschem/initial_conditions/f.e20.FC2010.f09_f09.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc
-/glade/p/univ/umit0034/Shared/GEOS-Chem/f.e20.FC2010.f19_f19.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc
+atm/cam/geoschem/initial_conditions/f.e20.FC2010.f19_f19.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc
+
+HEMCO_Config.rc
+HEMCO_Diagn.rc
-/glade/u/home/elundgren/drydep_henrys_law_nc/dep_data_file_geoschem.nc
@@ -36,26 +38,6 @@
-
-
-
-'ACET','ACTA','ALD2','AROMP4','AROMP5','ATOOH','BALD','BENZP','BR2','BRCL','BRNO3','BZCO3H','BZPAN','CH2O','CL2','CLNO2','CLNO3','CLO','CLOO','CSL','EOH','ETHLN','ETHN','ETHP','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MCT','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPHEN','NPRNO3','O3','PAN','PHEN','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2'
-
-
-
-
-'ACTA','ALD2','AROMP4','AROMP5','ATOOH','BALD','BENZP','BR2','BRCL','BZCO3H','BZPAN','CH2O','CSL','EOH','ETHLN','ETHN','ETHP','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','LVOCOA','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MCT','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','NPHEN','PAN','PHEN','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2'
-
-
-
-'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2'
-
-
-
-'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2'
-
-
-
1,30,365,240,240,480,365,73,30
diff --git a/bld/namelist_files/use_cases/2010_trop_strat_vbs_cam6.xml b/bld/namelist_files/use_cases/2010_trop_strat_vbs_cam6.xml
index 5a1dbc0bf7..1000976390 100644
--- a/bld/namelist_files/use_cases/2010_trop_strat_vbs_cam6.xml
+++ b/bld/namelist_files/use_cases/2010_trop_strat_vbs_cam6.xml
@@ -342,7 +342,7 @@
- 'CFC11STAR', 'AODDUST', 'AODDUST2', 'T', 'U', 'V', 'O3', 'OH', 'NO3', 'HO2',
+ 'CFC11STAR', 'AODDUST', 'AODDUST02', 'T', 'U', 'V', 'O3', 'OH', 'NO3', 'HO2',
'LNO_COL_PROD', 'NO2_CLXF', 'SFNO', 'SFNH3', 'BRO',
'CH3CL', 'CLO', 'CO2', 'HCL', 'HO2', 'HOCL', 'H2O', 'PHIS', 'Z3',
'BENZENE', 'C2H2', 'C2H4', 'C2H6', 'C3H8', 'CCL4', 'CFC11', 'CFC113', 'CFC12',
@@ -374,8 +374,8 @@
'SAD_SULFC', 'SAD_TROP', 'SAD_AERO', 'REFF_AERO', 'PDELDRY', 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'H2SO4M_C',
'HNO3_GAS', 'HNO3_STS', 'HNO3_NAT', 'VEL_NAT2', 'NITROP_PD', 'NOX', 'NOY', 'CLOX', 'CLOY',
'BROX', 'BROY', 'TCLY', 'TOTH', 'MASS', 'TBRY', 'HCL_GAS', 'wet_deposition_NHx_as_N', 'wet_deposition_NOy_as_N',
- 'HCL_GAS', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'ABSORB', 'AODVISdn', 'AODdnMODE1', 'AODVISstdn', 'AODNIRstdn',
- 'AODUVstdn', 'AODdnMODE2', 'AODdnMODE3', 'AODdnDUST1', 'AODdnDUST2', 'AODdnDUST3', 'AODVISstdn', 'AODUVstdn', 'AODNIRstdn',
+ 'HCL_GAS', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'ABSORB', 'AODVISdn', 'AODdn_aitken', 'AODVISstdn', 'AODNIRstdn',
+ 'AODUVstdn', 'AODdn_accum', 'AODdn_coarse', 'AODdnDUST01', 'AODdnDUST02', 'AODdnDUST03', 'AODVISstdn', 'AODUVstdn', 'AODNIRstdn',
'AODNIRstdn', 'AODVISdn', 'AODUVdn', 'EXTINCTdn', 'EXTxASYMdn', 'EXTINCTNIRdn', 'EXTINCTUVdn', 'WD_ALKNIT', 'WD_ALKOOH',
'WD_BENZOOH', 'WD_BRONO2', 'WD_BZOOH', 'WD_C2H5OH', 'WD_C2H5OOH', 'WD_C3H7OOH', 'WD_C6H5OOH', 'WD_CH2O', 'WD_CH3CHO',
'WD_CH3CN', 'WD_CH3COCHO', 'WD_CH3COOH', 'WD_CH3COOOH', 'WD_CH3COCH3', 'WD_CH3OH', 'WD_CH3OOH', 'WD_CLONO2', 'WD_COF2', 'WD_COFCL',
diff --git a/bld/namelist_files/use_cases/aquaplanet_cam3.xml b/bld/namelist_files/use_cases/aquaplanet_cam3.xml
index 3fd3d876cb..373b2ad18d 100644
--- a/bld/namelist_files/use_cases/aquaplanet_cam3.xml
+++ b/bld/namelist_files/use_cases/aquaplanet_cam3.xml
@@ -57,9 +57,6 @@
-
-.true.
-
86164.10063718943
6.37100e6
@@ -78,4 +75,3 @@
0
-
diff --git a/bld/namelist_files/use_cases/aquaplanet_cam4.xml b/bld/namelist_files/use_cases/aquaplanet_cam4.xml
index a18f4cfcd0..67d32c9f9f 100644
--- a/bld/namelist_files/use_cases/aquaplanet_cam4.xml
+++ b/bld/namelist_files/use_cases/aquaplanet_cam4.xml
@@ -31,8 +31,6 @@
-
-.true.
86164.10063718943
6.37100e6
@@ -45,4 +43,3 @@
.false.
-
diff --git a/bld/namelist_files/use_cases/aquaplanet_cam5.xml b/bld/namelist_files/use_cases/aquaplanet_cam5.xml
index afc820ecef..814eecd98f 100644
--- a/bld/namelist_files/use_cases/aquaplanet_cam5.xml
+++ b/bld/namelist_files/use_cases/aquaplanet_cam5.xml
@@ -29,10 +29,6 @@
CYCLICAL
1990
-
-.true.
-
-
86164.10063718943
6.37100e6
@@ -50,4 +46,3 @@
""
-
diff --git a/bld/namelist_files/use_cases/aquaplanet_cam6.xml b/bld/namelist_files/use_cases/aquaplanet_cam6.xml
index cbe41e8cee..814eecd98f 100644
--- a/bld/namelist_files/use_cases/aquaplanet_cam6.xml
+++ b/bld/namelist_files/use_cases/aquaplanet_cam6.xml
@@ -29,9 +29,6 @@
CYCLICAL
1990
-
-.true.
-
86164.10063718943
6.37100e6
@@ -49,4 +46,3 @@
""
-
diff --git a/bld/namelist_files/use_cases/aquaplanet_rce_cam6.xml b/bld/namelist_files/use_cases/aquaplanet_rce_cam6.xml
index 01d810b08d..f03c4294b2 100644
--- a/bld/namelist_files/use_cases/aquaplanet_rce_cam6.xml
+++ b/bld/namelist_files/use_cases/aquaplanet_rce_cam6.xml
@@ -44,9 +44,6 @@
CYCLICAL
1990
-
-.true.
-
.true.
0.73391095
@@ -71,4 +68,3 @@
0.0
-
diff --git a/bld/namelist_files/use_cases/dctest_frierson.xml b/bld/namelist_files/use_cases/dctest_frierson.xml
new file mode 100644
index 0000000000..340052bc84
--- /dev/null
+++ b/bld/namelist_files/use_cases/dctest_frierson.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+0.
+0.
+0.
+fixed_parameters
+
+
+.false.
+
+
+.true.
+-720
+'A'
+
+
+ 'U:A','T:A','V:A','Q:A','Z3:A','PRECL:A','PRECC:A','PS:A','SST:A','TS:A', 'gray_DTCOND', 'gray_DQCOND', 'gray_EVAPDT', 'gray_EVAPDQ', 'gray_PRECL' , 'gray_PRECC' , 'gray_Tsurf' , 'gray_Qsurf' , 'gray_Cdrag' , 'gray_Zpbl' , 'gray_KVH' , 'gray_KVM' , 'gray_VSE' , 'gray_Zm' , 'gray_Rf' , 'gray_DTV' , 'gray_DUV' , 'gray_DVV' , 'gray_VD01' , 'gray_SHflux', 'gray_LHflux', 'gray_TauU' , 'gray_TauV' , 'gray_QRL' , 'gray_QRS' , 'gray_SWflux', 'gray_LUflux', 'gray_LDflux', 'gray_LWflux', 'gray_LUflux_TOA', 'gray_LDflux_TOA', 'gray_LWflux_TOA'
+
+
+'moist_baroclinic_wave_dcmip2016'
+
+atm/cam/inic/fv/FGRAYRAD_f19.cam.i.0051-01-01-00000_c20230510.nc
+
+
+ 'TT_SLOT','TT_GBALL','TT_TANH','TT_EM8','TT_Y2_2','TT_Y32_16'
+
+
+
diff --git a/bld/namelist_files/use_cases/hist_cam_lt.xml b/bld/namelist_files/use_cases/hist_cam_lt.xml
new file mode 100644
index 0000000000..81834955c3
--- /dev/null
+++ b/bld/namelist_files/use_cases/hist_cam_lt.xml
@@ -0,0 +1,45 @@
+
+
+
+19790101
+
+
+atm/cam/solar/SolarForcingCMIP6_18491230-23000102_c20200615.nc
+
+
+atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180905.nc
+'SERIAL'
+'CO2','CH4','N2O','CFC11','CFC12','CFC11eq'
+
+
+'Q:H2O->UBC_FILE'
+atm/cam/chem/ubc/f.e21.FWHISTBgcCrop.f09_f09_mg17.CMIP6-AMIP-WACCM.ensAvg123.cam.h0zm.UBC.195001-201412_c220322.nc
+'SERIAL'
+
+
+ 'atm/cam/ozone_strataero'
+ 'ozone_strataero_WACCM_L70_zm5day_18500101-20150103_CMIP6ensAvg_c180923.nc'
+ 'O3'
+ SERIAL
+
+
+ .true.
+ 'atm/cam/ozone_strataero'
+ 'ozone_strataero_WACCM_L70_zm5day_18500101-20150103_CMIP6ensAvg_c180923.nc'
+ SERIAL
+
+
+ 'atm/cam/tracer_cnst'
+ 'tracer_cnst_halons_3D_L70_1849-2015_CMIP6ensAvg_c180927.nc'
+ 'O3','OH','NO3','HO2','HALONS'
+ INTERP_MISSING_MONTHS
+ ''
+
+
+INTERP_MISSING_MONTHS
+
+
+INTERP_MISSING_MONTHS
+SERIAL
+
+
diff --git a/bld/namelist_files/use_cases/hist_cam_mt.xml b/bld/namelist_files/use_cases/hist_cam_mt.xml
new file mode 100644
index 0000000000..c100cc6e85
--- /dev/null
+++ b/bld/namelist_files/use_cases/hist_cam_mt.xml
@@ -0,0 +1,40 @@
+
+
+
+19790101
+
+
+atm/cam/solar/SolarForcingCMIP6_18491230-23000102_c20200615.nc
+
+
+atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180905.nc
+'SERIAL'
+'CO2','CH4','N2O','CFC11','CFC12','CFC11eq'
+
+
+ 'atm/cam/ozone_strataero'
+ 'ozone_strataero_WACCM_L70_zm5day_18500101-20150103_CMIP6ensAvg_c180923.nc'
+ 'O3'
+ SERIAL
+
+
+ .true.
+ 'atm/cam/ozone_strataero'
+ 'ozone_strataero_WACCM_L70_zm5day_18500101-20150103_CMIP6ensAvg_c180923.nc'
+ SERIAL
+
+
+ 'atm/cam/tracer_cnst'
+ 'tracer_cnst_halons_3D_L70_1849-2015_CMIP6ensAvg_c180927.nc'
+ 'O3','OH','NO3','HO2','HALONS'
+ INTERP_MISSING_MONTHS
+ ''
+
+
+INTERP_MISSING_MONTHS
+
+
+INTERP_MISSING_MONTHS
+SERIAL
+
+
diff --git a/bld/namelist_files/use_cases/hist_geoschem.xml b/bld/namelist_files/use_cases/hist_geoschem.xml
index 161db508ee..78b681e572 100644
--- a/bld/namelist_files/use_cases/hist_geoschem.xml
+++ b/bld/namelist_files/use_cases/hist_geoschem.xml
@@ -6,13 +6,14 @@
-/glade/p/univ/umit0034/ExtData/CHEM_INPUTS/
+atm/cam/geoschem/ExtData/CHEM_INPUTS/
-/glade/p/univ/umit0034/Shared/GEOS-Chem/f.e20.FC2010.f09_f09.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc
+atm/cam/geoschem/initial_conditions/f.e20.FC2010.f09_f09.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc
-/glade/p/univ/umit0034/Shared/GEOS-Chem/f.e20.FC2010.f19_f19.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc
+atm/cam/geoschem/initial_conditions/f.e20.FC2010.f19_f19.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc
-/glade/u/home/elundgren/drydep_henrys_law_nc/dep_data_file_geoschem.nc
+HEMCO_Config.rc
+HEMCO_Diagn.rc
@@ -34,26 +35,6 @@
'noy', 'nhx'
-
-
-
-'ACET','ACTA','ALD2','AROMP4','AROMP5','ATOOH','BALD','BENZP','BR2','BRCL','BRNO3','BZCO3H','BZPAN','CH2O','CL2','CLNO2','CLNO3','CLO','CLOO','CSL','EOH','ETHLN','ETHN','ETHP','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','LVOCOA','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MCT','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPHEN','NPRNO3','O3','PAN','PHEN','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2'
-
-
-
-
-'ACTA','ALD2','AROMP4','AROMP5','ATOOH','BALD','BENZP','BR2','BRCL','BZCO3H','BZPAN','CH2O','CSL','EOH','ETHLN','ETHN','ETHP','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','LVOCOA','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MCT','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','NPHEN','PAN','PHEN','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2'
-
-
-
-'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2'
-
-
-
-'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2'
-
-
-
1,30,365,240,240,480,365,73,30
diff --git a/bld/namelist_files/use_cases/hist_geoschem_nudged.xml b/bld/namelist_files/use_cases/hist_geoschem_nudged.xml
index 2b1bcf64f9..0550880d80 100644
--- a/bld/namelist_files/use_cases/hist_geoschem_nudged.xml
+++ b/bld/namelist_files/use_cases/hist_geoschem_nudged.xml
@@ -6,13 +6,14 @@
-/glade/p/univ/umit0034/ExtData/CHEM_INPUTS/
+atm/cam/geoschem/ExtData/CHEM_INPUTS/
-/glade/p/univ/umit0034/Shared/GEOS-Chem/f.e20.FC2010.f09_f09.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc
+atm/cam/geoschem/initial_conditions/f.e20.FC2010.f09_f09.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc
-/glade/p/univ/umit0034/Shared/GEOS-Chem/f.e20.FC2010.f19_f19.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc
+atm/cam/geoschem/initial_conditions//f.e20.FC2010.f19_f19.144.GC_vbsext.001.cam.i.0007-01-01-00000.nc
-/glade/u/home/elundgren/drydep_henrys_law_nc/dep_data_file_geoschem.nc
+HEMCO_Config.rc
+HEMCO_Diagn.rc
@@ -89,26 +90,6 @@
0.1
.false.
-
-
-
-'ACET','ACTA','ALD2','AROMP4','AROMP5','ATOOH','BALD','BENZP','BR2','BRCL','BRNO3','BZCO3H','BZPAN','CH2O','CL2','CLNO2','CLNO3','CLO','CLOO','CSL','EOH','ETHLN','ETHN','ETHP','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','LVOCOA','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MCT','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPHEN','NPRNO3','O3','PAN','PHEN','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2'
-
-
-
-
-'ACTA','ALD2','AROMP4','AROMP5','ATOOH','BALD','BENZP','BR2','BRCL','BZCO3H','BZPAN','CH2O','CSL','EOH','ETHLN','ETHN','ETHP','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','LVOCOA','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MCT','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','NPHEN','PAN','PHEN','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2'
-
-
-
-'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2'
-
-
-
-'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2'
-
-
-
1,30,365,240,240,480,365,73,30
diff --git a/bld/namelist_files/use_cases/hist_trop_strat_nudged_cam6.xml b/bld/namelist_files/use_cases/hist_trop_strat_nudged_cam6.xml
index 2875336285..ff2a92b3ef 100644
--- a/bld/namelist_files/use_cases/hist_trop_strat_nudged_cam6.xml
+++ b/bld/namelist_files/use_cases/hist_trop_strat_nudged_cam6.xml
@@ -16,16 +16,116 @@
.false.
0.25D0
+
SERIAL
-atm/waccm/lb/LBC_1750-2014_CMIP6_0p5degLat_c170126.nc
+atm/waccm/lb/LBC_17500116-25001216_CMIP6_SSP585_0p5degLat_c20200824.nc
SERIAL
+2.70D0
+ 0.38D0
+ 'SERIAL'
+
INTERP_MISSING_MONTHS
+
+ 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_bc_a4_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'NO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NO2_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a1_anthro-ene_vertical_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a1_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc',
+ 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a2_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc',
+ 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_bc_a4_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SO2_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_SO2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc',
+ 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/stratvolc/VolcanEESMv3.10_piControl_SO2_1850-2014average_ext_1deg_ZeroTrop_c181020.nc',
+ 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a1_anthro-ene_vertical_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a1_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc',
+ 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc'
+
INTERP_MISSING_MONTHS
+
+ 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BENZENE_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BENZENE_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BIGALK_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BIGALK_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BIGENE_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BIGENE_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H2_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H2_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H4_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_C2H4_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H5OH_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H5OH_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H6_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H6_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_C2H6_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C3H6_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C3H6_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_C3H6_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C3H8_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C3H8_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_C3H8_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH2O_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH2O_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3CHO_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3CHO_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3CN_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3CN_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COCH3_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COCH3_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH3COCHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COCHO_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COOH_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COOH_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3OH_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3OH_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CO_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CO_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_CO_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'E90 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions_E90global_surface_175001-210101_0.9x1.25_c20190224.nc',
+ 'GLYALD -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_GLYALD_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_HCN_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_HCN_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_HCOOH_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_HCOOH_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'ISOP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_ISOP_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_IVOC_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_IVOC_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_MEK_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_MEK_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'MTERP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_MTERP_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NH3_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NH3_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_NH3_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NO_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NO_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_NO_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SVOC_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SVOC_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_TOLUENE_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_TOLUENE_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_XYLENES_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_XYLENES_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_bc_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_bc_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_DMS_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a1_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a1_anthro-ag-ship_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_bc_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_bc_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_pom_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_pom_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_pom_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_pom_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SO2_anthro-ag-ship-res_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SO2_anthro-ene_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SO2_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a1_anthro-ag-ship_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a1_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190224.nc'
+
'noy', 'nhx'
@@ -87,14 +187,14 @@
0, -24
'A', 'A'
- 1, 1
- 0, 0
-'A', 'A'
+ 1, 1
+ 0, 0
+'A', 'A'
.true.
.false.
.false.
-.false.
+.true.
.false.
.false.
.false.
@@ -102,236 +202,51 @@
.false.
-
- 'CFC11STAR', 'AODDUST', 'AODDUST2', 'T', 'U', 'V', 'O3', 'OH', 'NO3', 'HO2',
- 'LNO_COL_PROD', 'NO2_CLXF', 'SFNO', 'SFNH3', 'BRO',
- 'CH3CL', 'CLO', 'CO2', 'HCL', 'HO2', 'HOCL', 'H2O', 'PHIS', 'Z3',
- 'BENZENE', 'C2H2', 'C2H4', 'C2H6', 'C3H8', 'CCL4', 'CFC11', 'CFC113', 'CFC12',
- 'CH2O', 'CH3BR', 'CH3CCL3', 'CH3CHO', 'CH3CL', 'CH3CN', 'CH3COCH3', 'CH3OH', 'CH4',
- 'CO', 'H2O2', 'HCFC22', 'HCN', 'HNO3', 'ISOP', 'MTERP', 'N2O', 'O3', 'O3S',
- 'PAN', 'SO2', 'TOLUENE', 'OH', 'ALKNIT', 'ALKOOH', 'BCARY', 'BENZENE', 'BENZOOH',
- 'BEPOMUC', 'BIGALD', 'BIGALD1', 'BIGALD2', 'BIGALD3', 'BIGALD4', 'BIGALK', 'BIGENE', 'BR',
- 'BRCL', 'BRO', 'BRONO2', 'BRY', 'BZALD', 'BZOOH', 'C2H2', 'C2H4', 'C2H5OH',
- 'C2H5OOH', 'C2H6', 'C3H6', 'C3H7OOH', 'C3H8', 'C6H5OOH', 'CCL4', 'CF2CLBR', 'CF3BR',
- 'CFC11', 'CFC113', 'CFC114', 'CFC115', 'CFC12', 'CH2BR2', 'CH2O', 'CH3BR', 'CH3CCL3',
- 'CH3CHO', 'CH3CL', 'CH3CN', 'CH3COCH3', 'CH3COCHO', 'CH3COOH', 'CH3COOOH', 'CH3OH', 'CH3OOH',
- 'CH4', 'CHBR3', 'CL', 'CL2', 'CL2O2', 'CLO', 'CLONO2', 'CLY', 'CO',
- 'CO2', 'COF2', 'COFCL', 'CRESOL', 'DMS', 'EOOH', 'F', 'GLYALD', 'GLYOXAL',
- 'H', 'H2', 'H2402', 'H2O2', 'H2SO4', 'HBR', 'HCFC141B', 'HCFC142B', 'HCFC22',
- 'HCL', 'HCN', 'HCOOH', 'HF', 'HNO3', 'HO2NO2', 'HOBR', 'HOCL', 'HONITR',
- 'HPALD', 'HYAC', 'HYDRALD', 'IEPOX', 'ISOP', 'ISOPNITA', 'ISOPNITB', 'ISOPNO3', 'ISOPNOOH',
- 'ISOPOOH', 'IVOC', 'MACR', 'MACROOH', 'MEK', 'MEKOOH', 'MPAN', 'MTERP', 'MVK',
- 'N', 'N2O', 'N2O5', 'NC4CH2OH', 'NC4CHO', 'NH3', 'NH4', 'NO',
- 'NO2', 'NO3', 'NOA', 'NTERPOOH', 'O', 'OCLO',
- 'OCS', 'ONITR', 'PAN', 'PBZNIT', 'PHENO', 'PHENOL', 'PHENOOH', 'POOH', 'ROOH',
- 'S', 'SF6', 'SO', 'SO2', 'SO3', 'SOAG0', 'SOAG1', 'SOAG2', 'SOAG3',
- 'SOAG4', 'SVOC', 'TEPOMUC', 'TERP2OOH', 'TERPNIT', 'TERPOOH', 'TERPROD1', 'TERPROD2', 'TOLOOH',
- 'TOLUENE', 'XOOH', 'XYLENES', 'XYLENOOH', 'XYLOL', 'XYLOLOOH', 'NHDEP', 'NDEP', 'ACBZO2',
- 'ALKO2', 'BENZO2', 'BZOO', 'C2H5O2', 'C3H7O2', 'C6H5O2', 'CH3CO3', 'CH3O2', 'DICARBO2',
- 'ENEO2', 'EO', 'EO2', 'HO2', 'HOCH2OO', 'ISOPAO2', 'ISOPBO2', 'MACRO2',
- 'MALO2', 'MCO3', 'MDIALO2', 'MEKO2', 'NTERPO2',
- 'O1D', 'OH', 'PHENO2', 'PO2', 'RO2',
- 'TERP2O2', 'TERPO2', 'TOLO2', 'XO2', 'XYLENO2', 'XYLOLO2', 'H2O', 'SAD_ICE', 'SAD_LNAT',
- 'SAD_SULFC', 'SAD_TROP', 'SAD_AERO', 'REFF_AERO', 'PDELDRY', 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'H2SO4M_C',
- 'HNO3_GAS', 'HNO3_STS', 'HNO3_NAT', 'VEL_NAT2', 'NITROP_PD', 'NOX', 'NOY', 'CLOX', 'CLOY',
- 'BROX', 'BROY', 'TCLY', 'TOTH', 'MASS', 'TBRY', 'HCL_GAS', 'wet_deposition_NHx_as_N', 'wet_deposition_NOy_as_N',
- 'HCL_GAS', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'ABSORB', 'AODVISdn', 'AODdnMODE1', 'AODVISstdn', 'AODNIRstdn',
- 'AODUVstdn', 'AODdnMODE2', 'AODdnMODE3', 'AODdnDUST1', 'AODdnDUST2', 'AODdnDUST3', 'AODVISstdn', 'AODUVstdn', 'AODNIRstdn',
- 'AODNIRstdn', 'AODVISdn', 'AODUVdn', 'EXTINCTdn', 'EXTxASYMdn', 'EXTINCTNIRdn', 'EXTINCTUVdn', 'WD_ALKNIT', 'WD_ALKOOH',
- 'WD_BENZOOH', 'WD_BRONO2', 'WD_BZOOH', 'WD_C2H5OH', 'WD_C2H5OOH', 'WD_C3H7OOH', 'WD_C6H5OOH', 'WD_CH2O', 'WD_CH3CHO',
- 'WD_CH3CN', 'WD_CH3COCHO', 'WD_CH3COOH', 'WD_CH3COOOH', 'WD_CH3COCH3', 'WD_CH3OH', 'WD_CH3OOH', 'WD_CLONO2', 'WD_COF2', 'WD_COFCL',
- 'WD_EOOH', 'WD_GLYALD', 'WD_H2O2', 'WD_H2SO4', 'WD_HBR', 'WD_HCL', 'WD_HCN', 'WD_HCOOH', 'WD_HF',
- 'WD_HNO3', 'WD_HO2NO2', 'WD_HOBR', 'WD_HOCL', 'WD_HONITR', 'WD_HPALD', 'WD_HYAC', 'WD_HYDRALD', 'WD_IEPOX',
- 'WD_ISOPNITA', 'WD_ISOPNITB', 'WD_ISOPNO3', 'WD_ISOPNOOH', 'WD_ISOPOOH', 'WD_IVOC', 'WD_MACR', 'WD_MACROOH', 'WD_MEKOOH',
- 'WD_MVK', 'WD_NC4CH2OH', 'WD_NC4CHO', 'WD_NDEP', 'WD_NH3', 'WD_NH4', 'WD_NHDEP', 'WD_NOA',
- 'WD_NTERPOOH', 'WD_ONITR', 'WD_PHENOOH', 'WD_POOH', 'WD_ROOH', 'WD_SO2', 'WD_SOAG0', 'WD_SOAG1', 'WD_SOAG2',
- 'WD_SOAG3', 'WD_SOAG4', 'WD_SVOC', 'WD_TERP2OOH', 'WD_TERPNIT', 'WD_TERPOOH', 'WD_TERPROD1', 'WD_TERPROD2', 'WD_TOLOOH',
- 'WD_XOOH', 'WD_XYLENOOH', 'WD_XYLOLOOH', 'DF_ALKNIT', 'DF_ALKOOH', 'DF_BENZOOH', 'DF_BZOOH', 'DF_C2H5OH', 'DF_C2H5OOH',
- 'DF_C3H7OOH', 'DF_C6H5OOH', 'DF_CH2O', 'DF_CH3CHO', 'DF_CH3CN', 'DF_CH3COCH3', 'DF_CH3COCHO', 'DF_CH3COOH', 'DF_CH3COOOH',
- 'DF_CH3OH', 'DF_CH3OOH', 'DF_CO', 'DF_EOOH', 'DF_GLYALD', 'DF_H2O2', 'DF_H2SO4', 'DF_HCN', 'DF_HCOOH',
- 'DF_HNO3', 'DF_HO2NO2', 'DF_HONITR', 'DF_HPALD', 'DF_HYAC', 'DF_HYDRALD', 'DF_IEPOX', 'DF_ISOPNITA', 'DF_ISOPNITB',
- 'DF_ISOPNO3', 'DF_ISOPNOOH', 'DF_ISOPOOH', 'DF_IVOC', 'DF_MACROOH', 'DF_MEKOOH', 'DF_MPAN', 'DF_NC4CH2OH', 'DF_NC4CHO',
- 'dry_deposition_NHx_as_N', 'DF_NH3', 'DF_NH4', 'DF_NO', 'DF_NO2', 'DF_NOA', 'DF_NTERPOOH', 'DF_O3', 'DF_ONITR',
- 'DF_PAN', 'DF_PHENOOH', 'DF_POOH', 'DF_ROOH', 'DF_SO2', 'DF_SOAG0', 'DF_SOAG1', 'DF_SOAG2', 'DF_SOAG3',
- 'DF_SOAG4', 'DF_SVOC', 'DF_TERP2OOH', 'DF_TERPNIT', 'DF_TERPOOH', 'DF_TERPROD1', 'DF_TERPROD2', 'DF_TOLOOH', 'DF_XOOH',
- 'DF_XYLENOOH', 'DF_XYLOLOOH', 'dry_deposition_NOy_as_N', 'SO2_CLXF', 'SO2_XFRC', 'SVOC_CLXF', 'CO_CLXF', 'NO2_CLXF', 'LNO_PROD',
- 'LNO_COL_PROD', 'SFISOP', 'SFMTERP', 'SFBCARY', 'SFCH3OH', 'SFC2H5OH', 'SFCH3CHO', 'SFMEK', 'SFHCN',
- 'SFCH3CN', 'SFCH2O', 'SFC2H6', 'SFC3H8', 'SFC2H4', 'SFC3H6', 'SFCH3COCH3', 'SFBIGALK', 'SFBIGENE',
- 'SFBENZENE', 'SFTOLUENE', 'SFXYLENES', 'SFCO', 'SFNO', 'SFC2H2', 'SFHCOOH', 'SFCH3COOH', 'SFCH3COCH3',
- 'SFDMS', 'SFMEK', 'SFSO2', 'SFNH3', 'SFIVOC', 'SFSVOC', 'MEG_ISOP', 'MEG_MTERP', 'MEG_BCARY',
- 'MEG_CH3OH', 'MEG_C2H5OH', 'MEG_CH2O', 'MEG_CH3CHO', 'MEG_CH3COOH', 'MEG_CH3COCH3', 'MEG_HCOOH', 'MEG_HCN', 'MEG_CO',
- 'MEG_C2H6', 'MEG_C2H4', 'MEG_C3H8', 'MEG_C3H6', 'MEG_BIGALK', 'MEG_BIGENE', 'MEG_TOLUENE', 'Dso4_a1CHM', 'Dso4_a2CHM',
- 'Dso4_a3CHM', 'DO3CHM', 'DCOCHM', 'DHNO3CHM', 'DH2O2CHM', 'CH4_CHML', 'CO_CHMP', 'CO_CHML', 'CH3CCL3_CHML',
- 'CO2_CHML', 'AQ_SO2', 'GS_SO2', 'SO2_CHML', 'SO2_CHMP', 'SO2_CLXF', 'SOAG0_CHMP', 'SOAG1_CHMP', 'SOAG2_CHMP',
- 'SOAG3_CHMP', 'SOAG4_CHMP', 'IVOC_CHMP', 'SVOC_CHML', 'MASS', 'ABSORB', 'WD_H2SO4', 'WD_IVOC', 'WD_SO2',
- 'WD_SOAG0', 'WD_SOAG1', 'WD_SOAG2', 'WD_SOAG3', 'WD_SOAG4', 'WD_SVOC', 'DF_CO', 'DF_IVOC', 'DF_O3',
- 'DF_SO2', 'DF_SOAG0', 'DF_SOAG1', 'DF_SOAG2', 'DF_SOAG3', 'DF_SOAG4', 'DF_SVOC', 'SO2_CLXF', 'SVOC_CLXF',
- 'SFISOP', 'SFMTERP', 'SFCH3OH', 'SFCH3COCH3', 'SFCO', 'SFIVOC', 'SFSVOC', 'DO3CHM', 'DCOCHM',
- 'O3_CHMP', 'O3_CHML', 'CH4_CHML', 'CO_CHMP', 'CO_CHML', 'CH3CCL3_CHML', 'SO2_CHML', 'SO2_CHMP', 'SO2_CLXF',
- 'SOAG0_CHMP', 'SOAG1_CHMP', 'SOAG2_CHMP', 'SOAG3_CHMP', 'SOAG4_CHMP',
- 'r_HO2_O3', 'r_OH_O3', 'r_OH_O', 'r_O1D_H2O', 'r_het1', 'r_het2', 'r_het3', 'r_het4', 'r_het5', 'r_het6',
- 'jo3_a', 'jno2', 'jpan', 'jh2o2', 'jcl2o2', 'bc_a1', 'bc_a4', 'dst_a1', 'dst_a2',
- 'dst_a3', 'ncl_a1', 'ncl_a1', 'ncl_a2', 'ncl_a3', 'pom_a1', 'pom_a4', 'so4_a1', 'so4_a2',
- 'so4_a3', 'soa1_a1', 'soa2_a1', 'soa3_a1', 'soa4_a1', 'soa5_a1', 'soa1_a2', 'soa2_a2', 'soa3_a2',
- 'soa4_a2', 'soa5_a2', 'bc_c1', 'bc_c4', 'dst_c1', 'dst_c2', 'dst_c3', 'ncl_c1', 'ncl_c1',
- 'ncl_c2', 'ncl_c3', 'pom_c1', 'pom_c4', 'so4_c1', 'so4_c2', 'so4_c3', 'soa1_c1', 'soa2_c1',
- 'soa3_c1', 'soa4_c1', 'soa5_c1', 'soa1_c2', 'soa2_c2', 'soa3_c2', 'soa4_c2', 'soa5_c2',
- 'num_a1','num_a2','num_a3','num_a4','num_c1','num_c2','num_c3','num_c4',
- 'bc_a1SFWET', 'bc_a4SFWET', 'dst_a1SFWET', 'dst_a2SFWET', 'dst_a3SFWET', 'ncl_a1SFWET', 'ncl_a2SFWET', 'ncl_a3SFWET', 'pom_a1SFWET', 'pom_a4SFWET',
- 'so4_a1SFWET', 'so4_a2SFWET', 'so4_a3SFWET', 'soa1_a1SFWET', 'soa1_a2SFWET', 'soa2_a1SFWET', 'soa2_a2SFWET', 'soa3_a1SFWET', 'soa3_a2SFWET',
- 'soa4_a1SFWET', 'soa4_a2SFWET', 'soa5_a1SFWET', 'soa5_a2SFWET', 'bc_c1SFWET', 'bc_c4SFWET', 'dst_c1SFWET', 'dst_c2SFWET', 'dst_c3SFWET',
- 'ncl_c1SFWET', 'ncl_c2SFWET', 'ncl_c3SFWET', 'pom_c1SFWET', 'pom_c4SFWET', 'so4_c1SFWET', 'so4_c2SFWET', 'so4_c3SFWET', 'soa1_c1SFWET',
- 'soa1_c2SFWET', 'soa2_c1SFWET', 'soa2_c2SFWET', 'soa3_c1SFWET', 'soa3_c2SFWET', 'soa4_c1SFWET', 'soa4_c2SFWET', 'soa5_c1SFWET', 'soa5_c2SFWET',
- 'bc_a1DDF', 'bc_a4DDF', 'dst_a1DDF', 'dst_a2DDF', 'dst_a3DDF', 'ncl_a1DDF', 'ncl_a2DDF', 'ncl_a3DDF', 'pom_a1DDF',
- 'pom_a4DDF', 'so4_a1DDF', 'so4_a2DDF', 'so4_a3DDF', 'soa1_a1DDF', 'soa1_a2DDF', 'soa2_a1DDF', 'soa2_a2DDF', 'soa3_a1DDF',
- 'soa3_a2DDF', 'soa4_a1DDF', 'soa4_a2DDF', 'soa5_a1DDF', 'soa5_a2DDF', 'bc_c1DDF', 'bc_c4DDF', 'dst_c1DDF', 'dst_c2DDF',
- 'dst_c3DDF', 'ncl_c1DDF', 'ncl_c2DDF', 'ncl_c3DDF', 'pom_c1DDF', 'pom_c4DDF', 'so4_c1DDF', 'so4_c2DDF', 'so4_c3DDF',
- 'soa1_c1DDF', 'soa1_c2DDF', 'soa2_c1DDF', 'soa2_c2DDF', 'soa3_c1DDF', 'soa3_c2DDF', 'soa4_c1DDF', 'soa4_c2DDF', 'soa5_c1DDF',
- 'soa5_c2DDF', 'num_a1DDF', 'num_a2DDF', 'num_a3DDF', 'num_a4DDF', 'num_c1DDF', 'num_c2DDF', 'num_c3DDF', 'num_c4DDF',
- 'bc_a4_CLXF', 'pom_a4_CLXF', 'so4_a1_CLXF', 'so4_a2_CLXF', 'num_a1_CLXF', 'num_a2_CLXF', 'SFbc_a4', 'SFpom_a4', 'SFso4_a1',
- 'SFso4_a2', 'SFnum_a1', 'SFnum_a2', 'SFnum_a3', 'so4_a1_sfgaex1', 'so4_a2_sfgaex1', 'so4_a3_sfgaex1', 'soa1_a1_sfgaex1', 'soa1_a2_sfgaex1',
- 'soa2_a1_sfgaex1', 'soa2_a2_sfgaex1', 'soa3_a1_sfgaex1', 'soa3_a2_sfgaex1', 'soa4_a1_sfgaex1', 'soa4_a2_sfgaex1', 'soa5_a1_sfgaex1', 'soa5_a2_sfgaex1', 'so4_a2_sfnnuc1',
- 'so4_c1AQH2SO4', 'so4_c2AQH2SO4', 'so4_c3AQH2SO4', 'so4_c1AQSO4', 'so4_c2AQSO4', 'so4_c3AQSO4', 'SFdst_a1', 'SFdst_a2', 'SFdst_a3',
- 'SFncl_a1', 'SFncl_a2', 'SFncl_a3', 'soa1_a1_CHML', 'soa2_a1_CHML', 'soa3_a1_CHML', 'soa4_a1_CHML', 'soa5_a1_CHML', 'soa1_a2_CHML',
- 'soa2_a2_CHML', 'soa3_a2_CHML', 'soa4_a2_CHML', 'soa5_a2_CHML', 'so4_a1_CHMP', 'so4_a2_CHMP', 'so4_a3_CHMP', 'soa1_a1_CHMP', 'soa2_a1_CHMP',
- 'soa3_a1_CHMP', 'soa4_a1_CHMP', 'soa5_a1_CHMP', 'soa1_a2_CHMP', 'soa2_a2_CHMP', 'soa3_a2_CHMP', 'soa4_a2_CHMP', 'soa5_a2_CHMP', 'r_jsoa1_a1',
- 'r_jsoa2_a1', 'r_jsoa3_a1', 'r_jsoa4_a1', 'r_jsoa5_a1', 'r_jsoa1_a2', 'r_jsoa2_a2', 'r_jsoa3_a2', 'r_jsoa4_a2', 'r_jsoa5_a2',
- 'r_GLYOXAL_aer', 'H2SO4_sfnnuc1', 'num_a2_sfnnuc1', 'TMOCS', 'TMSO2', 'TMDMS', 'TMso4_a1', 'TMso4_a2', 'TMso4_a3',
- 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSO4dn', 'BURDENSOAdn', 'BURDENSEASALTdn','BURDENBCdn', 'PM25',
- 'O3_Prod','O3_Loss','O3S_Loss','RO2_NO_sum','O3_alkenes','RO2_NO3_sum','RO2_HO2_sum','RO2_RO2_sum','RCO2_NO2_sum',
- 'OddOx_Ox_Loss','OddOx_HOx_Loss','OddOx_NOx_Loss','OddOx_CLOxBROx_Loss','OddOx_Loss_Tot','OddOx_Prod_Tot',
- 'Ox_Prod','Ox_Loss'
+
+ 'ACTREL', 'AQ_SO2', 'AREA', 'BROX', 'BROY', 'BRY', 'CLOX', 'CLOY', 'CLY', 'NOX', 'NOY', 'TBRY', 'TCLY', 'CFC11STAR',
+ 'BTTGWSPEC', 'BTTGWSDF', 'BTTGWSKE', 'CONCLD', 'CME', 'CMFDQ', 'CMFMC', 'CMFMC_DP',
+ 'CH3CCL3_CHML', 'CH4_CHML', 'CO2_CHML', 'CO_CHML', 'IVOC_CHML', 'N2O_CHML', 'O3_CHML', 'SO2_CHML',
+ 'CO_CHMP', 'O3_CHMP', 'SO2_CHMP', 'TMDMS', 'TMOCS', 'TMSO2','TMso4_a1', 'TMso4_a2', 'TMso4_a3',
+ 'soa1_a1_CHML', 'soa1_a2_CHML', 'soa2_a1_CHML', 'soa2_a2_CHML', 'soa3_a1_CHML', 'soa3_a2_CHML',
+ 'soa4_a1_CHML', 'soa4_a2_CHML', 'soa5_a1_CHML', 'soa5_a2_CHML', 'SVOC_CHML',
+ 'so4_a1_CHMP','so4_a2_CHMP', 'SOAG0_CHMP', 'SOAG1_CHMP', 'SOAG2_CHMP', 'SOAG3_CHMP', 'SOAG4_CHMP', 'TOTH', 'TOT_CLD_VISTAU',
+ 'TREFHTMN', 'TREFHTMX', 'TROP_P', 'TROP_T', 'TROP_Z', 'TTEND_TOT', 'TTGWORO', 'TTGWSDF', 'TTGWSDFORO', 'TTGWSKE', 'TTGWSKEORO',
+ 'BURDENBCdn', 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSEASALTdn', 'BURDENSO4dn', 'BURDENSOAdn',
+ 'ABSORB', 'AODABSdn', 'AODBCdn', 'AODdnDUST01', 'AODdnDUST02', 'AODdnDUST03', 'AODdn_aitken', 'AODdn_accum', 'AODdn_coarse',
+ 'AODDUST02', 'AODDUST', 'AODNIRstdn', 'AODPOMdn', 'AODSO4dn', 'AODSOAdn', 'AODSSdn', 'AODUVdn', 'AODUVstdn', 'AODVIS',
+ 'AODVISdn', 'AODVISstdn', 'EXTINCTdn', 'EXTINCTNIRdn', 'EXTINCTUVdn', 'EXTxASYMdn', 'FLDSC', 'FLNR', 'FSNR',
+ 'CME', 'CMFDQ', 'CMFMC','CMFMC_DP', 'SOLLD', 'SOLSD', 'SSAVIS', 'SST','TAQ',
+ 'DCOCHM','DH2O2CHM', 'DHNO3CHM', 'DO3CHM', 'Dso4_a1CHM', 'Dso4_a2CHM', 'Dso4_a3CHM',
+ 'FLASHFRQ', 'LNO_COL_PROD', 'LNO_PROD','KVH_CLUBB','MASS', 'PDELDRY', 'NITROP_PD','PM25', 'PRECT', 'PTEQ', 'PTTEND',
+ 'QRLC', 'QRSC', 'QSNOW', 'QRAIN','GS_SO2', 'HNO3_GAS', 'HNO3_NAT', 'HNO3_STS','H2SO4M_C', 'H2SO4_sfnnuc1','HCL_GAS',
+ 'SAD_AERO', 'SAD_ICE', 'SAD_LNAT', 'SAD_SULFC', 'SAD_TROP' 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'REFF_AERO', 'RHREFHT',
+ 'EVAPPREC', 'EVAPQZM', 'EVAPTZM', 'FCTL','FREQZM', 'ZMDQ', 'ZMDT', 'ZMMTT', 'ZMMU','VEL_NAT2',
+ 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'bc_c1DDF', 'bc_c4DDF', 'dst_c1DDF', 'dst_c2DDF', 'dst_c3DDF',
+ 'ncl_c1DDF', 'ncl_c2DDF', 'ncl_c3DDF', 'pom_c1DDF', 'pom_c4DDF', 'num_c1DDF','num_c2DDF','num_c3DDF','num_c4DDF',
+ 'so4_a1_sfgaex1', 'so4_c1AQH2SO4', 'so4_c1AQSO4', 'so4_c1DDF', 'so4_a2_sfgaex1', 'so4_c2AQH2SO4', 'so4_c2AQSO4', 'so4_c2DDF',
+ 'so4_a3_sfgaex1', 'so4_c3AQH2SO4', 'so4_c3AQSO4', 'so4_c3DDF', 'so4_a2_sfnnuc1', 'num_a2_sfnnuc1',
+ 'soa1_a1_sfgaex1','soa1_c1DDF', 'soa1_a2_sfgaex1','soa1_c2DDF', 'soa2_a1_sfgaex1','soa2_c1DDF', 'soa2_a2_sfgaex1','soa2_c2DDF',
+ 'soa3_a1_sfgaex1','soa3_c1DDF', 'soa3_a2_sfgaex1','soa3_c2DDF', 'soa4_a1_sfgaex1','soa4_c1DDF', 'soa4_a2_sfgaex1','soa4_c2DDF',
+ 'soa5_a1_sfgaex1','soa5_c1DDF', 'soa5_a2_sfgaex1','soa5_c2DDF', 'jcl2o2', 'jh2o2', 'jno2', 'jo2_a', 'jo2_b', 'jo3_a', 'jo3_b', 'jpan',
+ 'r_het1', 'r_het2', 'r_het3', 'r_het4', 'r_het5', 'r_het6', 'r_het7', 'r_het8', 'r_het9', 'r_het10', 'r_het11', 'r_het12', 'r_het13',
+ 'r_het15', 'r_het16', 'r_het17', 'r_jsoa1_a1', 'r_jsoa1_a2', 'r_jsoa2_a1', 'r_jsoa2_a2', 'r_jsoa3_a1', 'r_jsoa3_a2', 'r_jsoa4_a1',
+ 'r_jsoa4_a2', 'r_jsoa5_a1', 'r_jsoa5_a2', 'r_GLYOXAL_aer', 'r_HO2_O3', 'r_N2O5_aer', 'r_NO2_aer', 'r_NO3_aer', 'r_O1D_H2O', 'r_OH_O3', 'r_OH_O',
+ 'O3_Prod','O3_Loss','O3S_Loss','RO2_NO_sum','O3_alkenes','RO2_NO3_sum','RO2_HO2_sum','RO2_RO2_sum','RCO2_NO2_sum',
+ 'OddOx_Ox_Loss','OddOx_HOx_Loss','OddOx_NOx_Loss','OddOx_CLOxBROx_Loss','OddOx_Loss_Tot','OddOx_Prod_Tot', 'Ox_Prod','Ox_Loss'
-
- 'CFC11STAR', 'AODDUST', 'AODDUST2', 'T', 'U', 'V', 'O3', 'OH',
- 'NO3', 'HO2', 'LNO_COL_PROD', 'NO2_CLXF', 'SFNO', 'SFNH3', 'BRO', 'CH3CL',
- 'CLO', 'CO2', 'HCL', 'HO2', 'HOCL', 'H2O', 'PHIS', 'Z3',
- 'BENZENE', 'C2H2', 'C2H4', 'C2H6', 'C3H8', 'CCL4', 'CFC11', 'CFC113',
- 'CFC12', 'CH2O', 'CH3BR', 'CH3CCL3', 'CH3CHO', 'CH3CL', 'CH3CN', 'CH3COCH3',
- 'CH3OH', 'CH4', 'CO', 'H2O2', 'HCFC22', 'HCN', 'HNO3', 'ISOP',
- 'N2O', 'O3', 'PAN', 'SO2', 'TOLUENE', 'OH', 'ALKNIT',
- 'ALKOOH', 'BCARY', 'BENZENE', 'BENZOOH', 'BEPOMUC', 'BIGALD1', 'BIGALD2',
- 'BIGALD3', 'BIGALD4', 'BIGALK', 'BIGENE', 'BR', 'BRCL', 'BRO', 'BRONO2',
- 'BRY', 'BZALD', 'BZOOH', 'C2H2', 'C2H4', 'C2H5OH', 'C2H5OOH', 'C2H6',
- 'C3H6', 'C3H7OOH', 'C3H8', 'C6H5OOH', 'CCL4', 'CF2CLBR', 'CF3BR', 'CFC11',
- 'CFC113', 'CFC114', 'CFC115', 'CFC12', 'CH2BR2', 'CH2O', 'CH3BR', 'CH3CCL3',
- 'CH3CHO', 'CH3CL', 'CH3CN', 'CH3COCH3', 'CH3COCHO', 'CH3COOH', 'CH3COOOH', 'CH3OH',
- 'CH3OOH', 'CH4', 'CHBR3', 'CL', 'CL2', 'CL2O2', 'CLO', 'CLONO2',
- 'CLY', 'CO', 'CO2', 'COF2', 'COFCL', 'CRESOL', 'DMS', 'EOOH',
- 'F', 'GLYALD', 'GLYOXAL', 'H', 'H2', 'H2402', 'H2O2', 'H2SO4',
- 'HBR', 'HCFC141B', 'HCFC142B', 'HCFC22', 'HCL', 'HCN', 'HCOOH', 'HF',
- 'HNO3', 'HO2NO2', 'HOBR', 'HOCL', 'HONITR', 'HYAC', 'HYDRALD',
- 'IEPOX', 'ISOP', 'ISOPNO3', 'ISOPOOH', 'IVOC',
- 'MACR', 'MACROOH', 'MEK', 'MEKOOH', 'MPAN', 'MVK', 'N',
- 'N2O', 'N2O5', 'NC4CHO', 'NH3', 'NH4', 'NO', 'NO2',
- 'NO3', 'NOA', 'O', 'OCLO', 'OCS', 'ONITR', 'PAN',
- 'PBZNIT', 'PHENO', 'PHENOL', 'PHENOOH', 'POOH', 'ROOH', 'S', 'SF6',
- 'SO', 'SO2', 'SO3', 'SOAG0', 'SOAG1', 'SOAG2', 'SOAG3', 'SOAG4',
- 'SVOC', 'TEPOMUC', 'TERP2AOOH', 'TERPOOH', 'TOLOOH',
- 'TOLUENE', 'XYLENES', 'XYLENOOH', 'XYLOL', 'XYLOLOOH', 'NHDEP', 'NDEP',
- 'ACBZO2', 'ALKO2', 'BENZO2', 'BZOO', 'C2H5O2', 'C3H7O2', 'C6H5O2', 'CH3CO3',
- 'CH3O2', 'DICARBO2', 'ENEO2', 'EO', 'EO2', 'HO2', 'HOCH2OO',
- 'MACRO2', 'MALO2', 'MCO3', 'MDIALO2', 'MEKO2', 'O1D',
- 'OH', 'PHENO2', 'PO2', 'RO2', 'TOLO2',
- 'XYLENO2', 'XYLOLO2', 'H2O', 'SAD_ICE', 'SAD_LNAT', 'SAD_SULFC', 'SAD_TROP', 'SAD_AERO',
- 'REFF_AERO', 'PDELDRY', 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'H2SO4M_C', 'HNO3_GAS', 'HNO3_STS',
- 'HNO3_NAT', 'VEL_NAT2', 'NITROP_PD', 'NOX', 'NOY', 'CLOX', 'CLOY', 'BROX',
- 'BROY', 'TCLY', 'TOTH', 'MASS', 'TBRY', 'HCL_GAS', 'wet_deposition_NHx_as_N', 'wet_deposition_NOy_as_N',
- 'HCL_GAS', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'ABSORB', 'AODVISdn', 'AODdnMODE1', 'AODVISstdn',
- 'AODNIRstdn', 'AODUVstdn', 'AODdnMODE2', 'AODdnMODE3', 'AODdnDUST1', 'AODdnDUST2', 'AODdnDUST3', 'AODVISstdn',
- 'AODUVstdn', 'AODNIRstdn', 'AODNIRstdn', 'AODVISdn', 'AODUVdn', 'EXTINCTdn', 'EXTxASYMdn', 'EXTINCTNIRdn',
- 'EXTINCTUVdn', 'WD_ALKNIT', 'WD_ALKOOH', 'WD_BENZOOH', 'WD_BRONO2', 'WD_BZOOH', 'WD_C2H5OH', 'WD_C2H5OOH',
- 'WD_C3H7OOH', 'WD_C6H5OOH', 'WD_CH2O', 'WD_CH3CHO', 'WD_CH3CN', 'WD_CH3COCHO', 'WD_CH3COOH', 'WD_CH3COOOH',
- 'WD_CH3COCH3', 'WD_CH3OH', 'WD_CH3OOH', 'WD_CLONO2', 'WD_COF2', 'WD_COFCL', 'WD_EOOH', 'WD_GLYALD',
- 'WD_H2O2', 'WD_H2SO4', 'WD_HBR', 'WD_HCL', 'WD_HCN', 'WD_HCOOH', 'WD_HF', 'WD_HNO3',
- 'WD_HO2NO2', 'WD_HOBR', 'WD_HOCL', 'WD_HONITR', 'WD_HYAC', 'WD_HYDRALD', 'WD_IEPOX',
- 'WD_ISOPOOH', 'WD_IVOC', 'WD_MACR', 'WD_MACROOH',
- 'WD_MEKOOH', 'WD_MVK', 'WD_NC4CHO', 'WD_NDEP', 'WD_NH3', 'WD_NH4', 'WD_NHDEP',
- 'WD_NOA', 'WD_ONITR', 'WD_PHENOOH', 'WD_POOH', 'WD_ROOH', 'WD_SO2', 'WD_SOAG0',
- 'WD_SOAG1', 'WD_SOAG2', 'WD_SOAG3', 'WD_SOAG4', 'WD_SVOC', 'WD_TERP2AOOH', 'WD_TERPOOH',
- 'WD_TOLOOH', 'WD_XYLENOOH', 'WD_XYLOLOOH', 'DF_ALKNIT', 'DF_ALKOOH',
- 'DF_BENZOOH', 'DF_BZOOH', 'DF_C2H5OH', 'DF_C2H5OOH', 'DF_C3H7OOH', 'DF_C6H5OOH', 'DF_CH2O', 'DF_CH3CHO',
- 'DF_CH3CN', 'DF_CH3COCH3', 'DF_CH3COCHO', 'DF_CH3COOH', 'DF_CH3COOOH', 'DF_CH3OH', 'DF_CH3OOH', 'DF_CO',
- 'DF_EOOH', 'DF_GLYALD', 'DF_H2O2', 'DF_H2SO4', 'DF_HCN', 'DF_HCOOH', 'DF_HNO3', 'DF_HO2NO2',
- 'DF_HONITR', 'DF_HYAC', 'DF_HYDRALD', 'DF_IEPOX',
- 'DF_ISOPOOH', 'DF_IVOC', 'DF_MACROOH', 'DF_MEKOOH', 'DF_MPAN', 'DF_NC4CHO',
- 'dry_deposition_NHx_as_N', 'DF_NH3', 'DF_NH4', 'DF_NO', 'DF_NO2', 'DF_NOA', 'DF_O3',
- 'DF_ONITR', 'DF_PAN', 'DF_PHENOOH', 'DF_POOH', 'DF_ROOH', 'DF_SO2', 'DF_SOAG0', 'DF_SOAG1',
- 'DF_SOAG2', 'DF_SOAG3', 'DF_SOAG4', 'DF_SVOC', 'DF_TERP2AOOH', 'DF_TERPOOH',
- 'DF_TOLOOH', 'DF_XYLENOOH', 'DF_XYLOLOOH', 'dry_deposition_NOy_as_N', 'SO2_CLXF', 'SO2_XFRC',
- 'SVOC_CLXF', 'CO_CLXF', 'NO2_CLXF', 'LNO_PROD', 'LNO_COL_PROD', 'SFISOP', 'SFBCARY',
- 'SFCH3OH', 'SFC2H5OH', 'SFCH3CHO', 'SFMEK', 'SFHCN', 'SFCH3CN', 'SFCH2O', 'SFC2H6',
- 'SFC3H8', 'SFC2H4', 'SFC3H6', 'SFCH3COCH3', 'SFBIGALK', 'SFBIGENE', 'SFBENZENE', 'SFTOLUENE',
- 'SFXYLENES', 'SFCO', 'SFNO', 'SFC2H2', 'SFHCOOH', 'SFCH3COOH', 'SFCH3COCH3', 'SFDMS',
- 'SFMEK', 'SFSO2', 'SFNH3', 'SFIVOC', 'SFSVOC', 'MEG_ISOP', 'MEG_BCARY',
- 'MEG_CH3OH', 'MEG_C2H5OH', 'MEG_CH2O', 'MEG_CH3CHO', 'MEG_CH3COOH', 'MEG_CH3COCH3', 'MEG_HCOOH', 'MEG_HCN',
- 'MEG_CO', 'MEG_C2H6', 'MEG_C2H4', 'MEG_C3H8', 'MEG_C3H6', 'MEG_BIGALK', 'MEG_BIGENE', 'MEG_TOLUENE',
- 'Dso4_a1CHM', 'Dso4_a2CHM', 'Dso4_a3CHM', 'DO3CHM', 'DCOCHM', 'DHNO3CHM', 'DH2O2CHM', 'CH4_CHML',
- 'CO_CHMP', 'CO_CHML', 'CH3CCL3_CHML', 'CO2_CHML', 'AQ_SO2', 'GS_SO2', 'SO2_CHML', 'SO2_CHMP',
- 'SO2_CLXF', 'SOAG0_CHMP', 'SOAG1_CHMP', 'SOAG2_CHMP', 'SOAG3_CHMP', 'SOAG4_CHMP', 'IVOC_CHMP', 'SVOC_CHML',
- 'MASS', 'ABSORB', 'WD_H2SO4', 'WD_IVOC', 'WD_SO2', 'WD_SOAG0', 'WD_SOAG1', 'WD_SOAG2',
- 'WD_SOAG3', 'WD_SOAG4', 'WD_SVOC', 'DF_CO', 'DF_IVOC', 'DF_O3', 'DF_SO2', 'DF_SOAG0',
- 'DF_SOAG1', 'DF_SOAG2', 'DF_SOAG3', 'DF_SOAG4', 'DF_SVOC', 'SO2_CLXF', 'SVOC_CLXF', 'SFISOP',
- 'SFCH3OH', 'SFCH3COCH3', 'SFCO', 'SFIVOC', 'SFSVOC', 'DO3CHM', 'DCOCHM',
- 'O3_CHMP', 'O3_CHML', 'CH4_CHML', 'CO_CHMP', 'CO_CHML', 'CH3CCL3_CHML', 'SO2_CHML', 'SO2_CHMP',
- 'SO2_CLXF', 'SOAG0_CHMP', 'SOAG1_CHMP', 'SOAG2_CHMP', 'SOAG3_CHMP', 'SOAG4_CHMP', 'O3_Prod', 'O3_Loss',
- 'OddOx_Ox_Loss', 'OddOx_HOx_Loss', 'OddOx_NOx_Loss', 'OddOx_CLOxBROx_Loss', 'OddOx_Loss_Tot', 'OddOx_Prod_Tot', 'O3_Prod', 'O3_Loss',
- 'r_HO2_O3', 'r_OH_O3', 'r_OH_O', 'r_O1D_H2O', 'r_het1', 'r_het2', 'r_het3', 'r_het4',
- 'r_het5', 'r_het6', 'jo3_a', 'jno2', 'jpan', 'jh2o2', 'jcl2o2', 'bc_a1',
- 'bc_a4', 'dst_a1', 'dst_a2', 'dst_a3', 'ncl_a1', 'ncl_a1', 'ncl_a2', 'ncl_a3',
- 'pom_a1', 'pom_a4', 'so4_a1', 'so4_a2', 'so4_a3', 'soa1_a1', 'soa2_a1', 'soa3_a1',
- 'soa4_a1', 'soa5_a1', 'soa1_a2', 'soa2_a2', 'soa3_a2', 'soa4_a2', 'soa5_a2', 'bc_c1',
- 'bc_c4', 'dst_c1', 'dst_c2', 'dst_c3', 'ncl_c1', 'ncl_c1', 'ncl_c2', 'ncl_c3',
- 'pom_c1', 'pom_c4', 'so4_c1', 'so4_c2', 'so4_c3', 'soa1_c1', 'soa2_c1', 'soa3_c1',
- 'soa4_c1', 'soa5_c1', 'soa1_c2', 'soa2_c2', 'soa3_c2', 'soa4_c2', 'soa5_c2', 'bc_a1SFWET',
- 'num_a1', 'num_a2', 'num_a3', 'num_a4', 'num_c1', 'num_c2', 'num_c3', 'num_c4',
- 'bc_a1SFWET', 'bc_a4SFWET', 'dst_a1SFWET', 'dst_a2SFWET', 'dst_a3SFWET', 'ncl_a1SFWET', 'ncl_a2SFWET', 'ncl_a3SFWET',
- 'pom_a1SFWET', 'pom_a4SFWET', 'so4_a1SFWET', 'so4_a2SFWET', 'so4_a3SFWET', 'soa1_a1SFWET', 'soa1_a2SFWET', 'soa2_a1SFWET',
- 'soa2_a2SFWET', 'soa3_a1SFWET', 'soa3_a2SFWET', 'soa4_a1SFWET', 'soa4_a2SFWET', 'soa5_a1SFWET', 'soa5_a2SFWET', 'bc_c1SFWET',
- 'bc_c4SFWET', 'dst_c1SFWET', 'dst_c2SFWET', 'dst_c3SFWET', 'ncl_c1SFWET', 'ncl_c2SFWET', 'ncl_c3SFWET', 'pom_c1SFWET',
- 'pom_c4SFWET', 'so4_c1SFWET', 'so4_c2SFWET', 'so4_c3SFWET', 'soa1_c1SFWET', 'soa1_c2SFWET', 'soa2_c1SFWET', 'soa2_c2SFWET',
- 'soa3_c1SFWET', 'soa3_c2SFWET', 'soa4_c1SFWET', 'soa4_c2SFWET', 'soa5_c1SFWET', 'soa5_c2SFWET', 'bc_a1DDF', 'bc_a4DDF',
- 'dst_a1DDF', 'dst_a2DDF', 'dst_a3DDF', 'ncl_a1DDF', 'ncl_a2DDF', 'ncl_a3DDF', 'pom_a1DDF', 'pom_a4DDF',
- 'so4_a1DDF', 'so4_a2DDF', 'so4_a3DDF', 'soa1_a1DDF', 'soa1_a2DDF', 'soa2_a1DDF', 'soa2_a2DDF', 'soa3_a1DDF',
- 'soa3_a2DDF', 'soa4_a1DDF', 'soa4_a2DDF', 'soa5_a1DDF', 'soa5_a2DDF', 'bc_c1DDF', 'bc_c4DDF', 'dst_c1DDF',
- 'dst_c2DDF', 'dst_c3DDF', 'ncl_c1DDF', 'ncl_c2DDF', 'ncl_c3DDF', 'pom_c1DDF', 'pom_c4DDF', 'so4_c1DDF',
- 'so4_c2DDF', 'so4_c3DDF', 'soa1_c1DDF', 'soa1_c2DDF', 'soa2_c1DDF', 'soa2_c2DDF', 'soa3_c1DDF', 'soa3_c2DDF',
- 'soa4_c1DDF', 'soa4_c2DDF', 'soa5_c1DDF', 'soa5_c2DDF', 'num_a1DDF', 'num_a2DDF', 'num_a3DDF', 'num_a4DDF',
- 'num_c1DDF', 'num_c2DDF', 'num_c3DDF', 'num_c4DDF', 'bc_a4_CLXF', 'pom_a4_CLXF', 'so4_a1_CLXF', 'so4_a2_CLXF',
- 'num_a1_CLXF', 'num_a2_CLXF', 'SFbc_a4', 'SFpom_a4', 'SFso4_a1', 'SFso4_a2', 'SFnum_a1', 'SFnum_a2',
- 'SFnum_a3', 'so4_a1_sfgaex1', 'so4_a2_sfgaex1', 'so4_a3_sfgaex1', 'soa1_a1_sfgaex1', 'soa1_a2_sfgaex1', 'soa2_a1_sfgaex1', 'soa2_a2_sfgaex1',
- 'soa3_a1_sfgaex1', 'soa3_a2_sfgaex1', 'soa4_a1_sfgaex1', 'soa4_a2_sfgaex1', 'soa5_a1_sfgaex1', 'soa5_a2_sfgaex1', 'so4_a2_sfnnuc1', 'so4_c1AQH2SO4',
- 'so4_c2AQH2SO4', 'so4_c3AQH2SO4', 'so4_c1AQSO4', 'so4_c2AQSO4', 'so4_c3AQSO4', 'SFdst_a1', 'SFdst_a2', 'SFdst_a3',
- 'SFncl_a1', 'SFncl_a2', 'SFncl_a3', 'soa1_a1_CHML', 'soa2_a1_CHML', 'soa3_a1_CHML', 'soa4_a1_CHML', 'soa5_a1_CHML',
- 'soa1_a2_CHML', 'soa2_a2_CHML', 'soa3_a2_CHML', 'soa4_a2_CHML', 'soa5_a2_CHML', 'so4_a1_CHMP', 'so4_a2_CHMP', 'so4_a3_CHMP',
- 'r_jsoa1_a1', 'r_jsoa2_a1', 'r_jsoa3_a1', 'r_jsoa4_a1', 'r_jsoa5_a1', 'r_jsoa1_a2', 'r_jsoa2_a2', 'r_jsoa3_a2',
- 'r_jsoa4_a2', 'r_jsoa5_a2', 'r_GLYOXAL_aer', 'H2SO4_sfnnuc1', 'num_a2_sfnnuc1', 'TMOCS', 'TMSO2', 'TMDMS',
- 'TMso4_a1', 'TMso4_a2', 'TMso4_a3', 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSO4dn', 'BURDENSOAdn', 'BURDENSEASALTdn',
- 'BURDENBCdn', 'PM25',
- 'MEG_XYLENES','MEG_BZALD','MEG_MEK',
- 'DF_BCARY', 'DF_BENZENE', 'DF_BEPOMUC', 'DF_BIGALD1', 'DF_BIGALD2', 'DF_BIGALD3',
- 'DF_BIGALD4', 'DF_BIGALK', 'DF_BIGENE', 'DF_BZALD', 'DF_C2H2', 'DF_C2H4', 'DF_C2H6', 'DF_C3H6',
- 'DF_C3H8', 'DF_CRESOL', 'DF_DMS', 'DF_GLYOXAL', 'DF_ISOP', 'DF_MACR', 'DF_MEK',
- 'DF_MVK', 'DF_N2O5', 'DF_PBZNIT', 'DF_PHENOL', 'DF_TEPOMUC', 'DF_TOLUENE', 'DF_XYLENES', 'DF_XYLOL',
- 'WD_BCARY', 'WD_BENZENE', 'WD_BEPOMUC', 'WD_BIGALD1', 'WD_BIGALD2', 'WD_BIGALD3', 'WD_BIGALD4',
- 'WD_BIGALK', 'WD_BIGENE', 'WD_BZALD',
- 'WD_C2H2', 'WD_C2H4', 'WD_C2H6', 'WD_C3H6', 'WD_C3H8', 'WD_CO', 'WD_CRESOL', 'WD_DMS', 'WD_GLYOXAL', 'WD_ISOP',
- 'WD_MEK', 'WD_MPAN',
- 'WD_N2O5', 'WD_NO', 'WD_NO2', 'WD_PAN', 'WD_PBZNIT', 'WD_PHENOL', 'WD_TEPOMUC','WD_TOLUENE', 'WD_XYLENES', 'WD_XYLOL'
-
-
+
'PMID', 'PDELDRY','PS','PHIS:I','Z3','T','U','V','Q','TROP_P', 'CLOUD',
'CO','O3','O3S','NO2','NO','OH','ISOP','SO2', 'PAN', 'HNO3', 'C2H6', 'C3H8', 'CH2O', 'CH3COCH3',
'SFISOP','SFCO','SFNO','SFNO2',
'PM25_SRF', 'so4_a1','so4_a2','so4_a3','dst_a1','dst_a2','dst_a3','soa_a1','soa_a2',
'ncl_a1','ncl_a2','ncl_a3','bc_a1', 'bc_a4','pom_a1','pom_a4', 'AODVISdn',
-
+
'soa_a1 = soa1_a1 + soa2_a1 + soa3_a1 + soa4_a1 + soa5_a1',
'soa_a2 = soa1_a2 + soa2_a2 + soa3_a2 + soa4_a2 + soa5_a2'
-
+
'MEG_APIN','MEG_BPIN','MEG_LIMON','MEG_MYRC',
'ISOPFDN', 'ISOPFNP', 'ISOPN3B', 'ISOPN2B', 'ISOPN1D', 'ISOPN4D',
'ISOPNBNO3', 'ISOPNOOHB', 'ISOPNOOHD', 'INHEB','INHED',
diff --git a/bld/namelist_files/use_cases/hist_trop_strat_vbs_cam6.xml b/bld/namelist_files/use_cases/hist_trop_strat_vbs_cam6.xml
index 98309c552e..f9ea8eb9eb 100644
--- a/bld/namelist_files/use_cases/hist_trop_strat_vbs_cam6.xml
+++ b/bld/namelist_files/use_cases/hist_trop_strat_vbs_cam6.xml
@@ -16,17 +16,114 @@
0.25D0
SERIAL
-atm/waccm/lb/LBC_1750-2014_CMIP6_0p5degLat_c170126.nc
+atm/waccm/lb/LBC_17500116-25001216_CMIP6_SSP585_0p5degLat_c20200824.nc
- SERIAL
+SERIAL
+2.70D0
+ 0.38D0
+ 'SERIAL'
+
INTERP_MISSING_MONTHS
+
+ 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_bc_a4_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'NO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NO2_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a1_anthro-ene_vertical_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a1_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc',
+ 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_num_a2_so4_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc',
+ 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_bc_a4_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SO2_aircraft_vertical_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_SO2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc',
+ 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/stratvolc/VolcanEESMv3.10_piControl_SO2_1850-2014average_ext_1deg_ZeroTrop_c181020.nc',
+ 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a1_anthro-ene_vertical_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a1_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc',
+ 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions-cmip6_so4_a2_contvolcano_vertical_850-5000_0.9x1.25_c20170724.nc'
+
INTERP_MISSING_MONTHS
-
-'noy', 'nhx'
+
+ 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BENZENE_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'BENZENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BENZENE_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BIGALK_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'BIGALK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BIGALK_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BIGENE_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'BIGENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_BIGENE_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H2_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C2H2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H2_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H4_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C2H4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_C2H4_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H5OH_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C2H5OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H5OH_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H6_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C2H6_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C2H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_C2H6_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C3H6_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C3H6_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C3H6 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_C3H6_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C3H8_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_C3H8_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'C3H8 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_C3H8_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH2O_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH2O -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH2O_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3CHO_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH3CHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3CHO_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3CN_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH3CN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3CN_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COCH3_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH3COCH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COCH3_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH3COCHO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COCHO_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COOH_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH3COOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3COOH_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3OH_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CH3OH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CH3OH_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CO_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_CO_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'CO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_CO_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'E90 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_1750_2015/emissions_E90global_surface_175001-210101_0.9x1.25_c20190224.nc',
+ 'GLYALD -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_GLYALD_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_HCN_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'HCN -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_HCN_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_HCOOH_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'HCOOH -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_HCOOH_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'ISOP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_ISOP_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_IVOC_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'IVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_IVOC_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_MEK_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'MEK -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_MEK_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'MTERP -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_MTERP_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NH3_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NH3_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'NH3 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_NH3_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NO_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_NO_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'NO -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-SSP_NO_other_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SVOC_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'SVOC -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SVOC_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_TOLUENE_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'TOLUENE -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_TOLUENE_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_XYLENES_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'XYLENES -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_XYLENES_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_bc_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'bc_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_bc_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'DMS -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_DMS_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a1_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'num_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a1_anthro-ag-ship_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'num_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_bc_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_bc_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_pom_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'num_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_num_pom_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_pom_a4_anthro_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'pom_a4 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_pom_a4_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SO2_anthro-ag-ship-res_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SO2_anthro-ene_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'SO2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_SO2_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a1_anthro-ag-ship_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a1_bb_surface_mol_175001-210101_0.9x1.25_c20190224.nc',
+ 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190224.nc'
+
@@ -37,113 +134,45 @@
.true.
.false.
.false.
-.false.
+.true.
.false.
.false.
.false.
.false.
.false.
-
+
- 'CFC11STAR', 'AODDUST', 'AODDUST2', 'T', 'U', 'V', 'O3', 'OH', 'NO3', 'HO2',
- 'LNO_COL_PROD', 'NO2_CLXF', 'SFNO', 'SFNH3', 'BRO',
- 'CH3CL', 'CLO', 'CO2', 'HCL', 'HO2', 'HOCL', 'H2O', 'PHIS', 'Z3',
- 'BENZENE', 'C2H2', 'C2H4', 'C2H6', 'C3H8', 'CCL4', 'CFC11', 'CFC113', 'CFC12',
- 'CH2O', 'CH3BR', 'CH3CCL3', 'CH3CHO', 'CH3CL', 'CH3CN', 'CH3COCH3', 'CH3OH', 'CH4',
- 'CO', 'H2O2', 'HCFC22', 'HCN', 'HNO3', 'ISOP', 'MTERP', 'N2O', 'O3', 'O3S',
- 'PAN', 'SO2', 'TOLUENE', 'OH', 'ALKNIT', 'ALKOOH', 'BCARY', 'BENZENE', 'BENZOOH',
- 'BEPOMUC', 'BIGALD', 'BIGALD1', 'BIGALD2', 'BIGALD3', 'BIGALD4', 'BIGALK', 'BIGENE', 'BR',
- 'BRCL', 'BRO', 'BRONO2', 'BRY', 'BZALD', 'BZOOH', 'C2H2', 'C2H4', 'C2H5OH',
- 'C2H5OOH', 'C2H6', 'C3H6', 'C3H7OOH', 'C3H8', 'C6H5OOH', 'CCL4', 'CF2CLBR', 'CF3BR',
- 'CFC11', 'CFC113', 'CFC114', 'CFC115', 'CFC12', 'CH2BR2', 'CH2O', 'CH3BR', 'CH3CCL3',
- 'CH3CHO', 'CH3CL', 'CH3CN', 'CH3COCH3', 'CH3COCHO', 'CH3COOH', 'CH3COOOH', 'CH3OH', 'CH3OOH',
- 'CH4', 'CHBR3', 'CL', 'CL2', 'CL2O2', 'CLO', 'CLONO2', 'CLY', 'CO',
- 'CO2', 'COF2', 'COFCL', 'CRESOL', 'DMS', 'EOOH', 'F', 'GLYALD', 'GLYOXAL',
- 'H', 'H2', 'H2402', 'H2O2', 'H2SO4', 'HBR', 'HCFC141B', 'HCFC142B', 'HCFC22',
- 'HCL', 'HCN', 'HCOOH', 'HF', 'HNO3', 'HO2NO2', 'HOBR', 'HOCL', 'HONITR',
- 'HPALD', 'HYAC', 'HYDRALD', 'IEPOX', 'ISOP', 'ISOPNITA', 'ISOPNITB', 'ISOPNO3', 'ISOPNOOH',
- 'ISOPOOH', 'IVOC', 'MACR', 'MACROOH', 'MEK', 'MEKOOH', 'MPAN', 'MTERP', 'MVK',
- 'N', 'N2O', 'N2O5', 'NC4CH2OH', 'NC4CHO', 'NH3', 'NH4', 'NO',
- 'NO2', 'NO3', 'NOA', 'NTERPOOH', 'O', 'OCLO',
- 'OCS', 'ONITR', 'PAN', 'PBZNIT', 'PHENO', 'PHENOL', 'PHENOOH', 'POOH', 'ROOH',
- 'S', 'SF6', 'SO', 'SO2', 'SO3', 'SOAG0', 'SOAG1', 'SOAG2', 'SOAG3',
- 'SOAG4', 'SVOC', 'TEPOMUC', 'TERP2OOH', 'TERPNIT', 'TERPOOH', 'TERPROD1', 'TERPROD2', 'TOLOOH',
- 'TOLUENE', 'XOOH', 'XYLENES', 'XYLENOOH', 'XYLOL', 'XYLOLOOH', 'NHDEP', 'NDEP', 'ACBZO2',
- 'ALKO2', 'BENZO2', 'BZOO', 'C2H5O2', 'C3H7O2', 'C6H5O2', 'CH3CO3', 'CH3O2', 'DICARBO2',
- 'ENEO2', 'EO', 'EO2', 'HO2', 'HOCH2OO', 'ISOPAO2', 'ISOPBO2', 'MACRO2',
- 'MALO2', 'MCO3', 'MDIALO2', 'MEKO2', 'NTERPO2',
- 'O1D', 'OH', 'PHENO2', 'PO2', 'RO2',
- 'TERP2O2', 'TERPO2', 'TOLO2', 'XO2', 'XYLENO2', 'XYLOLO2', 'H2O', 'SAD_ICE', 'SAD_LNAT',
- 'SAD_SULFC', 'SAD_TROP', 'SAD_AERO', 'REFF_AERO', 'PDELDRY', 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'H2SO4M_C',
- 'HNO3_GAS', 'HNO3_STS', 'HNO3_NAT', 'VEL_NAT2', 'NITROP_PD', 'NOX', 'NOY', 'CLOX', 'CLOY',
- 'BROX', 'BROY', 'TCLY', 'TOTH', 'MASS', 'TBRY', 'HCL_GAS', 'wet_deposition_NHx_as_N', 'wet_deposition_NOy_as_N',
- 'HCL_GAS', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'ABSORB', 'AODVISdn', 'AODdnMODE1', 'AODVISstdn', 'AODNIRstdn',
- 'AODUVstdn', 'AODdnMODE2', 'AODdnMODE3', 'AODdnDUST1', 'AODdnDUST2', 'AODdnDUST3', 'AODVISstdn', 'AODUVstdn', 'AODNIRstdn',
- 'AODNIRstdn', 'AODVISdn', 'AODUVdn', 'EXTINCTdn', 'EXTxASYMdn', 'EXTINCTNIRdn', 'EXTINCTUVdn', 'WD_ALKNIT', 'WD_ALKOOH',
- 'WD_BENZOOH', 'WD_BRONO2', 'WD_BZOOH', 'WD_C2H5OH', 'WD_C2H5OOH', 'WD_C3H7OOH', 'WD_C6H5OOH', 'WD_CH2O', 'WD_CH3CHO',
- 'WD_CH3CN', 'WD_CH3COCHO', 'WD_CH3COOH', 'WD_CH3COOOH', 'WD_CH3COCH3', 'WD_CH3OH', 'WD_CH3OOH', 'WD_CLONO2', 'WD_COF2', 'WD_COFCL',
- 'WD_EOOH', 'WD_GLYALD', 'WD_H2O2', 'WD_H2SO4', 'WD_HBR', 'WD_HCL', 'WD_HCN', 'WD_HCOOH', 'WD_HF',
- 'WD_HNO3', 'WD_HO2NO2', 'WD_HOBR', 'WD_HOCL', 'WD_HONITR', 'WD_HPALD', 'WD_HYAC', 'WD_HYDRALD', 'WD_IEPOX',
- 'WD_ISOPNITA', 'WD_ISOPNITB', 'WD_ISOPNO3', 'WD_ISOPNOOH', 'WD_ISOPOOH', 'WD_IVOC', 'WD_MACR', 'WD_MACROOH', 'WD_MEKOOH',
- 'WD_MVK', 'WD_NC4CH2OH', 'WD_NC4CHO', 'WD_NDEP', 'WD_NH3', 'WD_NH4', 'WD_NHDEP', 'WD_NOA',
- 'WD_NTERPOOH', 'WD_ONITR', 'WD_PHENOOH', 'WD_POOH', 'WD_ROOH', 'WD_SO2', 'WD_SOAG0', 'WD_SOAG1', 'WD_SOAG2',
- 'WD_SOAG3', 'WD_SOAG4', 'WD_SVOC', 'WD_TERP2OOH', 'WD_TERPNIT', 'WD_TERPOOH', 'WD_TERPROD1', 'WD_TERPROD2', 'WD_TOLOOH',
- 'WD_XOOH', 'WD_XYLENOOH', 'WD_XYLOLOOH', 'DF_ALKNIT', 'DF_ALKOOH', 'DF_BENZOOH', 'DF_BZOOH', 'DF_C2H5OH', 'DF_C2H5OOH',
- 'DF_C3H7OOH', 'DF_C6H5OOH', 'DF_CH2O', 'DF_CH3CHO', 'DF_CH3CN', 'DF_CH3COCH3', 'DF_CH3COCHO', 'DF_CH3COOH', 'DF_CH3COOOH',
- 'DF_CH3OH', 'DF_CH3OOH', 'DF_CO', 'DF_EOOH', 'DF_GLYALD', 'DF_H2O2', 'DF_H2SO4', 'DF_HCN', 'DF_HCOOH',
- 'DF_HNO3', 'DF_HO2NO2', 'DF_HONITR', 'DF_HPALD', 'DF_HYAC', 'DF_HYDRALD', 'DF_IEPOX', 'DF_ISOPNITA', 'DF_ISOPNITB',
- 'DF_ISOPNO3', 'DF_ISOPNOOH', 'DF_ISOPOOH', 'DF_IVOC', 'DF_MACROOH', 'DF_MEKOOH', 'DF_MPAN', 'DF_NC4CH2OH', 'DF_NC4CHO',
- 'dry_deposition_NHx_as_N', 'DF_NH3', 'DF_NH4', 'DF_NO', 'DF_NO2', 'DF_NOA', 'DF_NTERPOOH', 'DF_O3', 'DF_ONITR',
- 'DF_PAN', 'DF_PHENOOH', 'DF_POOH', 'DF_ROOH', 'DF_SO2', 'DF_SOAG0', 'DF_SOAG1', 'DF_SOAG2', 'DF_SOAG3',
- 'DF_SOAG4', 'DF_SVOC', 'DF_TERP2OOH', 'DF_TERPNIT', 'DF_TERPOOH', 'DF_TERPROD1', 'DF_TERPROD2', 'DF_TOLOOH', 'DF_XOOH',
- 'DF_XYLENOOH', 'DF_XYLOLOOH', 'dry_deposition_NOy_as_N', 'SO2_CLXF', 'SO2_XFRC', 'SVOC_CLXF', 'CO_CLXF', 'NO2_CLXF', 'LNO_PROD',
- 'LNO_COL_PROD', 'SFISOP', 'SFMTERP', 'SFBCARY', 'SFCH3OH', 'SFC2H5OH', 'SFCH3CHO', 'SFMEK', 'SFHCN',
- 'SFCH3CN', 'SFCH2O', 'SFC2H6', 'SFC3H8', 'SFC2H4', 'SFC3H6', 'SFCH3COCH3', 'SFBIGALK', 'SFBIGENE',
- 'SFBENZENE', 'SFTOLUENE', 'SFXYLENES', 'SFCO', 'SFNO', 'SFC2H2', 'SFHCOOH', 'SFCH3COOH', 'SFCH3COCH3',
- 'SFDMS', 'SFMEK', 'SFSO2', 'SFNH3', 'SFIVOC', 'SFSVOC', 'MEG_ISOP', 'MEG_MTERP', 'MEG_BCARY',
- 'MEG_CH3OH', 'MEG_C2H5OH', 'MEG_CH2O', 'MEG_CH3CHO', 'MEG_CH3COOH', 'MEG_CH3COCH3', 'MEG_HCOOH', 'MEG_HCN', 'MEG_CO',
- 'MEG_C2H6', 'MEG_C2H4', 'MEG_C3H8', 'MEG_C3H6', 'MEG_BIGALK', 'MEG_BIGENE', 'MEG_TOLUENE', 'Dso4_a1CHM', 'Dso4_a2CHM',
- 'Dso4_a3CHM', 'DO3CHM', 'DCOCHM', 'DHNO3CHM', 'DH2O2CHM', 'CH4_CHML', 'CO_CHMP', 'CO_CHML', 'CH3CCL3_CHML',
- 'CO2_CHML', 'AQ_SO2', 'GS_SO2', 'SO2_CHML', 'SO2_CHMP', 'SO2_CLXF', 'SOAG0_CHMP', 'SOAG1_CHMP', 'SOAG2_CHMP',
- 'SOAG3_CHMP', 'SOAG4_CHMP', 'IVOC_CHMP', 'SVOC_CHML', 'MASS', 'ABSORB', 'WD_H2SO4', 'WD_IVOC', 'WD_SO2',
- 'WD_SOAG0', 'WD_SOAG1', 'WD_SOAG2', 'WD_SOAG3', 'WD_SOAG4', 'WD_SVOC', 'DF_CO', 'DF_IVOC', 'DF_O3',
- 'DF_SO2', 'DF_SOAG0', 'DF_SOAG1', 'DF_SOAG2', 'DF_SOAG3', 'DF_SOAG4', 'DF_SVOC', 'SO2_CLXF', 'SVOC_CLXF',
- 'SFISOP', 'SFMTERP', 'SFCH3OH', 'SFCH3COCH3', 'SFCO', 'SFIVOC', 'SFSVOC', 'DO3CHM', 'DCOCHM',
- 'O3_CHMP', 'O3_CHML', 'CH4_CHML', 'CO_CHMP', 'CO_CHML', 'CH3CCL3_CHML', 'SO2_CHML', 'SO2_CHMP', 'SO2_CLXF',
- 'SOAG0_CHMP', 'SOAG1_CHMP', 'SOAG2_CHMP', 'SOAG3_CHMP', 'SOAG4_CHMP',
- 'r_HO2_O3', 'r_OH_O3', 'r_OH_O', 'r_O1D_H2O', 'r_het1', 'r_het2', 'r_het3', 'r_het4', 'r_het5', 'r_het6',
- 'jo3_a', 'jno2', 'jpan', 'jh2o2', 'jcl2o2', 'bc_a1', 'bc_a4', 'dst_a1', 'dst_a2',
- 'dst_a3', 'ncl_a1', 'ncl_a1', 'ncl_a2', 'ncl_a3', 'pom_a1', 'pom_a4', 'so4_a1', 'so4_a2',
- 'so4_a3', 'soa1_a1', 'soa2_a1', 'soa3_a1', 'soa4_a1', 'soa5_a1', 'soa1_a2', 'soa2_a2', 'soa3_a2',
- 'soa4_a2', 'soa5_a2', 'bc_c1', 'bc_c4', 'dst_c1', 'dst_c2', 'dst_c3', 'ncl_c1', 'ncl_c1',
- 'ncl_c2', 'ncl_c3', 'pom_c1', 'pom_c4', 'so4_c1', 'so4_c2', 'so4_c3', 'soa1_c1', 'soa2_c1',
- 'soa3_c1', 'soa4_c1', 'soa5_c1', 'soa1_c2', 'soa2_c2', 'soa3_c2', 'soa4_c2', 'soa5_c2',
- 'num_a1','num_a2','num_a3','num_a4','num_c1','num_c2','num_c3','num_c4',
- 'bc_a1SFWET', 'bc_a4SFWET', 'dst_a1SFWET', 'dst_a2SFWET', 'dst_a3SFWET', 'ncl_a1SFWET', 'ncl_a2SFWET', 'ncl_a3SFWET', 'pom_a1SFWET', 'pom_a4SFWET',
- 'so4_a1SFWET', 'so4_a2SFWET', 'so4_a3SFWET', 'soa1_a1SFWET', 'soa1_a2SFWET', 'soa2_a1SFWET', 'soa2_a2SFWET', 'soa3_a1SFWET', 'soa3_a2SFWET',
- 'soa4_a1SFWET', 'soa4_a2SFWET', 'soa5_a1SFWET', 'soa5_a2SFWET', 'bc_c1SFWET', 'bc_c4SFWET', 'dst_c1SFWET', 'dst_c2SFWET', 'dst_c3SFWET',
- 'ncl_c1SFWET', 'ncl_c2SFWET', 'ncl_c3SFWET', 'pom_c1SFWET', 'pom_c4SFWET', 'so4_c1SFWET', 'so4_c2SFWET', 'so4_c3SFWET', 'soa1_c1SFWET',
- 'soa1_c2SFWET', 'soa2_c1SFWET', 'soa2_c2SFWET', 'soa3_c1SFWET', 'soa3_c2SFWET', 'soa4_c1SFWET', 'soa4_c2SFWET', 'soa5_c1SFWET', 'soa5_c2SFWET',
- 'bc_a1DDF', 'bc_a4DDF', 'dst_a1DDF', 'dst_a2DDF', 'dst_a3DDF', 'ncl_a1DDF', 'ncl_a2DDF', 'ncl_a3DDF', 'pom_a1DDF',
- 'pom_a4DDF', 'so4_a1DDF', 'so4_a2DDF', 'so4_a3DDF', 'soa1_a1DDF', 'soa1_a2DDF', 'soa2_a1DDF', 'soa2_a2DDF', 'soa3_a1DDF',
- 'soa3_a2DDF', 'soa4_a1DDF', 'soa4_a2DDF', 'soa5_a1DDF', 'soa5_a2DDF', 'bc_c1DDF', 'bc_c4DDF', 'dst_c1DDF', 'dst_c2DDF',
- 'dst_c3DDF', 'ncl_c1DDF', 'ncl_c2DDF', 'ncl_c3DDF', 'pom_c1DDF', 'pom_c4DDF', 'so4_c1DDF', 'so4_c2DDF', 'so4_c3DDF',
- 'soa1_c1DDF', 'soa1_c2DDF', 'soa2_c1DDF', 'soa2_c2DDF', 'soa3_c1DDF', 'soa3_c2DDF', 'soa4_c1DDF', 'soa4_c2DDF', 'soa5_c1DDF',
- 'soa5_c2DDF', 'num_a1DDF', 'num_a2DDF', 'num_a3DDF', 'num_a4DDF', 'num_c1DDF', 'num_c2DDF', 'num_c3DDF', 'num_c4DDF',
- 'bc_a4_CLXF', 'pom_a4_CLXF', 'so4_a1_CLXF', 'so4_a2_CLXF', 'num_a1_CLXF', 'num_a2_CLXF', 'SFbc_a4', 'SFpom_a4', 'SFso4_a1',
- 'SFso4_a2', 'SFnum_a1', 'SFnum_a2', 'SFnum_a3', 'so4_a1_sfgaex1', 'so4_a2_sfgaex1', 'so4_a3_sfgaex1', 'soa1_a1_sfgaex1', 'soa1_a2_sfgaex1',
- 'soa2_a1_sfgaex1', 'soa2_a2_sfgaex1', 'soa3_a1_sfgaex1', 'soa3_a2_sfgaex1', 'soa4_a1_sfgaex1', 'soa4_a2_sfgaex1', 'soa5_a1_sfgaex1', 'soa5_a2_sfgaex1', 'so4_a2_sfnnuc1',
- 'so4_c1AQH2SO4', 'so4_c2AQH2SO4', 'so4_c3AQH2SO4', 'so4_c1AQSO4', 'so4_c2AQSO4', 'so4_c3AQSO4', 'SFdst_a1', 'SFdst_a2', 'SFdst_a3',
- 'SFncl_a1', 'SFncl_a2', 'SFncl_a3', 'soa1_a1_CHML', 'soa2_a1_CHML', 'soa3_a1_CHML', 'soa4_a1_CHML', 'soa5_a1_CHML', 'soa1_a2_CHML',
- 'soa2_a2_CHML', 'soa3_a2_CHML', 'soa4_a2_CHML', 'soa5_a2_CHML', 'so4_a1_CHMP', 'so4_a2_CHMP', 'so4_a3_CHMP', 'soa1_a1_CHMP', 'soa2_a1_CHMP',
- 'soa3_a1_CHMP', 'soa4_a1_CHMP', 'soa5_a1_CHMP', 'soa1_a2_CHMP', 'soa2_a2_CHMP', 'soa3_a2_CHMP', 'soa4_a2_CHMP', 'soa5_a2_CHMP', 'r_jsoa1_a1',
- 'r_jsoa2_a1', 'r_jsoa3_a1', 'r_jsoa4_a1', 'r_jsoa5_a1', 'r_jsoa1_a2', 'r_jsoa2_a2', 'r_jsoa3_a2', 'r_jsoa4_a2', 'r_jsoa5_a2',
- 'r_GLYOXAL_aer', 'H2SO4_sfnnuc1', 'num_a2_sfnnuc1', 'TMOCS', 'TMSO2', 'TMDMS', 'TMso4_a1', 'TMso4_a2', 'TMso4_a3',
- 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSO4dn', 'BURDENSOAdn', 'BURDENSEASALTdn','BURDENBCdn', 'PM25',
- 'O3_Prod','O3_Loss','O3S_Loss','RO2_NO_sum','O3_alkenes','RO2_NO3_sum','RO2_HO2_sum','RO2_RO2_sum','RCO2_NO2_sum',
- 'OddOx_Ox_Loss','OddOx_HOx_Loss','OddOx_NOx_Loss','OddOx_CLOxBROx_Loss','OddOx_Loss_Tot','OddOx_Prod_Tot',
- 'Ox_Prod','Ox_Loss'
+ 'ACTREL', 'AQ_SO2', 'AREA', 'BROX', 'BROY', 'BRY', 'CLOX', 'CLOY', 'CLY', 'NOX', 'NOY', 'TBRY', 'TCLY', 'CFC11STAR',
+ 'BTTGWSPEC', 'BTTGWSDF', 'BTTGWSKE', 'CONCLD', 'CME', 'CMFMC', 'CMFMC_DP',
+ 'CH3CCL3_CHML', 'CH4_CHML', 'CO2_CHML', 'CO_CHML', 'IVOC_CHML', 'N2O_CHML', 'O3_CHML', 'SO2_CHML',
+ 'CO_CHMP', 'O3_CHMP', 'SO2_CHMP', 'TMDMS', 'TMOCS', 'TMSO2','TMso4_a1', 'TMso4_a2', 'TMso4_a3',
+ 'soa1_a1_CHML', 'soa1_a2_CHML', 'soa2_a1_CHML', 'soa2_a2_CHML', 'soa3_a1_CHML', 'soa3_a2_CHML',
+ 'soa4_a1_CHML', 'soa4_a2_CHML', 'soa5_a1_CHML', 'soa5_a2_CHML', 'SVOC_CHML',
+ 'so4_a1_CHMP','so4_a2_CHMP', 'SOAG0_CHMP', 'SOAG1_CHMP', 'SOAG2_CHMP', 'SOAG3_CHMP', 'SOAG4_CHMP', 'TOTH', 'TOT_CLD_VISTAU',
+ 'TREFHTMN', 'TREFHTMX', 'TROP_P', 'TROP_T', 'TROP_Z', 'TTEND_TOT', 'TTGWORO', 'TTGWSDF', 'TTGWSDFORO', 'TTGWSKE', 'TTGWSKEORO',
+ 'BURDENBCdn', 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSEASALTdn', 'BURDENSO4dn', 'BURDENSOAdn',
+ 'ABSORB', 'AODABSdn', 'AODBCdn', 'AODdnDUST01', 'AODdnDUST02', 'AODdnDUST03', 'AODdn_aitken', 'AODdn_accum', 'AODdn_coarse',
+ 'AODDUST02', 'AODDUST', 'AODNIRstdn', 'AODPOMdn', 'AODSO4dn', 'AODSOAdn', 'AODSSdn', 'AODUVdn', 'AODUVstdn', 'AODVIS',
+ 'AODVISdn', 'AODVISstdn', 'EXTINCTdn', 'EXTINCTNIRdn', 'EXTINCTUVdn', 'EXTxASYMdn', 'FLDSC', 'FLNR', 'FSNR',
+ 'SOLLD', 'SOLSD', 'SSAVIS', 'SST','TAQ',
+ 'DCOCHM','DH2O2CHM', 'DHNO3CHM', 'DO3CHM', 'Dso4_a1CHM', 'Dso4_a2CHM', 'Dso4_a3CHM',
+ 'FLASHFRQ', 'LNO_COL_PROD', 'LNO_PROD','KVH_CLUBB','MASS', 'PDELDRY', 'NITROP_PD','PM25', 'PRECT', 'PTEQ', 'PTTEND',
+ 'QRLC', 'QRSC', 'QSNOW', 'QRAIN','GS_SO2', 'HNO3_GAS', 'HNO3_NAT', 'HNO3_STS','H2SO4M_C', 'H2SO4_sfnnuc1','HCL_GAS',
+ 'SAD_AERO', 'SAD_ICE', 'SAD_LNAT', 'SAD_SULFC', 'SAD_TROP' 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'REFF_AERO', 'RHREFHT',
+ 'EVAPPREC', 'EVAPQZM', 'EVAPTZM', 'FCTL','FREQZM', 'ZMDQ', 'ZMDT', 'ZMMTT', 'ZMMU','VEL_NAT2',
+ 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'bc_c1DDF', 'bc_c4DDF', 'dst_c1DDF', 'dst_c2DDF', 'dst_c3DDF',
+ 'ncl_c1DDF', 'ncl_c2DDF', 'ncl_c3DDF', 'pom_c1DDF', 'pom_c4DDF', 'num_c1DDF','num_c2DDF','num_c3DDF','num_c4DDF',
+ 'so4_a1_sfgaex1', 'so4_c1AQH2SO4', 'so4_c1AQSO4', 'so4_c1DDF', 'so4_a2_sfgaex1', 'so4_c2AQH2SO4', 'so4_c2AQSO4', 'so4_c2DDF',
+ 'so4_a3_sfgaex1', 'so4_c3AQH2SO4', 'so4_c3AQSO4', 'so4_c3DDF', 'so4_a2_sfnnuc1', 'num_a2_sfnnuc1',
+ 'soa1_a1_sfgaex1','soa1_c1DDF', 'soa1_a2_sfgaex1','soa1_c2DDF', 'soa2_a1_sfgaex1','soa2_c1DDF', 'soa2_a2_sfgaex1','soa2_c2DDF',
+ 'soa3_a1_sfgaex1','soa3_c1DDF', 'soa3_a2_sfgaex1','soa3_c2DDF', 'soa4_a1_sfgaex1','soa4_c1DDF', 'soa4_a2_sfgaex1','soa4_c2DDF',
+ 'soa5_a1_sfgaex1','soa5_c1DDF', 'soa5_a2_sfgaex1','soa5_c2DDF', 'jcl2o2', 'jh2o2', 'jno2', 'jo2_a', 'jo2_b', 'jo3_a', 'jo3_b', 'jpan',
+ 'r_het1', 'r_het2', 'r_het3', 'r_het4', 'r_het5', 'r_het6', 'r_het7', 'r_het8', 'r_het9', 'r_het10', 'r_het11', 'r_het12', 'r_het13',
+ 'r_het15', 'r_het16', 'r_het17', 'r_jsoa1_a1', 'r_jsoa1_a2', 'r_jsoa2_a1', 'r_jsoa2_a2', 'r_jsoa3_a1', 'r_jsoa3_a2', 'r_jsoa4_a1',
+ 'r_jsoa4_a2', 'r_jsoa5_a1', 'r_jsoa5_a2', 'r_GLYOXAL_aer', 'r_HO2_O3', 'r_N2O5_aer', 'r_NO2_aer', 'r_NO3_aer', 'r_O1D_H2O', 'r_OH_O3', 'r_OH_O',
+ 'O3_Prod','O3_Loss','O3S_Loss','RO2_NO_sum','O3_alkenes','RO2_NO3_sum','RO2_HO2_sum','RO2_RO2_sum','RCO2_NO2_sum',
+ 'OddOx_Ox_Loss','OddOx_HOx_Loss','OddOx_NOx_Loss','OddOx_CLOxBROx_Loss','OddOx_Loss_Tot','OddOx_Prod_Tot', 'Ox_Prod','Ox_Loss'
diff --git a/bld/namelist_files/use_cases/hist_trop_strat_vbsext_cam6.xml b/bld/namelist_files/use_cases/hist_trop_strat_vbsext_cam6.xml
index 8d8ff90bf9..38e1439ed0 100644
--- a/bld/namelist_files/use_cases/hist_trop_strat_vbsext_cam6.xml
+++ b/bld/namelist_files/use_cases/hist_trop_strat_vbsext_cam6.xml
@@ -46,7 +46,7 @@
- 'CFC11STAR', 'AODDUST', 'AODDUST2', 'T', 'U', 'V', 'O3', 'OH', 'O3S',
+ 'CFC11STAR', 'AODDUST', 'AODDUST02', 'T', 'U', 'V', 'O3', 'OH', 'O3S',
'NO3', 'HO2', 'LNO_COL_PROD', 'NO2_CLXF', 'SFNO', 'SFNH3', 'BRO', 'CH3CL',
'CLO', 'CO2', 'HCL', 'HO2', 'HOCL', 'H2O', 'PHIS', 'Z3',
'BENZENE', 'C2H2', 'C2H4', 'C2H6', 'C3H8', 'CCL4', 'CFC11', 'CFC113',
@@ -81,8 +81,8 @@
'REFF_AERO', 'PDELDRY', 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'H2SO4M_C', 'HNO3_GAS', 'HNO3_STS',
'HNO3_NAT', 'VEL_NAT2', 'NITROP_PD', 'NOX', 'NOY', 'CLOX', 'CLOY', 'BROX',
'BROY', 'TCLY', 'TOTH', 'MASS', 'TBRY', 'HCL_GAS', 'wet_deposition_NHx_as_N', 'wet_deposition_NOy_as_N',
- 'HCL_GAS', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'ABSORB', 'AODVISdn', 'AODdnMODE1', 'AODVISstdn',
- 'AODNIRstdn', 'AODUVstdn', 'AODdnMODE2', 'AODdnMODE3', 'AODdnDUST1', 'AODdnDUST2', 'AODdnDUST3', 'AODVISstdn',
+ 'HCL_GAS', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'ABSORB', 'AODVISdn', 'AODdn_aitken', 'AODVISstdn',
+ 'AODNIRstdn', 'AODUVstdn', 'AODdn_accum', 'AODdn_coarse', 'AODdnDUST01', 'AODdnDUST02', 'AODdnDUST03', 'AODVISstdn',
'AODUVstdn', 'AODNIRstdn', 'AODNIRstdn', 'AODVISdn', 'AODUVdn', 'EXTINCTdn', 'EXTxASYMdn', 'EXTINCTNIRdn',
'EXTINCTUVdn', 'WD_NC4CH2OH', 'WD_NC4CHO', 'WD_NDEP', 'WD_NH3', 'WD_NH4', 'WD_NHDEP',
'WD_NOA', 'WD_NTERPOOH', 'WD_ONITR', 'WD_PHENOOH', 'WD_POOH', 'WD_ROOH', 'WD_SO2',
diff --git a/bld/namelist_files/use_cases/hist_trop_strat_vbsfire_cam6.xml b/bld/namelist_files/use_cases/hist_trop_strat_vbsfire_cam6.xml
index 896609e72a..7219cf0322 100644
--- a/bld/namelist_files/use_cases/hist_trop_strat_vbsfire_cam6.xml
+++ b/bld/namelist_files/use_cases/hist_trop_strat_vbsfire_cam6.xml
@@ -78,7 +78,7 @@
.true.
.false.
.false.
-.false.
+.true.
.false.
.false.
.false.
@@ -87,104 +87,36 @@
- 'CFC11STAR', 'AODDUST', 'AODDUST2', 'T', 'U', 'V', 'O3', 'OH', 'NO3', 'HO2',
- 'LNO_COL_PROD', 'NO2_CLXF', 'SFNO', 'SFNH3', 'BRO',
- 'CH3CL', 'CLO', 'CO2', 'HCL', 'HO2', 'HOCL', 'H2O', 'PHIS', 'Z3',
- 'BENZENE', 'C2H2', 'C2H4', 'C2H6', 'C3H8', 'CCL4', 'CFC11', 'CFC113', 'CFC12',
- 'CH2O', 'CH3BR', 'CH3CCL3', 'CH3CHO', 'CH3CL', 'CH3CN', 'CH3COCH3', 'CH3OH', 'CH4',
- 'CO', 'H2O2', 'HCFC22', 'HCN', 'HNO3', 'ISOP', 'MTERP', 'N2O', 'O3', 'O3S',
- 'PAN', 'SO2', 'TOLUENE', 'OH', 'ALKNIT', 'ALKOOH', 'BCARY', 'BENZENE', 'BENZOOH',
- 'BEPOMUC', 'BIGALD', 'BIGALD1', 'BIGALD2', 'BIGALD3', 'BIGALD4', 'BIGALK', 'BIGENE', 'BR',
- 'BRCL', 'BRO', 'BRONO2', 'BRY', 'BZALD', 'BZOOH', 'C2H2', 'C2H4', 'C2H5OH',
- 'C2H5OOH', 'C2H6', 'C3H6', 'C3H7OOH', 'C3H8', 'C6H5OOH', 'CCL4', 'CF2CLBR', 'CF3BR',
- 'CFC11', 'CFC113', 'CFC114', 'CFC115', 'CFC12', 'CH2BR2', 'CH2O', 'CH3BR', 'CH3CCL3',
- 'CH3CHO', 'CH3CL', 'CH3CN', 'CH3COCH3', 'CH3COCHO', 'CH3COOH', 'CH3COOOH', 'CH3OH', 'CH3OOH',
- 'CH4', 'CHBR3', 'CL', 'CL2', 'CL2O2', 'CLO', 'CLONO2', 'CLY', 'CO',
- 'CO2', 'COF2', 'COFCL', 'CRESOL', 'DMS', 'EOOH', 'F', 'GLYALD', 'GLYOXAL',
- 'H', 'H2', 'H2402', 'H2O2', 'H2SO4', 'HBR', 'HCFC141B', 'HCFC142B', 'HCFC22',
- 'HCL', 'HCN', 'HCOOH', 'HF', 'HNO3', 'HO2NO2', 'HOBR', 'HOCL', 'HONITR',
- 'HPALD', 'HYAC', 'HYDRALD', 'IEPOX', 'ISOP', 'ISOPNITA', 'ISOPNITB', 'ISOPNO3', 'ISOPNOOH',
- 'ISOPOOH', 'IVOC', 'MACR', 'MACROOH', 'MEK', 'MEKOOH', 'MPAN', 'MTERP', 'MVK',
- 'N', 'N2O', 'N2O5', 'NC4CH2OH', 'NC4CHO', 'NH3', 'NH4', 'NO',
- 'NO2', 'NO3', 'NOA', 'NTERPOOH', 'O', 'OCLO',
- 'OCS', 'ONITR', 'PAN', 'PBZNIT', 'PHENO', 'PHENOL', 'PHENOOH', 'POOH', 'ROOH',
- 'S', 'SF6', 'SO', 'SO2', 'SO3', 'SOAG0', 'SOAG1', 'SOAG2', 'SOAG3',
- 'SOAG4', 'SVOC', 'TEPOMUC', 'TERP2OOH', 'TERPNIT', 'TERPOOH', 'TERPROD1', 'TERPROD2', 'TOLOOH',
- 'TOLUENE', 'XOOH', 'XYLENES', 'XYLENOOH', 'XYLOL', 'XYLOLOOH', 'NHDEP', 'NDEP', 'ACBZO2',
- 'ALKO2', 'BENZO2', 'BZOO', 'C2H5O2', 'C3H7O2', 'C6H5O2', 'CH3CO3', 'CH3O2', 'DICARBO2',
- 'ENEO2', 'EO', 'EO2', 'HO2', 'HOCH2OO', 'ISOPAO2', 'ISOPBO2', 'MACRO2',
- 'MALO2', 'MCO3', 'MDIALO2', 'MEKO2', 'NTERPO2',
- 'O1D', 'OH', 'PHENO2', 'PO2', 'RO2',
- 'TERP2O2', 'TERPO2', 'TOLO2', 'XO2', 'XYLENO2', 'XYLOLO2', 'H2O', 'SAD_ICE', 'SAD_LNAT',
- 'SAD_SULFC', 'SAD_TROP', 'SAD_AERO', 'REFF_AERO', 'PDELDRY', 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'H2SO4M_C',
- 'HNO3_GAS', 'HNO3_STS', 'HNO3_NAT', 'VEL_NAT2', 'NITROP_PD', 'NOX', 'NOY', 'CLOX', 'CLOY',
- 'BROX', 'BROY', 'TCLY', 'TOTH', 'MASS', 'TBRY', 'HCL_GAS', 'wet_deposition_NHx_as_N', 'wet_deposition_NOy_as_N',
- 'HCL_GAS', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'ABSORB', 'AODVISdn', 'AODdnMODE1', 'AODVISstdn', 'AODNIRstdn',
- 'AODUVstdn', 'AODdnMODE2', 'AODdnMODE3', 'AODdnDUST1', 'AODdnDUST2', 'AODdnDUST3', 'AODVISstdn', 'AODUVstdn', 'AODNIRstdn',
- 'AODNIRstdn', 'AODVISdn', 'AODUVdn', 'EXTINCTdn', 'EXTxASYMdn', 'EXTINCTNIRdn', 'EXTINCTUVdn', 'WD_ALKNIT', 'WD_ALKOOH',
- 'WD_BENZOOH', 'WD_BRONO2', 'WD_BZOOH', 'WD_C2H5OH', 'WD_C2H5OOH', 'WD_C3H7OOH', 'WD_C6H5OOH', 'WD_CH2O', 'WD_CH3CHO',
- 'WD_CH3CN', 'WD_CH3COCHO', 'WD_CH3COOH', 'WD_CH3COOOH', 'WD_CH3COCH3', 'WD_CH3OH', 'WD_CH3OOH', 'WD_CLONO2', 'WD_COF2', 'WD_COFCL',
- 'WD_EOOH', 'WD_GLYALD', 'WD_H2O2', 'WD_H2SO4', 'WD_HBR', 'WD_HCL', 'WD_HCN', 'WD_HCOOH', 'WD_HF',
- 'WD_HNO3', 'WD_HO2NO2', 'WD_HOBR', 'WD_HOCL', 'WD_HONITR', 'WD_HPALD', 'WD_HYAC', 'WD_HYDRALD', 'WD_IEPOX',
- 'WD_ISOPNITA', 'WD_ISOPNITB', 'WD_ISOPNO3', 'WD_ISOPNOOH', 'WD_ISOPOOH', 'WD_IVOC', 'WD_MACR', 'WD_MACROOH', 'WD_MEKOOH',
- 'WD_MVK', 'WD_NC4CH2OH', 'WD_NC4CHO', 'WD_NDEP', 'WD_NH3', 'WD_NH4', 'WD_NHDEP', 'WD_NOA',
- 'WD_NTERPOOH', 'WD_ONITR', 'WD_PHENOOH', 'WD_POOH', 'WD_ROOH', 'WD_SO2', 'WD_SOAG0', 'WD_SOAG1', 'WD_SOAG2',
- 'WD_SOAG3', 'WD_SOAG4', 'WD_SVOC', 'WD_TERP2OOH', 'WD_TERPNIT', 'WD_TERPOOH', 'WD_TERPROD1', 'WD_TERPROD2', 'WD_TOLOOH',
- 'WD_XOOH', 'WD_XYLENOOH', 'WD_XYLOLOOH', 'DF_ALKNIT', 'DF_ALKOOH', 'DF_BENZOOH', 'DF_BZOOH', 'DF_C2H5OH', 'DF_C2H5OOH',
- 'DF_C3H7OOH', 'DF_C6H5OOH', 'DF_CH2O', 'DF_CH3CHO', 'DF_CH3CN', 'DF_CH3COCH3', 'DF_CH3COCHO', 'DF_CH3COOH', 'DF_CH3COOOH',
- 'DF_CH3OH', 'DF_CH3OOH', 'DF_CO', 'DF_EOOH', 'DF_GLYALD', 'DF_H2O2', 'DF_H2SO4', 'DF_HCN', 'DF_HCOOH',
- 'DF_HNO3', 'DF_HO2NO2', 'DF_HONITR', 'DF_HPALD', 'DF_HYAC', 'DF_HYDRALD', 'DF_IEPOX', 'DF_ISOPNITA', 'DF_ISOPNITB',
- 'DF_ISOPNO3', 'DF_ISOPNOOH', 'DF_ISOPOOH', 'DF_IVOC', 'DF_MACROOH', 'DF_MEKOOH', 'DF_MPAN', 'DF_NC4CH2OH', 'DF_NC4CHO',
- 'dry_deposition_NHx_as_N', 'DF_NH3', 'DF_NH4', 'DF_NO', 'DF_NO2', 'DF_NOA', 'DF_NTERPOOH', 'DF_O3', 'DF_ONITR',
- 'DF_PAN', 'DF_PHENOOH', 'DF_POOH', 'DF_ROOH', 'DF_SO2', 'DF_SOAG0', 'DF_SOAG1', 'DF_SOAG2', 'DF_SOAG3',
- 'DF_SOAG4', 'DF_SVOC', 'DF_TERP2OOH', 'DF_TERPNIT', 'DF_TERPOOH', 'DF_TERPROD1', 'DF_TERPROD2', 'DF_TOLOOH', 'DF_XOOH',
- 'DF_XYLENOOH', 'DF_XYLOLOOH', 'dry_deposition_NOy_as_N', 'SO2_CLXF', 'SO2_XFRC', 'SVOC_CLXF', 'CO_CLXF', 'NO2_CLXF', 'LNO_PROD',
- 'LNO_COL_PROD', 'SFISOP', 'SFMTERP', 'SFBCARY', 'SFCH3OH', 'SFC2H5OH', 'SFCH3CHO', 'SFMEK', 'SFHCN',
- 'SFCH3CN', 'SFCH2O', 'SFC2H6', 'SFC3H8', 'SFC2H4', 'SFC3H6', 'SFCH3COCH3', 'SFBIGALK', 'SFBIGENE',
- 'SFBENZENE', 'SFTOLUENE', 'SFXYLENES', 'SFCO', 'SFNO', 'SFC2H2', 'SFHCOOH', 'SFCH3COOH', 'SFCH3COCH3',
- 'SFDMS', 'SFMEK', 'SFSO2', 'SFNH3', 'SFIVOC', 'SFSVOC', 'MEG_ISOP', 'MEG_MTERP', 'MEG_BCARY',
- 'MEG_CH3OH', 'MEG_C2H5OH', 'MEG_CH2O', 'MEG_CH3CHO', 'MEG_CH3COOH', 'MEG_CH3COCH3', 'MEG_HCOOH', 'MEG_HCN', 'MEG_CO',
- 'MEG_C2H6', 'MEG_C2H4', 'MEG_C3H8', 'MEG_C3H6', 'MEG_BIGALK', 'MEG_BIGENE', 'MEG_TOLUENE', 'Dso4_a1CHM', 'Dso4_a2CHM',
- 'Dso4_a3CHM', 'DO3CHM', 'DCOCHM', 'DHNO3CHM', 'DH2O2CHM', 'CH4_CHML', 'CO_CHMP', 'CO_CHML', 'CH3CCL3_CHML',
- 'CO2_CHML', 'AQ_SO2', 'GS_SO2', 'SO2_CHML', 'SO2_CHMP', 'SO2_CLXF', 'SOAG0_CHMP', 'SOAG1_CHMP', 'SOAG2_CHMP',
- 'SOAG3_CHMP', 'SOAG4_CHMP', 'IVOC_CHMP', 'SVOC_CHML', 'MASS', 'ABSORB', 'WD_H2SO4', 'WD_IVOC', 'WD_SO2',
- 'WD_SOAG0', 'WD_SOAG1', 'WD_SOAG2', 'WD_SOAG3', 'WD_SOAG4', 'WD_SVOC', 'DF_CO', 'DF_IVOC', 'DF_O3',
- 'DF_SO2', 'DF_SOAG0', 'DF_SOAG1', 'DF_SOAG2', 'DF_SOAG3', 'DF_SOAG4', 'DF_SVOC', 'SO2_CLXF', 'SVOC_CLXF',
- 'SFISOP', 'SFMTERP', 'SFCH3OH', 'SFCH3COCH3', 'SFCO', 'SFIVOC', 'SFSVOC', 'DO3CHM', 'DCOCHM',
- 'O3_CHMP', 'O3_CHML', 'CH4_CHML', 'CO_CHMP', 'CO_CHML', 'CH3CCL3_CHML', 'SO2_CHML', 'SO2_CHMP', 'SO2_CLXF',
- 'SOAG0_CHMP', 'SOAG1_CHMP', 'SOAG2_CHMP', 'SOAG3_CHMP', 'SOAG4_CHMP',
- 'r_HO2_O3', 'r_OH_O3', 'r_OH_O', 'r_O1D_H2O', 'r_het1', 'r_het2', 'r_het3', 'r_het4', 'r_het5', 'r_het6',
- 'jo3_a', 'jno2', 'jpan', 'jh2o2', 'jcl2o2', 'bc_a1', 'bc_a4', 'dst_a1', 'dst_a2',
- 'dst_a3', 'ncl_a1', 'ncl_a1', 'ncl_a2', 'ncl_a3', 'pom_a1', 'pom_a4', 'so4_a1', 'so4_a2',
- 'so4_a3', 'soa1_a1', 'soa2_a1', 'soa3_a1', 'soa4_a1', 'soa5_a1', 'soa1_a2', 'soa2_a2', 'soa3_a2',
- 'soa4_a2', 'soa5_a2', 'bc_c1', 'bc_c4', 'dst_c1', 'dst_c2', 'dst_c3', 'ncl_c1', 'ncl_c1',
- 'ncl_c2', 'ncl_c3', 'pom_c1', 'pom_c4', 'so4_c1', 'so4_c2', 'so4_c3', 'soa1_c1', 'soa2_c1',
- 'soa3_c1', 'soa4_c1', 'soa5_c1', 'soa1_c2', 'soa2_c2', 'soa3_c2', 'soa4_c2', 'soa5_c2',
- 'num_a1','num_a2','num_a3','num_a4','num_c1','num_c2','num_c3','num_c4',
- 'bc_a1SFWET', 'bc_a4SFWET', 'dst_a1SFWET', 'dst_a2SFWET', 'dst_a3SFWET', 'ncl_a1SFWET', 'ncl_a2SFWET', 'ncl_a3SFWET', 'pom_a1SFWET', 'pom_a4SFWET',
- 'so4_a1SFWET', 'so4_a2SFWET', 'so4_a3SFWET', 'soa1_a1SFWET', 'soa1_a2SFWET', 'soa2_a1SFWET', 'soa2_a2SFWET', 'soa3_a1SFWET', 'soa3_a2SFWET',
- 'soa4_a1SFWET', 'soa4_a2SFWET', 'soa5_a1SFWET', 'soa5_a2SFWET', 'bc_c1SFWET', 'bc_c4SFWET', 'dst_c1SFWET', 'dst_c2SFWET', 'dst_c3SFWET',
- 'ncl_c1SFWET', 'ncl_c2SFWET', 'ncl_c3SFWET', 'pom_c1SFWET', 'pom_c4SFWET', 'so4_c1SFWET', 'so4_c2SFWET', 'so4_c3SFWET', 'soa1_c1SFWET',
- 'soa1_c2SFWET', 'soa2_c1SFWET', 'soa2_c2SFWET', 'soa3_c1SFWET', 'soa3_c2SFWET', 'soa4_c1SFWET', 'soa4_c2SFWET', 'soa5_c1SFWET', 'soa5_c2SFWET',
- 'bc_a1DDF', 'bc_a4DDF', 'dst_a1DDF', 'dst_a2DDF', 'dst_a3DDF', 'ncl_a1DDF', 'ncl_a2DDF', 'ncl_a3DDF', 'pom_a1DDF',
- 'pom_a4DDF', 'so4_a1DDF', 'so4_a2DDF', 'so4_a3DDF', 'soa1_a1DDF', 'soa1_a2DDF', 'soa2_a1DDF', 'soa2_a2DDF', 'soa3_a1DDF',
- 'soa3_a2DDF', 'soa4_a1DDF', 'soa4_a2DDF', 'soa5_a1DDF', 'soa5_a2DDF', 'bc_c1DDF', 'bc_c4DDF', 'dst_c1DDF', 'dst_c2DDF',
- 'dst_c3DDF', 'ncl_c1DDF', 'ncl_c2DDF', 'ncl_c3DDF', 'pom_c1DDF', 'pom_c4DDF', 'so4_c1DDF', 'so4_c2DDF', 'so4_c3DDF',
- 'soa1_c1DDF', 'soa1_c2DDF', 'soa2_c1DDF', 'soa2_c2DDF', 'soa3_c1DDF', 'soa3_c2DDF', 'soa4_c1DDF', 'soa4_c2DDF', 'soa5_c1DDF',
- 'soa5_c2DDF', 'num_a1DDF', 'num_a2DDF', 'num_a3DDF', 'num_a4DDF', 'num_c1DDF', 'num_c2DDF', 'num_c3DDF', 'num_c4DDF',
- 'bc_a4_CLXF', 'pom_a4_CLXF', 'so4_a1_CLXF', 'so4_a2_CLXF', 'num_a1_CLXF', 'num_a2_CLXF', 'SFbc_a4', 'SFpom_a4', 'SFso4_a1',
- 'SFso4_a2', 'SFnum_a1', 'SFnum_a2', 'SFnum_a3', 'so4_a1_sfgaex1', 'so4_a2_sfgaex1', 'so4_a3_sfgaex1', 'soa1_a1_sfgaex1', 'soa1_a2_sfgaex1',
- 'soa2_a1_sfgaex1', 'soa2_a2_sfgaex1', 'soa3_a1_sfgaex1', 'soa3_a2_sfgaex1', 'soa4_a1_sfgaex1', 'soa4_a2_sfgaex1', 'soa5_a1_sfgaex1', 'soa5_a2_sfgaex1', 'so4_a2_sfnnuc1',
- 'so4_c1AQH2SO4', 'so4_c2AQH2SO4', 'so4_c3AQH2SO4', 'so4_c1AQSO4', 'so4_c2AQSO4', 'so4_c3AQSO4', 'SFdst_a1', 'SFdst_a2', 'SFdst_a3',
- 'SFncl_a1', 'SFncl_a2', 'SFncl_a3', 'soa1_a1_CHML', 'soa2_a1_CHML', 'soa3_a1_CHML', 'soa4_a1_CHML', 'soa5_a1_CHML', 'soa1_a2_CHML',
- 'soa2_a2_CHML', 'soa3_a2_CHML', 'soa4_a2_CHML', 'soa5_a2_CHML', 'so4_a1_CHMP', 'so4_a2_CHMP', 'so4_a3_CHMP', 'soa1_a1_CHMP', 'soa2_a1_CHMP',
- 'soa3_a1_CHMP', 'soa4_a1_CHMP', 'soa5_a1_CHMP', 'soa1_a2_CHMP', 'soa2_a2_CHMP', 'soa3_a2_CHMP', 'soa4_a2_CHMP', 'soa5_a2_CHMP', 'r_jsoa1_a1',
- 'r_jsoa2_a1', 'r_jsoa3_a1', 'r_jsoa4_a1', 'r_jsoa5_a1', 'r_jsoa1_a2', 'r_jsoa2_a2', 'r_jsoa3_a2', 'r_jsoa4_a2', 'r_jsoa5_a2',
- 'r_GLYOXAL_aer', 'H2SO4_sfnnuc1', 'num_a2_sfnnuc1', 'TMOCS', 'TMSO2', 'TMDMS', 'TMso4_a1', 'TMso4_a2', 'TMso4_a3',
- 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSO4dn', 'BURDENSOAdn', 'BURDENSEASALTdn','BURDENBCdn', 'PM25',
- 'O3_Prod','O3_Loss','O3S_Loss','RO2_NO_sum','O3_alkenes','RO2_NO3_sum','RO2_HO2_sum','RO2_RO2_sum','RCO2_NO2_sum',
- 'OddOx_Ox_Loss','OddOx_HOx_Loss','OddOx_NOx_Loss','OddOx_CLOxBROx_Loss','OddOx_Loss_Tot','OddOx_Prod_Tot',
- 'Ox_Prod','Ox_Loss'
+ 'ACTREL', 'AQ_SO2', 'AREA', 'BROX', 'BROY', 'BRY', 'CLOX', 'CLOY', 'CLY', 'NOX', 'NOY', 'TBRY', 'TCLY', 'CFC11STAR',
+ 'BTTGWSPEC', 'BTTGWSDF', 'BTTGWSKE', 'CONCLD', 'CME', 'CMFDQ', 'CMFMC', 'CMFMC_DP',
+ 'CH3CCL3_CHML', 'CH4_CHML', 'CO2_CHML', 'CO_CHML', 'IVOC_CHML', 'N2O_CHML', 'O3_CHML', 'SO2_CHML',
+ 'CO_CHMP', 'O3_CHMP', 'SO2_CHMP', 'TMDMS', 'TMOCS', 'TMSO2','TMso4_a1', 'TMso4_a2', 'TMso4_a3',
+ 'soa1_a1_CHML', 'soa1_a2_CHML', 'soa2_a1_CHML', 'soa2_a2_CHML', 'soa3_a1_CHML', 'soa3_a2_CHML',
+ 'soa4_a1_CHML', 'soa4_a2_CHML', 'soa5_a1_CHML', 'soa5_a2_CHML', 'SVOC_CHML',
+ 'so4_a1_CHMP','so4_a2_CHMP', 'SOAG0_CHMP', 'SOAG1_CHMP', 'SOAG2_CHMP', 'SOAG3_CHMP', 'SOAG4_CHMP', 'TOTH', 'TOT_CLD_VISTAU',
+ 'TREFHTMN', 'TREFHTMX', 'TROP_P', 'TROP_T', 'TROP_Z', 'TTEND_TOT', 'TTGWORO', 'TTGWSDF', 'TTGWSDFORO', 'TTGWSKE', 'TTGWSKEORO',
+ 'BURDENBCdn', 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSEASALTdn', 'BURDENSO4dn', 'BURDENSOAdn',
+ 'ABSORB', 'AODABSdn', 'AODBCdn', 'AODdnDUST01', 'AODdnDUST02', 'AODdnDUST03', 'AODdn_aitken', 'AODdn_accum', 'AODdn_coarse',
+ 'AODDUST02', 'AODDUST', 'AODNIRstdn', 'AODPOMdn', 'AODSO4dn', 'AODSOAdn', 'AODSSdn', 'AODUVdn', 'AODUVstdn', 'AODVIS',
+ 'AODVISdn', 'AODVISstdn', 'EXTINCTdn', 'EXTINCTNIRdn', 'EXTINCTUVdn', 'EXTxASYMdn', 'FLDSC', 'FLNR', 'FSNR',
+ 'CME', 'CMFDQ', 'CMFMC','CMFMC_DP', 'SOLLD', 'SOLSD', 'SSAVIS', 'SST','TAQ',
+ 'DCOCHM','DH2O2CHM', 'DHNO3CHM', 'DO3CHM', 'Dso4_a1CHM', 'Dso4_a2CHM', 'Dso4_a3CHM',
+ 'FLASHFRQ', 'LNO_COL_PROD', 'LNO_PROD','KVH_CLUBB','MASS', 'PDELDRY', 'NITROP_PD','PM25', 'PRECT', 'PTEQ', 'PTTEND',
+ 'QRLC', 'QRSC', 'QSNOW', 'QRAIN','GS_SO2', 'HNO3_GAS', 'HNO3_NAT', 'HNO3_STS','H2SO4M_C', 'H2SO4_sfnnuc1','HCL_GAS',
+ 'SAD_AERO', 'SAD_ICE', 'SAD_LNAT', 'SAD_SULFC', 'SAD_TROP' 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'REFF_AERO', 'RHREFHT',
+ 'EVAPPREC', 'EVAPQZM', 'EVAPTZM', 'FCTL','FREQZM', 'ZMDQ', 'ZMDT', 'ZMMTT', 'ZMMU','VEL_NAT2',
+ 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'bc_c1DDF', 'bc_c4DDF', 'dst_c1DDF', 'dst_c2DDF', 'dst_c3DDF',
+ 'ncl_c1DDF', 'ncl_c2DDF', 'ncl_c3DDF', 'pom_c1DDF', 'pom_c4DDF', 'num_c1DDF','num_c2DDF','num_c3DDF','num_c4DDF',
+ 'so4_a1_sfgaex1', 'so4_c1AQH2SO4', 'so4_c1AQSO4', 'so4_c1DDF', 'so4_a2_sfgaex1', 'so4_c2AQH2SO4', 'so4_c2AQSO4', 'so4_c2DDF',
+ 'so4_a3_sfgaex1', 'so4_c3AQH2SO4', 'so4_c3AQSO4', 'so4_c3DDF', 'so4_a2_sfnnuc1', 'num_a2_sfnnuc1',
+ 'soa1_a1_sfgaex1','soa1_c1DDF', 'soa1_a2_sfgaex1','soa1_c2DDF', 'soa2_a1_sfgaex1','soa2_c1DDF', 'soa2_a2_sfgaex1','soa2_c2DDF',
+ 'soa3_a1_sfgaex1','soa3_c1DDF', 'soa3_a2_sfgaex1','soa3_c2DDF', 'soa4_a1_sfgaex1','soa4_c1DDF', 'soa4_a2_sfgaex1','soa4_c2DDF',
+ 'soa5_a1_sfgaex1','soa5_c1DDF', 'soa5_a2_sfgaex1','soa5_c2DDF', 'jcl2o2', 'jh2o2', 'jno2', 'jo2_a', 'jo2_b', 'jo3_a', 'jo3_b', 'jpan',
+ 'r_het1', 'r_het2', 'r_het3', 'r_het4', 'r_het5', 'r_het6', 'r_het7', 'r_het8', 'r_het9', 'r_het10', 'r_het11', 'r_het12', 'r_het13',
+ 'r_het15', 'r_het16', 'r_het17', 'r_jsoa1_a1', 'r_jsoa1_a2', 'r_jsoa2_a1', 'r_jsoa2_a2', 'r_jsoa3_a1', 'r_jsoa3_a2', 'r_jsoa4_a1',
+ 'r_jsoa4_a2', 'r_jsoa5_a1', 'r_jsoa5_a2', 'r_GLYOXAL_aer', 'r_HO2_O3', 'r_N2O5_aer', 'r_NO2_aer', 'r_NO3_aer', 'r_O1D_H2O', 'r_OH_O3', 'r_OH_O',
+ 'O3_Prod','O3_Loss','O3S_Loss','RO2_NO_sum','O3_alkenes','RO2_NO3_sum','RO2_HO2_sum','RO2_RO2_sum','RCO2_NO2_sum',
+ 'OddOx_Ox_Loss','OddOx_HOx_Loss','OddOx_NOx_Loss','OddOx_CLOxBROx_Loss','OddOx_Loss_Tot','OddOx_Prod_Tot', 'Ox_Prod','Ox_Loss'
diff --git a/bld/namelist_files/use_cases/sd_geoschem.xml b/bld/namelist_files/use_cases/sd_geoschem.xml
deleted file mode 100644
index 04e5e60e5a..0000000000
--- a/bld/namelist_files/use_cases/sd_geoschem.xml
+++ /dev/null
@@ -1,206 +0,0 @@
-
-
-
-
-
-
-
-
-/glade/p/univ/umit0034/ExtData/CHEM_INPUTS/
-
-/glade/p/univ/umit0034/Shared/GEOS-Chem/f.e20.FCSD.f19_f19_mg17.cesm2.1-exp002.001.cam.i.2005-01-01-00000_c180801.nc
-atm/cam/met/MERRA2/1.9x2.5/fv_1.9x2.5_nc3000_Nsw084_Nrs016_Co120_Fi001_ZR_GRNL_MERRA2_c190617.nc
-
-/glade/p/univ/umit0034/Shared/GEOS-Chem/f.e20.FCSD.f09_f09_mg17.cesm2.1-exp002.001.cam.i.2005-01-01-00000_c180801.nc
-atm/cam/met/MERRA2/0.9x1.25/fv_0.9x1.25_nc3000_Nsw042_Nrs008_Co060_Fi001_ZR_sgh30_24km_GRNL_MERRA2_c171218.nc
-
-/glade/u/home/elundgren/drydep_henrys_law_nc/dep_data_file_geoschem.nc
-
-
-
-
-20150101
-
-50.
-.true.
-
-
-2015/MERRA2_1.9x2.5_20150101.nc
-atm/cam/met/MERRA2/1.9x2.5
-atm/cam/met/MERRA2/1.9x2.5/filenames_list_c20210302
-
-2015/MERRA2_0.9x1.25_20150101.nc
-atm/cam/met/MERRA2/0.9x1.25
-atm/cam/met/MERRA2/0.9x1.25/filenames_1975-2017_c190125.txt
-
-2010/MERRA2_0.5x0.63_20100101.nc
-atm/cam/met/MERRA2/0.5x0.63
-atm/cam/met/MERRA2/0.5x0.63/filenames_list_c180612
-
-
-atm/cam/solar/SolarForcingNRLSSI2_daily_s18820101_e20171231_c191122.nc
-SERIAL
-
-
-.true.
-.true.
-.false.
-0.25D0
-
-
-SERIAL
-atm/waccm/lb/LBC_1750-2014_CMIP6_0p5degLat_c170126.nc
-
-
-
-
-
-
-
-'ACET','ACTA','ALD2','AROMP4','AROMP5','ATOOH','BALD','BENZP','BR2','BRCL','BRNO3','BZCO3H','BZPAN','CH2O','CL2','CLNO2','CLNO3','CLO','CLOO','CSL','EOH','ETHLN','ETHN','ETHP','ETNO3','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPALD1','HPALD2','HPALD3','HPALD4','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDC','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','IPRNO3','ITCN','ITHN','LIMO','LVOC','MACR','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MCT','MENO3','MGLY','MOH','MONITS','MONITU','MPAN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','N2O5','NH3','NO2','NPHEN','NPRNO3','O3','PAN','PHEN','PP','PPN','PROPNN','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2'
-
-
-
-
-'ACTA','ALD2','AROMP4','AROMP5','ATOOH','BALD','BENZP','BR2','BRCL','BZCO3H','BZPAN','CH2O','CSL','EOH','ETHLN','ETHN','ETHP','ETP','GLYC','GLYX','H2O2','HAC','HBR','HC5A','HCL','HCOOH','HI','HMHP','HMML','HNO3','HOBR','HOCL','HOI','HONIT','HPETHNL','I2','I2O2','I2O3','I2O4','IBR','ICHE','ICL','ICN','ICPDH','IDCHP','IDHDP','IDHPE','IDN','IEPOXA','IEPOXB','IEPOXD','IHN1','IHN2','IHN3','IHN4','INPB','INPD','IONO','IONO2','ITCN','ITHN','LIMO','LVOC','LVOCOA','MACR1OOH','MAP','MCRDH','MCRENOL','MCRHN','MCRHNB','MCRHP','MCT','MEK','MGLY','MOH','MONITS','MONITU','MP','MPAN','MPN','MTPA','MTPO','MVK','MVKDH','MVKHC','MVKHCB','MVKHP','MVKN','MVKPC','NH3','NPHEN','PAN','PHEN','PP','PPN','PROPNN','PRPE','PRPN','PYAC','R4N2','R4P','RA3P','RB3P','RIPA','RIPB','RIPC','RIPD','RP','SO2'
-
-
-
-'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2'
-
-
-
-'dst_a1','so4_a1','nh4_a1','pom_a1','pomff1_a1','pombb1_a1','soa_a1','bc_a1','ncl_a1','num_a1','so4_a2','nh4_a2','soa_a2','ncl_a2','dst_a2','num_a2','dst_a3','ncl_a3','so4_a3','pom_a3','bc_a3','num_a3','ncl_a4','so4_a4','pom_a4','pomff1_a4','pombb1_a4','bc_a4','nh4_a4','num_a4','dst_a5','so4_a5','nh4_a5','num_a5','ncl_a6','so4_a6','nh4_a6','num_a6','dst_a7','so4_a7','nh4_a7','num_a7','soa1_a1','soa1_a2','soa2_a1','soa2_a2','soa3_a1','soa3_a2','soa4_a1','soa4_a2','soa5_a1','soa5_a2','soaff1_a1','soaff2_a1','soaff3_a1','soaff4_a1','soaff5_a1','soabb1_a1','soabb2_a1','soabb3_a1','soabb4_a1','soabb5_a1','soabg1_a1','soabg2_a1','soabg3_a1','soabg4_a1','soabg5_a1','soaff1_a2','soaff2_a2','soaff3_a2','soaff4_a2','soaff5_a2','soabb1_a2','soabb2_a2','soabb3_a2','soabb4_a2','soabb5_a2','soabg1_a2','soabg2_a2','soabg3_a2','soabg4_a2','soabg5_a2'
-
-
-
-
- 1,30,365,240,240,480,365,73,30
- 0,-24,-24,-3,-1,1,-24,-120,-240
-'A','A','A','A','A','A','A','A','I'
-
-.true.
-.false.
-.false.
-.false.
-.false.
-.false.
-.false.
-.false.
-.false.
-
-
-'AREA',
-'HEIGHT',
-'T',
-'U',
-'V',
-'Q',
-'PS',
-'CLOUD',
-'TROPP_P',
-'TROPP_T',
-'TROPP_Z',
-'DF_CO',
-'DF_O3',
-'DF_NO2',
-'DF_SO4',
-'DF_NIT',
-'CT_O3',
-'CT_OH',
-'OHwgtByAirMassColumnFull',
-'Chem_SO3AQ',
-'Jval_Cl2O2',
-'Jval_H2O2',
-'Jval_NO2',
-'Jval_PAN',
-'JvalO3O3P',
-'JvalO3O1D',
-'LNO_COL_PROD',
-'Prod_Ox',
-'Prod_SO4',
-'Prod_CO',
-'Prod_H2O2',
-'ProdCOfromCH4',
-'ProdCOfromNMVOC',
-'Loss_Ox',
-'Loss_CH4',
-'Loss_CO',
-'LossOHbyCH4columnTrop',
-'LossOHbyMCFcolumnTrop',
-'LossHNO3onSeaSalt',
-'ACET',
-'ALD2',
-'ALK4',
-'BR',
-'BRCL',
-'BRNO3',
-'BRO',
-'BROX',
-'BROY',
-'C3H8',
-'CH2O',
-'CH3CL',
-'CH4',
-'CL',
-'CLNO3',
-'CLO',
-'CLOX',
-'CLOY',
-'CO',
-'DMS',
-'EOH',
-'H2O',
-'H2O2',
-'H2SO4',
-'HO2',
-'HOX',
-'HBR',
-'HCL',
-'HOBR',
-'HOCL',
-'HNO3',
-'HNO4',
-'ISOP',
-'MACR',
-'MAP',
-'MEK',
-'MOH',
-'MVK',
-'N2O',
-'N2O5',
-'NHX',
-'NIT',
-'NO',
-'NO2',
-'NO3',
-'NOX',
-'NOY',
-'O3',
-'OH',
-'PAN',
-'PM25',
-'RCHO',
-'SALA',
-'SALC',
-'SO2',
-'SO4',
-'SOX',
-'TOLU',
-'bc_a1',
-'bc_a4',
-'dst_a1',
-'dst_a2',
-'dst_a3',
-'num_a1',
-'num_a2',
-'num_a3',
-'num_a4',
-'pom_a1',
-'pom_a4',
-'so4_a1',
-'so4_a2',
-'so4_a3',
-
-
-
diff --git a/bld/namelist_files/use_cases/sd_trop_strat2_cam6.xml b/bld/namelist_files/use_cases/sd_trop_strat2_cam6.xml
index 8ef3f6903d..4075ad584c 100644
--- a/bld/namelist_files/use_cases/sd_trop_strat2_cam6.xml
+++ b/bld/namelist_files/use_cases/sd_trop_strat2_cam6.xml
@@ -51,7 +51,7 @@
- 'CFC11STAR', 'AODDUST', 'AODDUST2', 'T', 'U', 'V', 'O3', 'OH',
+ 'CFC11STAR', 'AODDUST', 'AODDUST02', 'T', 'U', 'V', 'O3', 'OH',
'NO3', 'HO2', 'LNO_COL_PROD', 'NO2_CLXF', 'SFNO', 'SFNH3', 'BRO', 'CH3CL',
'CLO', 'CO2', 'HCL', 'HO2', 'HOCL', 'H2O', 'PHIS', 'Z3',
'BENZENE', 'C2H2', 'C2H4', 'C2H6', 'C3H8', 'CCL4', 'CFC11', 'CFC113',
@@ -85,8 +85,8 @@
'REFF_AERO', 'PDELDRY', 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'H2SO4M_C', 'HNO3_GAS', 'HNO3_STS',
'HNO3_NAT', 'VEL_NAT2', 'NITROP_PD', 'NOX', 'NOY', 'CLOX', 'CLOY', 'BROX',
'BROY', 'TCLY', 'TOTH', 'MASS', 'TBRY', 'HCL_GAS', 'wet_deposition_NHx_as_N', 'wet_deposition_NOy_as_N',
- 'HCL_GAS', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'ABSORB', 'AODVISdn', 'AODdnMODE1', 'AODVISstdn',
- 'AODNIRstdn', 'AODUVstdn', 'AODdnMODE2', 'AODdnMODE3', 'AODdnDUST1', 'AODdnDUST2', 'AODdnDUST3', 'AODVISstdn',
+ 'HCL_GAS', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'ABSORB', 'AODVISdn', 'AODdn_aitken', 'AODVISstdn',
+ 'AODNIRstdn', 'AODUVstdn', 'AODdn_accum', 'AODdn_coarse', 'AODdnDUST01', 'AODdnDUST02', 'AODdnDUST03', 'AODVISstdn',
'AODUVstdn', 'AODNIRstdn', 'AODNIRstdn', 'AODVISdn', 'AODUVdn', 'EXTINCTdn', 'EXTxASYMdn', 'EXTINCTNIRdn',
'EXTINCTUVdn', 'WD_ALKNIT', 'WD_ALKOOH', 'WD_BENZOOH', 'WD_BRONO2', 'WD_BZOOH', 'WD_C2H5OH', 'WD_C2H5OOH',
'WD_C3H7OOH', 'WD_C6H5OOH', 'WD_CH2O', 'WD_CH3CHO', 'WD_CH3CN', 'WD_CH3COCHO', 'WD_CH3COOH', 'WD_CH3COOOH',
diff --git a/bld/namelist_files/use_cases/sd_trop_strat_vbs_cam6.xml b/bld/namelist_files/use_cases/sd_trop_strat_vbs_cam6.xml
index 10cf37265a..2fe99cb0eb 100644
--- a/bld/namelist_files/use_cases/sd_trop_strat_vbs_cam6.xml
+++ b/bld/namelist_files/use_cases/sd_trop_strat_vbs_cam6.xml
@@ -52,113 +52,45 @@
.true.
.false.
.false.
-.false.
+.true.
.false.
.false.
.false.
.false.
.false.
-
+
- 'CFC11STAR', 'AODDUST', 'AODDUST2', 'T', 'U', 'V', 'O3', 'OH', 'NO3', 'HO2',
- 'LNO_COL_PROD', 'NO2_CLXF', 'SFNO', 'SFNH3', 'BRO',
- 'CH3CL', 'CLO', 'CO2', 'HCL', 'HO2', 'HOCL', 'H2O', 'PHIS', 'Z3',
- 'BENZENE', 'C2H2', 'C2H4', 'C2H6', 'C3H8', 'CCL4', 'CFC11', 'CFC113', 'CFC12',
- 'CH2O', 'CH3BR', 'CH3CCL3', 'CH3CHO', 'CH3CL', 'CH3CN', 'CH3COCH3', 'CH3OH', 'CH4',
- 'CO', 'H2O2', 'HCFC22', 'HCN', 'HNO3', 'ISOP', 'MTERP', 'N2O', 'O3', 'O3S',
- 'PAN', 'SO2', 'TOLUENE', 'OH', 'ALKNIT', 'ALKOOH', 'BCARY', 'BENZENE', 'BENZOOH',
- 'BEPOMUC', 'BIGALD', 'BIGALD1', 'BIGALD2', 'BIGALD3', 'BIGALD4', 'BIGALK', 'BIGENE', 'BR',
- 'BRCL', 'BRO', 'BRONO2', 'BRY', 'BZALD', 'BZOOH', 'C2H2', 'C2H4', 'C2H5OH',
- 'C2H5OOH', 'C2H6', 'C3H6', 'C3H7OOH', 'C3H8', 'C6H5OOH', 'CCL4', 'CF2CLBR', 'CF3BR',
- 'CFC11', 'CFC113', 'CFC114', 'CFC115', 'CFC12', 'CH2BR2', 'CH2O', 'CH3BR', 'CH3CCL3',
- 'CH3CHO', 'CH3CL', 'CH3CN', 'CH3COCH3', 'CH3COCHO', 'CH3COOH', 'CH3COOOH', 'CH3OH', 'CH3OOH',
- 'CH4', 'CHBR3', 'CL', 'CL2', 'CL2O2', 'CLO', 'CLONO2', 'CLY', 'CO',
- 'CO2', 'COF2', 'COFCL', 'CRESOL', 'DMS', 'EOOH', 'F', 'GLYALD', 'GLYOXAL',
- 'H', 'H2', 'H2402', 'H2O2', 'H2SO4', 'HBR', 'HCFC141B', 'HCFC142B', 'HCFC22',
- 'HCL', 'HCN', 'HCOOH', 'HF', 'HNO3', 'HO2NO2', 'HOBR', 'HOCL', 'HONITR',
- 'HPALD', 'HYAC', 'HYDRALD', 'IEPOX', 'ISOP', 'ISOPNITA', 'ISOPNITB', 'ISOPNO3', 'ISOPNOOH',
- 'ISOPOOH', 'IVOC', 'MACR', 'MACROOH', 'MEK', 'MEKOOH', 'MPAN', 'MTERP', 'MVK',
- 'N', 'N2O', 'N2O5', 'NC4CH2OH', 'NC4CHO', 'NH3', 'NH4', 'NO',
- 'NO2', 'NO3', 'NOA', 'NTERPOOH', 'O', 'OCLO',
- 'OCS', 'ONITR', 'PAN', 'PBZNIT', 'PHENO', 'PHENOL', 'PHENOOH', 'POOH', 'ROOH',
- 'S', 'SF6', 'SO', 'SO2', 'SO3', 'SOAG0', 'SOAG1', 'SOAG2', 'SOAG3',
- 'SOAG4', 'SVOC', 'TEPOMUC', 'TERP2OOH', 'TERPNIT', 'TERPOOH', 'TERPROD1', 'TERPROD2', 'TOLOOH',
- 'TOLUENE', 'XOOH', 'XYLENES', 'XYLENOOH', 'XYLOL', 'XYLOLOOH', 'NHDEP', 'NDEP', 'ACBZO2',
- 'ALKO2', 'BENZO2', 'BZOO', 'C2H5O2', 'C3H7O2', 'C6H5O2', 'CH3CO3', 'CH3O2', 'DICARBO2',
- 'ENEO2', 'EO', 'EO2', 'HO2', 'HOCH2OO', 'ISOPAO2', 'ISOPBO2', 'MACRO2',
- 'MALO2', 'MCO3', 'MDIALO2', 'MEKO2', 'NTERPO2',
- 'O1D', 'OH', 'PHENO2', 'PO2', 'RO2',
- 'TERP2O2', 'TERPO2', 'TOLO2', 'XO2', 'XYLENO2', 'XYLOLO2', 'H2O', 'SAD_ICE', 'SAD_LNAT',
- 'SAD_SULFC', 'SAD_TROP', 'SAD_AERO', 'REFF_AERO', 'PDELDRY', 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'H2SO4M_C',
- 'HNO3_GAS', 'HNO3_STS', 'HNO3_NAT', 'VEL_NAT2', 'NITROP_PD', 'NOX', 'NOY', 'CLOX', 'CLOY',
- 'BROX', 'BROY', 'TCLY', 'TOTH', 'MASS', 'TBRY', 'HCL_GAS', 'wet_deposition_NHx_as_N', 'wet_deposition_NOy_as_N',
- 'HCL_GAS', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'ABSORB', 'AODVISdn', 'AODdnMODE1', 'AODVISstdn', 'AODNIRstdn',
- 'AODUVstdn', 'AODdnMODE2', 'AODdnMODE3', 'AODdnDUST1', 'AODdnDUST2', 'AODdnDUST3', 'AODVISstdn', 'AODUVstdn', 'AODNIRstdn',
- 'AODNIRstdn', 'AODVISdn', 'AODUVdn', 'EXTINCTdn', 'EXTxASYMdn', 'EXTINCTNIRdn', 'EXTINCTUVdn', 'WD_ALKNIT', 'WD_ALKOOH',
- 'WD_BENZOOH', 'WD_BRONO2', 'WD_BZOOH', 'WD_C2H5OH', 'WD_C2H5OOH', 'WD_C3H7OOH', 'WD_C6H5OOH', 'WD_CH2O', 'WD_CH3CHO',
- 'WD_CH3CN', 'WD_CH3COCHO', 'WD_CH3COOH', 'WD_CH3COOOH', 'WD_CH3COCH3', 'WD_CH3OH', 'WD_CH3OOH', 'WD_CLONO2', 'WD_COF2', 'WD_COFCL',
- 'WD_EOOH', 'WD_GLYALD', 'WD_H2O2', 'WD_H2SO4', 'WD_HBR', 'WD_HCL', 'WD_HCN', 'WD_HCOOH', 'WD_HF',
- 'WD_HNO3', 'WD_HO2NO2', 'WD_HOBR', 'WD_HOCL', 'WD_HONITR', 'WD_HPALD', 'WD_HYAC', 'WD_HYDRALD', 'WD_IEPOX',
- 'WD_ISOPNITA', 'WD_ISOPNITB', 'WD_ISOPNO3', 'WD_ISOPNOOH', 'WD_ISOPOOH', 'WD_IVOC', 'WD_MACR', 'WD_MACROOH', 'WD_MEKOOH',
- 'WD_MVK', 'WD_NC4CH2OH', 'WD_NC4CHO', 'WD_NDEP', 'WD_NH3', 'WD_NH4', 'WD_NHDEP', 'WD_NOA',
- 'WD_NTERPOOH', 'WD_ONITR', 'WD_PHENOOH', 'WD_POOH', 'WD_ROOH', 'WD_SO2', 'WD_SOAG0', 'WD_SOAG1', 'WD_SOAG2',
- 'WD_SOAG3', 'WD_SOAG4', 'WD_SVOC', 'WD_TERP2OOH', 'WD_TERPNIT', 'WD_TERPOOH', 'WD_TERPROD1', 'WD_TERPROD2', 'WD_TOLOOH',
- 'WD_XOOH', 'WD_XYLENOOH', 'WD_XYLOLOOH', 'DF_ALKNIT', 'DF_ALKOOH', 'DF_BENZOOH', 'DF_BZOOH', 'DF_C2H5OH', 'DF_C2H5OOH',
- 'DF_C3H7OOH', 'DF_C6H5OOH', 'DF_CH2O', 'DF_CH3CHO', 'DF_CH3CN', 'DF_CH3COCH3', 'DF_CH3COCHO', 'DF_CH3COOH', 'DF_CH3COOOH',
- 'DF_CH3OH', 'DF_CH3OOH', 'DF_CO', 'DF_EOOH', 'DF_GLYALD', 'DF_H2O2', 'DF_H2SO4', 'DF_HCN', 'DF_HCOOH',
- 'DF_HNO3', 'DF_HO2NO2', 'DF_HONITR', 'DF_HPALD', 'DF_HYAC', 'DF_HYDRALD', 'DF_IEPOX', 'DF_ISOPNITA', 'DF_ISOPNITB',
- 'DF_ISOPNO3', 'DF_ISOPNOOH', 'DF_ISOPOOH', 'DF_IVOC', 'DF_MACROOH', 'DF_MEKOOH', 'DF_MPAN', 'DF_NC4CH2OH', 'DF_NC4CHO',
- 'dry_deposition_NHx_as_N', 'DF_NH3', 'DF_NH4', 'DF_NO', 'DF_NO2', 'DF_NOA', 'DF_NTERPOOH', 'DF_O3', 'DF_ONITR',
- 'DF_PAN', 'DF_PHENOOH', 'DF_POOH', 'DF_ROOH', 'DF_SO2', 'DF_SOAG0', 'DF_SOAG1', 'DF_SOAG2', 'DF_SOAG3',
- 'DF_SOAG4', 'DF_SVOC', 'DF_TERP2OOH', 'DF_TERPNIT', 'DF_TERPOOH', 'DF_TERPROD1', 'DF_TERPROD2', 'DF_TOLOOH', 'DF_XOOH',
- 'DF_XYLENOOH', 'DF_XYLOLOOH', 'dry_deposition_NOy_as_N', 'SO2_CLXF', 'SO2_XFRC', 'SVOC_CLXF', 'CO_CLXF', 'NO2_CLXF', 'LNO_PROD',
- 'LNO_COL_PROD', 'SFISOP', 'SFMTERP', 'SFBCARY', 'SFCH3OH', 'SFC2H5OH', 'SFCH3CHO', 'SFMEK', 'SFHCN',
- 'SFCH3CN', 'SFCH2O', 'SFC2H6', 'SFC3H8', 'SFC2H4', 'SFC3H6', 'SFCH3COCH3', 'SFBIGALK', 'SFBIGENE',
- 'SFBENZENE', 'SFTOLUENE', 'SFXYLENES', 'SFCO', 'SFNO', 'SFC2H2', 'SFHCOOH', 'SFCH3COOH', 'SFCH3COCH3',
- 'SFDMS', 'SFMEK', 'SFSO2', 'SFNH3', 'SFIVOC', 'SFSVOC', 'MEG_ISOP', 'MEG_MTERP', 'MEG_BCARY',
- 'MEG_CH3OH', 'MEG_C2H5OH', 'MEG_CH2O', 'MEG_CH3CHO', 'MEG_CH3COOH', 'MEG_CH3COCH3', 'MEG_HCOOH', 'MEG_HCN', 'MEG_CO',
- 'MEG_C2H6', 'MEG_C2H4', 'MEG_C3H8', 'MEG_C3H6', 'MEG_BIGALK', 'MEG_BIGENE', 'MEG_TOLUENE', 'Dso4_a1CHM', 'Dso4_a2CHM',
- 'Dso4_a3CHM', 'DO3CHM', 'DCOCHM', 'DHNO3CHM', 'DH2O2CHM', 'CH4_CHML', 'CO_CHMP', 'CO_CHML', 'CH3CCL3_CHML',
- 'CO2_CHML', 'AQ_SO2', 'GS_SO2', 'SO2_CHML', 'SO2_CHMP', 'SO2_CLXF', 'SOAG0_CHMP', 'SOAG1_CHMP', 'SOAG2_CHMP',
- 'SOAG3_CHMP', 'SOAG4_CHMP', 'IVOC_CHMP', 'SVOC_CHML', 'MASS', 'ABSORB', 'WD_H2SO4', 'WD_IVOC', 'WD_SO2',
- 'WD_SOAG0', 'WD_SOAG1', 'WD_SOAG2', 'WD_SOAG3', 'WD_SOAG4', 'WD_SVOC', 'DF_CO', 'DF_IVOC', 'DF_O3',
- 'DF_SO2', 'DF_SOAG0', 'DF_SOAG1', 'DF_SOAG2', 'DF_SOAG3', 'DF_SOAG4', 'DF_SVOC', 'SO2_CLXF', 'SVOC_CLXF',
- 'SFISOP', 'SFMTERP', 'SFCH3OH', 'SFCH3COCH3', 'SFCO', 'SFIVOC', 'SFSVOC', 'DO3CHM', 'DCOCHM',
- 'O3_CHMP', 'O3_CHML', 'CH4_CHML', 'CO_CHMP', 'CO_CHML', 'CH3CCL3_CHML', 'SO2_CHML', 'SO2_CHMP', 'SO2_CLXF',
- 'SOAG0_CHMP', 'SOAG1_CHMP', 'SOAG2_CHMP', 'SOAG3_CHMP', 'SOAG4_CHMP',
- 'r_HO2_O3', 'r_OH_O3', 'r_OH_O', 'r_O1D_H2O', 'r_het1', 'r_het2', 'r_het3', 'r_het4', 'r_het5', 'r_het6',
- 'jo3_a', 'jno2', 'jpan', 'jh2o2', 'jcl2o2', 'bc_a1', 'bc_a4', 'dst_a1', 'dst_a2',
- 'dst_a3', 'ncl_a1', 'ncl_a1', 'ncl_a2', 'ncl_a3', 'pom_a1', 'pom_a4', 'so4_a1', 'so4_a2',
- 'so4_a3', 'soa1_a1', 'soa2_a1', 'soa3_a1', 'soa4_a1', 'soa5_a1', 'soa1_a2', 'soa2_a2', 'soa3_a2',
- 'soa4_a2', 'soa5_a2', 'bc_c1', 'bc_c4', 'dst_c1', 'dst_c2', 'dst_c3', 'ncl_c1', 'ncl_c1',
- 'ncl_c2', 'ncl_c3', 'pom_c1', 'pom_c4', 'so4_c1', 'so4_c2', 'so4_c3', 'soa1_c1', 'soa2_c1',
- 'soa3_c1', 'soa4_c1', 'soa5_c1', 'soa1_c2', 'soa2_c2', 'soa3_c2', 'soa4_c2', 'soa5_c2',
- 'num_a1','num_a2','num_a3','num_a4','num_c1','num_c2','num_c3','num_c4',
- 'bc_a1SFWET', 'bc_a4SFWET', 'dst_a1SFWET', 'dst_a2SFWET', 'dst_a3SFWET', 'ncl_a1SFWET', 'ncl_a2SFWET', 'ncl_a3SFWET', 'pom_a1SFWET', 'pom_a4SFWET',
- 'so4_a1SFWET', 'so4_a2SFWET', 'so4_a3SFWET', 'soa1_a1SFWET', 'soa1_a2SFWET', 'soa2_a1SFWET', 'soa2_a2SFWET', 'soa3_a1SFWET', 'soa3_a2SFWET',
- 'soa4_a1SFWET', 'soa4_a2SFWET', 'soa5_a1SFWET', 'soa5_a2SFWET', 'bc_c1SFWET', 'bc_c4SFWET', 'dst_c1SFWET', 'dst_c2SFWET', 'dst_c3SFWET',
- 'ncl_c1SFWET', 'ncl_c2SFWET', 'ncl_c3SFWET', 'pom_c1SFWET', 'pom_c4SFWET', 'so4_c1SFWET', 'so4_c2SFWET', 'so4_c3SFWET', 'soa1_c1SFWET',
- 'soa1_c2SFWET', 'soa2_c1SFWET', 'soa2_c2SFWET', 'soa3_c1SFWET', 'soa3_c2SFWET', 'soa4_c1SFWET', 'soa4_c2SFWET', 'soa5_c1SFWET', 'soa5_c2SFWET',
- 'bc_a1DDF', 'bc_a4DDF', 'dst_a1DDF', 'dst_a2DDF', 'dst_a3DDF', 'ncl_a1DDF', 'ncl_a2DDF', 'ncl_a3DDF', 'pom_a1DDF',
- 'pom_a4DDF', 'so4_a1DDF', 'so4_a2DDF', 'so4_a3DDF', 'soa1_a1DDF', 'soa1_a2DDF', 'soa2_a1DDF', 'soa2_a2DDF', 'soa3_a1DDF',
- 'soa3_a2DDF', 'soa4_a1DDF', 'soa4_a2DDF', 'soa5_a1DDF', 'soa5_a2DDF', 'bc_c1DDF', 'bc_c4DDF', 'dst_c1DDF', 'dst_c2DDF',
- 'dst_c3DDF', 'ncl_c1DDF', 'ncl_c2DDF', 'ncl_c3DDF', 'pom_c1DDF', 'pom_c4DDF', 'so4_c1DDF', 'so4_c2DDF', 'so4_c3DDF',
- 'soa1_c1DDF', 'soa1_c2DDF', 'soa2_c1DDF', 'soa2_c2DDF', 'soa3_c1DDF', 'soa3_c2DDF', 'soa4_c1DDF', 'soa4_c2DDF', 'soa5_c1DDF',
- 'soa5_c2DDF', 'num_a1DDF', 'num_a2DDF', 'num_a3DDF', 'num_a4DDF', 'num_c1DDF', 'num_c2DDF', 'num_c3DDF', 'num_c4DDF',
- 'bc_a4_CLXF', 'pom_a4_CLXF', 'so4_a1_CLXF', 'so4_a2_CLXF', 'num_a1_CLXF', 'num_a2_CLXF', 'SFbc_a4', 'SFpom_a4', 'SFso4_a1',
- 'SFso4_a2', 'SFnum_a1', 'SFnum_a2', 'SFnum_a3', 'so4_a1_sfgaex1', 'so4_a2_sfgaex1', 'so4_a3_sfgaex1', 'soa1_a1_sfgaex1', 'soa1_a2_sfgaex1',
- 'soa2_a1_sfgaex1', 'soa2_a2_sfgaex1', 'soa3_a1_sfgaex1', 'soa3_a2_sfgaex1', 'soa4_a1_sfgaex1', 'soa4_a2_sfgaex1', 'soa5_a1_sfgaex1', 'soa5_a2_sfgaex1', 'so4_a2_sfnnuc1',
- 'so4_c1AQH2SO4', 'so4_c2AQH2SO4', 'so4_c3AQH2SO4', 'so4_c1AQSO4', 'so4_c2AQSO4', 'so4_c3AQSO4', 'SFdst_a1', 'SFdst_a2', 'SFdst_a3',
- 'SFncl_a1', 'SFncl_a2', 'SFncl_a3', 'soa1_a1_CHML', 'soa2_a1_CHML', 'soa3_a1_CHML', 'soa4_a1_CHML', 'soa5_a1_CHML', 'soa1_a2_CHML',
- 'soa2_a2_CHML', 'soa3_a2_CHML', 'soa4_a2_CHML', 'soa5_a2_CHML', 'so4_a1_CHMP', 'so4_a2_CHMP', 'so4_a3_CHMP', 'soa1_a1_CHMP', 'soa2_a1_CHMP',
- 'soa3_a1_CHMP', 'soa4_a1_CHMP', 'soa5_a1_CHMP', 'soa1_a2_CHMP', 'soa2_a2_CHMP', 'soa3_a2_CHMP', 'soa4_a2_CHMP', 'soa5_a2_CHMP', 'r_jsoa1_a1',
- 'r_jsoa2_a1', 'r_jsoa3_a1', 'r_jsoa4_a1', 'r_jsoa5_a1', 'r_jsoa1_a2', 'r_jsoa2_a2', 'r_jsoa3_a2', 'r_jsoa4_a2', 'r_jsoa5_a2',
- 'r_GLYOXAL_aer', 'H2SO4_sfnnuc1', 'num_a2_sfnnuc1', 'TMOCS', 'TMSO2', 'TMDMS', 'TMso4_a1', 'TMso4_a2', 'TMso4_a3',
- 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSO4dn', 'BURDENSOAdn', 'BURDENSEASALTdn','BURDENBCdn', 'PM25',
- 'O3_Prod','O3_Loss','O3S_Loss','RO2_NO_sum','O3_alkenes','RO2_NO3_sum','RO2_HO2_sum','RO2_RO2_sum','RCO2_NO2_sum',
- 'OddOx_Ox_Loss','OddOx_HOx_Loss','OddOx_NOx_Loss','OddOx_CLOxBROx_Loss','OddOx_Loss_Tot','OddOx_Prod_Tot',
- 'Ox_Prod','Ox_Loss'
+ 'ACTREL', 'AQ_SO2', 'AREA', 'BROX', 'BROY', 'BRY', 'CLOX', 'CLOY', 'CLY', 'NOX', 'NOY', 'TBRY', 'TCLY', 'CFC11STAR',
+ 'BTTGWSPEC', 'BTTGWSDF', 'BTTGWSKE', 'CONCLD', 'CME', 'CMFDQ', 'CMFMC', 'CMFMC_DP',
+ 'CH3CCL3_CHML', 'CH4_CHML', 'CO2_CHML', 'CO_CHML', 'IVOC_CHML', 'N2O_CHML', 'O3_CHML', 'SO2_CHML',
+ 'CO_CHMP', 'O3_CHMP', 'SO2_CHMP', 'TMDMS', 'TMOCS', 'TMSO2','TMso4_a1', 'TMso4_a2', 'TMso4_a3',
+ 'soa1_a1_CHML', 'soa1_a2_CHML', 'soa2_a1_CHML', 'soa2_a2_CHML', 'soa3_a1_CHML', 'soa3_a2_CHML',
+ 'soa4_a1_CHML', 'soa4_a2_CHML', 'soa5_a1_CHML', 'soa5_a2_CHML', 'SVOC_CHML',
+ 'so4_a1_CHMP','so4_a2_CHMP', 'SOAG0_CHMP', 'SOAG1_CHMP', 'SOAG2_CHMP', 'SOAG3_CHMP', 'SOAG4_CHMP', 'TOTH', 'TOT_CLD_VISTAU',
+ 'TREFHTMN', 'TREFHTMX', 'TROP_P', 'TROP_T', 'TROP_Z', 'TTEND_TOT', 'TTGWORO', 'TTGWSDF', 'TTGWSDFORO', 'TTGWSKE', 'TTGWSKEORO',
+ 'BURDENBCdn', 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSEASALTdn', 'BURDENSO4dn', 'BURDENSOAdn',
+ 'ABSORB', 'AODABSdn', 'AODBCdn', 'AODdnDUST01', 'AODdnDUST02', 'AODdnDUST03', 'AODdn_aitken', 'AODdn_accum', 'AODdn_coarse',
+ 'AODDUST02', 'AODDUST', 'AODNIRstdn', 'AODPOMdn', 'AODSO4dn', 'AODSOAdn', 'AODSSdn', 'AODUVdn', 'AODUVstdn', 'AODVIS',
+ 'AODVISdn', 'AODVISstdn', 'EXTINCTdn', 'EXTINCTNIRdn', 'EXTINCTUVdn', 'EXTxASYMdn', 'FLDSC', 'FLNR', 'FSNR',
+ 'CME', 'CMFDQ', 'CMFMC','CMFMC_DP', 'SOLLD', 'SOLSD', 'SSAVIS', 'SST','TAQ',
+ 'DCOCHM','DH2O2CHM', 'DHNO3CHM', 'DO3CHM', 'Dso4_a1CHM', 'Dso4_a2CHM', 'Dso4_a3CHM',
+ 'FLASHFRQ', 'LNO_COL_PROD', 'LNO_PROD','KVH_CLUBB','MASS', 'PDELDRY', 'NITROP_PD','PM25', 'PRECT', 'PTEQ', 'PTTEND',
+ 'QRLC', 'QRSC', 'QSNOW', 'QRAIN','GS_SO2', 'HNO3_GAS', 'HNO3_NAT', 'HNO3_STS','H2SO4M_C', 'H2SO4_sfnnuc1','HCL_GAS',
+ 'SAD_AERO', 'SAD_ICE', 'SAD_LNAT', 'SAD_SULFC', 'SAD_TROP' 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'REFF_AERO', 'RHREFHT',
+ 'EVAPPREC', 'EVAPQZM', 'EVAPTZM', 'FCTL','FREQZM', 'ZMDQ', 'ZMDT', 'ZMMTT', 'ZMMU','VEL_NAT2',
+ 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'bc_c1DDF', 'bc_c4DDF', 'dst_c1DDF', 'dst_c2DDF', 'dst_c3DDF',
+ 'ncl_c1DDF', 'ncl_c2DDF', 'ncl_c3DDF', 'pom_c1DDF', 'pom_c4DDF', 'num_c1DDF','num_c2DDF','num_c3DDF','num_c4DDF',
+ 'so4_a1_sfgaex1', 'so4_c1AQH2SO4', 'so4_c1AQSO4', 'so4_c1DDF', 'so4_a2_sfgaex1', 'so4_c2AQH2SO4', 'so4_c2AQSO4', 'so4_c2DDF',
+ 'so4_a3_sfgaex1', 'so4_c3AQH2SO4', 'so4_c3AQSO4', 'so4_c3DDF', 'so4_a2_sfnnuc1', 'num_a2_sfnnuc1',
+ 'soa1_a1_sfgaex1','soa1_c1DDF', 'soa1_a2_sfgaex1','soa1_c2DDF', 'soa2_a1_sfgaex1','soa2_c1DDF', 'soa2_a2_sfgaex1','soa2_c2DDF',
+ 'soa3_a1_sfgaex1','soa3_c1DDF', 'soa3_a2_sfgaex1','soa3_c2DDF', 'soa4_a1_sfgaex1','soa4_c1DDF', 'soa4_a2_sfgaex1','soa4_c2DDF',
+ 'soa5_a1_sfgaex1','soa5_c1DDF', 'soa5_a2_sfgaex1','soa5_c2DDF', 'jcl2o2', 'jh2o2', 'jno2', 'jo2_a', 'jo2_b', 'jo3_a', 'jo3_b', 'jpan',
+ 'r_het1', 'r_het2', 'r_het3', 'r_het4', 'r_het5', 'r_het6', 'r_het7', 'r_het8', 'r_het9', 'r_het10', 'r_het11', 'r_het12', 'r_het13',
+ 'r_het15', 'r_het16', 'r_het17', 'r_jsoa1_a1', 'r_jsoa1_a2', 'r_jsoa2_a1', 'r_jsoa2_a2', 'r_jsoa3_a1', 'r_jsoa3_a2', 'r_jsoa4_a1',
+ 'r_jsoa4_a2', 'r_jsoa5_a1', 'r_jsoa5_a2', 'r_GLYOXAL_aer', 'r_HO2_O3', 'r_N2O5_aer', 'r_NO2_aer', 'r_NO3_aer', 'r_O1D_H2O', 'r_OH_O3', 'r_OH_O',
+ 'O3_Prod','O3_Loss','O3S_Loss','RO2_NO_sum','O3_alkenes','RO2_NO3_sum','RO2_HO2_sum','RO2_RO2_sum','RCO2_NO2_sum',
+ 'OddOx_Ox_Loss','OddOx_HOx_Loss','OddOx_NOx_Loss','OddOx_CLOxBROx_Loss','OddOx_Loss_Tot','OddOx_Prod_Tot', 'Ox_Prod','Ox_Loss'
diff --git a/bld/namelist_files/use_cases/sd_waccm_sulfur.xml b/bld/namelist_files/use_cases/sd_waccm_sulfur.xml
index f45159054a..25c4d622de 100644
--- a/bld/namelist_files/use_cases/sd_waccm_sulfur.xml
+++ b/bld/namelist_files/use_cases/sd_waccm_sulfur.xml
@@ -139,27 +139,4 @@
1850-2000
-
-.false.
-1850
-2008
-
-atm/cam/sst/sst_HadOIBl_bc_0.47x0.63_1850_2008_c100128.nc
-atm/cam/sst/sst_HadOIBl_bc_0.9x1.25_1850_2008_c100127.nc
-atm/cam/sst/sst_HadOIBl_bc_1.9x2.5_1850_2008_c100127.nc
-atm/cam/sst/sst_HadOIBl_bc_4x5_1850_2008_c100127.nc
-atm/cam/sst/sst_HadOIBl_bc_10x15_1850_2008_c100127.nc
-
-atm/cam/sst/sst_HadOIBl_bc_128x256_1850_2008_c100128.nc
-atm/cam/sst/sst_HadOIBl_bc_64x128_1850_2008_c100128.nc
-atm/cam/sst/sst_HadOIBl_bc_48x96_1850_2008_c100128.nc
-atm/cam/sst/sst_HadOIBl_bc_32x64_1850_2008_c100128.nc
-atm/cam/sst/sst_HadOIBl_bc_8x16_1850_2008_c100128.nc
-
-
-.true.
-0
-0
-atm/cam/sst/sst_HadOIBl_bc_0.23x0.31_clim_pi_c091020.nc
-
diff --git a/bld/namelist_files/use_cases/sd_waccm_tsmlt_cam6.xml b/bld/namelist_files/use_cases/sd_waccm_tsmlt_cam6.xml
index 4c862f997c..e52fd92caa 100644
--- a/bld/namelist_files/use_cases/sd_waccm_tsmlt_cam6.xml
+++ b/bld/namelist_files/use_cases/sd_waccm_tsmlt_cam6.xml
@@ -68,8 +68,8 @@
'AOA1SRC', 'AOA2SRC', 'NO2_CMXF'
- 'ABSORB', 'ACBZO2', 'ACTREL', 'ALKNIT', 'ALKO2', 'ALKOOH', 'AOA1', 'AOA_NH', 'AODABSdn', 'AODBCdn', 'AODdnDUST1', 'AODdnDUST2',
- 'AODdnDUST3', 'AODdnMODE1', 'AODdnMODE2', 'AODdnMODE3', 'AODDUST2', 'AODDUST', 'AODNIRstdn', 'AODPOMdn', 'AODSO4dn', 'AODSOAdn', 'AODSSdn',
+ 'ABSORB', 'ACBZO2', 'ACTREL', 'ALKNIT', 'ALKO2', 'ALKOOH', 'AOA1', 'AOA_NH', 'AODABSdn', 'AODBCdn', 'AODdnDUST01', 'AODdnDUST02',
+ 'AODdnDUST03', 'AODdn_aitken', 'AODdn_accum', 'AODdn_coarse', 'AODDUST02', 'AODDUST', 'AODNIRstdn', 'AODPOMdn', 'AODSO4dn', 'AODSOAdn', 'AODSSdn',
'AODUVdn', 'AODUVstdn', 'AODVIS', 'AODVISdn', 'AODVISstdn', 'AQ_SO2', 'AREA', 'AREI', 'AREL', 'bc_a1', 'bc_a1DDF',
'bc_a1SFWET', 'bc_a4', 'bc_a4_CLXF', 'bc_a4DDF', 'bc_a4SFWET', 'BCARY', 'bc_c1', 'bc_c1DDF', 'bc_c1SFWET', 'bc_c4', 'bc_c4DDF',
'bc_c4SFWET', 'BENZENE', 'BENZO2', 'BENZOOH', 'BEPOMUC', 'BIGALD1', 'BIGALD2', 'BIGALD3', 'BIGALD4', 'BIGALD', 'BIGALK', 'BIGENE',
@@ -84,7 +84,7 @@
'DCOCHM', 'DF_ALKNIT', 'DF_ALKOOH', 'DF_BENZOOH', 'DF_BZOOH', 'DF_C2H5OH', 'DF_C2H5OOH', 'DF_C3H7OOH', 'DF_C6H5OOH', 'DF_CH2O',
'DF_CH3CHO', 'DF_CH3CN', 'DF_CH3COCH3', 'DF_CH3COCHO', 'DF_CH3COOH', 'DF_CH3COOOH', 'DF_CH3OH', 'DF_CH3OOH', 'DF_CO', 'DF_EOOH',
'DF_GLYALD', 'DF_H2O2', 'DF_H2SO4', 'DF_HCN', 'DF_HCOOH', 'DF_HNO3', 'DF_HO2NO2', 'DF_HONITR', 'DF_HPALD', 'DF_HYAC', 'DF_HYDRALD',
- 'DF_IEPOX', 'DF_ISOPNITA', 'DF_ISOPNITB', 'DF_ISOPNO3', 'DF_ISOPNOOH', 'DF_ISOPOOH', 'DF_IVOC', 'DF_MACROOH', 'DF_MEKOOH',
+ 'DF_IEPOX', 'DF_ISOPNITA', 'DF_ISOPNITB', 'DF_ISOPNOOH', 'DF_ISOPOOH', 'DF_IVOC', 'DF_MACROOH', 'DF_MEKOOH',
'DF_MPAN', 'DF_NC4CH2OH', 'DF_NC4CHO', 'DF_NH3', 'DF_NH4', 'DF_NO2', 'DF_NO', 'DF_NOA', 'DF_NTERPOOH', 'DF_O3',
'DF_ONITR', 'DF_PAN', 'DF_PHENOOH', 'DF_POOH', 'DF_ROOH', 'DF_SO2', 'DF_SOAG0', 'DF_SOAG1', 'DF_SOAG2', 'DF_SOAG3',
'DF_SOAG4', 'DF_SVOC', 'DF_TERP2OOH', 'DF_TERPNIT', 'DF_TERPOOH', 'DF_TERPROD1', 'DF_TERPROD2', 'DF_TOLOOH', 'DF_XOOH', 'DF_XYLENOOH',
@@ -120,7 +120,7 @@
'S', 'SAD_AERO', 'SAD_ICE', 'SAD_LNAT', 'SAD_SULFC', 'SAD_TROP', 'SF6', 'SFbc_a4', 'SFBCARY',
'SFBENZENE', 'SFBIGALK', 'SFBIGENE', 'SFC2H2', 'SFC2H4', 'SFC2H5OH', 'SFC2H6', 'SFC3H6', 'SFC3H8', 'SFCH2O', 'SFCH3CHO', 'SFCH3CN',
'SFCH3COCH3', 'SFCH3COCHO', 'SFCH3COOH', 'SFCH3OH', 'SFCO', 'SFDMS', 'SFdst_a1', 'SFdst_a2', 'SFdst_a3', 'SFGLYALD', 'SFHCN', 'SFHCOOH',
- 'SFISOP', 'SFIVOC', 'SFMEK', 'SFMTERP', 'SFncl_a1', 'SFncl_a2', 'SFncl_a3', 'SFNH3', 'SFNO2', 'SFNO', 'SFnum_a1', 'SFnum_a2',
+ 'SFISOP', 'SFIVOC', 'SFMEK', 'SFMTERP', 'SFncl_a1', 'SFncl_a2', 'SFncl_a3', 'SFNH3', 'SFNO', 'SFnum_a1', 'SFnum_a2',
'SFnum_a3', 'SFpom_a4', 'SFSO2', 'SFso4_a1', 'SFso4_a2', 'SFSVOC', 'SFTOLUENE', 'SFXYLENES', 'SHFLX', 'SO2',
'SO2_CHML', 'SO2_CHMP', 'SO2_CLXF', 'SO2_XFRC', 'SO3', 'so4_a1', 'so4_a1_CHMP', 'so4_a1_CLXF', 'so4_a1DDF', 'so4_a1_sfgaex1', 'so4_a1SFWET',
'so4_a2', 'so4_a2_CHMP', 'so4_a2_CLXF', 'so4_a2DDF', 'so4_a2_sfgaex1', 'so4_a2_sfnnuc1', 'so4_a2SFWET', 'so4_a3',
diff --git a/bld/namelist_files/use_cases/sd_waccmx_ma_cam6.xml b/bld/namelist_files/use_cases/sd_waccmx_ma_cam6.xml
index c67531174b..6b56c46b17 100644
--- a/bld/namelist_files/use_cases/sd_waccmx_ma_cam6.xml
+++ b/bld/namelist_files/use_cases/sd_waccmx_ma_cam6.xml
@@ -62,11 +62,11 @@
0, -1, -24, -24, -120, -24, -120, -240
1, 24, 7, 7, 10, 365, 73, 30
-
-
- 'Z3', 'T', 'TIon', 'TElec', 'e', 'U', 'V', 'OMEGA', 'UI', 'VI', 'WI', 'ElecColDens', 'PHIM2D', 'PS',
- 'PED_CONDUCTANCE', 'HALL_CONDUCTANCE', 'ED1', 'ED2' 'O', 'O2', 'H', 'NO', 'CO2', 'N', 'O1D', 'Op2P', 'Op2D', 'Op',
- 'Np', 'N2p', 'O2p', 'NOp', 'QJOULE', 'SIGMAHAL', 'SIGMAPED', 'SolIonRate_Tot', 'QRS_TOT', 'QO3', 'QCO2',
+
+
+ 'Z3', 'T', 'TIon', 'TElec', 'e', 'U', 'V', 'OMEGA', 'UI', 'VI', 'WI', 'ElecColDens', 'PHIM2D', 'PS',
+ 'PED_CONDUCTANCE', 'HALL_CONDUCTANCE', 'ED1', 'ED2' 'O', 'O2', 'H', 'NO', 'CO2', 'N', 'O1D', 'Op2P', 'Op2D', 'Op',
+ 'Np', 'N2p', 'O2p', 'NOp', 'QJOULE', 'SIGMAHAL', 'SIGMAPED', 'SolIonRate_Tot', 'QRS_TOT', 'QO3', 'QCO2',
'QNO', 'QO3P', 'QHC2S', 'QJOULE', 'EKGW', 'TTGW', 'UTGW_TOTAL',
'T_24_COS', 'T_24_SIN', 'T_12_COS', 'T_12_SIN', 'T_08_COS', 'T_08_SIN',
'U_24_COS', 'U_24_SIN', 'U_12_COS', 'U_12_SIN', 'U_08_COS', 'U_08_SIN',
@@ -75,49 +75,49 @@
'ALATM', 'ALONM', 'AOA1', 'AOA2', 'BR', 'BRCL', 'BRO', 'BRONO2', 'CCL4', 'CF2CLBR', 'CF3BR', 'CFC11',
'CFC113', 'CFC12', 'CH2O', 'CH3BR', 'CH3CCL3', 'CH3CL', 'CH3O2', 'CH3OOH', 'CH4', 'CL',
'CL2', 'CL2O2', 'CLDHGH', 'CLDLOW', 'CLDMED', 'CLDTOT', 'CLO', 'CLONO2', 'CLOUD', 'CO',
- 'DTCOND', 'DTV', 'DUV', 'DVV', 'FLNS', 'FLNSC', 'FLNT', 'FLNTC','FSDS', 'FSNS', 'FSNSC', 'FSNT', 'FSNTC',
- 'H2', 'H2O', 'H2O2', 'HBR', 'HCFC22', 'HCL', 'HNO3', 'HO2', 'HO2NO2', 'HOBR', 'HOCL', 'HORZ',
- 'LANDFRAC', 'LHFLX', 'N2O', 'N2O5', 'NO2', 'NO3', 'O3', 'OCLO', 'OCNFRAC', 'OH', 'PHIS',
+ 'DTCOND', 'DTV', 'DUV', 'DVV', 'FLNS', 'FLNSC', 'FLNT', 'FLNTC','FSDS', 'FSNS', 'FSNSC', 'FSNT', 'FSNTC',
+ 'H2', 'H2O', 'H2O2', 'HBR', 'HCFC22', 'HCL', 'HNO3', 'HO2', 'HO2NO2', 'HOBR', 'HOCL', 'HORZ',
+ 'LANDFRAC', 'LHFLX', 'N2O', 'N2O5', 'NO2', 'NO3', 'O3', 'OCLO', 'OCNFRAC', 'OH', 'PHIS',
'PRECC', 'PRECL', 'Q', 'QFLX', 'QRL', 'QRS', 'RELHUM', 'SHFLX', 'SOLIN', 'SWCF', 'QCP', 'QTHERMAL',
'QRL_TOT', 'PSL', 'HNO3_STS', 'HNO3_NAT', 'HNO3_GAS', 'NO_Aircraft', 'NO_Lightning',
'QRS_AUR', 'QRS_CO2NIR', 'QRS_EUV', 'SAD_ICE', 'SAD_LNAT', 'SAD_SULFC', 'TREFHT',
- 'VERT', 'VTGWORO', 'VTGWSPEC', 'O2_1S', 'O2_1D', 'NOX', 'NOY', 'CLOX', 'CLOY', 'BROX', 'BROY',
- 'TCLY', 'TOTH', 'UIONTEND', 'VIONTEND', 'DTCORE', 'CLDLIQ', 'CLDICE', 'CONCLD', 'FRONTGF:I',
- 'BTAUE', 'BTAUW', 'BTAUN', 'BTAUS', 'TAUE', 'TAUW', 'TAUN', 'TAUS', 'TAUGWX', 'TAUGWY', 'TAUX', 'TAUY',
+ 'VERT', 'VTGWORO', 'VTGWSPEC', 'O2_1S', 'O2_1D', 'NOX', 'NOY', 'CLOX', 'CLOY', 'BROX', 'BROY',
+ 'TCLY', 'TOTH', 'UIONTEND', 'VIONTEND', 'DTCORE', 'CLDLIQ', 'CLDICE', 'CONCLD', 'FRONTGF:I',
+ 'BTAUE', 'BTAUW', 'BTAUN', 'BTAUS', 'TAUE', 'TAUW', 'TAUN', 'TAUS', 'TAUGWX', 'TAUGWY', 'TAUX', 'TAUY',
'SNOWHLND', 'SNOWHICE', 'ICEFRAC', 'FSDSC', 'SFNO', 'SFCO', 'SFCH2O', 'CFC11STAR', 'TROPP_FD',
'KVH', 'KVM', 'KVT', 'Qbkgndtot', 'Z3GM', 'OpDens', 'EDens'
-
-
- 'Z3', 'T', 'TIon', 'TElec', 'e', 'U', 'V', 'OMEGA', 'UI', 'VI', 'WI', 'ElecColDens', 'PHIM2D', 'PS',
+
+
+ 'Z3', 'T', 'TIon', 'TElec', 'e', 'U', 'V', 'OMEGA', 'UI', 'VI', 'WI', 'ElecColDens', 'PHIM2D', 'PS',
'PED_CONDUCTANCE', 'HALL_CONDUCTANCE', 'ED1', 'ED2', 'O', 'O2', 'H'
-
-
- 'Z3', 'T', 'TIon', 'TElec', 'e', 'U', 'V', 'OMEGA', 'UI', 'VI', 'WI', 'ElecColDens', 'PHIM2D', 'PS',
- 'PED_CONDUCTANCE', 'HALL_CONDUCTANCE', 'ED1', 'ED2', 'O', 'O2', 'H', 'NO', 'CO2', 'N', 'O1D',
+
+
+ 'Z3', 'T', 'TIon', 'TElec', 'e', 'U', 'V', 'OMEGA', 'UI', 'VI', 'WI', 'ElecColDens', 'PHIM2D', 'PS',
+ 'PED_CONDUCTANCE', 'HALL_CONDUCTANCE', 'ED1', 'ED2', 'O', 'O2', 'H', 'NO', 'CO2', 'N', 'O1D',
'Op2P', 'Op2D', 'Op', 'Np', 'N2p', 'O2p', 'NOp', 'QJOULE', 'SIGMAHAL', 'SIGMAPED', 'SolIonRate_Tot',
'Z3GM', 'OpDens', 'EDens'
-
-
- 'Z3', 'T', 'TIon', 'TElec', 'e', 'U', 'V', 'OMEGA', 'UI', 'VI', 'WI', 'ElecColDens', 'PHIM2D', 'PS',
- 'PED_CONDUCTANCE', 'HALL_CONDUCTANCE', 'ED1', 'ED2', 'O', 'O2', 'H', 'NO', 'CO2', 'N', 'QRS_TOT',
- 'QO3', 'QCO2', 'QNO', 'QO3P', 'QHC2S', 'QJOULE', 'EKGW', 'TTGW', 'UTGW_TOTAL',
+
+
+ 'Z3', 'T', 'TIon', 'TElec', 'e', 'U', 'V', 'OMEGA', 'UI', 'VI', 'WI', 'ElecColDens', 'PHIM2D', 'PS',
+ 'PED_CONDUCTANCE', 'HALL_CONDUCTANCE', 'ED1', 'ED2', 'O', 'O2', 'H', 'NO', 'CO2', 'N', 'QRS_TOT',
+ 'QO3', 'QCO2', 'QNO', 'QO3P', 'QHC2S', 'QJOULE', 'EKGW', 'TTGW', 'UTGW_TOTAL',
'SolIonRate_Tot', 'Z3GM', 'OpDens', 'EDens'
-
-
+
+
'T_24_COS', 'T_24_SIN', 'T_12_COS', 'T_12_SIN', 'T_08_COS', 'T_08_SIN',
'U_24_COS', 'U_24_SIN', 'U_12_COS', 'U_12_SIN', 'U_08_COS', 'U_08_SIN',
'V_24_COS', 'V_24_SIN', 'V_12_COS', 'V_12_SIN', 'V_08_COS', 'V_08_SIN',
'OMEGA_24_COS', 'OMEGA_24_SIN', 'OMEGA_12_COS', 'OMEGA_12_SIN', 'OMEGA_08_COS', 'OMEGA_08_SIN'
-
+
'MSKtem','PS','PSL','VTHzm','UVzm','UWzm','Uzm','Vzm','THzm','Wzm','PHIS'
-
+
'PS', 'PSL', 'U', 'V', 'T', 'Z3', 'PHIS', 'FRONTGF:I', 'OMEGA', 'O3',
'REFF_AERO', 'SAD_AERO', 'so4_a1', 'so4_a2', 'so4_a3', 'AODVISstdn', 'NITROP_PD',
@@ -135,9 +135,4 @@
.false.
.false.
-
- 'SolIonRate_Tot = jeuv_1 + jeuv_2 + jeuv_3 + jeuv_4 + jeuv_5 + jeuv_6 + jeuv_7 + jeuv_8 + jeuv_9 + jeuv_10 + jeuv_11 + jeuv_14 + jeuv_15 + jeuv_16 +',
- 'jeuv_17 + jeuv_18 + jeuv_19 + jeuv_20 + jeuv_21 + jeuv_22 + jeuv_23',
-
-
diff --git a/bld/namelist_files/use_cases/waccm_carma_bc_2013_cam4.xml b/bld/namelist_files/use_cases/waccm_carma_bc_2013_cam4.xml
index ff2a72cbcc..a6e5287553 100644
--- a/bld/namelist_files/use_cases/waccm_carma_bc_2013_cam4.xml
+++ b/bld/namelist_files/use_cases/waccm_carma_bc_2013_cam4.xml
@@ -46,12 +46,12 @@
atm/waccm/sulf/SAD_SULF_1849-2100_1.9x2.5_c090817.nc
'SERIAL'
-
+
.false.
atm/waccm/qbo/qbocoefficients_c091230.nc'
-.true.
+.true.
@@ -75,42 +75,42 @@
0, -240, -240, -24, -24
'A', 'I', 'I', 'A', 'A'
-
+
- 'AOA1', 'AOA2', 'BR', 'BRCL', 'BRO', 'BRONO2', 'CCL4', 'CF2CLBR', 'CF3BR',
- 'CFC11', 'CFC113', 'CFC12', 'CH2O', 'CH3BR', 'CH3CCL3', 'CH3CL', 'CH3O2', 'CH3OOH',
- 'CH4', 'CL', 'CL2', 'CL2O2', 'CLDHGH', 'CLDLOW', 'CLDMED', 'CLDTOT', 'CLO', 'CLONO2',
- 'CLOUD', 'CO', 'CO2', 'DTCOND', 'DTV', 'DUV', 'DVV', 'EKGW', 'FLNS', 'FLNSC', 'FLNT',
+ 'AOA1', 'AOA2', 'BR', 'BRCL', 'BRO', 'BRONO2', 'CCL4', 'CF2CLBR', 'CF3BR',
+ 'CFC11', 'CFC113', 'CFC12', 'CH2O', 'CH3BR', 'CH3CCL3', 'CH3CL', 'CH3O2', 'CH3OOH',
+ 'CH4', 'CL', 'CL2', 'CL2O2', 'CLDHGH', 'CLDLOW', 'CLDMED', 'CLDTOT', 'CLO', 'CLONO2',
+ 'CLOUD', 'CO', 'CO2', 'DTCOND', 'DTV', 'DUV', 'DVV', 'EKGW', 'FLNS', 'FLNSC', 'FLNT',
'FLNTC', 'FSDS', 'FSNS', 'FSNSC', 'FSNT', 'FSNTC', 'H', 'H2', 'H2O', 'H2O2', 'HBR',
'HCFC22', 'HCL', 'HNO3', 'HO2', 'HO2NO2', 'HOBR', 'HOCL', 'HORZ', 'LANDFRAC', 'LHFLX',
'N', 'N2O', 'N2O5', 'NO', 'NO2', 'NO3', 'O', 'O1D', 'O2', 'O3',
'OCLO', 'OCNFRAC', 'OH', 'OMEGA', 'PHIS', 'PRECC', 'PRECL', 'PS', 'Q', 'QFLX',
'QPERT', 'QRL', 'QRLNLTE', 'QRS', 'RELHUM', 'SHFLX', 'SOLIN', 'SWCF', 'QCP',
- 'QTHERMAL', 'QRL_TOT', 'QRS_TOT', 'QJOULE', 'PSL', 'HNO3_STS', 'HNO3_NAT',
- 'HNO3_GAS', 'NO_Aircraft', 'NO_Lightning', 'QNO', 'QRS_AUR', 'QRS_CO2NIR', 'QRS_EUV',
- 'SAD_ICE', 'SAD_LNAT', 'SAD_SULFC', 'T', 'TREFHT',
- 'TTGW', 'U', 'UTGWORO', 'UTGWSPEC', 'V', 'VERT', 'VTGWORO', 'VTGWSPEC', 'Z3', 'O2_1S',
- 'O2_1D', 'NOX', 'NOY', 'CLOX', 'CLOY', 'BROX', 'BROY', 'TCLY', 'TOTH', 'QJOULE', 'UI',
+ 'QTHERMAL', 'QRL_TOT', 'QRS_TOT', 'QJOULE', 'PSL', 'HNO3_STS', 'HNO3_NAT',
+ 'HNO3_GAS', 'NO_Aircraft', 'NO_Lightning', 'QNO', 'QRS_AUR', 'QRS_CO2NIR', 'QRS_EUV',
+ 'SAD_ICE', 'SAD_LNAT', 'SAD_SULFC', 'T', 'TREFHT',
+ 'TTGW', 'U', 'UTGWORO', 'UTGWSPEC', 'V', 'VERT', 'VTGWORO', 'VTGWSPEC', 'Z3', 'O2_1S',
+ 'O2_1D', 'NOX', 'NOY', 'CLOX', 'CLOY', 'BROX', 'BROY', 'TCLY', 'TOTH', 'QJOULE', 'UI',
'VI', 'UIONTEND', 'VIONTEND', 'DTCORE', 'T_24_COS', 'T_24_SIN', 'T_12_COS', 'T_12_SIN',
'OMEGA_24_COS', 'OMEGA_24_SIN', 'OMEGA_12_COS', 'OMEGA_12_SIN',
- 'U_24_COS', 'U_24_SIN', 'U_12_COS', 'U_12_SIN', 'V_24_COS', 'V_24_SIN', 'V_12_COS',
+ 'U_24_COS', 'U_24_SIN', 'U_12_COS', 'U_12_SIN', 'V_24_COS', 'V_24_SIN', 'V_12_COS',
'V_12_SIN', 'PS_24_COS', 'PS_24_SIN', 'PS_12_COS', 'PS_12_SIN', 'CLDLIQ','CLDICE','CONCLD',
'FRONTGF:I', 'BUTGWSPEC', 'BTAUE', 'BTAUW', 'BTAUN', 'BTAUS','TAUE','TAUW','TAUN','TAUS',
'TAUGWX', 'TAUGWY', 'TAUX','TAUY','SNOWHLND','SNOWHICE','ICEFRAC','FSDSC','SFNO', 'SFCO',
'SFCH2O','CFC11STAR','TROPP_FD'
-
+
- 'PS', 'Z3', 'T', 'U', 'V', 'FLNT','PSL',
+ 'PS', 'Z3', 'T', 'U', 'V', 'FLNT','PSL',
'OMEGA','FSDS','FSDSC','CLOUD','CONCLD','SNOWHLND','SNOWHICE',
- 'CH3CL', 'CFC11', 'CFC12', 'CFC113', 'HCFC22', 'CCL4', 'CH3CCL3',
+ 'CH3CL', 'CFC11', 'CFC12', 'CFC113', 'HCFC22', 'CCL4', 'CH3CCL3',
'CH3BR', 'CF3BR', 'CF2CLBR',
'CO', 'CO2', 'CH2O', 'CH3OOH', 'CH4',
'O3', 'O', 'O1D',
'N', 'NO', 'NO2', 'NO3', 'N2O5', 'HNO3', 'HO2NO2', 'NOX', 'NOY', 'N2O',
'H', 'H2', 'OH', 'HO2', 'H2O2', 'H2O',
- 'CL','CL2', 'CLO', 'OCLO', 'CL2O2', 'CLONO2', 'HOCL', 'HCL', 'CLOX', 'CLOY',
+ 'CL','CL2', 'CLO', 'OCLO', 'CL2O2', 'CLONO2', 'HOCL', 'HCL', 'CLOX', 'CLOY',
'BR', 'BRO', 'HOBR', 'HBR', 'BRCL', 'BRONO2', 'BROX', 'BROY', 'TCLY',
'jo2_a', 'jo2_b', 'jo3_a', 'jo3_b', 'jhocl', 'jno3_b', 'jcl2o2',
'SAD_SULFC', 'SAD_LNAT', 'SAD_ICE','AOA1','AOA2',
@@ -118,7 +118,7 @@
'VTHzm', 'WTHzm', 'UVzm', 'UWzm', 'TH', 'MSKtem'
-
+
'PS:B', 'T:B', 'Z3:B', 'U:B', 'V:B', 'CO:B', 'CO2:B',
'H2:B', 'O:B', 'O2:B', 'O3:B', 'H:B', 'OH:B', 'HO2:B', 'H2O:B',
@@ -126,11 +126,11 @@
'Np:B', 'N2p:B', 'Op:B', 'O2p:B', 'NOp:B', 'e:B', 'QRL_TOT:B',
'QRS_TOT:B', 'QJOULE:B', 'jno3_a:B', 'jno3_b:B', 'jcl2o2:B', 'CL2O2:B', 'CLO:B',
'BRO:B', 'NO3:B', 'DTCORE:B', 'DTV:B', 'TTGW:B','OMEGA:B'
-
+
- 'PS', 'PSL', 'U', 'V', 'T', 'Z3', 'PHIS','FRONTGF:I', 'OMEGA'
+ 'PS', 'PSL', 'U', 'V', 'T', 'Z3', 'PHIS','FRONTGF:I', 'OMEGA'
-
+
'MSKtem', 'PS', 'PSL', 'VTHzm', 'UVzm', 'UWzm', 'Uzm', 'Vzm', 'THzm','Wzm', 'PHIS'
@@ -138,27 +138,4 @@
1850-2000
-
-.false.
-1850
-2008
-
-atm/cam/sst/sst_HadOIBl_bc_0.47x0.63_1850_2008_c100128.nc
-atm/cam/sst/sst_HadOIBl_bc_0.9x1.25_1850_2008_c100127.nc
-atm/cam/sst/sst_HadOIBl_bc_1.9x2.5_1850_2008_c100127.nc
-atm/cam/sst/sst_HadOIBl_bc_4x5_1850_2008_c100127.nc
-atm/cam/sst/sst_HadOIBl_bc_10x15_1850_2008_c100127.nc
-
-atm/cam/sst/sst_HadOIBl_bc_128x256_1850_2008_c100128.nc
-atm/cam/sst/sst_HadOIBl_bc_64x128_1850_2008_c100128.nc
-atm/cam/sst/sst_HadOIBl_bc_48x96_1850_2008_c100128.nc
-atm/cam/sst/sst_HadOIBl_bc_32x64_1850_2008_c100128.nc
-atm/cam/sst/sst_HadOIBl_bc_8x16_1850_2008_c100128.nc
-
-
-.true.
-0
-0
-atm/cam/sst/sst_HadOIBl_bc_0.23x0.31_clim_pi_c091020.nc
-
diff --git a/bld/namelist_files/use_cases/waccm_ma_2000_cam6.xml b/bld/namelist_files/use_cases/waccm_ma_2000_cam6.xml
index cf84af173e..f87670c6b0 100644
--- a/bld/namelist_files/use_cases/waccm_ma_2000_cam6.xml
+++ b/bld/namelist_files/use_cases/waccm_ma_2000_cam6.xml
@@ -21,7 +21,6 @@
cesm2_init/f.e22.FWma2000climo.f09_f09_mg17.cam6_2_021.c20200421/0004-01-01/f.e22.FWma2000climo.f09_f09_mg17.cam6_2_021.c20200421.cam.i.0004-01-01-00000.nc
cesm2_init/f.e22.FWma2000climo.f19_f19_mg17.cam6_2_021.c20200421/0008-01-01/f.e22.FWma2000climo.f19_f19_mg17.cam6_2_021.c20200421.cam.i.0008-01-01-00000.nc
-cesm2_init/f.e22.FWma2000climo.ne30pg3_ne30pg3_mg17.cam6_2_021.c20200421/0004-01-01/f.e22.FWma2000climo.ne30pg3_ne30pg3_mg17.cam6_2_021.c20200421.cam.i.0004-01-01-00000.nc
atm/waccm/ic/f2000.waccm-mam3_4x5_L70.cam2.i.0017-01-01.c121113.nc
diff --git a/bld/namelist_files/use_cases/waccm_sc_2000_cam6.xml b/bld/namelist_files/use_cases/waccm_sc_2000_cam6.xml
index 8625224f69..cdb217a987 100644
--- a/bld/namelist_files/use_cases/waccm_sc_2000_cam6.xml
+++ b/bld/namelist_files/use_cases/waccm_sc_2000_cam6.xml
@@ -84,18 +84,18 @@
'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_so4_a1_anthro-ag-ship_surface_2000climo_0.9x1.25_c20170616.nc',
'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_so4_a1_bb_surface_2000climo_0.9x1.25_c20170322.nc',
'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_so4_a2_anthro-res_surface_2000climo_0.9x1.25_c20170616.nc',
- 'SOAE -> 4.4323D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_BENZENE_anthro_surface_2000climo_0.9x1.25_c20170608.nc',
- 'SOAE -> 4.4323D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_BENZENE_bb_surface_2000climo_0.9x1.25_c20170322.nc',
- 'SOAE -> 1.2021D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_ISOP_bb_surface_2000climo_0.9x1.25_c20170322.nc',
- 'SOAE -> 6.6625D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_MTERP_bb_surface_2000climo_0.9x1.25_c20170322.nc',
- 'SOAE -> 9.9042D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_TOLUENE_anthro_surface_2000climo_0.9x1.25_c20170608.nc',
- 'SOAE -> 9.9042D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_TOLUENE_bb_surface_2000climo_0.9x1.25_c20170322.nc',
- 'SOAE -> 8.3792D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_XYLENES_anthro_surface_2000climo_0.9x1.25_c20170608.nc',
- 'SOAE -> 8.3792D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_XYLENES_bb_surface_2000climo_0.9x1.25_c20170322.nc',
- 'SOAE -> 8.6865D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_IVOC_anthro_surface_2000climo_0.9x1.25_c20170608.nc',
- 'SOAE -> 8.6865D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_IVOC_bb_surface_2000climo_0.9x1.25_c20170322.nc',
- 'SOAE -> 16.8188D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_SVOC_anthro_surface_2000climo_0.9x1.25_c20170608.nc',
- 'SOAE -> 16.8188D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_SVOC_bb_surface_2000climo_0.9x1.25_c20170322.nc'
+ 'SOAE -> 2.5592D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_BENZENE_anthro_surface_2000climo_0.9x1.25_c20170608.nc',
+ 'SOAE -> 2.5592D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_BENZENE_bb_surface_2000climo_0.9x1.25_c20170322.nc',
+ 'SOAE -> 0.5954D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_ISOP_bb_surface_2000climo_0.9x1.25_c20170322.nc',
+ 'SOAE -> 5.1004D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_MTERP_bb_surface_2000climo_0.9x1.25_c20170322.nc',
+ 'SOAE -> 8.2367D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_TOLUENE_anthro_surface_2000climo_0.9x1.25_c20170608.nc',
+ 'SOAE -> 8.2367D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_TOLUENE_bb_surface_2000climo_0.9x1.25_c20170322.nc',
+ 'SOAE -> 6.5013D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_XYLENES_anthro_surface_2000climo_0.9x1.25_c20170608.nc',
+ 'SOAE -> 6.5013D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_XYLENES_bb_surface_2000climo_0.9x1.25_c20170322.nc',
+ 'SOAE -> 8.5371D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_IVOC_anthro_surface_2000climo_0.9x1.25_c20170608.nc',
+ 'SOAE -> 8.5371D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_IVOC_bb_surface_2000climo_0.9x1.25_c20170322.nc',
+ 'SOAE -> 16.650D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_SVOC_anthro_surface_2000climo_0.9x1.25_c20170608.nc',
+ 'SOAE -> 16.650D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo/emissions-cmip6_SVOC_bb_surface_2000climo_0.9x1.25_c20170322.nc'
diff --git a/bld/namelist_files/use_cases/waccm_sc_2010_cam6.xml b/bld/namelist_files/use_cases/waccm_sc_2010_cam6.xml
index d24823caab..d878ba8f6d 100644
--- a/bld/namelist_files/use_cases/waccm_sc_2010_cam6.xml
+++ b/bld/namelist_files/use_cases/waccm_sc_2010_cam6.xml
@@ -84,18 +84,18 @@
'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_so4_a1_anthro-ag-ship_surface_2010climo_0.9x1.25_c20180918.nc',
'so4_a1 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_so4_a1_bb_surface_2010climo_0.9x1.25_c20180918.nc',
'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_so4_a2_anthro-res_surface_2010climo_0.9x1.25_c20180918.nc',
- 'SOAE -> 4.4323D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_BENZENE_anthro_surface_2010climo_0.9x1.25_c20180918.nc',
- 'SOAE -> 4.4323D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_BENZENE_bb_surface_2010climo_0.9x1.25_c20180918.nc',
- 'SOAE -> 1.2021D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_ISOP_bb_surface_2010climo_0.9x1.25_c20180918.nc',
- 'SOAE -> 6.6625D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_MTERP_bb_surface_2010climo_0.9x1.25_c20180918.nc',
- 'SOAE -> 9.9042D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_TOLUENE_anthro_surface_2010climo_0.9x1.25_c20180918.nc',
- 'SOAE -> 9.9042D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_TOLUENE_bb_surface_2010climo_0.9x1.25_c20180918.nc',
- 'SOAE -> 8.3792D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_XYLENES_anthro_surface_2010climo_0.9x1.25_c20180918.nc',
- 'SOAE -> 8.3792D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_XYLENES_bb_surface_2010climo_0.9x1.25_c20180918.nc',
- 'SOAE -> 8.6865D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_IVOC_anthro_surface_2010climo_0.9x1.25_c20180918.nc',
- 'SOAE -> 8.6865D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_IVOC_bb_surface_2010climo_0.9x1.25_c20180918.nc',
- 'SOAE -> 16.8188D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_SVOC_anthro_surface_2010climo_0.9x1.25_c20180918.nc',
- 'SOAE -> 16.8188D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_SVOC_bb_surface_2010climo_0.9x1.25_c20180918.nc'
+ 'SOAE -> 2.5592D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_BENZENE_anthro_surface_2010climo_0.9x1.25_c20180918.nc',
+ 'SOAE -> 2.5592D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_BENZENE_bb_surface_2010climo_0.9x1.25_c20180918.nc',
+ 'SOAE -> 0.5954D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_ISOP_bb_surface_2010climo_0.9x1.25_c20180918.nc',
+ 'SOAE -> 5.1004D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_MTERP_bb_surface_2010climo_0.9x1.25_c20180918.nc',
+ 'SOAE -> 8.2367D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_TOLUENE_anthro_surface_2010climo_0.9x1.25_c20180918.nc',
+ 'SOAE -> 8.2367D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_TOLUENE_bb_surface_2010climo_0.9x1.25_c20180918.nc',
+ 'SOAE -> 6.5013D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_XYLENES_anthro_surface_2010climo_0.9x1.25_c20180918.nc',
+ 'SOAE -> 6.5013D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_XYLENES_bb_surface_2010climo_0.9x1.25_c20180918.nc',
+ 'SOAE -> 8.5371D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_IVOC_anthro_surface_2010climo_0.9x1.25_c20180918.nc',
+ 'SOAE -> 8.5371D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_IVOC_bb_surface_2010climo_0.9x1.25_c20180918.nc',
+ 'SOAE -> 16.650D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_SVOC_anthro_surface_2010climo_0.9x1.25_c20180918.nc',
+ 'SOAE -> 16.650D0*$INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_SVOC_bb_surface_2010climo_0.9x1.25_c20180918.nc'
CYCLICAL
diff --git a/bld/namelist_files/use_cases/waccm_tsmlt_1850_cam6.xml b/bld/namelist_files/use_cases/waccm_tsmlt_1850_cam6.xml
index cf01e5431a..800b9b228a 100644
--- a/bld/namelist_files/use_cases/waccm_tsmlt_1850_cam6.xml
+++ b/bld/namelist_files/use_cases/waccm_tsmlt_1850_cam6.xml
@@ -66,85 +66,36 @@
'AOA1SRC', 'AOA2SRC', 'NO2_CMXF', 'NO2_CLXF'
- 'ABSORB', 'ACBZO2', 'ACTREL', 'ALKNIT', 'ALKO2', 'ALKOOH', 'AOA1', 'AOA_NH', 'AODABSdn', 'AODBCdn', 'AODdnDUST1', 'AODdnDUST2',
- 'AODdnDUST3', 'AODdnMODE1', 'AODdnMODE2', 'AODdnMODE3', 'AODDUST2', 'AODDUST', 'AODNIRstdn', 'AODPOMdn', 'AODSO4dn', 'AODSOAdn', 'AODSSdn',
- 'AODUVdn', 'AODUVstdn', 'AODVIS', 'AODVISdn', 'AODVISstdn', 'AQ_SO2', 'AREA', 'AREI', 'AREL', 'bc_a1', 'bc_a1DDF',
- 'bc_a1SFWET', 'bc_a4', 'bc_a4_CLXF', 'bc_a4DDF', 'bc_a4SFWET', 'BCARY', 'bc_c1', 'bc_c1DDF', 'bc_c1SFWET', 'bc_c4', 'bc_c4DDF',
- 'bc_c4SFWET', 'BENZENE', 'BENZO2', 'BENZOOH', 'BEPOMUC', 'BIGALD1', 'BIGALD2', 'BIGALD3', 'BIGALD4', 'BIGALD', 'BIGALK', 'BIGENE',
- 'BR', 'BRCL', 'BRO', 'BRONO2', 'BROX', 'BROY', 'BRY', 'BTTGWSPEC', 'BTTGWSDF', 'BTTGWSKE',
- 'BURDENBCdn', 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSEASALTdn', 'BURDENSO4dn',
- 'BURDENSOAdn', 'BUTGWSPEC', 'BZALD', 'BZOO', 'BZOOH', 'C2H2', 'C2H4', 'C2H5O2', 'C2H5OH', 'C2H5OOH', 'C2H6', 'C3H6', 'C3H7O2',
- 'C3H7OOH', 'C3H8', 'C6H5O2', 'C6H5OOH', 'CCL4', 'CDNUMC', 'CF2CLBR', 'CF3BR', 'CFC113', 'CFC114', 'CFC115', 'CFC11', 'CFC11STAR',
- 'CFC12', 'CH2BR2', 'CH2O', 'CH3BR', 'CH3CCL3', 'CH3CCL3_CHML', 'CH3CHO', 'CH3CL', 'CH3CN', 'CH3CO3', 'CH3COCH3', 'CH3COCHO',
- 'CH3COOH', 'CH3COOOH', 'CH3O2', 'CH3OH', 'CH3OOH', 'CH4', 'CH4_CHML', 'CHBR3', 'CL2', 'CL2O2', 'CL',
- 'CLDICE', 'CLDLIQ', 'CLDTOT', 'CLO', 'CLONO2', 'CLOUD', 'CLOX', 'CLOY', 'CLY', 'CME', 'CMFDQ', 'CMFMC',
- 'CMFMC_DP', 'CO2', 'CO2_CHML', 'CO', 'CO_CHML', 'CO_CHMP', 'COF2', 'COFCL', 'CONCLD', 'CRESOL',
- 'DCOCHM', 'DF_ALKNIT', 'DF_ALKOOH', 'DF_BENZOOH', 'DF_BZOOH', 'DF_C2H5OH', 'DF_C2H5OOH', 'DF_C3H7OOH', 'DF_C6H5OOH', 'DF_CH2O',
- 'DF_CH3CHO', 'DF_CH3CN', 'DF_CH3COCH3', 'DF_CH3COCHO', 'DF_CH3COOH', 'DF_CH3COOOH', 'DF_CH3OH', 'DF_CH3OOH', 'DF_CO', 'DF_EOOH',
- 'DF_GLYALD', 'DF_H2O2', 'DF_H2SO4', 'DF_HCN', 'DF_HCOOH', 'DF_HNO3', 'DF_HO2NO2', 'DF_HONITR', 'DF_HPALD', 'DF_HYAC', 'DF_HYDRALD',
- 'DF_IEPOX', 'DF_ISOPNITA', 'DF_ISOPNITB', 'DF_ISOPNO3', 'DF_ISOPNOOH', 'DF_ISOPOOH', 'DF_IVOC', 'DF_MACROOH', 'DF_MEKOOH',
- 'DF_MPAN', 'DF_NC4CH2OH', 'DF_NC4CHO', 'DF_NH3', 'DF_NH4', 'DF_NO2', 'DF_NO', 'DF_NOA', 'DF_NTERPOOH', 'DF_O3',
- 'DF_ONITR', 'DF_PAN', 'DF_PHENOOH', 'DF_POOH', 'DF_ROOH', 'DF_SO2', 'DF_SOAG0', 'DF_SOAG1', 'DF_SOAG2', 'DF_SOAG3',
- 'DF_SOAG4', 'DF_SVOC', 'DF_TERP2OOH', 'DF_TERPNIT', 'DF_TERPOOH', 'DF_TERPROD1', 'DF_TERPROD2', 'DF_TOLOOH', 'DF_XOOH', 'DF_XYLENOOH',
- 'DF_XYLOLOOH', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'DH2O2CHM', 'DHNO3CHM', 'DICARBO2', 'DMS', 'DO3CHM', 'dry_deposition_NHx_as_N',
- 'dry_deposition_NOy_as_N', 'Dso4_a1CHM', 'Dso4_a2CHM', 'Dso4_a3CHM', 'dst_a1', 'dst_a1DDF', 'dst_a1SFWET', 'dst_a2', 'dst_a2DDF',
- 'dst_a2SFWET', 'dst_a3', 'dst_a3DDF', 'dst_a3SFWET', 'dst_c1', 'dst_c1DDF', 'dst_c1SFWET', 'dst_c2', 'dst_c2DDF', 'dst_c2SFWET',
- 'dst_c3', 'dst_c3DDF', 'dst_c3SFWET', 'DTCORE', 'E90', 'e', 'ENEO2', 'EO2', 'EO', 'EOOH', 'EVAPPREC',
- 'EVAPQZM', 'EVAPTZM', 'EXTINCTdn', 'EXTINCTNIRdn', 'EXTINCTUVdn', 'EXTxASYMdn', 'F', 'FCTL',
- 'FLASHFRQ', 'FLDS', 'FLDSC', 'FLNR', 'FLNS', 'FLNSC', 'FLNT', 'FLNTC', 'FLUT', 'FLUTC', 'FREQI', 'FREQL', 'FREQZM', 'FSDS',
- 'FSDSC', 'FSNR', 'FSNS', 'FSNSC', 'FSNT', 'FSNTC', 'FSNTOAC', 'FSUTOA', 'GLYALD', 'GLYOXAL',
- 'GS_SO2', 'H2402', 'H2', 'H2O2', 'H2O', 'H2SO4', 'H2SO4M_C', 'H2SO4_sfnnuc1', 'H', 'HBR', 'HCFC141B', 'HCFC142B', 'HCFC22', 'HCL',
- 'HCL_GAS', 'HCN', 'HCOOH', 'HF', 'HNO3', 'HNO3_GAS', 'HNO3_NAT', 'HNO3_STS', 'HO2', 'HO2NO2', 'HOBR', 'HOCH2OO', 'HOCL', 'HONITR',
- 'HPALD', 'HYAC', 'HYDRALD', 'ICEFRAC', 'IEPOX', 'ISOP', 'ISOPAO2', 'ISOPBO2', 'ISOPNITA', 'ISOPNITB', 'ISOPNO3',
- 'ISOPNOOH', 'ISOPOOH', 'IVOC', 'IVOC_CHML', 'jcl2o2', 'jh2o2', 'jno2', 'jo2_a', 'jo2_b', 'jo3_a', 'jo3_b', 'jpan', 'KVH_CLUBB',
- 'LANDFRAC', 'LHFLX', 'LNO_COL_PROD', 'LNO_PROD', 'MACR', 'MACRO2', 'MACROOH', 'MALO2', 'MASS', 'MCO3', 'MDIALO2',
- 'MEG_BCARY', 'MEG_BIGALK', 'MEG_BIGENE', 'MEG_C2H4', 'MEG_C2H5OH', 'MEG_C2H6', 'MEG_C3H6', 'MEG_C3H8', 'MEG_CH2O',
- 'MEG_CH3CHO', 'MEG_CH3COCH3', 'MEG_CH3COOH', 'MEG_CH3OH', 'MEG_CO', 'MEG_HCN', 'MEG_HCOOH', 'MEG_ISOP', 'MEG_MTERP', 'MEG_TOLUENE',
- 'MEK', 'MEKO2', 'MEKOOH', 'MPAN', 'MTERP', 'MVK', 'N2D', 'N2O5', 'N2O', 'N2O_CHML', 'N2p', 'N', 'NC4CH2OH',
- 'NC4CHO', 'ncl_a1', 'ncl_a1DDF', 'ncl_a1SFWET', 'ncl_a2', 'ncl_a2DDF', 'ncl_a2SFWET', 'ncl_a3', 'ncl_a3DDF', 'ncl_a3SFWET', 'ncl_c1',
- 'ncl_c1DDF', 'ncl_c1SFWET', 'ncl_c2', 'ncl_c2DDF', 'ncl_c2SFWET', 'ncl_c3', 'ncl_c3DDF', 'ncl_c3SFWET', 'NDEP', 'NH3', 'NH4', 'NH_50',
- 'NH_5', 'NHDEP', 'NITROP_PD', 'NO2', 'NO2_CLXF', 'NO3', 'NO', 'NOA', 'NOp', 'NOX', 'NOY', 'Np', 'NTERPO2', 'NTERPOOH',
- 'num_a1', 'num_a1_CLXF', 'num_a1DDF', 'num_a2', 'num_a2_CLXF', 'num_a2DDF', 'num_a2_sfnnuc1', 'num_a3', 'num_a3DDF', 'num_a4',
- 'num_a4DDF', 'num_c1', 'num_c1DDF', 'num_c2', 'num_c2DDF', 'num_c3', 'num_c3DDF', 'num_c4', 'num_c4DDF', 'NUMLIQ', 'O1D', 'O2_1D',
- 'O2_1S', 'O2', 'O2p', 'O3', 'O3S', 'O3_CHML', 'O3_CHMP', 'O', 'OCLO', 'OCS', 'OH', 'OMEGA', 'OMEGAT', 'ONITR', 'Op',
- 'PAN', 'PBLH', 'PBZNIT', 'PDELDRY', 'PHENO2', 'PHENO', 'PHENOL', 'PHENOOH', 'PHIS', 'PM25', 'PO2', 'pom_a1', 'pom_a1DDF', 'pom_a1SFWET',
- 'pom_a4', 'pom_a4DDF', 'pom_a4SFWET', 'pom_c1', 'pom_c1DDF', 'pom_c1SFWET', 'pom_c4', 'pom_c4DDF', 'pom_c4SFWET',
- 'POOH', 'PRECC', 'PRECT', 'PS', 'PSL', 'PTEQ', 'PTTEND', 'Q', 'QFLX', 'QRAIN', 'QREFHT', 'QRL', 'QRLC', 'QRS',
- 'QRSC', 'QSNOW', 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'REFF_AERO', 'RELHUM', 'r_GLYOXAL_aer',
- 'r_het10', 'r_het11', 'r_het12', 'r_het13', 'r_het15', 'r_het16', 'r_het17', 'r_het1', 'r_het2', 'r_het3', 'r_het4', 'r_het5',
- 'r_het6', 'r_het7', 'r_het8', 'r_het9', 'r_HO2_O3', 'RHREFHT', 'r_jsoa1_a1', 'r_jsoa1_a2', 'r_jsoa2_a1', 'r_jsoa2_a2',
- 'r_jsoa3_a1', 'r_jsoa3_a2', 'r_jsoa4_a1', 'r_jsoa4_a2', 'r_jsoa5_a1', 'r_jsoa5_a2', 'r_N2O5_aer', 'r_NO2_aer', 'r_NO3_aer', 'r_O1D_H2O',
- 'r_OH_O3', 'r_OH_O', 'ROOH', 'RO2',
- 'S', 'SAD_AERO', 'SAD_ICE', 'SAD_LNAT', 'SAD_SULFC', 'SAD_TROP', 'SF6', 'SFbc_a4', 'SFBCARY',
- 'SFBENZENE', 'SFBIGALK', 'SFBIGENE', 'SFC2H2', 'SFC2H4', 'SFC2H5OH', 'SFC2H6', 'SFC3H6', 'SFC3H8', 'SFCH2O', 'SFCH3CHO', 'SFCH3CN',
- 'SFCH3COCH3', 'SFCH3COCHO', 'SFCH3COOH', 'SFCH3OH', 'SFCO', 'SFDMS', 'SFdst_a1', 'SFdst_a2', 'SFdst_a3', 'SFGLYALD', 'SFHCN', 'SFHCOOH',
- 'SFISOP', 'SFIVOC', 'SFMEK', 'SFMTERP', 'SFncl_a1', 'SFncl_a2', 'SFncl_a3', 'SFNH3', 'SFNO2', 'SFNO', 'SFnum_a1', 'SFnum_a2',
- 'SFnum_a3', 'SFpom_a4', 'SFSO2', 'SFso4_a1', 'SFso4_a2', 'SFSVOC', 'SFTOLUENE', 'SFXYLENES', 'SHFLX', 'SO2',
- 'SO2_CHML', 'SO2_CHMP', 'SO2_CLXF', 'SO2_XFRC', 'SO3', 'so4_a1', 'so4_a1_CHMP', 'so4_a1_CLXF', 'so4_a1DDF', 'so4_a1_sfgaex1', 'so4_a1SFWET',
- 'so4_a2', 'so4_a2_CHMP', 'so4_a2_CLXF', 'so4_a2DDF', 'so4_a2_sfgaex1', 'so4_a2_sfnnuc1', 'so4_a2SFWET', 'so4_a3',
- 'so4_a3DDF', 'so4_a3_sfgaex1', 'so4_a3SFWET', 'so4_c1', 'so4_c1AQH2SO4', 'so4_c1AQSO4', 'so4_c1DDF', 'so4_c1SFWET', 'so4_c2', 'so4_c2AQH2SO4',
- 'so4_c2AQSO4', 'so4_c2DDF', 'so4_c2SFWET', 'so4_c3', 'so4_c3AQH2SO4', 'so4_c3AQSO4', 'so4_c3DDF', 'so4_c3SFWET', 'SO', 'soa1_a1',
- 'soa1_a1_CHML', 'soa1_a1DDF', 'soa1_a1_sfgaex1', 'soa1_a1SFWET', 'soa1_a2', 'soa1_a2_CHML', 'soa1_a2DDF',
- 'soa1_a2_sfgaex1', 'soa1_a2SFWET', 'soa1_c1', 'soa1_c1DDF', 'soa1_c1SFWET', 'soa1_c2', 'soa1_c2DDF', 'soa1_c2SFWET', 'soa2_a1', 'soa2_a1_CHML',
- 'soa2_a1DDF', 'soa2_a1_sfgaex1', 'soa2_a1SFWET', 'soa2_a2', 'soa2_a2_CHML', 'soa2_a2DDF', 'soa2_a2_sfgaex1',
- 'soa2_a2SFWET', 'soa2_c1', 'soa2_c1DDF', 'soa2_c1SFWET', 'soa2_c2', 'soa2_c2DDF', 'soa2_c2SFWET', 'soa3_a1', 'soa3_a1_CHML',
- 'soa3_a1DDF', 'soa3_a1_sfgaex1', 'soa3_a1SFWET', 'soa3_a2', 'soa3_a2_CHML', 'soa3_a2DDF', 'soa3_a2_sfgaex1', 'soa3_a2SFWET',
- 'soa3_c1', 'soa3_c1DDF', 'soa3_c1SFWET', 'soa3_c2', 'soa3_c2DDF', 'soa3_c2SFWET', 'soa4_a1', 'soa4_a1_CHML', 'soa4_a1DDF',
- 'soa4_a1_sfgaex1', 'soa4_a1SFWET', 'soa4_a2', 'soa4_a2_CHML', 'soa4_a2DDF', 'soa4_a2_sfgaex1', 'soa4_a2SFWET', 'soa4_c1',
- 'soa4_c1DDF', 'soa4_c1SFWET', 'soa4_c2', 'soa4_c2DDF', 'soa4_c2SFWET', 'soa5_a1', 'soa5_a1_CHML', 'soa5_a1DDF', 'soa5_a1_sfgaex1',
- 'soa5_a1SFWET', 'soa5_a2', 'soa5_a2_CHML', 'soa5_a2DDF', 'soa5_a2_sfgaex1', 'soa5_a2SFWET', 'soa5_c1', 'soa5_c1DDF',
- 'soa5_c1SFWET', 'soa5_c2', 'soa5_c2DDF', 'soa5_c2SFWET', 'SOAG0', 'SOAG0_CHMP', 'SOAG1', 'SOAG1_CHMP', 'SOAG2', 'SOAG2_CHMP',
- 'SOAG3', 'SOAG3_CHMP', 'SOAG4', 'SOAG4_CHMP', 'SOLIN', 'SOLLD', 'SOLSD', 'SSAVIS', 'SST', 'ST80_25', 'SVOC', 'SVOC_CHML',
- 'T', 'TAQ', 'TAUBLJX', 'TAUBLJY', 'TAUGWX', 'TAUGWY', 'TAUX', 'TAUY', 'TBRY', 'TCLY', 'TEPOMUC', 'TERP2O2', 'TERP2OOH',
- 'TERPNIT', 'TERPO2', 'TERPOOH', 'TERPROD1', 'TERPROD2', 'TGCLDIWP', 'TGCLDLWP', 'TMDMS', 'TMOCS', 'TMQ', 'TMSO2',
- 'TMso4_a1', 'TMso4_a2', 'TMso4_a3', 'TOLO2', 'TOLOOH', 'TOLUENE', 'TOT_CLD_VISTAU', 'TOTH', 'TREFHT', 'TREFHTMN', 'TREFHTMX', 'TROP_P',
- 'TROP_T', 'TROP_Z', 'TS', 'TSMN:M', 'TSMX:X', 'TTEND_TOT', 'TTGWORO', 'TTGWSDF', 'TTGWSDFORO', 'TTGWSKE', 'TTGWSKEORO', 'TTGWSPEC',
- 'U10', 'U', 'UTGWORO', 'UTGWSPEC', 'UU', 'V', 'VD01', 'VEL_NAT2', 'VV',
- 'wet_deposition_NHx_as_N', 'wet_deposition_NOy_as_N', 'XO2', 'XOOH', 'XYLENES', 'XYLENO2', 'XYLENOOH', 'XYLOL', 'XYLOLO2',
- 'XYLOLOOH', 'Z3', 'ZMDQ', 'ZMDT', 'ZMMTT', 'ZMMU',
+ 'ACTREL', 'AQ_SO2', 'AREA', 'BROX', 'BROY', 'BRY', 'CLOX', 'CLOY', 'CLY', 'NOX', 'NOY', 'TBRY', 'TCLY', 'CFC11STAR',
+ 'BTTGWSPEC', 'BTTGWSDF', 'BTTGWSKE', 'CONCLD', 'CME', 'CMFDQ', 'CMFMC', 'CMFMC_DP',
+ 'CH3CCL3_CHML', 'CH4_CHML', 'CO2_CHML', 'CO_CHML', 'IVOC_CHML', 'N2O_CHML', 'O3_CHML', 'SO2_CHML',
+ 'CO_CHMP', 'O3_CHMP', 'SO2_CHMP', 'TMDMS', 'TMOCS', 'TMSO2','TMso4_a1', 'TMso4_a2', 'TMso4_a3',
+ 'soa1_a1_CHML', 'soa1_a2_CHML', 'soa2_a1_CHML', 'soa2_a2_CHML', 'soa3_a1_CHML', 'soa3_a2_CHML',
+ 'soa4_a1_CHML', 'soa4_a2_CHML', 'soa5_a1_CHML', 'soa5_a2_CHML', 'SVOC_CHML',
+ 'so4_a1_CHMP','so4_a2_CHMP', 'SOAG0_CHMP', 'SOAG1_CHMP', 'SOAG2_CHMP', 'SOAG3_CHMP', 'SOAG4_CHMP', 'TOTH', 'TOT_CLD_VISTAU',
+ 'TREFHTMN', 'TREFHTMX', 'TROP_P', 'TROP_T', 'TROP_Z', 'TTEND_TOT', 'TTGWORO', 'TTGWSDF', 'TTGWSDFORO', 'TTGWSKE', 'TTGWSKEORO',
+ 'TS', 'TSMN:M', 'TSMX:X', 'BURDENBCdn', 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSEASALTdn', 'BURDENSO4dn', 'BURDENSOAdn',
+ 'ABSORB', 'AODABSdn', 'AODBCdn', 'AODdnDUST01', 'AODdnDUST02', 'AODdnDUST03', 'AODdn_aitken', 'AODdn_accum', 'AODdn_coarse',
+ 'AODDUST02', 'AODDUST', 'AODNIRstdn', 'AODPOMdn', 'AODSO4dn', 'AODSOAdn', 'AODSSdn', 'AODUVdn', 'AODUVstdn', 'AODVIS',
+ 'AODVISdn', 'AODVISstdn', 'EXTINCTdn', 'EXTINCTNIRdn', 'EXTINCTUVdn', 'EXTxASYMdn', 'FLDSC', 'FLNR', 'FSNR',
+ 'CME', 'CMFDQ', 'CMFMC','CMFMC_DP', 'SOLLD', 'SOLSD', 'SSAVIS', 'SST','TAQ',
+ 'DCOCHM','DH2O2CHM', 'DHNO3CHM', 'DO3CHM', 'Dso4_a1CHM', 'Dso4_a2CHM', 'Dso4_a3CHM',
+ 'FLASHFRQ', 'LNO_COL_PROD', 'LNO_PROD','KVH_CLUBB','MASS', 'PDELDRY', 'NITROP_PD','PM25', 'PRECT', 'PTEQ', 'PTTEND',
+ 'QRLC', 'QRSC', 'QSNOW', 'QRAIN','GS_SO2', 'HNO3_GAS', 'HNO3_NAT', 'HNO3_STS','H2SO4M_C', 'H2SO4_sfnnuc1','HCL_GAS',
+ 'SAD_AERO', 'SAD_ICE', 'SAD_LNAT', 'SAD_SULFC', 'SAD_TROP' 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'REFF_AERO', 'RHREFHT',
+ 'EVAPPREC', 'EVAPQZM', 'EVAPTZM', 'FCTL','FREQZM', 'ZMDQ', 'ZMDT', 'ZMMTT', 'ZMMU','VEL_NAT2',
+ 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'bc_c1DDF', 'bc_c4DDF', 'dst_c1DDF', 'dst_c2DDF', 'dst_c3DDF',
+ 'ncl_c1DDF', 'ncl_c2DDF', 'ncl_c3DDF', 'pom_c1DDF', 'pom_c4DDF', 'num_c1DDF','num_c2DDF','num_c3DDF','num_c4DDF',
+ 'so4_a1_sfgaex1', 'so4_c1AQH2SO4', 'so4_c1AQSO4', 'so4_c1DDF', 'so4_a2_sfgaex1', 'so4_c2AQH2SO4', 'so4_c2AQSO4', 'so4_c2DDF',
+ 'so4_a3_sfgaex1', 'so4_c3AQH2SO4', 'so4_c3AQSO4', 'so4_c3DDF', 'so4_a2_sfnnuc1', 'num_a2_sfnnuc1',
+ 'soa1_a1_sfgaex1','soa1_c1DDF', 'soa1_a2_sfgaex1','soa1_c2DDF', 'soa2_a1_sfgaex1','soa2_c1DDF', 'soa2_a2_sfgaex1','soa2_c2DDF',
+ 'soa3_a1_sfgaex1','soa3_c1DDF', 'soa3_a2_sfgaex1','soa3_c2DDF', 'soa4_a1_sfgaex1','soa4_c1DDF', 'soa4_a2_sfgaex1','soa4_c2DDF',
+ 'soa5_a1_sfgaex1','soa5_c1DDF', 'soa5_a2_sfgaex1','soa5_c2DDF', 'jcl2o2', 'jh2o2', 'jno2', 'jo2_a', 'jo2_b', 'jo3_a', 'jo3_b', 'jpan',
+ 'r_het1', 'r_het2', 'r_het3', 'r_het4', 'r_het5', 'r_het6', 'r_het7', 'r_het8', 'r_het9', 'r_het10', 'r_het11', 'r_het12', 'r_het13',
+ 'r_het15', 'r_het16', 'r_het17', 'r_jsoa1_a1', 'r_jsoa1_a2', 'r_jsoa2_a1', 'r_jsoa2_a2', 'r_jsoa3_a1', 'r_jsoa3_a2', 'r_jsoa4_a1',
+ 'r_jsoa4_a2', 'r_jsoa5_a1', 'r_jsoa5_a2', 'r_GLYOXAL_aer', 'r_HO2_O3', 'r_N2O5_aer', 'r_NO2_aer', 'r_NO3_aer', 'r_O1D_H2O', 'r_OH_O3', 'r_OH_O',
'O3_Prod','O3_Loss','O3S_Loss','RO2_NO_sum','O3_alkenes','RO2_NO3_sum','RO2_HO2_sum','RO2_RO2_sum','RCO2_NO2_sum',
- 'OddOx_Ox_Loss','OddOx_HOx_Loss','OddOx_NOx_Loss','OddOx_CLOxBROx_Loss','OddOx_Loss_Tot','OddOx_Prod_Tot',
- 'Ox_Prod','Ox_Loss'
+ 'OddOx_Ox_Loss','OddOx_HOx_Loss','OddOx_NOx_Loss','OddOx_CLOxBROx_Loss','OddOx_Loss_Tot','OddOx_Prod_Tot', 'Ox_Prod','Ox_Loss'
diff --git a/bld/namelist_files/use_cases/waccm_tsmlt_2000_cam6.xml b/bld/namelist_files/use_cases/waccm_tsmlt_2000_cam6.xml
index 564cfaf660..3ad0c7db31 100644
--- a/bld/namelist_files/use_cases/waccm_tsmlt_2000_cam6.xml
+++ b/bld/namelist_files/use_cases/waccm_tsmlt_2000_cam6.xml
@@ -263,85 +263,36 @@
'AOA1SRC', 'AOA2SRC', 'NO2_CMXF'
- 'ABSORB', 'ACBZO2', 'ACTREL', 'ALKNIT', 'ALKO2', 'ALKOOH', 'AOA1', 'AOA_NH', 'AODABSdn', 'AODBCdn', 'AODdnDUST1', 'AODdnDUST2',
- 'AODdnDUST3', 'AODdnMODE1', 'AODdnMODE2', 'AODdnMODE3', 'AODDUST2', 'AODDUST', 'AODNIRstdn', 'AODPOMdn', 'AODSO4dn', 'AODSOAdn', 'AODSSdn',
- 'AODUVdn', 'AODUVstdn', 'AODVIS', 'AODVISdn', 'AODVISstdn', 'AQ_SO2', 'AREA', 'AREI', 'AREL', 'bc_a1', 'bc_a1DDF',
- 'bc_a1SFWET', 'bc_a4', 'bc_a4_CLXF', 'bc_a4DDF', 'bc_a4SFWET', 'BCARY', 'bc_c1', 'bc_c1DDF', 'bc_c1SFWET', 'bc_c4', 'bc_c4DDF',
- 'bc_c4SFWET', 'BENZENE', 'BENZO2', 'BENZOOH', 'BEPOMUC', 'BIGALD1', 'BIGALD2', 'BIGALD3', 'BIGALD4', 'BIGALD', 'BIGALK', 'BIGENE',
- 'BR', 'BRCL', 'BRO', 'BRONO2', 'BROX', 'BROY', 'BRY', 'BTTGWSPEC', 'BTTGWSDF', 'BTTGWSKE',
- 'BURDENBCdn', 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSEASALTdn', 'BURDENSO4dn',
- 'BURDENSOAdn', 'BUTGWSPEC', 'BZALD', 'BZOO', 'BZOOH', 'C2H2', 'C2H4', 'C2H5O2', 'C2H5OH', 'C2H5OOH', 'C2H6', 'C3H6', 'C3H7O2',
- 'C3H7OOH', 'C3H8', 'C6H5O2', 'C6H5OOH', 'CCL4', 'CDNUMC', 'CF2CLBR', 'CF3BR', 'CFC113', 'CFC114', 'CFC115', 'CFC11', 'CFC11STAR',
- 'CFC12', 'CH2BR2', 'CH2O', 'CH3BR', 'CH3CCL3', 'CH3CCL3_CHML', 'CH3CHO', 'CH3CL', 'CH3CN', 'CH3CO3', 'CH3COCH3', 'CH3COCHO',
- 'CH3COOH', 'CH3COOOH', 'CH3O2', 'CH3OH', 'CH3OOH', 'CH4', 'CH4_CHML', 'CHBR3', 'CL2', 'CL2O2', 'CL',
- 'CLDICE', 'CLDLIQ', 'CLDTOT', 'CLO', 'CLONO2', 'CLOUD', 'CLOX', 'CLOY', 'CLY', 'CME', 'CMFDQ', 'CMFMC',
- 'CMFMC_DP', 'CO2', 'CO2_CHML', 'CO', 'CO_CHML', 'CO_CHMP', 'COF2', 'COFCL', 'CONCLD', 'CRESOL',
- 'DCOCHM', 'DF_ALKNIT', 'DF_ALKOOH', 'DF_BENZOOH', 'DF_BZOOH', 'DF_C2H5OH', 'DF_C2H5OOH', 'DF_C3H7OOH', 'DF_C6H5OOH', 'DF_CH2O',
- 'DF_CH3CHO', 'DF_CH3CN', 'DF_CH3COCH3', 'DF_CH3COCHO', 'DF_CH3COOH', 'DF_CH3COOOH', 'DF_CH3OH', 'DF_CH3OOH', 'DF_CO', 'DF_EOOH',
- 'DF_GLYALD', 'DF_H2O2', 'DF_H2SO4', 'DF_HCN', 'DF_HCOOH', 'DF_HNO3', 'DF_HO2NO2', 'DF_HONITR', 'DF_HPALD', 'DF_HYAC', 'DF_HYDRALD',
- 'DF_IEPOX', 'DF_ISOPNITA', 'DF_ISOPNITB', 'DF_ISOPNO3', 'DF_ISOPNOOH', 'DF_ISOPOOH', 'DF_IVOC', 'DF_MACROOH', 'DF_MEKOOH',
- 'DF_MPAN', 'DF_NC4CH2OH', 'DF_NC4CHO', 'DF_NH3', 'DF_NH4', 'DF_NO2', 'DF_NO', 'DF_NOA', 'DF_NTERPOOH', 'DF_O3',
- 'DF_ONITR', 'DF_PAN', 'DF_PHENOOH', 'DF_POOH', 'DF_ROOH', 'DF_SO2', 'DF_SOAG0', 'DF_SOAG1', 'DF_SOAG2', 'DF_SOAG3',
- 'DF_SOAG4', 'DF_SVOC', 'DF_TERP2OOH', 'DF_TERPNIT', 'DF_TERPOOH', 'DF_TERPROD1', 'DF_TERPROD2', 'DF_TOLOOH', 'DF_XOOH', 'DF_XYLENOOH',
- 'DF_XYLOLOOH', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'DH2O2CHM', 'DHNO3CHM', 'DICARBO2', 'DMS', 'DO3CHM', 'dry_deposition_NHx_as_N',
- 'dry_deposition_NOy_as_N', 'Dso4_a1CHM', 'Dso4_a2CHM', 'Dso4_a3CHM', 'dst_a1', 'dst_a1DDF', 'dst_a1SFWET', 'dst_a2', 'dst_a2DDF',
- 'dst_a2SFWET', 'dst_a3', 'dst_a3DDF', 'dst_a3SFWET', 'dst_c1', 'dst_c1DDF', 'dst_c1SFWET', 'dst_c2', 'dst_c2DDF', 'dst_c2SFWET',
- 'dst_c3', 'dst_c3DDF', 'dst_c3SFWET', 'DTCORE', 'E90', 'e', 'ENEO2', 'EO2', 'EO', 'EOOH', 'EVAPPREC',
- 'EVAPQZM', 'EVAPTZM', 'EXTINCTdn', 'EXTINCTNIRdn', 'EXTINCTUVdn', 'EXTxASYMdn', 'F', 'FCTL',
- 'FLASHFRQ', 'FLDS', 'FLDSC', 'FLNR', 'FLNS', 'FLNSC', 'FLNT', 'FLNTC', 'FLUT', 'FLUTC', 'FREQI', 'FREQL', 'FREQZM', 'FSDS',
- 'FSDSC', 'FSNR', 'FSNS', 'FSNSC', 'FSNT', 'FSNTC', 'FSNTOAC', 'FSUTOA', 'GLYALD', 'GLYOXAL',
- 'GS_SO2', 'H2402', 'H2', 'H2O2', 'H2O', 'H2SO4', 'H2SO4M_C', 'H2SO4_sfnnuc1', 'H', 'HBR', 'HCFC141B', 'HCFC142B', 'HCFC22', 'HCL',
- 'HCL_GAS', 'HCN', 'HCOOH', 'HF', 'HNO3', 'HNO3_GAS', 'HNO3_NAT', 'HNO3_STS', 'HO2', 'HO2NO2', 'HOBR', 'HOCH2OO', 'HOCL', 'HONITR',
- 'HPALD', 'HYAC', 'HYDRALD', 'ICEFRAC', 'IEPOX', 'ISOP', 'ISOPAO2', 'ISOPBO2', 'ISOPNITA', 'ISOPNITB', 'ISOPNO3',
- 'ISOPNOOH', 'ISOPOOH', 'IVOC', 'IVOC_CHML', 'jcl2o2', 'jh2o2', 'jno2', 'jo2_a', 'jo2_b', 'jo3_a', 'jo3_b', 'jpan', 'KVH_CLUBB',
- 'LANDFRAC', 'LHFLX', 'LNO_COL_PROD', 'LNO_PROD', 'MACR', 'MACRO2', 'MACROOH', 'MALO2', 'MASS', 'MCO3', 'MDIALO2',
- 'MEG_BCARY', 'MEG_BIGALK', 'MEG_BIGENE', 'MEG_C2H4', 'MEG_C2H5OH', 'MEG_C2H6', 'MEG_C3H6', 'MEG_C3H8', 'MEG_CH2O',
- 'MEG_CH3CHO', 'MEG_CH3COCH3', 'MEG_CH3COOH', 'MEG_CH3OH', 'MEG_CO', 'MEG_HCN', 'MEG_HCOOH', 'MEG_ISOP', 'MEG_MTERP', 'MEG_TOLUENE',
- 'MEK', 'MEKO2', 'MEKOOH', 'MPAN', 'MTERP', 'MVK', 'N2D', 'N2O5', 'N2O', 'N2O_CHML', 'N2p', 'N', 'NC4CH2OH',
- 'NC4CHO', 'ncl_a1', 'ncl_a1DDF', 'ncl_a1SFWET', 'ncl_a2', 'ncl_a2DDF', 'ncl_a2SFWET', 'ncl_a3', 'ncl_a3DDF', 'ncl_a3SFWET', 'ncl_c1',
- 'ncl_c1DDF', 'ncl_c1SFWET', 'ncl_c2', 'ncl_c2DDF', 'ncl_c2SFWET', 'ncl_c3', 'ncl_c3DDF', 'ncl_c3SFWET', 'NDEP', 'NH3', 'NH4', 'NH_50',
- 'NH_5', 'NHDEP', 'NITROP_PD', 'NO2', 'NO2_CLXF', 'NO3', 'NO', 'NOA', 'NOp', 'NOX', 'NOY', 'Np', 'NTERPO2', 'NTERPOOH',
- 'num_a1', 'num_a1_CLXF', 'num_a1DDF', 'num_a2', 'num_a2_CLXF', 'num_a2DDF', 'num_a2_sfnnuc1', 'num_a3', 'num_a3DDF', 'num_a4',
- 'num_a4DDF', 'num_c1', 'num_c1DDF', 'num_c2', 'num_c2DDF', 'num_c3', 'num_c3DDF', 'num_c4', 'num_c4DDF', 'NUMLIQ', 'O1D', 'O2_1D',
- 'O2_1S', 'O2', 'O2p', 'O3', 'O3S', 'O3_CHML', 'O3_CHMP', 'O', 'OCLO', 'OCS', 'OH', 'OMEGA', 'OMEGAT', 'ONITR', 'Op',
- 'PAN', 'PBLH', 'PBZNIT', 'PDELDRY', 'PHENO2', 'PHENO', 'PHENOL', 'PHENOOH', 'PHIS', 'PM25', 'PO2', 'pom_a1', 'pom_a1DDF', 'pom_a1SFWET',
- 'pom_a4', 'pom_a4DDF', 'pom_a4SFWET', 'pom_c1', 'pom_c1DDF', 'pom_c1SFWET', 'pom_c4', 'pom_c4DDF', 'pom_c4SFWET',
- 'POOH', 'PRECC', 'PRECT', 'PS', 'PSL', 'PTEQ', 'PTTEND', 'Q', 'QFLX', 'QRAIN', 'QREFHT', 'QRL', 'QRLC', 'QRS',
- 'QRSC', 'QSNOW', 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'REFF_AERO', 'RELHUM', 'r_GLYOXAL_aer',
- 'r_het10', 'r_het11', 'r_het12', 'r_het13', 'r_het15', 'r_het16', 'r_het17', 'r_het1', 'r_het2', 'r_het3', 'r_het4', 'r_het5',
- 'r_het6', 'r_het7', 'r_het8', 'r_het9', 'r_HO2_O3', 'RHREFHT', 'r_jsoa1_a1', 'r_jsoa1_a2', 'r_jsoa2_a1', 'r_jsoa2_a2',
- 'r_jsoa3_a1', 'r_jsoa3_a2', 'r_jsoa4_a1', 'r_jsoa4_a2', 'r_jsoa5_a1', 'r_jsoa5_a2', 'r_N2O5_aer', 'r_NO2_aer', 'r_NO3_aer', 'r_O1D_H2O',
- 'r_OH_O3', 'r_OH_O', 'ROOH', 'RO2',
- 'S', 'SAD_AERO', 'SAD_ICE', 'SAD_LNAT', 'SAD_SULFC', 'SAD_TROP', 'SF6', 'SFbc_a4', 'SFBCARY',
- 'SFBENZENE', 'SFBIGALK', 'SFBIGENE', 'SFC2H2', 'SFC2H4', 'SFC2H5OH', 'SFC2H6', 'SFC3H6', 'SFC3H8', 'SFCH2O', 'SFCH3CHO', 'SFCH3CN',
- 'SFCH3COCH3', 'SFCH3COCHO', 'SFCH3COOH', 'SFCH3OH', 'SFCO', 'SFDMS', 'SFdst_a1', 'SFdst_a2', 'SFdst_a3', 'SFGLYALD', 'SFHCN', 'SFHCOOH',
- 'SFISOP', 'SFIVOC', 'SFMEK', 'SFMTERP', 'SFncl_a1', 'SFncl_a2', 'SFncl_a3', 'SFNH3', 'SFNO2', 'SFNO', 'SFnum_a1', 'SFnum_a2',
- 'SFnum_a3', 'SFpom_a4', 'SFSO2', 'SFso4_a1', 'SFso4_a2', 'SFSVOC', 'SFTOLUENE', 'SFXYLENES', 'SHFLX', 'SO2',
- 'SO2_CHML', 'SO2_CHMP', 'SO2_CLXF', 'SO2_XFRC', 'SO3', 'so4_a1', 'so4_a1_CHMP', 'so4_a1_CLXF', 'so4_a1DDF', 'so4_a1_sfgaex1', 'so4_a1SFWET',
- 'so4_a2', 'so4_a2_CHMP', 'so4_a2_CLXF', 'so4_a2DDF', 'so4_a2_sfgaex1', 'so4_a2_sfnnuc1', 'so4_a2SFWET', 'so4_a3',
- 'so4_a3DDF', 'so4_a3_sfgaex1', 'so4_a3SFWET', 'so4_c1', 'so4_c1AQH2SO4', 'so4_c1AQSO4', 'so4_c1DDF', 'so4_c1SFWET', 'so4_c2', 'so4_c2AQH2SO4',
- 'so4_c2AQSO4', 'so4_c2DDF', 'so4_c2SFWET', 'so4_c3', 'so4_c3AQH2SO4', 'so4_c3AQSO4', 'so4_c3DDF', 'so4_c3SFWET', 'SO', 'soa1_a1',
- 'soa1_a1_CHML', 'soa1_a1DDF', 'soa1_a1_sfgaex1', 'soa1_a1SFWET', 'soa1_a2', 'soa1_a2_CHML', 'soa1_a2DDF',
- 'soa1_a2_sfgaex1', 'soa1_a2SFWET', 'soa1_c1', 'soa1_c1DDF', 'soa1_c1SFWET', 'soa1_c2', 'soa1_c2DDF', 'soa1_c2SFWET', 'soa2_a1', 'soa2_a1_CHML',
- 'soa2_a1DDF', 'soa2_a1_sfgaex1', 'soa2_a1SFWET', 'soa2_a2', 'soa2_a2_CHML', 'soa2_a2DDF', 'soa2_a2_sfgaex1',
- 'soa2_a2SFWET', 'soa2_c1', 'soa2_c1DDF', 'soa2_c1SFWET', 'soa2_c2', 'soa2_c2DDF', 'soa2_c2SFWET', 'soa3_a1', 'soa3_a1_CHML',
- 'soa3_a1DDF', 'soa3_a1_sfgaex1', 'soa3_a1SFWET', 'soa3_a2', 'soa3_a2_CHML', 'soa3_a2DDF', 'soa3_a2_sfgaex1', 'soa3_a2SFWET',
- 'soa3_c1', 'soa3_c1DDF', 'soa3_c1SFWET', 'soa3_c2', 'soa3_c2DDF', 'soa3_c2SFWET', 'soa4_a1', 'soa4_a1_CHML', 'soa4_a1DDF',
- 'soa4_a1_sfgaex1', 'soa4_a1SFWET', 'soa4_a2', 'soa4_a2_CHML', 'soa4_a2DDF', 'soa4_a2_sfgaex1', 'soa4_a2SFWET', 'soa4_c1',
- 'soa4_c1DDF', 'soa4_c1SFWET', 'soa4_c2', 'soa4_c2DDF', 'soa4_c2SFWET', 'soa5_a1', 'soa5_a1_CHML', 'soa5_a1DDF', 'soa5_a1_sfgaex1',
- 'soa5_a1SFWET', 'soa5_a2', 'soa5_a2_CHML', 'soa5_a2DDF', 'soa5_a2_sfgaex1', 'soa5_a2SFWET', 'soa5_c1', 'soa5_c1DDF',
- 'soa5_c1SFWET', 'soa5_c2', 'soa5_c2DDF', 'soa5_c2SFWET', 'SOAG0', 'SOAG0_CHMP', 'SOAG1', 'SOAG1_CHMP', 'SOAG2', 'SOAG2_CHMP',
- 'SOAG3', 'SOAG3_CHMP', 'SOAG4', 'SOAG4_CHMP', 'SOLIN', 'SOLLD', 'SOLSD', 'SSAVIS', 'SST', 'ST80_25', 'SVOC', 'SVOC_CHML',
- 'T', 'TAQ', 'TAUBLJX', 'TAUBLJY', 'TAUGWX', 'TAUGWY', 'TAUX', 'TAUY', 'TBRY', 'TCLY', 'TEPOMUC', 'TERP2O2', 'TERP2OOH',
- 'TERPNIT', 'TERPO2', 'TERPOOH', 'TERPROD1', 'TERPROD2', 'TGCLDIWP', 'TGCLDLWP', 'TMDMS', 'TMOCS', 'TMQ', 'TMSO2',
- 'TMso4_a1', 'TMso4_a2', 'TMso4_a3', 'TOLO2', 'TOLOOH', 'TOLUENE', 'TOT_CLD_VISTAU', 'TOTH', 'TREFHT', 'TREFHTMN', 'TREFHTMX', 'TROP_P',
- 'TROP_T', 'TROP_Z', 'TS', 'TSMN:M', 'TSMX:X', 'TTEND_TOT', 'TTGWORO', 'TTGWSDF', 'TTGWSDFORO', 'TTGWSKE', 'TTGWSKEORO', 'TTGWSPEC',
- 'U10', 'U', 'UTGWORO', 'UTGWSPEC', 'UU', 'V', 'VD01', 'VEL_NAT2', 'VV',
- 'wet_deposition_NHx_as_N', 'wet_deposition_NOy_as_N', 'XO2', 'XOOH', 'XYLENES', 'XYLENO2', 'XYLENOOH', 'XYLOL', 'XYLOLO2',
- 'XYLOLOOH', 'Z3', 'ZMDQ', 'ZMDT', 'ZMMTT', 'ZMMU',
+ 'ACTREL', 'AQ_SO2', 'AREA', 'BROX', 'BROY', 'BRY', 'CLOX', 'CLOY', 'CLY', 'NOX', 'NOY', 'TBRY', 'TCLY', 'CFC11STAR',
+ 'BTTGWSPEC', 'BTTGWSDF', 'BTTGWSKE', 'CONCLD', 'CME', 'CMFDQ', 'CMFMC', 'CMFMC_DP',
+ 'CH3CCL3_CHML', 'CH4_CHML', 'CO2_CHML', 'CO_CHML', 'IVOC_CHML', 'N2O_CHML', 'O3_CHML', 'SO2_CHML',
+ 'CO_CHMP', 'O3_CHMP', 'SO2_CHMP', 'TMDMS', 'TMOCS', 'TMSO2','TMso4_a1', 'TMso4_a2', 'TMso4_a3',
+ 'soa1_a1_CHML', 'soa1_a2_CHML', 'soa2_a1_CHML', 'soa2_a2_CHML', 'soa3_a1_CHML', 'soa3_a2_CHML',
+ 'soa4_a1_CHML', 'soa4_a2_CHML', 'soa5_a1_CHML', 'soa5_a2_CHML', 'SVOC_CHML',
+ 'so4_a1_CHMP','so4_a2_CHMP', 'SOAG0_CHMP', 'SOAG1_CHMP', 'SOAG2_CHMP', 'SOAG3_CHMP', 'SOAG4_CHMP', 'TOTH', 'TOT_CLD_VISTAU',
+ 'TREFHTMN', 'TREFHTMX', 'TROP_P', 'TROP_T', 'TROP_Z', 'TTEND_TOT', 'TTGWORO', 'TTGWSDF', 'TTGWSDFORO', 'TTGWSKE', 'TTGWSKEORO',
+ 'TS', 'TSMN:M', 'TSMX:X', 'BURDENBCdn', 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSEASALTdn', 'BURDENSO4dn', 'BURDENSOAdn',
+ 'ABSORB', 'AODABSdn', 'AODBCdn', 'AODdnDUST01', 'AODdnDUST02', 'AODdnDUST03', 'AODdn_aitken', 'AODdn_accum', 'AODdn_coarse',
+ 'AODDUST02', 'AODDUST', 'AODNIRstdn', 'AODPOMdn', 'AODSO4dn', 'AODSOAdn', 'AODSSdn', 'AODUVdn', 'AODUVstdn', 'AODVIS',
+ 'AODVISdn', 'AODVISstdn', 'EXTINCTdn', 'EXTINCTNIRdn', 'EXTINCTUVdn', 'EXTxASYMdn', 'FLDSC', 'FLNR', 'FSNR',
+ 'CME', 'CMFDQ', 'CMFMC','CMFMC_DP', 'SOLLD', 'SOLSD', 'SSAVIS', 'SST','TAQ',
+ 'DCOCHM','DH2O2CHM', 'DHNO3CHM', 'DO3CHM', 'Dso4_a1CHM', 'Dso4_a2CHM', 'Dso4_a3CHM',
+ 'FLASHFRQ', 'LNO_COL_PROD', 'LNO_PROD','KVH_CLUBB','MASS', 'PDELDRY', 'NITROP_PD','PM25', 'PRECT', 'PTEQ', 'PTTEND',
+ 'QRLC', 'QRSC', 'QSNOW', 'QRAIN','GS_SO2', 'HNO3_GAS', 'HNO3_NAT', 'HNO3_STS','H2SO4M_C', 'H2SO4_sfnnuc1','HCL_GAS',
+ 'SAD_AERO', 'SAD_ICE', 'SAD_LNAT', 'SAD_SULFC', 'SAD_TROP' 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'REFF_AERO', 'RHREFHT',
+ 'EVAPPREC', 'EVAPQZM', 'EVAPTZM', 'FCTL','FREQZM', 'ZMDQ', 'ZMDT', 'ZMMTT', 'ZMMU','VEL_NAT2',
+ 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'bc_c1DDF', 'bc_c4DDF', 'dst_c1DDF', 'dst_c2DDF', 'dst_c3DDF',
+ 'ncl_c1DDF', 'ncl_c2DDF', 'ncl_c3DDF', 'pom_c1DDF', 'pom_c4DDF', 'num_c1DDF','num_c2DDF','num_c3DDF','num_c4DDF',
+ 'so4_a1_sfgaex1', 'so4_c1AQH2SO4', 'so4_c1AQSO4', 'so4_c1DDF', 'so4_a2_sfgaex1', 'so4_c2AQH2SO4', 'so4_c2AQSO4', 'so4_c2DDF',
+ 'so4_a3_sfgaex1', 'so4_c3AQH2SO4', 'so4_c3AQSO4', 'so4_c3DDF', 'so4_a2_sfnnuc1', 'num_a2_sfnnuc1',
+ 'soa1_a1_sfgaex1','soa1_c1DDF', 'soa1_a2_sfgaex1','soa1_c2DDF', 'soa2_a1_sfgaex1','soa2_c1DDF', 'soa2_a2_sfgaex1','soa2_c2DDF',
+ 'soa3_a1_sfgaex1','soa3_c1DDF', 'soa3_a2_sfgaex1','soa3_c2DDF', 'soa4_a1_sfgaex1','soa4_c1DDF', 'soa4_a2_sfgaex1','soa4_c2DDF',
+ 'soa5_a1_sfgaex1','soa5_c1DDF', 'soa5_a2_sfgaex1','soa5_c2DDF', 'jcl2o2', 'jh2o2', 'jno2', 'jo2_a', 'jo2_b', 'jo3_a', 'jo3_b', 'jpan',
+ 'r_het1', 'r_het2', 'r_het3', 'r_het4', 'r_het5', 'r_het6', 'r_het7', 'r_het8', 'r_het9', 'r_het10', 'r_het11', 'r_het12', 'r_het13',
+ 'r_het15', 'r_het16', 'r_het17', 'r_jsoa1_a1', 'r_jsoa1_a2', 'r_jsoa2_a1', 'r_jsoa2_a2', 'r_jsoa3_a1', 'r_jsoa3_a2', 'r_jsoa4_a1',
+ 'r_jsoa4_a2', 'r_jsoa5_a1', 'r_jsoa5_a2', 'r_GLYOXAL_aer', 'r_HO2_O3', 'r_N2O5_aer', 'r_NO2_aer', 'r_NO3_aer', 'r_O1D_H2O', 'r_OH_O3', 'r_OH_O',
'O3_Prod','O3_Loss','O3S_Loss','RO2_NO_sum','O3_alkenes','RO2_NO3_sum','RO2_HO2_sum','RO2_RO2_sum','RCO2_NO2_sum',
- 'OddOx_Ox_Loss','OddOx_HOx_Loss','OddOx_NOx_Loss','OddOx_CLOxBROx_Loss','OddOx_Loss_Tot','OddOx_Prod_Tot',
- 'Ox_Prod','Ox_Loss'
+ 'OddOx_Ox_Loss','OddOx_HOx_Loss','OddOx_NOx_Loss','OddOx_CLOxBROx_Loss','OddOx_Loss_Tot','OddOx_Prod_Tot', 'Ox_Prod','Ox_Loss'
diff --git a/bld/namelist_files/use_cases/waccm_tsmlt_2010_cam6.xml b/bld/namelist_files/use_cases/waccm_tsmlt_2010_cam6.xml
index 70a9f99e37..219083b1a4 100644
--- a/bld/namelist_files/use_cases/waccm_tsmlt_2010_cam6.xml
+++ b/bld/namelist_files/use_cases/waccm_tsmlt_2010_cam6.xml
@@ -163,85 +163,36 @@
'AOA1SRC', 'AOA2SRC', 'NO2_CMXF'
- 'ABSORB', 'ACBZO2', 'ACTREL', 'ALKNIT', 'ALKO2', 'ALKOOH', 'AOA1', 'AOA_NH', 'AODABSdn', 'AODBCdn', 'AODdnDUST1', 'AODdnDUST2',
- 'AODdnDUST3', 'AODdnMODE1', 'AODdnMODE2', 'AODdnMODE3', 'AODDUST2', 'AODDUST', 'AODNIRstdn', 'AODPOMdn', 'AODSO4dn', 'AODSOAdn', 'AODSSdn',
- 'AODUVdn', 'AODUVstdn', 'AODVIS', 'AODVISdn', 'AODVISstdn', 'AQ_SO2', 'AREA', 'AREI', 'AREL', 'bc_a1', 'bc_a1DDF',
- 'bc_a1SFWET', 'bc_a4', 'bc_a4_CLXF', 'bc_a4DDF', 'bc_a4SFWET', 'BCARY', 'bc_c1', 'bc_c1DDF', 'bc_c1SFWET', 'bc_c4', 'bc_c4DDF',
- 'bc_c4SFWET', 'BENZENE', 'BENZO2', 'BENZOOH', 'BEPOMUC', 'BIGALD1', 'BIGALD2', 'BIGALD3', 'BIGALD4', 'BIGALD', 'BIGALK', 'BIGENE',
- 'BR', 'BRCL', 'BRO', 'BRONO2', 'BROX', 'BROY', 'BRY', 'BTTGWSPEC', 'BTTGWSDF', 'BTTGWSKE',
- 'BURDENBCdn', 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSEASALTdn', 'BURDENSO4dn',
- 'BURDENSOAdn', 'BUTGWSPEC', 'BZALD', 'BZOO', 'BZOOH', 'C2H2', 'C2H4', 'C2H5O2', 'C2H5OH', 'C2H5OOH', 'C2H6', 'C3H6', 'C3H7O2',
- 'C3H7OOH', 'C3H8', 'C6H5O2', 'C6H5OOH', 'CCL4', 'CDNUMC', 'CF2CLBR', 'CF3BR', 'CFC113', 'CFC114', 'CFC115', 'CFC11', 'CFC11STAR',
- 'CFC12', 'CH2BR2', 'CH2O', 'CH3BR', 'CH3CCL3', 'CH3CCL3_CHML', 'CH3CHO', 'CH3CL', 'CH3CN', 'CH3CO3', 'CH3COCH3', 'CH3COCHO',
- 'CH3COOH', 'CH3COOOH', 'CH3O2', 'CH3OH', 'CH3OOH', 'CH4', 'CH4_CHML', 'CHBR3', 'CL2', 'CL2O2', 'CL',
- 'CLDICE', 'CLDLIQ', 'CLDTOT', 'CLO', 'CLONO2', 'CLOUD', 'CLOX', 'CLOY', 'CLY', 'CME', 'CMFDQ', 'CMFMC',
- 'CMFMC_DP', 'CO2', 'CO2_CHML', 'CO', 'CO_CHML', 'CO_CHMP', 'COF2', 'COFCL', 'CONCLD', 'CRESOL',
- 'DCOCHM', 'DF_ALKNIT', 'DF_ALKOOH', 'DF_BENZOOH', 'DF_BZOOH', 'DF_C2H5OH', 'DF_C2H5OOH', 'DF_C3H7OOH', 'DF_C6H5OOH', 'DF_CH2O',
- 'DF_CH3CHO', 'DF_CH3CN', 'DF_CH3COCH3', 'DF_CH3COCHO', 'DF_CH3COOH', 'DF_CH3COOOH', 'DF_CH3OH', 'DF_CH3OOH', 'DF_CO', 'DF_EOOH',
- 'DF_GLYALD', 'DF_H2O2', 'DF_H2SO4', 'DF_HCN', 'DF_HCOOH', 'DF_HNO3', 'DF_HO2NO2', 'DF_HONITR', 'DF_HPALD', 'DF_HYAC', 'DF_HYDRALD',
- 'DF_IEPOX', 'DF_ISOPNITA', 'DF_ISOPNITB', 'DF_ISOPNO3', 'DF_ISOPNOOH', 'DF_ISOPOOH', 'DF_IVOC', 'DF_MACROOH', 'DF_MEKOOH',
- 'DF_MPAN', 'DF_NC4CH2OH', 'DF_NC4CHO', 'DF_NH3', 'DF_NH4', 'DF_NO2', 'DF_NO', 'DF_NOA', 'DF_NTERPOOH', 'DF_O3',
- 'DF_ONITR', 'DF_PAN', 'DF_PHENOOH', 'DF_POOH', 'DF_ROOH', 'DF_SO2', 'DF_SOAG0', 'DF_SOAG1', 'DF_SOAG2', 'DF_SOAG3',
- 'DF_SOAG4', 'DF_SVOC', 'DF_TERP2OOH', 'DF_TERPNIT', 'DF_TERPOOH', 'DF_TERPROD1', 'DF_TERPROD2', 'DF_TOLOOH', 'DF_XOOH', 'DF_XYLENOOH',
- 'DF_XYLOLOOH', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'DH2O2CHM', 'DHNO3CHM', 'DICARBO2', 'DMS', 'DO3CHM', 'dry_deposition_NHx_as_N',
- 'dry_deposition_NOy_as_N', 'Dso4_a1CHM', 'Dso4_a2CHM', 'Dso4_a3CHM', 'dst_a1', 'dst_a1DDF', 'dst_a1SFWET', 'dst_a2', 'dst_a2DDF',
- 'dst_a2SFWET', 'dst_a3', 'dst_a3DDF', 'dst_a3SFWET', 'dst_c1', 'dst_c1DDF', 'dst_c1SFWET', 'dst_c2', 'dst_c2DDF', 'dst_c2SFWET',
- 'dst_c3', 'dst_c3DDF', 'dst_c3SFWET', 'DTCORE', 'E90', 'e', 'ENEO2', 'EO2', 'EO', 'EOOH', 'EVAPPREC',
- 'EVAPQZM', 'EVAPTZM', 'EXTINCTdn', 'EXTINCTNIRdn', 'EXTINCTUVdn', 'EXTxASYMdn', 'F', 'FCTL',
- 'FLASHFRQ', 'FLDS', 'FLDSC', 'FLNR', 'FLNS', 'FLNSC', 'FLNT', 'FLNTC', 'FLUT', 'FLUTC', 'FREQI', 'FREQL', 'FREQZM', 'FSDS',
- 'FSDSC', 'FSNR', 'FSNS', 'FSNSC', 'FSNT', 'FSNTC', 'FSNTOAC', 'FSUTOA', 'GLYALD', 'GLYOXAL',
- 'GS_SO2', 'H2402', 'H2', 'H2O2', 'H2O', 'H2SO4', 'H2SO4M_C', 'H2SO4_sfnnuc1', 'H', 'HBR', 'HCFC141B', 'HCFC142B', 'HCFC22', 'HCL',
- 'HCL_GAS', 'HCN', 'HCOOH', 'HF', 'HNO3', 'HNO3_GAS', 'HNO3_NAT', 'HNO3_STS', 'HO2', 'HO2NO2', 'HOBR', 'HOCH2OO', 'HOCL', 'HONITR',
- 'HPALD', 'HYAC', 'HYDRALD', 'ICEFRAC', 'IEPOX', 'ISOP', 'ISOPAO2', 'ISOPBO2', 'ISOPNITA', 'ISOPNITB', 'ISOPNO3',
- 'ISOPNOOH', 'ISOPOOH', 'IVOC', 'IVOC_CHML', 'jcl2o2', 'jh2o2', 'jno2', 'jo2_a', 'jo2_b', 'jo3_a', 'jo3_b', 'jpan', 'KVH_CLUBB',
- 'LANDFRAC', 'LHFLX', 'LNO_COL_PROD', 'LNO_PROD', 'MACR', 'MACRO2', 'MACROOH', 'MALO2', 'MASS', 'MCO3', 'MDIALO2',
- 'MEG_BCARY', 'MEG_BIGALK', 'MEG_BIGENE', 'MEG_C2H4', 'MEG_C2H5OH', 'MEG_C2H6', 'MEG_C3H6', 'MEG_C3H8', 'MEG_CH2O',
- 'MEG_CH3CHO', 'MEG_CH3COCH3', 'MEG_CH3COOH', 'MEG_CH3OH', 'MEG_CO', 'MEG_HCN', 'MEG_HCOOH', 'MEG_ISOP', 'MEG_MTERP', 'MEG_TOLUENE',
- 'MEK', 'MEKO2', 'MEKOOH', 'MPAN', 'MTERP', 'MVK', 'N2D', 'N2O5', 'N2O', 'N2O_CHML', 'N2p', 'N', 'NC4CH2OH',
- 'NC4CHO', 'ncl_a1', 'ncl_a1DDF', 'ncl_a1SFWET', 'ncl_a2', 'ncl_a2DDF', 'ncl_a2SFWET', 'ncl_a3', 'ncl_a3DDF', 'ncl_a3SFWET', 'ncl_c1',
- 'ncl_c1DDF', 'ncl_c1SFWET', 'ncl_c2', 'ncl_c2DDF', 'ncl_c2SFWET', 'ncl_c3', 'ncl_c3DDF', 'ncl_c3SFWET', 'NDEP', 'NH3', 'NH4', 'NH_50',
- 'NH_5', 'NHDEP', 'NITROP_PD', 'NO2', 'NO2_CLXF', 'NO3', 'NO', 'NOA', 'NOp', 'NOX', 'NOY', 'Np', 'NTERPO2', 'NTERPOOH',
- 'num_a1', 'num_a1_CLXF', 'num_a1DDF', 'num_a2', 'num_a2_CLXF', 'num_a2DDF', 'num_a2_sfnnuc1', 'num_a3', 'num_a3DDF', 'num_a4',
- 'num_a4DDF', 'num_c1', 'num_c1DDF', 'num_c2', 'num_c2DDF', 'num_c3', 'num_c3DDF', 'num_c4', 'num_c4DDF', 'NUMLIQ', 'O1D', 'O2_1D',
- 'O2_1S', 'O2', 'O2p', 'O3', 'O3S', 'O3_CHML', 'O3_CHMP', 'O', 'OCLO', 'OCS', 'OH', 'OMEGA', 'OMEGAT', 'ONITR', 'Op',
- 'PAN', 'PBLH', 'PBZNIT', 'PDELDRY', 'PHENO2', 'PHENO', 'PHENOL', 'PHENOOH', 'PHIS', 'PM25', 'PO2', 'pom_a1', 'pom_a1DDF', 'pom_a1SFWET',
- 'pom_a4', 'pom_a4DDF', 'pom_a4SFWET', 'pom_c1', 'pom_c1DDF', 'pom_c1SFWET', 'pom_c4', 'pom_c4DDF', 'pom_c4SFWET',
- 'POOH', 'PRECC', 'PRECT', 'PS', 'PSL', 'PTEQ', 'PTTEND', 'Q', 'QFLX', 'QRAIN', 'QREFHT', 'QRL', 'QRLC', 'QRS',
- 'QRSC', 'QSNOW', 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'REFF_AERO', 'RELHUM', 'r_GLYOXAL_aer',
- 'r_het10', 'r_het11', 'r_het12', 'r_het13', 'r_het15', 'r_het16', 'r_het17', 'r_het1', 'r_het2', 'r_het3', 'r_het4', 'r_het5',
- 'r_het6', 'r_het7', 'r_het8', 'r_het9', 'r_HO2_O3', 'RHREFHT', 'r_jsoa1_a1', 'r_jsoa1_a2', 'r_jsoa2_a1', 'r_jsoa2_a2',
- 'r_jsoa3_a1', 'r_jsoa3_a2', 'r_jsoa4_a1', 'r_jsoa4_a2', 'r_jsoa5_a1', 'r_jsoa5_a2', 'r_N2O5_aer', 'r_NO2_aer', 'r_NO3_aer', 'r_O1D_H2O',
- 'r_OH_O3', 'r_OH_O', 'ROOH', 'RO2',
- 'S', 'SAD_AERO', 'SAD_ICE', 'SAD_LNAT', 'SAD_SULFC', 'SAD_TROP', 'SF6', 'SFbc_a4', 'SFBCARY',
- 'SFBENZENE', 'SFBIGALK', 'SFBIGENE', 'SFC2H2', 'SFC2H4', 'SFC2H5OH', 'SFC2H6', 'SFC3H6', 'SFC3H8', 'SFCH2O', 'SFCH3CHO', 'SFCH3CN',
- 'SFCH3COCH3', 'SFCH3COCHO', 'SFCH3COOH', 'SFCH3OH', 'SFCO', 'SFDMS', 'SFdst_a1', 'SFdst_a2', 'SFdst_a3', 'SFGLYALD', 'SFHCN', 'SFHCOOH',
- 'SFISOP', 'SFIVOC', 'SFMEK', 'SFMTERP', 'SFncl_a1', 'SFncl_a2', 'SFncl_a3', 'SFNH3', 'SFNO2', 'SFNO', 'SFnum_a1', 'SFnum_a2',
- 'SFnum_a3', 'SFpom_a4', 'SFSO2', 'SFso4_a1', 'SFso4_a2', 'SFSVOC', 'SFTOLUENE', 'SFXYLENES', 'SHFLX', 'SO2',
- 'SO2_CHML', 'SO2_CHMP', 'SO2_CLXF', 'SO2_XFRC', 'SO3', 'so4_a1', 'so4_a1_CHMP', 'so4_a1_CLXF', 'so4_a1DDF', 'so4_a1_sfgaex1', 'so4_a1SFWET',
- 'so4_a2', 'so4_a2_CHMP', 'so4_a2_CLXF', 'so4_a2DDF', 'so4_a2_sfgaex1', 'so4_a2_sfnnuc1', 'so4_a2SFWET', 'so4_a3',
- 'so4_a3DDF', 'so4_a3_sfgaex1', 'so4_a3SFWET', 'so4_c1', 'so4_c1AQH2SO4', 'so4_c1AQSO4', 'so4_c1DDF', 'so4_c1SFWET', 'so4_c2', 'so4_c2AQH2SO4',
- 'so4_c2AQSO4', 'so4_c2DDF', 'so4_c2SFWET', 'so4_c3', 'so4_c3AQH2SO4', 'so4_c3AQSO4', 'so4_c3DDF', 'so4_c3SFWET', 'SO', 'soa1_a1',
- 'soa1_a1_CHML', 'soa1_a1DDF', 'soa1_a1_sfgaex1', 'soa1_a1SFWET', 'soa1_a2', 'soa1_a2_CHML', 'soa1_a2DDF',
- 'soa1_a2_sfgaex1', 'soa1_a2SFWET', 'soa1_c1', 'soa1_c1DDF', 'soa1_c1SFWET', 'soa1_c2', 'soa1_c2DDF', 'soa1_c2SFWET', 'soa2_a1', 'soa2_a1_CHML',
- 'soa2_a1DDF', 'soa2_a1_sfgaex1', 'soa2_a1SFWET', 'soa2_a2', 'soa2_a2_CHML', 'soa2_a2DDF', 'soa2_a2_sfgaex1',
- 'soa2_a2SFWET', 'soa2_c1', 'soa2_c1DDF', 'soa2_c1SFWET', 'soa2_c2', 'soa2_c2DDF', 'soa2_c2SFWET', 'soa3_a1', 'soa3_a1_CHML',
- 'soa3_a1DDF', 'soa3_a1_sfgaex1', 'soa3_a1SFWET', 'soa3_a2', 'soa3_a2_CHML', 'soa3_a2DDF', 'soa3_a2_sfgaex1', 'soa3_a2SFWET',
- 'soa3_c1', 'soa3_c1DDF', 'soa3_c1SFWET', 'soa3_c2', 'soa3_c2DDF', 'soa3_c2SFWET', 'soa4_a1', 'soa4_a1_CHML', 'soa4_a1DDF',
- 'soa4_a1_sfgaex1', 'soa4_a1SFWET', 'soa4_a2', 'soa4_a2_CHML', 'soa4_a2DDF', 'soa4_a2_sfgaex1', 'soa4_a2SFWET', 'soa4_c1',
- 'soa4_c1DDF', 'soa4_c1SFWET', 'soa4_c2', 'soa4_c2DDF', 'soa4_c2SFWET', 'soa5_a1', 'soa5_a1_CHML', 'soa5_a1DDF', 'soa5_a1_sfgaex1',
- 'soa5_a1SFWET', 'soa5_a2', 'soa5_a2_CHML', 'soa5_a2DDF', 'soa5_a2_sfgaex1', 'soa5_a2SFWET', 'soa5_c1', 'soa5_c1DDF',
- 'soa5_c1SFWET', 'soa5_c2', 'soa5_c2DDF', 'soa5_c2SFWET', 'SOAG0', 'SOAG0_CHMP', 'SOAG1', 'SOAG1_CHMP', 'SOAG2', 'SOAG2_CHMP',
- 'SOAG3', 'SOAG3_CHMP', 'SOAG4', 'SOAG4_CHMP', 'SOLIN', 'SOLLD', 'SOLSD', 'SSAVIS', 'SST', 'ST80_25', 'SVOC', 'SVOC_CHML',
- 'T', 'TAQ', 'TAUBLJX', 'TAUBLJY', 'TAUGWX', 'TAUGWY', 'TAUX', 'TAUY', 'TBRY', 'TCLY', 'TEPOMUC', 'TERP2O2', 'TERP2OOH',
- 'TERPNIT', 'TERPO2', 'TERPOOH', 'TERPROD1', 'TERPROD2', 'TGCLDIWP', 'TGCLDLWP', 'TMDMS', 'TMOCS', 'TMQ', 'TMSO2',
- 'TMso4_a1', 'TMso4_a2', 'TMso4_a3', 'TOLO2', 'TOLOOH', 'TOLUENE', 'TOT_CLD_VISTAU', 'TOTH', 'TREFHT', 'TREFHTMN', 'TREFHTMX', 'TROP_P',
- 'TROP_T', 'TROP_Z', 'TS', 'TSMN:M', 'TSMX:X', 'TTEND_TOT', 'TTGWORO', 'TTGWSDF', 'TTGWSDFORO', 'TTGWSKE', 'TTGWSKEORO', 'TTGWSPEC',
- 'U10', 'U', 'UTGWORO', 'UTGWSPEC', 'UU', 'V', 'VD01', 'VEL_NAT2', 'VV',
- 'wet_deposition_NHx_as_N', 'wet_deposition_NOy_as_N', 'XO2', 'XOOH', 'XYLENES', 'XYLENO2', 'XYLENOOH', 'XYLOL', 'XYLOLO2',
- 'XYLOLOOH', 'Z3', 'ZMDQ', 'ZMDT', 'ZMMTT', 'ZMMU',
+ 'ACTREL', 'AQ_SO2', 'AREA', 'BROX', 'BROY', 'BRY', 'CLOX', 'CLOY', 'CLY', 'NOX', 'NOY', 'TBRY', 'TCLY', 'CFC11STAR',
+ 'BTTGWSPEC', 'BTTGWSDF', 'BTTGWSKE', 'CONCLD', 'CME', 'CMFDQ', 'CMFMC', 'CMFMC_DP',
+ 'CH3CCL3_CHML', 'CH4_CHML', 'CO2_CHML', 'CO_CHML', 'IVOC_CHML', 'N2O_CHML', 'O3_CHML', 'SO2_CHML',
+ 'CO_CHMP', 'O3_CHMP', 'SO2_CHMP', 'TMDMS', 'TMOCS', 'TMSO2','TMso4_a1', 'TMso4_a2', 'TMso4_a3',
+ 'soa1_a1_CHML', 'soa1_a2_CHML', 'soa2_a1_CHML', 'soa2_a2_CHML', 'soa3_a1_CHML', 'soa3_a2_CHML',
+ 'soa4_a1_CHML', 'soa4_a2_CHML', 'soa5_a1_CHML', 'soa5_a2_CHML', 'SVOC_CHML',
+ 'so4_a1_CHMP','so4_a2_CHMP', 'SOAG0_CHMP', 'SOAG1_CHMP', 'SOAG2_CHMP', 'SOAG3_CHMP', 'SOAG4_CHMP', 'TOTH', 'TOT_CLD_VISTAU',
+ 'TREFHTMN', 'TREFHTMX', 'TROP_P', 'TROP_T', 'TROP_Z', 'TTEND_TOT', 'TTGWORO', 'TTGWSDF', 'TTGWSDFORO', 'TTGWSKE', 'TTGWSKEORO',
+ 'TS', 'TSMN:M', 'TSMX:X', 'BURDENBCdn', 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSEASALTdn', 'BURDENSO4dn', 'BURDENSOAdn',
+ 'ABSORB', 'AODABSdn', 'AODBCdn', 'AODdnDUST01', 'AODdnDUST02', 'AODdnDUST03', 'AODdn_aitken', 'AODdn_accum', 'AODdn_coarse',
+ 'AODDUST02', 'AODDUST', 'AODNIRstdn', 'AODPOMdn', 'AODSO4dn', 'AODSOAdn', 'AODSSdn', 'AODUVdn', 'AODUVstdn', 'AODVIS',
+ 'AODVISdn', 'AODVISstdn', 'EXTINCTdn', 'EXTINCTNIRdn', 'EXTINCTUVdn', 'EXTxASYMdn', 'FLDSC', 'FLNR', 'FSNR',
+ 'CME', 'CMFDQ', 'CMFMC','CMFMC_DP', 'SOLLD', 'SOLSD', 'SSAVIS', 'SST','TAQ',
+ 'DCOCHM','DH2O2CHM', 'DHNO3CHM', 'DO3CHM', 'Dso4_a1CHM', 'Dso4_a2CHM', 'Dso4_a3CHM',
+ 'FLASHFRQ', 'LNO_COL_PROD', 'LNO_PROD','KVH_CLUBB','MASS', 'PDELDRY', 'NITROP_PD','PM25', 'PRECT', 'PTEQ', 'PTTEND',
+ 'QRLC', 'QRSC', 'QSNOW', 'QRAIN','GS_SO2', 'HNO3_GAS', 'HNO3_NAT', 'HNO3_STS','H2SO4M_C', 'H2SO4_sfnnuc1','HCL_GAS',
+ 'SAD_AERO', 'SAD_ICE', 'SAD_LNAT', 'SAD_SULFC', 'SAD_TROP' 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'REFF_AERO', 'RHREFHT',
+ 'EVAPPREC', 'EVAPQZM', 'EVAPTZM', 'FCTL','FREQZM', 'ZMDQ', 'ZMDT', 'ZMMTT', 'ZMMU','VEL_NAT2',
+ 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'bc_c1DDF', 'bc_c4DDF', 'dst_c1DDF', 'dst_c2DDF', 'dst_c3DDF',
+ 'ncl_c1DDF', 'ncl_c2DDF', 'ncl_c3DDF', 'pom_c1DDF', 'pom_c4DDF', 'num_c1DDF','num_c2DDF','num_c3DDF','num_c4DDF',
+ 'so4_a1_sfgaex1', 'so4_c1AQH2SO4', 'so4_c1AQSO4', 'so4_c1DDF', 'so4_a2_sfgaex1', 'so4_c2AQH2SO4', 'so4_c2AQSO4', 'so4_c2DDF',
+ 'so4_a3_sfgaex1', 'so4_c3AQH2SO4', 'so4_c3AQSO4', 'so4_c3DDF', 'so4_a2_sfnnuc1', 'num_a2_sfnnuc1',
+ 'soa1_a1_sfgaex1','soa1_c1DDF', 'soa1_a2_sfgaex1','soa1_c2DDF', 'soa2_a1_sfgaex1','soa2_c1DDF', 'soa2_a2_sfgaex1','soa2_c2DDF',
+ 'soa3_a1_sfgaex1','soa3_c1DDF', 'soa3_a2_sfgaex1','soa3_c2DDF', 'soa4_a1_sfgaex1','soa4_c1DDF', 'soa4_a2_sfgaex1','soa4_c2DDF',
+ 'soa5_a1_sfgaex1','soa5_c1DDF', 'soa5_a2_sfgaex1','soa5_c2DDF', 'jcl2o2', 'jh2o2', 'jno2', 'jo2_a', 'jo2_b', 'jo3_a', 'jo3_b', 'jpan',
+ 'r_het1', 'r_het2', 'r_het3', 'r_het4', 'r_het5', 'r_het6', 'r_het7', 'r_het8', 'r_het9', 'r_het10', 'r_het11', 'r_het12', 'r_het13',
+ 'r_het15', 'r_het16', 'r_het17', 'r_jsoa1_a1', 'r_jsoa1_a2', 'r_jsoa2_a1', 'r_jsoa2_a2', 'r_jsoa3_a1', 'r_jsoa3_a2', 'r_jsoa4_a1',
+ 'r_jsoa4_a2', 'r_jsoa5_a1', 'r_jsoa5_a2', 'r_GLYOXAL_aer', 'r_HO2_O3', 'r_N2O5_aer', 'r_NO2_aer', 'r_NO3_aer', 'r_O1D_H2O', 'r_OH_O3', 'r_OH_O',
'O3_Prod','O3_Loss','O3S_Loss','RO2_NO_sum','O3_alkenes','RO2_NO3_sum','RO2_HO2_sum','RO2_RO2_sum','RCO2_NO2_sum',
- 'OddOx_Ox_Loss','OddOx_HOx_Loss','OddOx_NOx_Loss','OddOx_CLOxBROx_Loss','OddOx_Loss_Tot','OddOx_Prod_Tot',
- 'Ox_Prod','Ox_Loss'
+ 'OddOx_Ox_Loss','OddOx_HOx_Loss','OddOx_NOx_Loss','OddOx_CLOxBROx_Loss','OddOx_Loss_Tot','OddOx_Prod_Tot', 'Ox_Prod','Ox_Loss'
diff --git a/bld/namelist_files/use_cases/waccm_tsmlt_hist_cam6.xml b/bld/namelist_files/use_cases/waccm_tsmlt_hist_cam6.xml
index 12628e4412..6ad0b14145 100644
--- a/bld/namelist_files/use_cases/waccm_tsmlt_hist_cam6.xml
+++ b/bld/namelist_files/use_cases/waccm_tsmlt_hist_cam6.xml
@@ -59,85 +59,36 @@
'AOA1SRC', 'AOA2SRC', 'NO2_CMXF'
- 'ABSORB', 'ACBZO2', 'ACTREL', 'ALKNIT', 'ALKO2', 'ALKOOH', 'AOA1', 'AOA_NH', 'AODABSdn', 'AODBCdn', 'AODdnDUST1', 'AODdnDUST2',
- 'AODdnDUST3', 'AODdnMODE1', 'AODdnMODE2', 'AODdnMODE3', 'AODDUST2', 'AODDUST', 'AODNIRstdn', 'AODPOMdn', 'AODSO4dn', 'AODSOAdn', 'AODSSdn',
- 'AODUVdn', 'AODUVstdn', 'AODVIS', 'AODVISdn', 'AODVISstdn', 'AQ_SO2', 'AREA', 'AREI', 'AREL', 'bc_a1', 'bc_a1DDF',
- 'bc_a1SFWET', 'bc_a4', 'bc_a4_CLXF', 'bc_a4DDF', 'bc_a4SFWET', 'BCARY', 'bc_c1', 'bc_c1DDF', 'bc_c1SFWET', 'bc_c4', 'bc_c4DDF',
- 'bc_c4SFWET', 'BENZENE', 'BENZO2', 'BENZOOH', 'BEPOMUC', 'BIGALD1', 'BIGALD2', 'BIGALD3', 'BIGALD4', 'BIGALD', 'BIGALK', 'BIGENE',
- 'BR', 'BRCL', 'BRO', 'BRONO2', 'BROX', 'BROY', 'BRY', 'BTTGWSPEC', 'BTTGWSDF', 'BTTGWSKE',
- 'BURDENBCdn', 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSEASALTdn', 'BURDENSO4dn',
- 'BURDENSOAdn', 'BUTGWSPEC', 'BZALD', 'BZOO', 'BZOOH', 'C2H2', 'C2H4', 'C2H5O2', 'C2H5OH', 'C2H5OOH', 'C2H6', 'C3H6', 'C3H7O2',
- 'C3H7OOH', 'C3H8', 'C6H5O2', 'C6H5OOH', 'CCL4', 'CDNUMC', 'CF2CLBR', 'CF3BR', 'CFC113', 'CFC114', 'CFC115', 'CFC11', 'CFC11STAR',
- 'CFC12', 'CH2BR2', 'CH2O', 'CH3BR', 'CH3CCL3', 'CH3CCL3_CHML', 'CH3CHO', 'CH3CL', 'CH3CN', 'CH3CO3', 'CH3COCH3', 'CH3COCHO',
- 'CH3COOH', 'CH3COOOH', 'CH3O2', 'CH3OH', 'CH3OOH', 'CH4', 'CH4_CHML', 'CHBR3', 'CL2', 'CL2O2', 'CL',
- 'CLDICE', 'CLDLIQ', 'CLDTOT', 'CLO', 'CLONO2', 'CLOUD', 'CLOX', 'CLOY', 'CLY', 'CME', 'CMFDQ', 'CMFMC',
- 'CMFMC_DP', 'CO2', 'CO2_CHML', 'CO', 'CO_CHML', 'CO_CHMP', 'COF2', 'COFCL', 'CONCLD', 'CRESOL',
- 'DCOCHM', 'DF_ALKNIT', 'DF_ALKOOH', 'DF_BENZOOH', 'DF_BZOOH', 'DF_C2H5OH', 'DF_C2H5OOH', 'DF_C3H7OOH', 'DF_C6H5OOH', 'DF_CH2O',
- 'DF_CH3CHO', 'DF_CH3CN', 'DF_CH3COCH3', 'DF_CH3COCHO', 'DF_CH3COOH', 'DF_CH3COOOH', 'DF_CH3OH', 'DF_CH3OOH', 'DF_CO', 'DF_EOOH',
- 'DF_GLYALD', 'DF_H2O2', 'DF_H2SO4', 'DF_HCN', 'DF_HCOOH', 'DF_HNO3', 'DF_HO2NO2', 'DF_HONITR', 'DF_HPALD', 'DF_HYAC', 'DF_HYDRALD',
- 'DF_IEPOX', 'DF_ISOPNITA', 'DF_ISOPNITB', 'DF_ISOPNO3', 'DF_ISOPNOOH', 'DF_ISOPOOH', 'DF_IVOC', 'DF_MACROOH', 'DF_MEKOOH',
- 'DF_MPAN', 'DF_NC4CH2OH', 'DF_NC4CHO', 'DF_NH3', 'DF_NH4', 'DF_NO2', 'DF_NO', 'DF_NOA', 'DF_NTERPOOH', 'DF_O3',
- 'DF_ONITR', 'DF_PAN', 'DF_PHENOOH', 'DF_POOH', 'DF_ROOH', 'DF_SO2', 'DF_SOAG0', 'DF_SOAG1', 'DF_SOAG2', 'DF_SOAG3',
- 'DF_SOAG4', 'DF_SVOC', 'DF_TERP2OOH', 'DF_TERPNIT', 'DF_TERPOOH', 'DF_TERPROD1', 'DF_TERPROD2', 'DF_TOLOOH', 'DF_XOOH', 'DF_XYLENOOH',
- 'DF_XYLOLOOH', 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'DH2O2CHM', 'DHNO3CHM', 'DICARBO2', 'DMS', 'DO3CHM', 'dry_deposition_NHx_as_N',
- 'dry_deposition_NOy_as_N', 'Dso4_a1CHM', 'Dso4_a2CHM', 'Dso4_a3CHM', 'dst_a1', 'dst_a1DDF', 'dst_a1SFWET', 'dst_a2', 'dst_a2DDF',
- 'dst_a2SFWET', 'dst_a3', 'dst_a3DDF', 'dst_a3SFWET', 'dst_c1', 'dst_c1DDF', 'dst_c1SFWET', 'dst_c2', 'dst_c2DDF', 'dst_c2SFWET',
- 'dst_c3', 'dst_c3DDF', 'dst_c3SFWET', 'DTCORE', 'E90', 'e', 'ENEO2', 'EO2', 'EO', 'EOOH', 'EVAPPREC',
- 'EVAPQZM', 'EVAPTZM', 'EXTINCTdn', 'EXTINCTNIRdn', 'EXTINCTUVdn', 'EXTxASYMdn', 'F', 'FCTL',
- 'FLASHFRQ', 'FLDS', 'FLDSC', 'FLNR', 'FLNS', 'FLNSC', 'FLNT', 'FLNTC', 'FLUT', 'FLUTC', 'FREQI', 'FREQL', 'FREQZM', 'FSDS',
- 'FSDSC', 'FSNR', 'FSNS', 'FSNSC', 'FSNT', 'FSNTC', 'FSNTOAC', 'FSUTOA', 'GLYALD', 'GLYOXAL',
- 'GS_SO2', 'H2402', 'H2', 'H2O2', 'H2O', 'H2SO4', 'H2SO4M_C', 'H2SO4_sfnnuc1', 'H', 'HBR', 'HCFC141B', 'HCFC142B', 'HCFC22', 'HCL',
- 'HCL_GAS', 'HCN', 'HCOOH', 'HF', 'HNO3', 'HNO3_GAS', 'HNO3_NAT', 'HNO3_STS', 'HO2', 'HO2NO2', 'HOBR', 'HOCH2OO', 'HOCL', 'HONITR',
- 'HPALD', 'HYAC', 'HYDRALD', 'ICEFRAC', 'IEPOX', 'ISOP', 'ISOPAO2', 'ISOPBO2', 'ISOPNITA', 'ISOPNITB', 'ISOPNO3',
- 'ISOPNOOH', 'ISOPOOH', 'IVOC', 'IVOC_CHML', 'jcl2o2', 'jh2o2', 'jno2', 'jo2_a', 'jo2_b', 'jo3_a', 'jo3_b', 'jpan', 'KVH_CLUBB',
- 'LANDFRAC', 'LHFLX', 'LNO_COL_PROD', 'LNO_PROD', 'MACR', 'MACRO2', 'MACROOH', 'MALO2', 'MASS', 'MCO3', 'MDIALO2',
- 'MEG_BCARY', 'MEG_BIGALK', 'MEG_BIGENE', 'MEG_C2H4', 'MEG_C2H5OH', 'MEG_C2H6', 'MEG_C3H6', 'MEG_C3H8', 'MEG_CH2O',
- 'MEG_CH3CHO', 'MEG_CH3COCH3', 'MEG_CH3COOH', 'MEG_CH3OH', 'MEG_CO', 'MEG_HCN', 'MEG_HCOOH', 'MEG_ISOP', 'MEG_MTERP', 'MEG_TOLUENE',
- 'MEK', 'MEKO2', 'MEKOOH', 'MPAN', 'MTERP', 'MVK', 'N2D', 'N2O5', 'N2O', 'N2O_CHML', 'N2p', 'N', 'NC4CH2OH',
- 'NC4CHO', 'ncl_a1', 'ncl_a1DDF', 'ncl_a1SFWET', 'ncl_a2', 'ncl_a2DDF', 'ncl_a2SFWET', 'ncl_a3', 'ncl_a3DDF', 'ncl_a3SFWET', 'ncl_c1',
- 'ncl_c1DDF', 'ncl_c1SFWET', 'ncl_c2', 'ncl_c2DDF', 'ncl_c2SFWET', 'ncl_c3', 'ncl_c3DDF', 'ncl_c3SFWET', 'NDEP', 'NH3', 'NH4', 'NH_50',
- 'NH_5', 'NHDEP', 'NITROP_PD', 'NO2', 'NO2_CLXF', 'NO3', 'NO', 'NOA', 'NOp', 'NOX', 'NOY', 'Np', 'NTERPO2', 'NTERPOOH',
- 'num_a1', 'num_a1_CLXF', 'num_a1DDF', 'num_a2', 'num_a2_CLXF', 'num_a2DDF', 'num_a2_sfnnuc1', 'num_a3', 'num_a3DDF', 'num_a4',
- 'num_a4DDF', 'num_c1', 'num_c1DDF', 'num_c2', 'num_c2DDF', 'num_c3', 'num_c3DDF', 'num_c4', 'num_c4DDF', 'NUMLIQ', 'O1D', 'O2_1D',
- 'O2_1S', 'O2', 'O2p', 'O3', 'O3S', 'O3_CHML', 'O3_CHMP', 'O', 'OCLO', 'OCS', 'OH', 'OMEGA', 'OMEGAT', 'ONITR', 'Op',
- 'PAN', 'PBLH', 'PBZNIT', 'PDELDRY', 'PHENO2', 'PHENO', 'PHENOL', 'PHENOOH', 'PHIS', 'PM25', 'PO2', 'pom_a1', 'pom_a1DDF', 'pom_a1SFWET',
- 'pom_a4', 'pom_a4DDF', 'pom_a4SFWET', 'pom_c1', 'pom_c1DDF', 'pom_c1SFWET', 'pom_c4', 'pom_c4DDF', 'pom_c4SFWET',
- 'POOH', 'PRECC', 'PRECT', 'PS', 'PSL', 'PTEQ', 'PTTEND', 'Q', 'QFLX', 'QRAIN', 'QREFHT', 'QRL', 'QRLC', 'QRS',
- 'QRSC', 'QSNOW', 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'REFF_AERO', 'RELHUM', 'r_GLYOXAL_aer',
- 'r_het10', 'r_het11', 'r_het12', 'r_het13', 'r_het15', 'r_het16', 'r_het17', 'r_het1', 'r_het2', 'r_het3', 'r_het4', 'r_het5',
- 'r_het6', 'r_het7', 'r_het8', 'r_het9', 'r_HO2_O3', 'RHREFHT', 'r_jsoa1_a1', 'r_jsoa1_a2', 'r_jsoa2_a1', 'r_jsoa2_a2',
- 'r_jsoa3_a1', 'r_jsoa3_a2', 'r_jsoa4_a1', 'r_jsoa4_a2', 'r_jsoa5_a1', 'r_jsoa5_a2', 'r_N2O5_aer', 'r_NO2_aer', 'r_NO3_aer', 'r_O1D_H2O',
- 'r_OH_O3', 'r_OH_O', 'ROOH', 'RO2',
- 'S', 'SAD_AERO', 'SAD_ICE', 'SAD_LNAT', 'SAD_SULFC', 'SAD_TROP', 'SF6', 'SFbc_a4', 'SFBCARY',
- 'SFBENZENE', 'SFBIGALK', 'SFBIGENE', 'SFC2H2', 'SFC2H4', 'SFC2H5OH', 'SFC2H6', 'SFC3H6', 'SFC3H8', 'SFCH2O', 'SFCH3CHO', 'SFCH3CN',
- 'SFCH3COCH3', 'SFCH3COCHO', 'SFCH3COOH', 'SFCH3OH', 'SFCO', 'SFDMS', 'SFdst_a1', 'SFdst_a2', 'SFdst_a3', 'SFGLYALD', 'SFHCN', 'SFHCOOH',
- 'SFISOP', 'SFIVOC', 'SFMEK', 'SFMTERP', 'SFncl_a1', 'SFncl_a2', 'SFncl_a3', 'SFNH3', 'SFNO2', 'SFNO', 'SFnum_a1', 'SFnum_a2',
- 'SFnum_a3', 'SFpom_a4', 'SFSO2', 'SFso4_a1', 'SFso4_a2', 'SFSVOC', 'SFTOLUENE', 'SFXYLENES', 'SHFLX', 'SO2',
- 'SO2_CHML', 'SO2_CHMP', 'SO2_CLXF', 'SO2_XFRC', 'SO3', 'so4_a1', 'so4_a1_CHMP', 'so4_a1_CLXF', 'so4_a1DDF', 'so4_a1_sfgaex1', 'so4_a1SFWET',
- 'so4_a2', 'so4_a2_CHMP', 'so4_a2_CLXF', 'so4_a2DDF', 'so4_a2_sfgaex1', 'so4_a2_sfnnuc1', 'so4_a2SFWET', 'so4_a3',
- 'so4_a3DDF', 'so4_a3_sfgaex1', 'so4_a3SFWET', 'so4_c1', 'so4_c1AQH2SO4', 'so4_c1AQSO4', 'so4_c1DDF', 'so4_c1SFWET', 'so4_c2', 'so4_c2AQH2SO4',
- 'so4_c2AQSO4', 'so4_c2DDF', 'so4_c2SFWET', 'so4_c3', 'so4_c3AQH2SO4', 'so4_c3AQSO4', 'so4_c3DDF', 'so4_c3SFWET', 'SO', 'soa1_a1',
- 'soa1_a1_CHML', 'soa1_a1DDF', 'soa1_a1_sfgaex1', 'soa1_a1SFWET', 'soa1_a2', 'soa1_a2_CHML', 'soa1_a2DDF',
- 'soa1_a2_sfgaex1', 'soa1_a2SFWET', 'soa1_c1', 'soa1_c1DDF', 'soa1_c1SFWET', 'soa1_c2', 'soa1_c2DDF', 'soa1_c2SFWET', 'soa2_a1', 'soa2_a1_CHML',
- 'soa2_a1DDF', 'soa2_a1_sfgaex1', 'soa2_a1SFWET', 'soa2_a2', 'soa2_a2_CHML', 'soa2_a2DDF', 'soa2_a2_sfgaex1',
- 'soa2_a2SFWET', 'soa2_c1', 'soa2_c1DDF', 'soa2_c1SFWET', 'soa2_c2', 'soa2_c2DDF', 'soa2_c2SFWET', 'soa3_a1', 'soa3_a1_CHML',
- 'soa3_a1DDF', 'soa3_a1_sfgaex1', 'soa3_a1SFWET', 'soa3_a2', 'soa3_a2_CHML', 'soa3_a2DDF', 'soa3_a2_sfgaex1', 'soa3_a2SFWET',
- 'soa3_c1', 'soa3_c1DDF', 'soa3_c1SFWET', 'soa3_c2', 'soa3_c2DDF', 'soa3_c2SFWET', 'soa4_a1', 'soa4_a1_CHML', 'soa4_a1DDF',
- 'soa4_a1_sfgaex1', 'soa4_a1SFWET', 'soa4_a2', 'soa4_a2_CHML', 'soa4_a2DDF', 'soa4_a2_sfgaex1', 'soa4_a2SFWET', 'soa4_c1',
- 'soa4_c1DDF', 'soa4_c1SFWET', 'soa4_c2', 'soa4_c2DDF', 'soa4_c2SFWET', 'soa5_a1', 'soa5_a1_CHML', 'soa5_a1DDF', 'soa5_a1_sfgaex1',
- 'soa5_a1SFWET', 'soa5_a2', 'soa5_a2_CHML', 'soa5_a2DDF', 'soa5_a2_sfgaex1', 'soa5_a2SFWET', 'soa5_c1', 'soa5_c1DDF',
- 'soa5_c1SFWET', 'soa5_c2', 'soa5_c2DDF', 'soa5_c2SFWET', 'SOAG0', 'SOAG0_CHMP', 'SOAG1', 'SOAG1_CHMP', 'SOAG2', 'SOAG2_CHMP',
- 'SOAG3', 'SOAG3_CHMP', 'SOAG4', 'SOAG4_CHMP', 'SOLIN', 'SOLLD', 'SOLSD', 'SSAVIS', 'SST', 'ST80_25', 'SVOC', 'SVOC_CHML',
- 'T', 'TAQ', 'TAUBLJX', 'TAUBLJY', 'TAUGWX', 'TAUGWY', 'TAUX', 'TAUY', 'TBRY', 'TCLY', 'TEPOMUC', 'TERP2O2', 'TERP2OOH',
- 'TERPNIT', 'TERPO2', 'TERPOOH', 'TERPROD1', 'TERPROD2', 'TGCLDIWP', 'TGCLDLWP', 'TMDMS', 'TMOCS', 'TMQ', 'TMSO2',
- 'TMso4_a1', 'TMso4_a2', 'TMso4_a3', 'TOLO2', 'TOLOOH', 'TOLUENE', 'TOT_CLD_VISTAU', 'TOTH', 'TREFHT', 'TREFHTMN', 'TREFHTMX', 'TROP_P',
- 'TROP_T', 'TROP_Z', 'TS', 'TSMN:M', 'TSMX:X', 'TTEND_TOT', 'TTGWORO', 'TTGWSDF', 'TTGWSDFORO', 'TTGWSKE', 'TTGWSKEORO', 'TTGWSPEC',
- 'U10', 'U', 'UTGWORO', 'UTGWSPEC', 'UU', 'V', 'VD01', 'VEL_NAT2', 'VV',
- 'wet_deposition_NHx_as_N', 'wet_deposition_NOy_as_N', 'XO2', 'XOOH', 'XYLENES', 'XYLENO2', 'XYLENOOH', 'XYLOL', 'XYLOLO2',
- 'XYLOLOOH', 'Z3', 'ZMDQ', 'ZMDT', 'ZMMTT', 'ZMMU',
+ 'ACTREL', 'AQ_SO2', 'AREA', 'BROX', 'BROY', 'BRY', 'CLOX', 'CLOY', 'CLY', 'NOX', 'NOY', 'TBRY', 'TCLY', 'CFC11STAR',
+ 'BTTGWSPEC', 'BTTGWSDF', 'BTTGWSKE', 'CONCLD', 'CME', 'CMFDQ', 'CMFMC', 'CMFMC_DP',
+ 'CH3CCL3_CHML', 'CH4_CHML', 'CO2_CHML', 'CO_CHML', 'IVOC_CHML', 'N2O_CHML', 'O3_CHML', 'SO2_CHML',
+ 'CO_CHMP', 'O3_CHMP', 'SO2_CHMP', 'TMDMS', 'TMOCS', 'TMSO2','TMso4_a1', 'TMso4_a2', 'TMso4_a3',
+ 'soa1_a1_CHML', 'soa1_a2_CHML', 'soa2_a1_CHML', 'soa2_a2_CHML', 'soa3_a1_CHML', 'soa3_a2_CHML',
+ 'soa4_a1_CHML', 'soa4_a2_CHML', 'soa5_a1_CHML', 'soa5_a2_CHML', 'SVOC_CHML',
+ 'so4_a1_CHMP','so4_a2_CHMP', 'SOAG0_CHMP', 'SOAG1_CHMP', 'SOAG2_CHMP', 'SOAG3_CHMP', 'SOAG4_CHMP', 'TOTH', 'TOT_CLD_VISTAU',
+ 'TREFHTMN', 'TREFHTMX', 'TROP_P', 'TROP_T', 'TROP_Z', 'TTEND_TOT', 'TTGWORO', 'TTGWSDF', 'TTGWSDFORO', 'TTGWSKE', 'TTGWSKEORO',
+ 'TS', 'TSMN:M', 'TSMX:X', 'BURDENBCdn', 'BURDENDUSTdn', 'BURDENPOMdn', 'BURDENSEASALTdn', 'BURDENSO4dn', 'BURDENSOAdn',
+ 'ABSORB', 'AODABSdn', 'AODBCdn', 'AODdnDUST01', 'AODdnDUST02', 'AODdnDUST03', 'AODdn_aitken', 'AODdn_accum', 'AODdn_coarse',
+ 'AODDUST02', 'AODDUST', 'AODNIRstdn', 'AODPOMdn', 'AODSO4dn', 'AODSOAdn', 'AODSSdn', 'AODUVdn', 'AODUVstdn', 'AODVIS',
+ 'AODVISdn', 'AODVISstdn', 'EXTINCTdn', 'EXTINCTNIRdn', 'EXTINCTUVdn', 'EXTxASYMdn', 'FLDSC', 'FLNR', 'FSNR',
+ 'CME', 'CMFDQ', 'CMFMC','CMFMC_DP', 'SOLLD', 'SOLSD', 'SSAVIS', 'SST','TAQ',
+ 'DCOCHM','DH2O2CHM', 'DHNO3CHM', 'DO3CHM', 'Dso4_a1CHM', 'Dso4_a2CHM', 'Dso4_a3CHM',
+ 'FLASHFRQ', 'LNO_COL_PROD', 'LNO_PROD','KVH_CLUBB','MASS', 'PDELDRY', 'NITROP_PD','PM25', 'PRECT', 'PTEQ', 'PTTEND',
+ 'QRLC', 'QRSC', 'QSNOW', 'QRAIN','GS_SO2', 'HNO3_GAS', 'HNO3_NAT', 'HNO3_STS','H2SO4M_C', 'H2SO4_sfnnuc1','HCL_GAS',
+ 'SAD_AERO', 'SAD_ICE', 'SAD_LNAT', 'SAD_SULFC', 'SAD_TROP' 'RAD_ICE', 'RAD_LNAT', 'RAD_SULFC', 'REFF_AERO', 'RHREFHT',
+ 'EVAPPREC', 'EVAPQZM', 'EVAPTZM', 'FCTL','FREQZM', 'ZMDQ', 'ZMDT', 'ZMMTT', 'ZMMU','VEL_NAT2',
+ 'dgnumwet1', 'dgnumwet2', 'dgnumwet3', 'bc_c1DDF', 'bc_c4DDF', 'dst_c1DDF', 'dst_c2DDF', 'dst_c3DDF',
+ 'ncl_c1DDF', 'ncl_c2DDF', 'ncl_c3DDF', 'pom_c1DDF', 'pom_c4DDF', 'num_c1DDF','num_c2DDF','num_c3DDF','num_c4DDF',
+ 'so4_a1_sfgaex1', 'so4_c1AQH2SO4', 'so4_c1AQSO4', 'so4_c1DDF', 'so4_a2_sfgaex1', 'so4_c2AQH2SO4', 'so4_c2AQSO4', 'so4_c2DDF',
+ 'so4_a3_sfgaex1', 'so4_c3AQH2SO4', 'so4_c3AQSO4', 'so4_c3DDF', 'so4_a2_sfnnuc1', 'num_a2_sfnnuc1',
+ 'soa1_a1_sfgaex1','soa1_c1DDF', 'soa1_a2_sfgaex1','soa1_c2DDF', 'soa2_a1_sfgaex1','soa2_c1DDF', 'soa2_a2_sfgaex1','soa2_c2DDF',
+ 'soa3_a1_sfgaex1','soa3_c1DDF', 'soa3_a2_sfgaex1','soa3_c2DDF', 'soa4_a1_sfgaex1','soa4_c1DDF', 'soa4_a2_sfgaex1','soa4_c2DDF',
+ 'soa5_a1_sfgaex1','soa5_c1DDF', 'soa5_a2_sfgaex1','soa5_c2DDF', 'jcl2o2', 'jh2o2', 'jno2', 'jo2_a', 'jo2_b', 'jo3_a', 'jo3_b', 'jpan',
+ 'r_het1', 'r_het2', 'r_het3', 'r_het4', 'r_het5', 'r_het6', 'r_het7', 'r_het8', 'r_het9', 'r_het10', 'r_het11', 'r_het12', 'r_het13',
+ 'r_het15', 'r_het16', 'r_het17', 'r_jsoa1_a1', 'r_jsoa1_a2', 'r_jsoa2_a1', 'r_jsoa2_a2', 'r_jsoa3_a1', 'r_jsoa3_a2', 'r_jsoa4_a1',
+ 'r_jsoa4_a2', 'r_jsoa5_a1', 'r_jsoa5_a2', 'r_GLYOXAL_aer', 'r_HO2_O3', 'r_N2O5_aer', 'r_NO2_aer', 'r_NO3_aer', 'r_O1D_H2O', 'r_OH_O3', 'r_OH_O',
'O3_Prod','O3_Loss','O3S_Loss','RO2_NO_sum','O3_alkenes','RO2_NO3_sum','RO2_HO2_sum','RO2_RO2_sum','RCO2_NO2_sum',
- 'OddOx_Ox_Loss','OddOx_HOx_Loss','OddOx_NOx_Loss','OddOx_CLOxBROx_Loss','OddOx_Loss_Tot','OddOx_Prod_Tot',
- 'Ox_Prod','Ox_Loss'
+ 'OddOx_Ox_Loss','OddOx_HOx_Loss','OddOx_NOx_Loss','OddOx_CLOxBROx_Loss','OddOx_Loss_Tot','OddOx_Prod_Tot', 'Ox_Prod','Ox_Loss'
diff --git a/bld/namelist_files/use_cases/waccmx_ma_2000_cam6.xml b/bld/namelist_files/use_cases/waccmx_ma_2000_cam6.xml
index cb86bc0f9c..6e6986f127 100644
--- a/bld/namelist_files/use_cases/waccmx_ma_2000_cam6.xml
+++ b/bld/namelist_files/use_cases/waccmx_ma_2000_cam6.xml
@@ -95,15 +95,10 @@
'OMEGA_24_COS', 'OMEGA_24_SIN', 'OMEGA_12_COS', 'OMEGA_12_SIN', 'OMEGA_08_COS', 'OMEGA_08_SIN'
-
+
'MSKtem', 'PS', 'PSL', 'VTHzm', 'UVzm', 'UWzm', 'Uzm', 'Vzm', 'THzm','Wzm', 'PHIS'
42
-
- 'SolIonRate_Tot = jeuv_1 + jeuv_2 + jeuv_3 + jeuv_4 + jeuv_5 + jeuv_6 + jeuv_7 + jeuv_8 + jeuv_9 + jeuv_10 + jeuv_11 + jeuv_14 + jeuv_15 + jeuv_16 +',
- 'jeuv_17 + jeuv_18 + jeuv_19 + jeuv_20 + jeuv_21 + jeuv_22 + jeuv_23',
-
-
diff --git a/bld/namelist_files/use_cases/waccmx_ma_hist_cam6.xml b/bld/namelist_files/use_cases/waccmx_ma_hist_cam6.xml
index 7075565589..c928b43f28 100644
--- a/bld/namelist_files/use_cases/waccmx_ma_hist_cam6.xml
+++ b/bld/namelist_files/use_cases/waccmx_ma_hist_cam6.xml
@@ -99,9 +99,4 @@
42
-
- 'SolIonRate_Tot = jeuv_1 + jeuv_2 + jeuv_3 + jeuv_4 + jeuv_5 + jeuv_6 + jeuv_7 + jeuv_8 + jeuv_9 + jeuv_10 + jeuv_11 + jeuv_14 + jeuv_15 + jeuv_16 +',
- 'jeuv_17 + jeuv_18 + jeuv_19 + jeuv_20 + jeuv_21 + jeuv_22 + jeuv_23',
-
-
diff --git a/bld/perl5lib/Build/ChemNamelist.pm b/bld/perl5lib/Build/ChemNamelist.pm
index 88d573afe1..7d4f5a6103 100644
--- a/bld/perl5lib/Build/ChemNamelist.pm
+++ b/bld/perl5lib/Build/ChemNamelist.pm
@@ -44,7 +44,7 @@ sub chem_has_species
#-------------------------------------------------------------------------------
sub set_dep_lists
{
- my ( $cfgdir, $chem_proc_src, $chem_src_dir, $nl, $print_lvl ) = @_;
+ my ( $chem, $cfgdir, $chem_proc_src, $chem_src_dir, $nl, $print_lvl ) = @_;
my ( $gas_wetdep_list, $aer_wetdep_list, $aer_drydep_list, $aer_sol_facti, $aer_sol_factb,
$aer_scav_coef, $gas_drydep_list ) ;
@@ -71,37 +71,17 @@ sub set_dep_lists
if ($print_lvl>=2) {print "Chemistry species : @species_list \n" ;}
if ($print_lvl>=2) {print "Not transported species : @nottransported_list \n" ;}
- if (!defined $nl->get_value('gas_wetdep_list')) {
- $gas_wetdep_list = get_gas_wetdep_list( $cfgdir, $print_lvl, \@species_list, \@nottransported_list );
- } else {
- $gas_wetdep_list = $nl->get_value('gas_wetdep_list');
- $gas_wetdep_list = filter_dep_list( $gas_wetdep_list, $print_lvl, \@species_list, \@nottransported_list );
- if ($print_lvl>=2) {print " gas wet dep list : $gas_wetdep_list \n" ;}
- }
+ $gas_wetdep_list = get_gas_wetdep_list( $chem, $cfgdir, $print_lvl, \@species_list, \@nottransported_list );
+ if ($print_lvl>=2) {print " gas wet dep list : $gas_wetdep_list \n" ;}
- if (!defined $nl->get_value('aer_wetdep_list')) {
- $aer_wetdep_list = get_aer_wetdep_list( $cfgdir, $print_lvl, \@species_list, \@nottransported_list );
- } else {
- $aer_wetdep_list = $nl->get_value('aer_wetdep_list');
- $aer_wetdep_list = filter_dep_list( $aer_wetdep_list, $print_lvl, \@species_list, \@nottransported_list );
- if ($print_lvl>=2) {print " aer wet dep list : $aer_wetdep_list \n" ;}
- }
+ $aer_wetdep_list = get_aer_wetdep_list( $chem, $cfgdir, $print_lvl, \@species_list, \@nottransported_list );
+ if ($print_lvl>=2) {print " aer wet dep list : $aer_wetdep_list \n" ;}
- if (!defined $nl->get_value('drydep_list')) {
- $gas_drydep_list = get_gas_drydep_list( $cfgdir, $print_lvl, \@species_list, \@nottransported_list );
- } else {
- $gas_drydep_list = $nl->get_value('drydep_list');
- $gas_drydep_list = filter_dep_list( $gas_drydep_list, $print_lvl, \@species_list, \@nottransported_list );
- if ($print_lvl>=2) {print " dry dep list : $gas_drydep_list \n" ;}
- }
+ $gas_drydep_list = get_gas_drydep_list( $chem, $cfgdir, $print_lvl, \@species_list, \@nottransported_list );
+ if ($print_lvl>=2) {print " dry dep list : $gas_drydep_list \n" ;}
- if (!defined $nl->get_value('aer_drydep_list')) {
- $aer_drydep_list = get_aer_drydep_list( $cfgdir, $print_lvl, \@species_list, \@nottransported_list );
- } else {
- $aer_drydep_list = $nl->get_value('aer_drydep_list');
- $aer_drydep_list = filter_dep_list( $aer_drydep_list, $print_lvl, \@species_list, \@nottransported_list );
- if ($print_lvl>=2) {print " aer dry dep list : $aer_drydep_list \n" ;}
- }
+ $aer_drydep_list = get_aer_drydep_list( $chem, $cfgdir, $print_lvl, \@species_list, \@nottransported_list );
+ if ($print_lvl>=2) {print " aer dry dep list : $aer_drydep_list \n" ;}
# set solubility factors for aerosols
if (length($aer_wetdep_list)>2){
@@ -229,9 +209,14 @@ sub print_modal_info
#-------------------------------------------------------------------------------
sub get_gas_drydep_list
{
- my ($cfg_dir,$print_lvl,$species_list,$nottransported_list) = @_;
+ my ($chem,$cfg_dir,$print_lvl,$species_list,$nottransported_list) = @_;
- my $master_file = "$cfg_dir/namelist_files/master_gas_drydep_list.xml";
+ my $master_file = '';
+ if ($chem =~ /geoschem/) {
+ $master_file = "$cfg_dir/namelist_files/geoschem_master_gas_drydep_list.xml";
+ } else {
+ $master_file = "$cfg_dir/namelist_files/mozart_master_gas_drydep_list.xml";
+ }
my $list = get_dep_list($master_file,$print_lvl,$species_list,$nottransported_list);
@@ -244,9 +229,14 @@ sub get_gas_drydep_list
#-------------------------------------------------------------------------------
sub get_aer_drydep_list
{
- my ($cfg_dir,$print_lvl,$species_list,$nottransported_list) = @_;
+ my ($chem,$cfg_dir,$print_lvl,$species_list,$nottransported_list) = @_;
- my $master_file = "$cfg_dir/namelist_files/master_aer_drydep_list.xml";
+ my $master_file = '';
+ if ($chem =~ /geoschem/) {
+ $master_file = "$cfg_dir/namelist_files/geoschem_master_aer_drydep_list.xml";
+ } else {
+ $master_file = "$cfg_dir/namelist_files/mozart_master_aer_drydep_list.xml";
+ }
my $list = get_dep_list($master_file,$print_lvl,$species_list,$nottransported_list);
@@ -257,10 +247,15 @@ sub get_aer_drydep_list
#-------------------------------------------------------------------------------
sub get_aer_wetdep_list
{
- my ($cfg_dir,$print_lvl,$species_list,$nottransported_list) = @_;
-
- my $master_file = "$cfg_dir/namelist_files/master_aer_wetdep_list.xml";
+ my ($chem,$cfg_dir,$print_lvl,$species_list,$nottransported_list) = @_;
+ my $master_file = '';
+ if ($chem =~ /geoschem/) {
+ $master_file = "$cfg_dir/namelist_files/geoschem_master_aer_wetdep_list.xml";
+ } else {
+ $master_file = "$cfg_dir/namelist_files/mozart_master_aer_wetdep_list.xml";
+ }
+
my $list = get_dep_list($master_file,$print_lvl,$species_list,$nottransported_list);
if ($print_lvl>=2) {print " aer wet dep list : $list \n" ;}
@@ -270,9 +265,14 @@ sub get_aer_wetdep_list
#-------------------------------------------------------------------------------
sub get_gas_wetdep_list
{
- my ($cfg_dir,$print_lvl,$species_list,$nottransported_list) = @_;
+ my ($chem,$cfg_dir,$print_lvl,$species_list,$nottransported_list) = @_;
- my $master_file = "$cfg_dir/namelist_files/master_gas_wetdep_list.xml";
+ my $master_file = '';
+ if ($chem =~ /geoschem/) {
+ $master_file = "$cfg_dir/namelist_files/geoschem_master_gas_wetdep_list.xml";
+ } else {
+ $master_file = "$cfg_dir/namelist_files/mozart_master_gas_wetdep_list.xml";
+ }
my $list = get_dep_list($master_file,$print_lvl,$species_list,$nottransported_list);
@@ -310,40 +310,6 @@ sub get_dep_list
return ($list);
}
-
-#-------------------------------------------------------------------------------
-#-------------------------------------------------------------------------------
-sub filter_dep_list
-{
- my ( $input_list, $print_lvl, $species_list_ref, $nottransported_list_ref ) = @_;
-
- if ($print_lvl>=2){ print "Filtering deposition species list \n"; }
-
- my @species_list = @{$species_list_ref};
- my @nottransported_list = @{$nottransported_list_ref};
-
- my @master_list = split( ('\s+|\s*,+\s*'), $input_list);
-
- my $list = '';
- my $first = 1; my $pre = "";
- foreach my $name (sort @species_list) {
- foreach my $item (@master_list) {
- $item =~ s/['"]//g; #"'
- if (!($item ~~ @nottransported_list)) {
- if ($name eq $item) {
- $list .= $pre . quote_string($name) ;
- if ($first) { $pre = ","; $first = 0; }
- }
- }
- }
- }
-
- if ( length($list)<1 ) {$list = quote_string(' ') ;}
-
- return ($list);
-
-}
-
#-------------------------------------------------------------------------------
sub read_master_list_file
{
diff --git a/cime_config/SystemTests/mgp.py b/cime_config/SystemTests/mgp.py
new file mode 100644
index 0000000000..14f691dfcf
--- /dev/null
+++ b/cime_config/SystemTests/mgp.py
@@ -0,0 +1,47 @@
+"""
+CIME MGP test. This class inherits from SystemTestsCompareTwo
+
+This is a changing config options test to compare between MG3 and
+PUMAS in camdev. The use of MG3 or PUMAS should be bfb.
+This is just like an ERC test and it's meant for CAM only
+as it only does a single build.
+
+(1) Do an initial run with microphys setup as MG3 (suffix MG3)
+(2) Do an initial run with microphys setup as PUMAS (suffix PUMAS)
+"""
+
+import sys
+from CIME.XML.standard_module_setup import *
+from CIME.SystemTests.system_tests_compare_two import SystemTestsCompareTwo
+
+logger = logging.getLogger(__name__)
+
+class MGP(SystemTestsCompareTwo):
+
+ def __init__(self, case,
+ separate_builds=True,
+ run_one_suffix="mg3",
+ run_two_suffix="pumas",
+ run_one_description="MG3 microphysics",
+ run_two_description="PUMAS microphysics",
+ multisubmit=False,
+ **kwargs
+ ):
+ SystemTestsCompareTwo.__init__(self, case,
+ separate_builds=separate_builds,
+ run_one_suffix=run_one_suffix,
+ run_two_suffix=run_two_suffix,
+ run_one_description=run_one_description,
+ run_two_description=run_two_description,
+ multisubmit=multisubmit,
+ **kwargs
+ )
+ def _case_one_setup(self):
+ stop_n = self._case1.get_value("STOP_N")
+ expect(stop_n >= 3, "STOP_N must be at least 3, STOP_N = {}".format(stop_n))
+ self._case.set_value("CAM_CONFIG_OPTS","-phys cam_dev -microphys mg3")
+
+ def _case_two_setup(self):
+ self._case.set_value("CAM_CONFIG_OPTS","-phys cam_dev -microphys pumas")
+
+
diff --git a/cime_config/SystemTests/sct.py b/cime_config/SystemTests/sct.py
index ffcf85411a..bc11add267 100644
--- a/cime_config/SystemTests/sct.py
+++ b/cime_config/SystemTests/sct.py
@@ -43,7 +43,7 @@ def _case_two_setup(self):
append_to_user_nl_files(caseroot = self._get_caseroot(), component = "cam", contents = "MFILT = 1,7,1,1,1,1")
append_to_user_nl_files(caseroot = self._get_caseroot(), component = "cam", contents = "nhtfrq = 1,1,1,1,1,1")
append_to_user_nl_files(caseroot = self._get_caseroot(), component = "cam", contents = "fincl2='T','Q','TDIFF','QDIFF','LANDFRAC'")
- append_to_user_nl_files(caseroot = self._get_caseroot(), component = "cam", contents = "iopfile = '../"+case_name+".cam.h1."+RUN_STARTDATE+"-00000.nc'")
+ append_to_user_nl_files(caseroot = self._get_caseroot(), component = "cam", contents = "iopfile = '../"+case_name+".cam.h1i."+RUN_STARTDATE+"-00000.nc'")
append_to_user_nl_files(caseroot = self._get_caseroot(), component = "cam", contents = "inithist = 'YEARLY'")
append_to_user_nl_files(caseroot = self._get_caseroot(), component = "cam", contents = "scm_cambfb_mode = .true.")
append_to_user_nl_files(caseroot = self._get_caseroot(), component = "cam", contents = "scm_use_obs_uv = .true.")
@@ -65,7 +65,7 @@ def _component_compare_test(self, suffix1, suffix2,
success_change=False,
ignore_fieldlist_diffs=False):
with self._test_status:
- stat,netcdf_filename,err=run_cmd('ls ./run/case2run/*h1*8400.nc ')
+ stat,netcdf_filename,err=run_cmd('ls ./run/case2run/*h1i*8400.nc ')
stat,DIFFs,err=run_cmd('ncdump -ff -p 9,17 -v QDIFF,TDIFF '+netcdf_filename+' | egrep //\.\*DIFF | sed s/^\ \*// | sed s/^0,/0.0,/ | sed s/^0\;/0.0\;/ | sed s/\[,\;\].\*// | uniq')
array_of_DIFFs=DIFFs.split("\n")
answer=max([abs(float(x)) for x in array_of_DIFFs])
diff --git a/cime_config/SystemTests/tmc.py b/cime_config/SystemTests/tmc.py
index 97e96091b1..9fb8a5f7ab 100644
--- a/cime_config/SystemTests/tmc.py
+++ b/cime_config/SystemTests/tmc.py
@@ -6,6 +6,7 @@
from CIME.SystemTests.system_tests_common import SystemTestsCommon
from CIME.test_status import *
from CIME.utils import append_testlog
+from CIME.baselines.performance import get_latest_cpl_logs
import glob, gzip
@@ -22,7 +23,7 @@ def run_phase(self):
with self._test_status:
self._test_status.set_status("COMPARE_MASS", TEST_PEND_STATUS)
self.run_indv()
- cpllog = ''.join(self._get_latest_cpl_logs())
+ cpllog = ''.join(get_latest_cpl_logs(self._case))
atmlog = cpllog.replace("cpl.log","atm.log")
atmlog = atmlog.replace("drv.log","atm.log")
if '.gz' == atmlog[-3:]:
@@ -35,9 +36,9 @@ def run_phase(self):
first_val = -9.0
with self._test_status:
self._test_status.set_status("COMPARE_MASS", TEST_PASS_STATUS)
- use_this_tt_un = False
+ use_this_tt_un = False
for line in lines:
- if re.search('vvvvv gmean_mass: before tphysbc DRY',line.decode('utf-8')):
+ if re.search('vvvvv gmean_mass: before tphysbc DRY',line.decode('utf-8')):
use_this_tt_un = True
if re.search('TT_UN ',line.decode('utf-8')) and use_this_tt_un:
tt_un_flt=re.findall("\d+\.\d+",line.decode('utf-8'))
@@ -49,7 +50,7 @@ def run_phase(self):
self._test_status.set_status("COMPARE_MASS", TEST_FAIL_STATUS, comments="Mass Not Conserved")
comments = "CAM mass conservation test FAILED."
append_testlog(comments, self._orig_caseroot)
- use_this_tt_un = False
+ use_this_tt_un = False
if first_val == -9.0:
with self._test_status:
self._test_status.set_status("COMPARE_MASS", TEST_FAIL_STATUS, comments="Failed to find TT_UN in atm.log")
diff --git a/cime_config/buildlib b/cime_config/buildlib
index 90322da1ac..73db5db3dd 100755
--- a/cime_config/buildlib
+++ b/cime_config/buildlib
@@ -3,11 +3,12 @@
"""
create the cam library
"""
-#pylint: disable=multiple-imports, wrong-import-position, wildcard-import
-#pylint: disable=unused-wildcard-import, bad-whitespace, too-many-locals
-#pylint: disable=invalid-name
+# pylint: disable=multiple-imports, wrong-import-position, wildcard-import
+# pylint: disable=unused-wildcard-import, bad-whitespace, too-many-locals
+# pylint: disable=invalid-name
import sys, os, filecmp, shutil, imp
+
_CIMEROOT = os.environ.get("CIMEROOT")
if _CIMEROOT is None:
raise SystemExit("ERROR: must set CIMEROOT environment variable")
@@ -17,51 +18,27 @@ sys.path.append(_LIBDIR)
from standard_script_setup import *
from CIME.case import Case
-from CIME.utils import run_cmd, expect
+from CIME.utils import run_sub_or_cmd, expect, run_cmd
from CIME.buildlib import parse_input
from CIME.build import get_standard_makefile_args
logger = logging.getLogger(__name__)
-###############################################################################
-def _build_fms(caseroot, libroot, bldroot):
-###############################################################################
-
- with Case(caseroot) as case:
-
- # Only need FMS for fv3 dycore
- cam_dycore = case.get_value("CAM_DYCORE")
- if cam_dycore == 'fv3':
- # Check to see if some other component built it already
- if not os.path.exists(os.path.join(libroot,"libfms.a")):
- # first check for the external FMS library and build it
- srcroot = case.get_value("SRCROOT")
- fmsbuildlib = os.path.join(srcroot,"libraries","FMS","buildlib")
- fmsbuilddir = os.path.join(case.get_value("EXEROOT"),"FMS")
- expect(os.path.exists(fmsbuildlib), "FMS external not found")
- stat, _, err = run_cmd("{} {} {} {}".format(fmsbuildlib, case.get_value("EXEROOT"), fmsbuilddir, caseroot), verbose=True)
- expect(stat==0, "FMS build Failed {}".format(err))
-
- libfms = os.path.join(bldroot,"FMS","libfms.a")
- if os.path.exists(libfms):
- shutil.copy(libfms, libroot)
-
###############################################################################
def _build_cam(caseroot, libroot, bldroot):
-###############################################################################
+ ###############################################################################
with Case(caseroot, read_only=False) as case:
srcroot = case.get_value("SRCROOT")
- #-------------------------------------------------------
+ # -------------------------------------------------------
# Call cam's buildcpp
- #-------------------------------------------------------
+ # -------------------------------------------------------
testpath = os.path.join(srcroot, "components", "cam")
if os.path.exists(testpath):
srcroot = testpath
- cmd = os.path.join(os.path.join(srcroot,
- "cime_config", "buildcpp"))
+ cmd = os.path.join(os.path.join(srcroot, "cime_config", "buildcpp"))
logger.info(" ...calling cam buildcpp to set build time options")
try:
mod = imp.load_source("buildcpp", cmd)
@@ -76,16 +53,32 @@ def _build_cam(caseroot, libroot, bldroot):
gmake_j = case.get_value("GMAKE_J")
gmake = case.get_value("GMAKE")
mach = case.get_value("MACH")
-
- #-------------------------------------------------------
+ user_incldir = None
+ cam_dycore = case.get_value("CAM_DYCORE")
+ if cam_dycore == "fv3":
+ slr = os.path.abspath(case.get_value("SHAREDLIBROOT"))
+ compiler = case.get_value("COMPILER")
+ mpilib = case.get_value("MPILIB")
+ debug = "debug" if case.get_value("DEBUG") else "nodebug"
+ threaded = "threads" if case.get_value("BUILD_THREADED") or case.get_value("FORCE_BUILD_SMP") else "nothreads"
+ comp_interface = case.get_value("COMP_INTERFACE")
+ fmsbuilddir = os.path.join(
+ slr, compiler, mpilib, debug, threaded, comp_interface)
+ user_incldir = '"-I{} -I{} -I{}"'.format(
+ os.path.join(srcroot, "libraries", "FMS", "src", "include"),
+ os.path.join(srcroot, "libraries", "FMS", "src", "mpp", "include"),
+ fmsbuilddir,
+ )
+
+ # -------------------------------------------------------
# Filepath is created in caseroot/camconf by the call
# to buildcpp - this needs to be copied to bldroot
- #-------------------------------------------------------
+ # -------------------------------------------------------
filesrc = os.path.join(caseroot, "Buildconf", "camconf", "Filepath")
filedst = os.path.join(bldroot, "Filepath_tmp")
shutil.copy(filesrc, filedst)
- filedst = os.path.join(bldroot, "Filepath")
+ filedst = os.path.join(bldroot, "Filepath")
filedst_tmp = os.path.join(bldroot, "Filepath_tmp")
if os.path.isfile(filedst):
if not filecmp.cmp(filedst_tmp, filedst):
@@ -93,28 +86,42 @@ def _build_cam(caseroot, libroot, bldroot):
else:
shutil.move(filedst_tmp, filedst)
- #-------------------------------------------------------
+ # -------------------------------------------------------
+ # fms is needed by fv3 and should have been built by the framework
+ # -------------------------------------------------------
+ if cam_dycore == "fv3":
+ libfms = os.path.join(fmsbuilddir, "libfms.a")
+ expect(os.path.isfile(libfms), "FMS library not found {}".format(libfms))
+ shutil.copy(libfms, libroot)
+
+ # -------------------------------------------------------
# build the library
- #-------------------------------------------------------
- complib = os.path.join(libroot, "libatm.a")
+ # -------------------------------------------------------
+ complib = os.path.join(libroot, "libatm.a")
makefile = os.path.join(casetools, "Makefile")
- cmd = "{} complib -j {} COMP_NAME=cam COMPLIB={} -f {} {} " \
- .format(gmake, gmake_j, complib, makefile, get_standard_makefile_args(case))
+ cmd = "{} complib -j {} COMP_NAME=cam COMPLIB={} -f {} {} ".format(
+ gmake, gmake_j, complib, makefile, get_standard_makefile_args(case)
+ )
if cam_cppdefs:
cmd += " USER_CPPDEFS='{}'".format(cam_cppdefs)
+ if user_incldir:
+ cmd += " USER_INCLDIR={}".format(user_incldir)
+
rc, out, err = run_cmd(cmd)
logger.info("%s: \n\n output:\n %s \n\n err:\n\n%s\n", cmd, out, err)
expect(rc == 0, "Command %s failed with rc=%s" % (cmd, rc))
+
###############################################################################
+
def _main_func():
caseroot, libroot, bldroot = parse_input(sys.argv)
- _build_fms(caseroot, libroot, bldroot)
_build_cam(caseroot, libroot, bldroot)
+
###############################################################################
if __name__ == "__main__":
diff --git a/cime_config/buildnml b/cime_config/buildnml
index ca44b885d5..0af683719a 100755
--- a/cime_config/buildnml
+++ b/cime_config/buildnml
@@ -48,6 +48,12 @@ def buildnml(case, caseroot, compname):
RUN_REFTOD = case.get_value("RUN_REFTOD")
COMP_INTERFACE = case.get_value("COMP_INTERFACE")
+ stream_ndep_year_first = case.get_value("CAM_STREAM_NDEP_YEAR_FIRST")
+ stream_ndep_year_last = case.get_value("CAM_STREAM_NDEP_YEAR_LAST")
+ stream_ndep_year_align = case.get_value("CAM_STREAM_NDEP_YEAR_ALIGN")
+ stream_ndep_data_filename = case.get_value("CAM_STREAM_NDEP_DATA_FILENAME")
+ stream_ndep_mesh_filename = case.get_value("CAM_STREAM_NDEP_MESH_FILENAME")
+
testsrc = os.path.join(srcroot, "components", "cam")
if os.path.exists(testsrc):
srcroot = testsrc
@@ -56,12 +62,14 @@ def buildnml(case, caseroot, compname):
# call buildcpp to set both cppdefs and config_cache.xml file for generating namelist
#--------------------------------------------------------------------
call_buildcpp = False
- if not os.path.exists(os.path.join(caseroot,"LockedFiles","env_build.xml")):
+ camconf = os.path.join(caseroot, "Buildconf", "camconf")
+ filename = os.path.join(camconf, "config_cache.xml")
+ if not os.path.isfile(filename):
call_buildcpp = True
else:
file1 = os.path.join(caseroot,"env_build.xml")
file2 = os.path.join(caseroot,"LockedFiles","env_build.xml")
- if not filecmp.cmp(file1, file2):
+ if os.path.isfile(file2) and not filecmp.cmp(file1, file2):
call_buildcpp = True
if call_buildcpp:
cmd = os.path.join(os.path.join(srcroot,"cime_config","buildcpp"))
@@ -73,8 +81,6 @@ def buildnml(case, caseroot, compname):
raise
# Verify that we have a config_cache file (generated by the call to buildcpp)
- camconf = os.path.join(caseroot, "Buildconf", "camconf")
- filename = os.path.join(camconf, "config_cache.xml")
expect(os.path.isfile(filename),
" Missing config_cache.xml - cannot run build-namelist")
@@ -167,6 +173,12 @@ def buildnml(case, caseroot, compname):
buildnl_opts += ["-inputdata", input_data_list]
+ CAM_NAMELIST_OPTS += " stream_ndep_year_first=" + stream_ndep_year_first
+ CAM_NAMELIST_OPTS += " stream_ndep_year_last=" + stream_ndep_year_last
+ CAM_NAMELIST_OPTS += " stream_ndep_year_align=" + stream_ndep_year_align
+ CAM_NAMELIST_OPTS += " stream_ndep_data_filename='" + stream_ndep_data_filename.strip() + "'"
+ CAM_NAMELIST_OPTS += " stream_ndep_mesh_filename='" + stream_ndep_mesh_filename.strip() + "'"
+
buildnl_opts += ["-namelist",
'" &atmexp ' + CAM_NAMELIST_OPTS + '/" ']
@@ -179,42 +191,17 @@ def buildnml(case, caseroot, compname):
rc, out, err = run_cmd(cmd, from_dir=camconf)
expect(rc==0,"Command %s failed rc=%d\nout=%s\nerr=%s"%(cmd,rc,out,err))
- # -----------------------------------------------------
- # For GEOS-Chem / HEMCO only:
- # Copy input files from storage location into Buildconf/camconf
- # This only needs to be done once
- # -----------------------------------------------------
-
- # We use this to figure out if we are using the GEOS-Chem chemistry
- # mechanism.
- # Might have to do something else with HEMCO_CESM?
- if '-chem geoschem' in CAM_CONFIG_OPTS:
- geoschem_src = os.path.join(srcroot, "src/chemistry/geoschem/geoschem_src")
- if not os.path.isdir(geoschem_src):
- raise SystemExit("ERROR: Did not find path to GEOS-Chem source code at {:s}".format(geoschem_src))
- if os.path.isdir(rundir):
- for fileName in ['species_database.yml', 'geoschem_config.yml',
- 'HISTORY.rc', 'HEMCO_Config.rc', 'HEMCO_Diagn.rc']:
- file1 = os.path.join(geoschem_src, "run/CESM", fileName)
- file2 = os.path.join(camconf, fileName)
- if not os.path.exists(file2):
- logger.info("CAM namelist one-time copy: file1 %s file2 %s ", file1, file2)
- shutil.copy(file1,file2)
-
# -----------------------------------------------------
# copy resolved namelist, atm_in, to rundir
# -----------------------------------------------------
if os.path.isdir(rundir):
- for fileName in ['atm_in', 'species_database.yml', 'geoschem_config.yml',
- 'HISTORY.rc', 'HEMCO_Config.rc', 'HEMCO_Diagn.rc']:
- file1 = os.path.join(camconf, fileName)
- file2 = os.path.join(rundir, fileName)
- if fileName == 'atm_in' and ninst > 1:
- file2 += inst_string
- if os.path.exists(file1) or fileName == 'atm_in':
- logger.info("CAM namelist copy: file1 %s file2 %s ", file1, file2)
- shutil.copy(file1,file2)
+ file1 = os.path.join(camconf, "atm_in")
+ file2 = os.path.join(rundir, "atm_in")
+ if ninst > 1:
+ file2 += inst_string
+ logger.info("CAM namelist copy: file1 %s file2 %s ", file1, file2)
+ shutil.copy(file1,file2)
# -----------------------------------------------------
# copy drv_flds_in to rundir if it does not exist
@@ -225,6 +212,18 @@ def buildnml(case, caseroot, compname):
if (os.path.isfile(file1)) and (not os.path.isfile(file2)):
shutil.copy(file1,file2)
+ # -----------------------------------------------------
+ # copy geos-chem config files to rundir if using geos-chem chemistry
+ # -----------------------------------------------------
+
+ if os.path.isdir(rundir) and '-chem geoschem' in CAM_CONFIG_OPTS:
+ for fname in ['species_database.yml', 'geoschem_config.yml',
+ 'HISTORY.rc', 'HEMCO_Config.rc', 'HEMCO_Diagn.rc']:
+ file1 = os.path.join(caseroot, fname)
+ file2 = os.path.join(rundir, fname)
+ logger.info("GEOS-Chem config file copy: file1 %s file2 %s ", file1, file2)
+ shutil.copy(file1,file2)
+
###############################################################################
def _main_func():
diff --git a/cime_config/cam.case_setup.py b/cime_config/cam.case_setup.py
new file mode 100755
index 0000000000..e8cb17c5a6
--- /dev/null
+++ b/cime_config/cam.case_setup.py
@@ -0,0 +1,69 @@
+#! /usr/bin/env python3
+
+"""Copy GEOS-Chem configuration files from source to the case directory.
+This script is run from CIME when calling case.setup"""
+
+import logging
+import os
+import shutil
+import sys
+
+_CIMEROOT = os.environ.get("CIMEROOT")
+if _CIMEROOT is None:
+ raise SystemExit("ERROR: must set CIMEROOT environment variable")
+# end if
+_LIBDIR = os.path.join(_CIMEROOT, "CIME", "Tools")
+sys.path.append(_LIBDIR)
+sys.path.insert(0, _CIMEROOT)
+
+#pylint: disable=wrong-import-position
+from CIME.case import Case
+
+logger = logging.getLogger(__name__)
+
+if len(sys.argv) != 3:
+ raise SystemExit(f"Incorrect call to {sys.argv[0]}, need CAM root and case root")
+# end if
+cam_root = sys.argv[1]
+case_root = sys.argv[2]
+
+with Case(case_root) as case:
+ cam_config = case.get_value('CAM_CONFIG_OPTS')
+ # Gather case information (from _build_usernl_files in case_setup.py)
+ comp_interface = case.get_value("COMP_INTERFACE")
+
+ if comp_interface == "nuopc":
+ ninst = case.get_value("NINST")
+ elif ninst == 1:
+ ninst = case.get_value("NINST_CAM")
+ # end if
+# end with
+
+# GEOS-Chem only: copy config files to case
+if '-chem geoschem' in cam_config:
+ geoschem_config_src = os.path.join(cam_root, 'src', 'chemistry',
+ 'geoschem', 'geoschem_src', 'run', 'CESM')
+ if not os.path.isdir(geoschem_config_src):
+ raise SystemExit(f"ERROR: Did not find path to GEOS-Chem config files at {geoschem_config_src}")
+ # end if
+ for fileName in ['species_database.yml', 'geoschem_config.yml', 'HISTORY.rc',
+ 'HEMCO_Config.rc', 'HEMCO_Diagn.rc']:
+ source_file = os.path.join(cam_root, geoschem_config_src, fileName)
+ if not os.path.exists(source_file):
+ raise SystemExit(f"ERROR: Did not find source file, {source_file}")
+ # end if
+ spaths = os.path.splitext(source_file)
+ for inst_num in range(ninst):
+ if ninst > 1:
+ target_file = f"{spaths[0]}_{inst_num+1:04d}{spaths[1]}"
+ else:
+ target_file = os.path.join(case_root, fileName)
+ # end if
+ if not os.path.exists(target_file):
+ logger.info("CAM namelist one-time copy of GEOS-Chem run directory files: source_file %s target_file %s ",
+ source_file, target_file)
+ shutil.copy(source_file, target_file)
+ # end if
+ # end for
+ # end for
+# end if
diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml
index 37d2a20175..21d3ec6d4b 100644
--- a/cime_config/config_component.xml
+++ b/cime_config/config_component.xml
@@ -8,12 +8,12 @@
CAM
===============
-->
- CAM cam6 physics:
- CAM cam5 physics:
- CAM cam4 physics:
+ CAM cam6 physics:
+ CAM cam5 physics:
+ CAM cam4 physics:
CAM cam3 physics:
- CAM simplified and non-versioned physics :
- CAM7 development physics:
+ CAM simplified and non-versioned physics :
+ CAM7 development physics:
- 58 vertical layers:
- 93 vertical layers:
CAM-Chem troposphere/stratosphere chemistry with simplified VBS-SOA:
CAM-Chem troposphere/stratosphere chemistry with simplified VBS-SOA and expanded isoprene and terpene oxidation:
- GEOS-Chem troposphere/stratosphere chemistry :
+ GEOS-Chem troposphere/stratosphere chemistry :
CAM-Chem troposphere/stratosphere chem with simplified volatility basis set SOA scheme and fire emissons :
CAM CLUBB - turned on by default in CAM60:
- CAM-Chem troposphere/stratosphere chem with extended volatility basis set SOA scheme and modal aerosols :
+ CAM-Chem troposphere/stratosphere chem with extended volatility basis set SOA scheme and modal aersols :
+ CAM low top model
+ Prognostic GHG chemistry mechanism for CAM7:
Modal Aerosol Model composed of 7 modes:
+ CAM mid top model
CAM CO2 ramp:
CAM super-parameterized CAM one moment SAM microphysics
CAM super-parameterized CAM one moment SAM microphysics using CLUBB
CAM super-parameterized CAM double moment m2005 SAM microphysics
- CAM super-parameterized CAM double moment m2005 SAM microphysics using GEOS-Chem
CAM super-parameterized CAM double moment m2005 SAM microphysics using CLUBB
CAM tropospheric chemistry with bulk aerosols:
@@ -80,8 +80,8 @@
CAM dry adiabatic configurarion (no physics forcing):
CAM dry adiabatic baroclinic instability (Polvani et al., 2004):
CAM moist Held-Suarez forcing (Thatcher and Jablonowski, 2016):
+ CAM moist simple model (Frierson, 2006):
CAM dry Held-Suarez forcing (Held and Suarez (1994)):
- CAM with GEOS-Chem dycore test:
CAM moist dynamical core test with Ullrich et al. (2014) baroclinic wave IC, Kessler physics and terminator chemistry:
-phys cam_dev
+ -chem ghg_mam4
-chem trop_strat_mam5_vbs
- -chem geoschem_mam4 -hemco
+ -chem geoschem_mam4
-chem trop_mam7
-chem trop_strat_mam5_vbsext
@@ -153,9 +154,6 @@
-co2_cycle
-
- -hemco
-
-age_of_air_trcs
@@ -175,18 +173,17 @@
-offline_dyn
-nlev 56
-nlev 56
- -nlev 56
-nlev 88
-nlev 145
- -nlev 58
- -nlev 93
+ -nlev 58 -model_top lt
+ -nlev 93 -model_top mt
-phys adiabatic
-phys adiabatic
-phys tj2016 -analytic_ic
+ -phys grayrad -analytic_ic
-phys held_suarez -analytic_ic
- -phys held_suarez -chem geoschem -hemco -analytic_ic
-phys kessler -chem terminator -analytic_ic -nadv_tt=6
@@ -220,23 +217,20 @@
waccm_tsmlt_1850_cam6
waccm_ma_1850_cam6
waccm_sc_1850_cam6
+ 1850_cam_lt
+ 1850_cam_mt
2000_cam4_trop_chem
waccmxie_ma_2000_cam4
waccmx_ma_2000_cam4
- geoschem
- geoschem
- geoschem
- geoschem_baro_moist
-
2000_cam6
2000_cam6
waccm_tsmlt_2000_cam6
waccm_ma_2000_cam6
waccm_sc_2000_cam6
2000_trop_strat_vbs_cam6
- 2000_geoschem
+ 2000_geoschem
waccmx_ma_2000_cam6
aquaplanet_cam3
@@ -253,7 +247,7 @@
2010_trop_strat_vbs_cam6
waccm_tsmlt_2010_cam6
waccm_sc_2010_cam6
- 2010_geoschem
+ 2010_geoschem
1850-2005_cam5
1850-2005_cam4
@@ -263,6 +257,8 @@
1950-2010_ccmi_refc1_waccmx_ma
1850-2005_cam5
hist_cam6
+ hist_cam_lt
+ hist_cam_mt
waccm_tsmlt_hist_cam6
waccm_sc_hist_cam6
waccm_ma_hist_cam6
@@ -272,8 +268,8 @@
hist_trop_strat_nudged_cam6
hist_trop_strat_vbsext_cam6
hist_trop_strat_vbsfire_cam6
- hist_geoschem
- hist_geoschem_nudged
+ hist_geoschem
+ hist_geoschem_nudged
waccmx_ma_hist_cam6
1850-PD_cam5
@@ -300,12 +296,12 @@
sd_waccm_ma_cam4
sd_trop_strat_vbs_cam6
sd_trop_strat2_cam6
- sd_geoschem
sd_cam6
dabi_p2004
held_suarez_1994
dctest_tj2016
+ dctest_frierson
dctest_baro_kessler
@@ -345,6 +341,8 @@
flbc_file='$DIN_LOC_ROOT/atm/waccm/lb/LBC_CMIP6_1pctCO2ramp_y1-165_0p5degLat_c180930.nc'
nlte_limit_co2=.true.
co2_cycle_rad_passive=.true.
+
+ use_hemco=.true.
rearth = 6.37122D6
@@ -371,6 +369,79 @@
User mods to apply to specific compset matches.
+
+
+
+ char
+ 2000
+
+ 1850
+ 2010
+ 1850
+ 2015
+
+ run_component_cam
+ env_run.xml
+ Nitrogen deposition data year first
+
+
+
+ char
+ 2000
+
+ 2010
+ 1850
+ 2015
+ 2101
+
+ run_component_cam
+ env_run.xml
+ Nitrogen deposition data year last
+
+
+
+ char
+ 1
+
+ 1850
+ 2015
+
+ run_component_cam
+ env_run.xml
+ Nitrogen deposition align CAM_STREAM_NDEP_YEAR_FIRST with this model year
+
+
+
+
+ char
+ UNSET
+
+ $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP5-8.5-WACCM_1849-2101_monthly_c191007.nc
+ $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP1-2.6-WACCM_1849-2101_monthly_c191007.nc
+ $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP2-4.5-WACCM_1849-2101_monthly_c191007.nc
+ $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_SSP370_b.e21.BWSSP370cmip6.f09_g17.CMIP6-SSP3-7.0-WACCM.002_1849-2101_monthly_0.9x1.25_c211216.nc
+ $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc
+ $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc
+ $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc
+ $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc
+
+ run_component_cam
+ env_run.xml
+ Nitrogen deposition data filename
+
+
+
+ char
+ $DIN_LOC_ROOT/share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc
+ run_component_cam
+ env_run.xml
+ Nitrogen deposition mesh filename (corresponding to the CAM_STREAM_NDEP_DATA_FILENAME)
+
+
=========================================
CAM naming conventions
diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml
index 004f3cc07b..d2aec47d2e 100644
--- a/cime_config/config_compsets.xml
+++ b/cime_config/config_compsets.xml
@@ -61,6 +61,26 @@
+
+ FLTHIST
+ HIST_CAM%DEV%LT%GHGMAM4_CLM51%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
+
+
+
+ FMTHIST
+ HIST_CAM%DEV%MT%GHGMAM4_CLM51%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
+
+
+
+ FLT1850_TESTINGONLY_v0c
+ 1850_CAM%DEV%LT%GHGMAM4_CLM51%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
+
+
+
+ FMT1850_TESTINGONLY_v0c
+ 1850_CAM%DEV%MT%GHGMAM4_CLM51%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
+
+
FHIST_BGC
HIST_CAM60_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
@@ -324,11 +344,11 @@
FCLTHIST
- HIST_CAM%DEV%L58%CCTS1_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
+ HIST_CAM%DEV%LT%CCTS1_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
FCMTHIST
- HIST_CAM%DEV%L93%CCTS1_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
+ HIST_CAM%DEV%MT%CCTS1_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
FCvbsxHIST
@@ -393,6 +413,10 @@
HIST_CAM60_CLM50%SP_CICE%PRES_DOCN%DOM_SROF_SGLC_SWAV
+
+ FGRAYRAD
+ 2000_CAM%GRAYRAD_SLND_SICE_SOCN_SROF_SGLC_SWAV
+
@@ -531,35 +555,24 @@
HIST_CAM60%WXIED%SDYN_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
-
-
-
-
-
FC2000climo_GC
- 2000_CAM60%GC_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_CISM2%NOEVOLVE_SWAV
+ 2000_CAM60%GEOSCHEM%HEMCO_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_CISM2%NOEVOLVE_SWAV
FC2010climo_GC
- 2010_CAM60%GC_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_CISM2%NOEVOLVE_SWAV
+ 2010_CAM60%GEOSCHEM%HEMCO_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_CISM2%NOEVOLVE_SWAV
FCHIST_GC
- HIST_CAM60%GC_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_CISM2%NOEVOLVE_SWAV
-
-
-
- FCSD_GC
- HIST_CAM60%GC%SDYN_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
+ HIST_CAM60%GEOSCHEM%HEMCO_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_CISM2%NOEVOLVE_SWAV
FCnudged_GC
- HIST_CAM60%GC%NUDG_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
+ HIST_CAM60%GEOSCHEM%HEMCO%NUDG_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
@@ -575,18 +588,17 @@
1980-01-01
1850-01-01
2010-01-01
- 2015-01-01
+ 2015-01-01
2013-01-01
1995-01-01
1995-01-01
2005-01-01
2005-01-01
- 2015-01-01
2010-01-01
1980-01-01
2000-01-01
- 2000-01-01
- 2010-01-01
+ 2000-01-01
+ 2010-01-01
2004-01-01
1950-01-01
@@ -612,13 +624,6 @@
-
-
-
- TRUE
-
-
-
@@ -628,56 +633,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
1
1
- 1
@@ -685,7 +644,6 @@
1
1
- 1
@@ -693,7 +651,6 @@
1
1
- 1
@@ -701,7 +658,6 @@
1
1
- 1
@@ -709,7 +665,6 @@
1
1
- 1
@@ -717,7 +672,6 @@
1
1
- 1
@@ -725,7 +679,6 @@
1
1
- 1
@@ -733,7 +686,6 @@
1
1
- 1
@@ -741,7 +693,6 @@
1
1
- 1
@@ -749,7 +700,6 @@
1
1
- 1
diff --git a/cime_config/config_pes.xml b/cime_config/config_pes.xml
index de5c27950f..5b4bc10c5b 100644
--- a/cime_config/config_pes.xml
+++ b/cime_config/config_pes.xml
@@ -257,6 +257,48 @@
+
+
+
+
+ 360
+ 360
+ 360
+ 360
+ 360
+ 360
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+ -4
+ -4
+ -4
+ -4
+ -4
+ -4
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+
+
@@ -293,6 +335,27 @@
+
+
+ none
+
+ -4
+ -4
+ -4
+ -4
+ -4
+ -4
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+
@@ -330,9 +393,122 @@
+
+
+ none
+
+ -16
+ -16
+ -16
+ -16
+ -16
+ -16
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+
+ none
+
+ -8
+ -8
+ -8
+ -8
+ -8
+ -8
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+
+ none
+
+ -8
+ -8
+ -8
+ -8
+ -8
+ -8
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+ none
+
+ -8
+ -8
+ -8
+ -8
+ -8
+ -8
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+
+
+ none
+
+ -12
+ -12
+ -12
+ -12
+ -12
+ -12
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+
none
@@ -619,6 +795,66 @@
+
+
+
+ none
+
+ 128
+ 128
+ 128
+ 128
+ 128
+ 128
+ 128
+ 128
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+
+
+ none
+
+ -4
+ -4
+ -4
+ -4
+ -4
+ -4
+ -4
+ -4
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+
+
@@ -1051,6 +1287,27 @@
+
+
+ none
+
+ -8
+ -8
+ -8
+ -8
+ -8
+ -8
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+
@@ -1157,6 +1414,27 @@
+
+
+ none
+
+ -8
+ -8
+ -8
+ -8
+ -8
+ -8
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+
@@ -1392,6 +1670,44 @@
+
+
+
+ none
+
+ 36
+ 36
+ 36
+ 36
+ 36
+ 36
+ 36
+ 36
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+
+
+
+
@@ -1470,6 +1786,41 @@
+
+
+ none
+
+ 128
+ 128
+ 128
+ 128
+ 128
+ 128
+ 128
+ 128
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+
+
none
@@ -1715,18 +2066,6 @@
1
-
-
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
-
-
diff --git a/cime_config/config_tests.xml b/cime_config/config_tests.xml
index 111cb8371e..da799010f9 100644
--- a/cime_config/config_tests.xml
+++ b/cime_config/config_tests.xml
@@ -23,6 +23,7 @@ TMC CAM mass conservation test
9
$STOP_OPTION
$STOP_N
+ TRUE
@@ -69,5 +70,15 @@ TMC CAM mass conservation test
$STOP_N
+
+ CAM test: Verify mg3 and pumas give identical answers
+ 1
+ FALSE
+ FALSE
+ nsteps
+ 7
+ $STOP_OPTION
+ $STOP_N
+
diff --git a/cime_config/testdefs/testlist_cam.xml b/cime_config/testdefs/testlist_cam.xml
index db6c93525e..4b6647697d 100644
--- a/cime_config/testdefs/testlist_cam.xml
+++ b/cime_config/testdefs/testlist_cam.xml
@@ -7,11 +7,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -19,16 +19,7 @@
-
-
-
-
-
-
-
-
-
-
+
@@ -44,8 +35,8 @@
-
-
+
+
@@ -53,7 +44,7 @@
-
+
@@ -61,7 +52,7 @@
-
+
@@ -69,7 +60,7 @@
-
+
@@ -78,8 +69,8 @@
-
-
+
+
@@ -88,8 +79,8 @@
-
-
+
+
@@ -98,20 +89,20 @@
-
-
+
+
-
+
-
-
-
-
+
+
+
+
@@ -120,7 +111,7 @@
-
+
@@ -134,7 +125,7 @@
-
+
@@ -142,7 +133,7 @@
-
+
@@ -150,7 +141,7 @@
-
+
@@ -159,8 +150,8 @@
-
-
+
+
@@ -169,8 +160,8 @@
-
-
+
+
@@ -179,9 +170,9 @@
-
-
-
+
+
+
@@ -192,18 +183,9 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
@@ -211,7 +193,7 @@
-
+
@@ -219,7 +201,7 @@
-
+
@@ -233,17 +215,9 @@
-
-
-
-
-
-
-
-
-
+
@@ -251,7 +225,7 @@
-
+
@@ -259,7 +233,7 @@
-
+
@@ -273,7 +247,7 @@
-
+
@@ -281,18 +255,9 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
@@ -300,7 +265,7 @@
-
+
@@ -308,7 +273,7 @@
-
+
@@ -316,7 +281,7 @@
-
+
@@ -325,8 +290,8 @@
-
-
+
+
@@ -334,7 +299,7 @@
-
+
@@ -342,7 +307,7 @@
-
+
@@ -353,7 +318,7 @@
-
+
@@ -380,16 +345,6 @@
-
-
-
-
-
-
-
-
-
-
@@ -570,16 +525,6 @@
-
-
-
-
-
-
-
-
-
-
@@ -647,7 +592,16 @@
-
+
+
+
+
+
+
+
+
+
+
@@ -659,7 +613,7 @@
-
+
@@ -670,7 +624,7 @@
-
+
@@ -681,7 +635,7 @@
-
+
@@ -692,7 +646,7 @@
-
+
@@ -703,7 +657,7 @@
-
+
@@ -714,7 +668,7 @@
-
+
@@ -725,7 +679,7 @@
-
+
@@ -736,7 +690,7 @@
-
+
@@ -747,7 +701,7 @@
-
+
@@ -759,30 +713,31 @@
-
+
-
+
-
+
-
-
-
+
+
+
+
-
+
-
-
+
+
@@ -793,7 +748,7 @@
-
+
@@ -804,7 +759,7 @@
-
+
@@ -815,13 +770,142 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -852,7 +936,7 @@
-
+
@@ -860,8 +944,8 @@
-
-
+
+
@@ -1099,16 +1183,7 @@
-
-
-
-
-
-
-
-
-
-
+
@@ -1118,16 +1193,7 @@
-
-
-
-
-
-
-
-
-
-
+
@@ -1137,7 +1203,7 @@
-
+
@@ -1149,7 +1215,7 @@
-
+
@@ -1158,8 +1224,8 @@
-
-
+
+
@@ -1167,7 +1233,7 @@
-
+
@@ -1176,7 +1242,7 @@
-
+
@@ -1186,7 +1252,7 @@
-
+
@@ -1196,7 +1262,7 @@
-
+
@@ -1206,8 +1272,8 @@
-
-
+
+
@@ -1216,8 +1282,8 @@
-
-
+
+
@@ -1225,7 +1291,7 @@
-
+
@@ -1233,7 +1299,7 @@
-
+
@@ -1242,7 +1308,7 @@
-
+
@@ -1252,7 +1318,7 @@
-
+
@@ -1262,7 +1328,7 @@
-
+
@@ -1272,7 +1338,7 @@
-
+
@@ -1282,7 +1348,7 @@
-
+
@@ -1291,7 +1357,7 @@
-
+
@@ -1300,7 +1366,7 @@
-
+
@@ -1316,6 +1382,16 @@
+
+
+
+
+
+
+
+
+
+
@@ -1353,10 +1429,15 @@
+
+
+
+
+
-
+
@@ -1367,16 +1448,8 @@
-
-
-
-
-
-
-
-
-
-
+
+
@@ -1384,8 +1457,8 @@
-
-
+
+
@@ -1399,17 +1472,46 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
@@ -1417,22 +1519,30 @@
-
-
+
+
-
+
+
+
+
+
+
+
+
+
-
+
-
+
@@ -1482,7 +1592,7 @@
-
+
@@ -1490,7 +1600,7 @@
-
+
@@ -1498,7 +1608,7 @@
-
+
@@ -1506,7 +1616,7 @@
-
+
@@ -1514,7 +1624,7 @@
-
+
@@ -1522,7 +1632,7 @@
-
+
@@ -1530,7 +1640,7 @@
-
+
@@ -1538,16 +1648,8 @@
-
-
-
-
-
-
-
-
-
-
+
+
@@ -1555,8 +1657,8 @@
-
-
+
+
@@ -1564,8 +1666,8 @@
-
-
+
+
@@ -1574,9 +1676,9 @@
-
-
-
+
+
+
@@ -1585,8 +1687,8 @@
-
-
+
+
@@ -1595,8 +1697,8 @@
-
-
+
+
@@ -1605,13 +1707,14 @@
-
+
+
+
-
@@ -1633,47 +1736,83 @@
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
@@ -1681,8 +1820,8 @@
-
-
+
+
@@ -1690,7 +1829,7 @@
-
+
@@ -1698,8 +1837,8 @@
-
-
+
+
@@ -1707,8 +1846,8 @@
-
-
+
+
@@ -1716,8 +1855,8 @@
-
-
+
+
@@ -1725,13 +1864,13 @@
-
+
-
-
+
+
@@ -1739,24 +1878,24 @@
-
+
-
+
-
-
+
+
-
-
+
+
@@ -1764,37 +1903,42 @@
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
+
+
+
+
+
-
-
+
+
@@ -1803,18 +1947,18 @@
-
+
-
+
-
-
+
+
@@ -1822,24 +1966,33 @@
-
+
-
-
+
+
-
+
-
+
-
-
+
-
+
+
+
+
+
+
+
+
+
+
+
@@ -1861,7 +2014,7 @@
-
+
@@ -1869,7 +2022,7 @@
-
+
@@ -1877,18 +2030,18 @@
-
+
-
+
-
+
@@ -1896,8 +2049,8 @@
-
-
+
+
@@ -1905,8 +2058,8 @@
-
-
+
+
@@ -1929,7 +2082,7 @@
-
+
@@ -1939,7 +2092,7 @@
-
+
@@ -1947,7 +2100,7 @@
-
+
@@ -1955,7 +2108,7 @@
-
+
@@ -1964,7 +2117,7 @@
-
+
@@ -1973,7 +2126,7 @@
-
+
@@ -1982,7 +2135,7 @@
-
+
@@ -1992,7 +2145,7 @@
-
+
@@ -2000,7 +2153,7 @@
-
+
@@ -2009,7 +2162,7 @@
-
+
@@ -2019,27 +2172,46 @@
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
@@ -2047,22 +2219,22 @@
-
+
-
-
+
+
-
+
-
-
+
+
@@ -2071,7 +2243,7 @@
-
+
@@ -2080,9 +2252,9 @@
-
-
-
+
+
+
@@ -2090,8 +2262,8 @@
-
-
+
+
@@ -2099,8 +2271,8 @@
-
-
+
+
@@ -2108,8 +2280,8 @@
-
-
+
+
@@ -2117,8 +2289,8 @@
-
-
+
+
@@ -2126,7 +2298,7 @@
-
+
@@ -2134,7 +2306,7 @@
-
+
@@ -2142,7 +2314,7 @@
-
+
@@ -2150,7 +2322,7 @@
-
+
@@ -2158,8 +2330,8 @@
-
-
+
+
@@ -2167,13 +2339,13 @@
-
+
-
-
+
+
@@ -2181,8 +2353,8 @@
-
-
+
+
@@ -2190,7 +2362,7 @@
-
+
@@ -2198,7 +2370,7 @@
-
+
@@ -2206,8 +2378,8 @@
-
-
+
+
@@ -2215,7 +2387,7 @@
-
+
@@ -2223,8 +2395,8 @@
-
-
+
+
@@ -2232,8 +2404,8 @@
-
-
+
+
@@ -2241,27 +2413,27 @@
-
-
+
+
-
+
-
+
-
+
-
-
+
+
@@ -2269,23 +2441,23 @@
-
+
-
+
-
+
-
-
+
+
@@ -2293,12 +2465,12 @@
-
+
-
+
@@ -2306,7 +2478,7 @@
-
+
@@ -2314,22 +2486,22 @@
-
+
-
+
-
+
-
+
@@ -2337,7 +2509,7 @@
-
+
@@ -2345,7 +2517,7 @@
-
+
@@ -2353,8 +2525,8 @@
-
-
+
+
@@ -2362,7 +2534,7 @@
-
+
@@ -2370,7 +2542,7 @@
-
+
@@ -2378,32 +2550,32 @@
-
+
-
+
-
+
-
+
-
+
-
+
@@ -2421,8 +2593,8 @@
-
-
+
+
@@ -2430,7 +2602,7 @@
-
+
@@ -2447,7 +2619,7 @@
-
+
@@ -2455,8 +2627,8 @@
-
-
+
+
@@ -2464,23 +2636,23 @@
-
+
-
+
-
+
-
-
+
+
@@ -2488,18 +2660,18 @@
-
+
-
+
-
-
+
+
@@ -2507,8 +2679,8 @@
-
-
+
+
@@ -2516,21 +2688,22 @@
-
+
-
-
+
+
-
+
-
+
+
@@ -2539,7 +2712,7 @@
-
+
@@ -2548,14 +2721,14 @@
-
-
+
+
-
-
+
+
@@ -2563,41 +2736,41 @@
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
-
+
+
-
-
+
+
@@ -2606,8 +2779,8 @@
-
-
+
+
@@ -2616,8 +2789,8 @@
-
-
+
+
@@ -2626,9 +2799,9 @@
-
-
-
+
+
+
@@ -2636,8 +2809,8 @@
-
-
+
+
@@ -2651,8 +2824,8 @@
-
-
+
+
@@ -2660,9 +2833,9 @@
-
-
-
+
+
+
@@ -2684,7 +2857,7 @@
-
+
@@ -2698,7 +2871,7 @@
-
+
diff --git a/cime_config/testdefs/testmods_dirs/cam/cam4_port/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/cam4_port/user_nl_cam
index 1b86d5d825..1a21d77206 100644
--- a/cime_config/testdefs/testmods_dirs/cam/cam4_port/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/cam4_port/user_nl_cam
@@ -13,3 +13,4 @@
rad_data_output = .false.
mfilt=100,100
nhtfrq=-120,73
+ write_nstep0 = .true.
diff --git a/cime_config/testdefs/testmods_dirs/cam/cam4_port5d/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/cam4_port5d/user_nl_cam
index 655487485b..0cd7f3d3c3 100644
--- a/cime_config/testdefs/testmods_dirs/cam/cam4_port5d/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/cam4_port5d/user_nl_cam
@@ -13,6 +13,7 @@
rad_data_output = .false.
mfilt=100,100
nhtfrq=-120,73
+ write_nstep0 = .true.
ncdata='$DIN_LOC_ROOT/atm/cam/inic/fv/aqua_0006-01-01_1.9x2.5_L26_c161020.nc'
use_topo_file=.false.
atm_dep_flux=.false.
diff --git a/cime_config/testdefs/testmods_dirs/cam/cam5_port_f45/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/cam5_port_f45/user_nl_cam
index e42183057a..62e4e75bf4 100644
--- a/cime_config/testdefs/testmods_dirs/cam/cam5_port_f45/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/cam5_port_f45/user_nl_cam
@@ -13,3 +13,4 @@
rad_data_output = .false.
mfilt=100,100
nhtfrq=-120,73
+ write_nstep0 = .true.
diff --git a/cime_config/testdefs/testmods_dirs/cam/cam5_port_ne30/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/cam5_port_ne30/user_nl_cam
index 150660c7f4..551c1c8aa1 100644
--- a/cime_config/testdefs/testmods_dirs/cam/cam5_port_ne30/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/cam5_port_ne30/user_nl_cam
@@ -13,3 +13,4 @@
rad_data_output = .false.
mfilt=100,100
nhtfrq=-120,73
+ write_nstep0 = .true.
diff --git a/cime_config/testdefs/testmods_dirs/cam/cam6_port_f09/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/cam6_port_f09/user_nl_cam
index e99e90fc96..bcdd47f3b0 100644
--- a/cime_config/testdefs/testmods_dirs/cam/cam6_port_f09/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/cam6_port_f09/user_nl_cam
@@ -13,6 +13,7 @@
rad_data_output = .false.
mfilt=100,100
nhtfrq=-120,73
+ write_nstep0 = .true.
prescribed_strataero_3modes = .true.
prescribed_strataero_cycle_yr = 1999
diff --git a/cime_config/testdefs/testmods_dirs/cam/carma_dust/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/carma_dust/user_nl_cam
index 377cbb2295..cfac3a4818 100644
--- a/cime_config/testdefs/testmods_dirs/cam/carma_dust/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/carma_dust/user_nl_cam
@@ -4,5 +4,6 @@ nhtfrq=3,3,3,3,3,3
inithist='ENDOFRUN'
pbuf_global_allocate=.false.
history_carma=.true.
+fincl2 = 'CRSLERFC'
carma_do_fixedinit=.false.
carma_reftfile="camrun.cam.r.carma_reft.nc"
diff --git a/cime_config/testdefs/testmods_dirs/cam/carma_meteor_impact/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/carma_meteor_impact/user_nl_cam
index f69245ce24..36487d1f35 100644
--- a/cime_config/testdefs/testmods_dirs/cam/carma_meteor_impact/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/carma_meteor_impact/user_nl_cam
@@ -8,4 +8,7 @@ carma_do_fixedinit=.false.
carma_reftfile="camrun.cam.r.carma_reft.nc"
solar_data_type='FIXED'
solar_data_ymd=20000101
-
+carma_emis_maxlat = 40.
+carma_emis_maxlon = 20.
+carma_emis_minlat = -20.
+carma_emis_minlon = -80.
diff --git a/cime_config/testdefs/testmods_dirs/cam/carma_mixed_sulfate/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/carma_mixed_sulfate/user_nl_cam
index c080a8a8aa..52b192f861 100644
--- a/cime_config/testdefs/testmods_dirs/cam/carma_mixed_sulfate/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/carma_mixed_sulfate/user_nl_cam
@@ -6,8 +6,9 @@ pbuf_global_allocate=.false.
history_carma=.true.
carma_do_fixedinit=.false.
carma_reftfile="camrun.cam.r.carma_reft.nc"
-flbc_list = 'CCL4', 'CF2CLBR', 'CF3BR', 'CFC11', 'CFC113', 'CFC12', 'CH3BR', 'CH3CCL3', 'CH3CL', 'CH4', 'CO2', 'H2',
- 'HCFC22', 'N2O', 'OCS'
+flbc_list = 'CCL4', 'CF2CLBR', 'CF3BR', 'CFC11', 'CFC113', 'CFC12', 'CH3BR', 'CH3CCL3', 'CH3CL', 'CH4', 'CO2', 'H2',
+ 'HCFC22', 'N2O', 'OCS'
solar_data_type='FIXED'
solar_data_ymd=20000101
-
+carma_maxretries = 40
+ubc_specifier = 'T->MSIS', 'Q->2.d-8vmr', 'CH4->2.d-10vmr', 'H->MSIS', 'N->MSIS', 'O->MSIS', 'O2->MSIS', 'H2->TGCM', 'NO->SNOE'
diff --git a/cime_config/testdefs/testmods_dirs/cam/carma_sulfate/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/carma_sulfate/user_nl_cam
index c080a8a8aa..cfc4580f54 100644
--- a/cime_config/testdefs/testmods_dirs/cam/carma_sulfate/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/carma_sulfate/user_nl_cam
@@ -6,8 +6,8 @@ pbuf_global_allocate=.false.
history_carma=.true.
carma_do_fixedinit=.false.
carma_reftfile="camrun.cam.r.carma_reft.nc"
-flbc_list = 'CCL4', 'CF2CLBR', 'CF3BR', 'CFC11', 'CFC113', 'CFC12', 'CH3BR', 'CH3CCL3', 'CH3CL', 'CH4', 'CO2', 'H2',
- 'HCFC22', 'N2O', 'OCS'
+flbc_list = 'CCL4', 'CF2CLBR', 'CF3BR', 'CFC11', 'CFC113', 'CFC12', 'CH3BR', 'CH3CCL3', 'CH3CL', 'CH4', 'CO2', 'H2',
+ 'HCFC22', 'N2O', 'OCS'
solar_data_type='FIXED'
solar_data_ymd=20000101
-
+ubc_specifier = 'T->MSIS', 'Q->2.d-8vmr', 'CH4->2.d-10vmr', 'H->MSIS', 'N->MSIS', 'O->MSIS', 'O2->MSIS', 'H2->TGCM', 'NO->SNOE'
diff --git a/cime_config/testdefs/testmods_dirs/cam/nudging/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/nudging/user_nl_cam
index 81149c52e0..ce798ca005 100644
--- a/cime_config/testdefs/testmods_dirs/cam/nudging/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/nudging/user_nl_cam
@@ -7,6 +7,7 @@
fincl3='U','V','T','Q','PS','Nudge_U','Nudge_V','Nudge_T','Nudge_Q','Target_U','Target_V','Target_T','Target_Q'
nhtfrq=0,-6,1
mfilt =1,4,48
+ write_nstep0 = .true.
ncdata='$DIN_LOC_ROOT/atm/cam/nudging/ERAI_fv09_BILIN/ERAI_fv09_DART2.cam2.i.2009-01-01-00000.nc'
/
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq1d/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq1d/user_nl_cam
index 1d7042c597..b0d39d2335 100644
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq1d/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq1d/user_nl_cam
@@ -1,3 +1,4 @@
mfilt=1,1,1,1,1,1
ndens=1,1,1,1,1,1
nhtfrq=-24,-24,-24,-24,-24,-24
+write_nstep0 = .true.
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq1d_14dec_L32wsc/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq1d_14dec_L32wsc/user_nl_cam
deleted file mode 100644
index 53ed11dfc5..0000000000
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq1d_14dec_L32wsc/user_nl_cam
+++ /dev/null
@@ -1,5 +0,0 @@
-mfilt=1,1,1,1,1,1,1,1,1,1
-ndens=1,1,1,1,1,1,1,1,1,1
-nhtfrq=-24,-24,-24,-24,-24,-24,-24,-24,-24,-24
-tracer_cnst_specifier = 'O3','OH','NO3','HO2','HALONS'
-ubc_specifier = 'NOTSET'
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq1d_14dec_L32wsc/shell_commands b/cime_config/testdefs/testmods_dirs/cam/outfrq1d_14dec_ghg_cam_dev/shell_commands
similarity index 84%
rename from cime_config/testdefs/testmods_dirs/cam/outfrq1d_14dec_L32wsc/shell_commands
rename to cime_config/testdefs/testmods_dirs/cam/outfrq1d_14dec_ghg_cam_dev/shell_commands
index eca142f772..513b5dbe41 100644
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq1d_14dec_L32wsc/shell_commands
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq1d_14dec_ghg_cam_dev/shell_commands
@@ -1,3 +1,3 @@
./xmlchange ROF_NCPL=\$ATM_NCPL
./xmlchange RUN_STARTDATE=0001-12-14
-./xmlchange CAM_CONFIG_OPTS="-phys cam_dev -microphys mg2 -chem waccm_sc_mam4 -nlev 32"
+./xmlchange CAM_CONFIG_OPTS="-phys cam_dev -microphys mg2 -chem ghg_mam4 -nlev 32"
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq1d_14dec_ghg_cam_dev/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq1d_14dec_ghg_cam_dev/user_nl_cam
new file mode 100644
index 0000000000..1e5bc2fa49
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq1d_14dec_ghg_cam_dev/user_nl_cam
@@ -0,0 +1,9 @@
+mfilt=1,1,1,1,1,1,1,1,1,1
+ndens=1,1,1,1,1,1,1,1,1,1
+nhtfrq=-24,-24,-24,-24,-24,-24,-24,-24,-24,-24
+tracer_cnst_specifier = 'O3','OH','NO3','HO2','HALONS'
+flbc_cycle_yr=1850
+phys_grid_ctem_nfreq=-6
+phys_grid_ctem_zm_nbas=16
+phys_grid_ctem_za_nlat=15
+fincl2 = 'THphys','VTHzm','WTHzm','UVzm','UWzm','Uzm','Vzm','Wzm','THzm'
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq1d_14dec_L32wsc/user_nl_clm b/cime_config/testdefs/testmods_dirs/cam/outfrq1d_14dec_ghg_cam_dev/user_nl_clm
similarity index 100%
rename from cime_config/testdefs/testmods_dirs/cam/outfrq1d_14dec_L32wsc/user_nl_clm
rename to cime_config/testdefs/testmods_dirs/cam/outfrq1d_14dec_ghg_cam_dev/user_nl_clm
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq1d_physgrid_tem_mpasa120_wcmsc/shell_commands b/cime_config/testdefs/testmods_dirs/cam/outfrq1d_physgrid_tem_mpasa120_wcmsc/shell_commands
index bbc9a3e804..a371a33c20 100644
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq1d_physgrid_tem_mpasa120_wcmsc/shell_commands
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq1d_physgrid_tem_mpasa120_wcmsc/shell_commands
@@ -1,2 +1 @@
./xmlchange ROF_NCPL=\$ATM_NCPL
-./xmlchange LND_DOMAIN_FILE="domain.lnd.mpasa120_gx1v7.201215.nc"
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq1d_physgrid_tem_mpasa120_wcmsc/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq1d_physgrid_tem_mpasa120_wcmsc/user_nl_cam
index 1212d35edd..a5fa13c3a1 100644
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq1d_physgrid_tem_mpasa120_wcmsc/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq1d_physgrid_tem_mpasa120_wcmsc/user_nl_cam
@@ -1,15 +1,3 @@
-ncdata = '$DIN_LOC_ROOT/atm/waccm/ic/mpasa120km.waccm_fulltopo_c220818.nc'
-
-mpas_cam_coef = 0.2D0
-mpas_rayleigh_damp_u_timescale_days = 5.D0
-mpas_zd = 80000.0D0
-mpas_apvm_upwinding = 0.0D0
-mpas_dt = 600.D0
-mpas_dynamics_split_steps = 4
-mpas_epssm = 0.5D0
-
-use_gw_front = .false.
-
phys_grid_ctem_nfreq = -12
phys_grid_ctem_zm_nbas = 120
phys_grid_ctem_za_nlat = 90
@@ -17,7 +5,7 @@ phys_grid_ctem_za_nlat = 90
fincl1 = ' '
fexcl1 = ' '
-fincl2 = 'VTHzaphys','WTHzaphys','UVzaphys','UWzaphys'
+fincl2 = 'Uzm','Vzm','Wzm','THzm', 'VTHzm','WTHzm','UVzm','UWzm'
mfilt=1,1,1,1,1,1,1,1,1,1
ndens=1,1,1,1,1,1,1,1,1,1
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq1d_physgrid_tem_mpasa120_wcmsc/user_nl_clm b/cime_config/testdefs/testmods_dirs/cam/outfrq1d_physgrid_tem_mpasa120_wcmsc/user_nl_clm
index a8dec89f15..59ebd669f7 100644
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq1d_physgrid_tem_mpasa120_wcmsc/user_nl_clm
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq1d_physgrid_tem_mpasa120_wcmsc/user_nl_clm
@@ -1,4 +1,3 @@
hist_nhtfrq = -24
hist_mfilt = 1
hist_ndens = 1
-fsurdat = '${DIN_LOC_ROOT}/lnd/clm2/surfdata_map/release-clm5.0.34/surfdata_mpasa120_hist_78pfts_CMIP6_simyr2000_c201215.nc'
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq3h/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq3h/user_nl_cam
index fa95272eca..e7912ac2f0 100644
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq3h/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq3h/user_nl_cam
@@ -1,3 +1,4 @@
mfilt=1,1,1,1,1,1,1,1,1,1
ndens=1,1,1,1,1,1,1,1,1,1
nhtfrq=-3,-3,-3,-3,-3,-3,-3,-3,-3,-3
+write_nstep0 = .true.
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq3s/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq3s/user_nl_cam
index b8f943cd5f..805f0ab383 100644
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq3s/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq3s/user_nl_cam
@@ -1,5 +1,6 @@
mfilt=1,1,1,1,1,1
ndens=1,1,1,1,1,1
nhtfrq=3,3,3,3,3,3
+write_nstep0=.true.
inithist='ENDOFRUN'
pbuf_global_allocate=.false.
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq3s_convmic/shell_commands b/cime_config/testdefs/testmods_dirs/cam/outfrq3s_convmic/shell_commands
deleted file mode 100644
index 3a506cfaa1..0000000000
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq3s_convmic/shell_commands
+++ /dev/null
@@ -1,4 +0,0 @@
-./xmlchange ROF_NCPL=\$ATM_NCPL
-./xmlchange GLC_NCPL=\$ATM_NCPL
-./xmlchange CAM_NML_USE_CASE=UNSET
-./xmlchange RUN_STARTDATE="19950101"
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq3s_convmic/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq3s_convmic/user_nl_cam
deleted file mode 100644
index f81fb38bfc..0000000000
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq3s_convmic/user_nl_cam
+++ /dev/null
@@ -1,6 +0,0 @@
-zmconv_microp=.true.
-mfilt=1,1,1,1,1,1
-ndens=1,1,1,1,1,1
-nhtfrq=3,3,3,3,3,3
-inithist='ENDOFRUN'
-pbuf_global_allocate=.false.
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq3s_convmic/user_nl_cpl b/cime_config/testdefs/testmods_dirs/cam/outfrq3s_convmic/user_nl_cpl
deleted file mode 100644
index 398535cf65..0000000000
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq3s_convmic/user_nl_cpl
+++ /dev/null
@@ -1,2 +0,0 @@
-reprosum_diffmax=1.0e-14
-reprosum_recompute=.true.
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq3s_cospsathist/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq3s_cospsathist/user_nl_cam
index 801587cedd..e893c96525 100644
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq3s_cospsathist/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq3s_cospsathist/user_nl_cam
@@ -1,6 +1,7 @@
ndens=1,1,1,1,1,1
nhtfrq=3,3,3,3,-2,3
mfilt=1,1,1,1,1,1
+ write_nstep0=.true.
sathist_track_infile='$DIN_LOC_ROOT/atm/cam/sat/satellite_profilelist_20020125_20101030_c110204_noleap.nc'
sathist_fincl = 'Q','T','PS','U','V','FV'
fincl3 = 'Q','T','PS','FV','UWzm:I'
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq3s_diags/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq3s_diags/user_nl_cam
index 63b92fe23d..1e6c0ad508 100644
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq3s_diags/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq3s_diags/user_nl_cam
@@ -1,6 +1,7 @@
mfilt=1,1,1,1,1,1
ndens=2,2,2,2,2,2
nhtfrq=3,3,3,3,3,3
+write_nstep0=.true.
inithist='ENDOFRUN'
history_amwg=.true.
history_aerosol=.true.
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq3s_physgrid_tem/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq3s_physgrid_tem/user_nl_cam
index 55e353983a..dad2b49ac7 100644
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq3s_physgrid_tem/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq3s_physgrid_tem/user_nl_cam
@@ -5,4 +5,4 @@ inithist='ENDOFRUN'
phys_grid_ctem_nfreq=3
phys_grid_ctem_zm_nbas=16
phys_grid_ctem_za_nlat=15
-fincl3 = 'VTHzaphys','WTHzaphys','UVzaphys','UWzaphys'
+fincl3 = 'Uzm','Vzm','Wzm','THzm', 'VTHzm','WTHzm','UVzm','UWzm'
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq9s/user_nl_cam
index 8482082dce..77424c653b 100644
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq9s/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s/user_nl_cam
@@ -1,4 +1,5 @@
mfilt=1,1,1,1,1,1
ndens=1,1,1,1,1,1
nhtfrq=9,9,9,9,9,9
+write_nstep0=.true.
inithist='ENDOFRUN'
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_apmee/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_apmee/user_nl_cam
index b84cb6ba7f..5babfe1d07 100644
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_apmee/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_apmee/user_nl_cam
@@ -1,6 +1,7 @@
mfilt=1,1,1,1,1,1
ndens=1,1,1,1,1,1
nhtfrq=9,9,9,9,9,9
+write_nstep0=.true.
inithist='ENDOFRUN'
mee_ion_inline=.true.
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mee_fluxes/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mee_fluxes/user_nl_cam
index 60e99dd798..0c31a14035 100644
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mee_fluxes/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mee_fluxes/user_nl_cam
@@ -1,6 +1,7 @@
mfilt=1,1,1,1,1,1
ndens=1,1,1,1,1,1
nhtfrq=9,9,9,9,9,9
+write_nstep0=.true.
inithist='ENDOFRUN'
mee_fluxes_filepath='$DIN_LOC_ROOT/atm/waccm/mee/RBSP-ECT_FB_precip_c211124.nc'
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa120/shell_commands b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa120/shell_commands
index a7d6273fb0..eb40ad83e0 100644
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa120/shell_commands
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa120/shell_commands
@@ -1,3 +1,2 @@
./xmlchange ROF_NCPL=\$ATM_NCPL
./xmlchange GLC_NCPL=\$ATM_NCPL
-./xmlchange LND_DOMAIN_FILE="domain.lnd.mpasa120_gx1v7.201215.nc"
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa120/user_nl_clm b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa120/user_nl_clm
index 260ae6cc31..c4cb9d28d6 100644
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa120/user_nl_clm
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa120/user_nl_clm
@@ -1,4 +1,3 @@
hist_nhtfrq = 9
hist_mfilt = 1
hist_ndens = 1
-fsurdat = '${DIN_LOC_ROOT}/lnd/clm2/surfdata_map/release-clm5.0.34/surfdata_mpasa120_hist_78pfts_CMIP6_simyr2000_c201215.nc'
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa480/shell_commands b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa480/shell_commands
index 52f64de9ce..eb40ad83e0 100644
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa480/shell_commands
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa480/shell_commands
@@ -1,3 +1,2 @@
./xmlchange ROF_NCPL=\$ATM_NCPL
./xmlchange GLC_NCPL=\$ATM_NCPL
-./xmlchange LND_DOMAIN_FILE="domain.lnd.mpasa480_gx1v7.201001.nc"
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa480/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa480/user_nl_cam
index 8482082dce..ccffd8c129 100644
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa480/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa480/user_nl_cam
@@ -2,3 +2,5 @@ mfilt=1,1,1,1,1,1
ndens=1,1,1,1,1,1
nhtfrq=9,9,9,9,9,9
inithist='ENDOFRUN'
+mpas_cam_coef=1.0D0
+mpas_cam_damping_levels=3
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa480/user_nl_clm b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa480/user_nl_clm
index c5b8430671..c4cb9d28d6 100644
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa480/user_nl_clm
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa480/user_nl_clm
@@ -1,4 +1,3 @@
hist_nhtfrq = 9
hist_mfilt = 1
hist_ndens = 1
-fsurdat = '${DIN_LOC_ROOT}/lnd/clm2/surfdata_map/surfdata_mpasa480_hist_78pfts_CMIP6_simyr2000_c201001.nc'
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_physgrid_tem_1deg/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_physgrid_tem_1deg/user_nl_cam
index 9cf4e0a97d..a82b687449 100644
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_physgrid_tem_1deg/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_physgrid_tem_1deg/user_nl_cam
@@ -5,4 +5,4 @@ inithist='ENDOFRUN'
phys_grid_ctem_nfreq=-2
phys_grid_ctem_zm_nbas=120
phys_grid_ctem_za_nlat=90
-fincl3 = 'VTHzaphys','WTHzaphys','UVzaphys','UWzaphys'
+fincl3 = 'Uzm','Vzm','Wzm','THzm', 'VTHzm','WTHzm','UVzm','UWzm'
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_wcm_ne30/shell_commands b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_emulated/shell_commands
similarity index 52%
rename from cime_config/testdefs/testmods_dirs/cam/outfrq9s_wcm_ne30/shell_commands
rename to cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_emulated/shell_commands
index eb40ad83e0..d10bce4cdc 100644
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_wcm_ne30/shell_commands
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_emulated/shell_commands
@@ -1,2 +1,3 @@
./xmlchange ROF_NCPL=\$ATM_NCPL
./xmlchange GLC_NCPL=\$ATM_NCPL
+./xmlchange CAM_CONFIG_OPTS=' -microphys pumas' --append
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_emulated/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_emulated/user_nl_cam
new file mode 100644
index 0000000000..172af9ba82
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_emulated/user_nl_cam
@@ -0,0 +1,5 @@
+mfilt=1,1,1,1,1,1
+ndens=1,1,1,1,1,1
+nhtfrq=9,9,9,9,9,9
+inithist='ENDOFRUN'
+micro_mg_warm_rain='emulated'
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_wcm_ne30/user_nl_clm b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_emulated/user_nl_clm
similarity index 99%
rename from cime_config/testdefs/testmods_dirs/cam/outfrq9s_wcm_ne30/user_nl_clm
rename to cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_emulated/user_nl_clm
index 0d83b5367b..12d5a36d2b 100644
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_wcm_ne30/user_nl_clm
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_emulated/user_nl_clm
@@ -24,4 +24,3 @@
hist_nhtfrq = 9
hist_mfilt = 1
hist_ndens = 1
-
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_sb2001/shell_commands b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_sb2001/shell_commands
new file mode 100644
index 0000000000..d10bce4cdc
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_sb2001/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange ROF_NCPL=\$ATM_NCPL
+./xmlchange GLC_NCPL=\$ATM_NCPL
+./xmlchange CAM_CONFIG_OPTS=' -microphys pumas' --append
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_sb2001/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_sb2001/user_nl_cam
new file mode 100644
index 0000000000..5caf9ff70d
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_sb2001/user_nl_cam
@@ -0,0 +1,5 @@
+mfilt=1,1,1,1,1,1
+ndens=1,1,1,1,1,1
+nhtfrq=9,9,9,9,9,9
+inithist='ENDOFRUN'
+micro_mg_warm_rain='sb2001'
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq3s_convmic/user_nl_clm b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_sb2001/user_nl_clm
similarity index 98%
rename from cime_config/testdefs/testmods_dirs/cam/outfrq3s_convmic/user_nl_clm
rename to cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_sb2001/user_nl_clm
index f3ac27f1e6..12d5a36d2b 100644
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq3s_convmic/user_nl_clm
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_sb2001/user_nl_clm
@@ -21,7 +21,6 @@
! Set maxpatch_glcmec with GLC_NEC option
! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable
!----------------------------------------------------------------------------------
-hist_nhtfrq = 3
+hist_nhtfrq = 9
hist_mfilt = 1
hist_ndens = 1
-
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_tau/shell_commands b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_tau/shell_commands
new file mode 100644
index 0000000000..d10bce4cdc
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_tau/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange ROF_NCPL=\$ATM_NCPL
+./xmlchange GLC_NCPL=\$ATM_NCPL
+./xmlchange CAM_CONFIG_OPTS=' -microphys pumas' --append
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_tau/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_tau/user_nl_cam
new file mode 100644
index 0000000000..28d485b6bd
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_tau/user_nl_cam
@@ -0,0 +1,5 @@
+mfilt=1,1,1,1,1,1
+ndens=1,1,1,1,1,1
+nhtfrq=9,9,9,9,9,9
+inithist='ENDOFRUN'
+micro_mg_warm_rain='tau'
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_tau/user_nl_clm b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_tau/user_nl_clm
new file mode 100644
index 0000000000..12d5a36d2b
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_tau/user_nl_clm
@@ -0,0 +1,26 @@
+!----------------------------------------------------------------------------------
+! Users should add all user specific namelist changes below in the form of
+! namelist_var = new_namelist_value
+!
+! Include namelist variables for drv_flds_in ONLY if -megan and/or -drydep options
+! are set in the CLM_NAMELIST_OPTS env variable.
+!
+! EXCEPTIONS:
+! Set use_cndv by the compset you use and the CLM_BLDNML_OPTS -dynamic_vegetation setting
+! Set use_vichydro by the compset you use and the CLM_BLDNML_OPTS -vichydro setting
+! Set use_cn by the compset you use and CLM_BLDNML_OPTS -bgc setting
+! Set use_crop by the compset you use and CLM_BLDNML_OPTS -crop setting
+! Set spinup_state by the CLM_BLDNML_OPTS -bgc_spinup setting
+! Set irrigate by the CLM_BLDNML_OPTS -irrig setting
+! Set dtime with L_NCPL option
+! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options
+! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases
+! (includes $inst_string for multi-ensemble cases)
+! Set glc_grid with CISM_GRID option
+! Set glc_smb with GLC_SMB option
+! Set maxpatch_glcmec with GLC_NEC option
+! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable
+!----------------------------------------------------------------------------------
+hist_nhtfrq = 9
+hist_mfilt = 1
+hist_ndens = 1
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_wcm_ne30/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_wcm_ne30/user_nl_cam
deleted file mode 100644
index f695957589..0000000000
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_wcm_ne30/user_nl_cam
+++ /dev/null
@@ -1,8 +0,0 @@
-mfilt=1,1,1,1,1,1,1,1,1
-ndens=1,1,1,1,1,1,1,1,1
-nhtfrq=9,9,9,9,9,9,9,9,9
-inithist='ENDOFRUN'
-
-se_nsplit = 30
-state_debug_checks = .true.
-
diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_wcm_ne30/user_nl_cpl b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_wcm_ne30/user_nl_cpl
deleted file mode 100644
index 398535cf65..0000000000
--- a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_wcm_ne30/user_nl_cpl
+++ /dev/null
@@ -1,2 +0,0 @@
-reprosum_diffmax=1.0e-14
-reprosum_recompute=.true.
diff --git a/cime_config/testdefs/testmods_dirs/cam/reduced_hist1d/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/reduced_hist1d/user_nl_cam
index eeb2417bec..e1205823ee 100644
--- a/cime_config/testdefs/testmods_dirs/cam/reduced_hist1d/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/reduced_hist1d/user_nl_cam
@@ -2,6 +2,7 @@
mfilt=1,1,1,1,1,1
ndens=1,1,1,1,1,1
nhtfrq=-24,-24,-24,-24,-24,-24
+ write_nstep0=.true.
fincl1 = ' '
fincl2 = ' '
diff --git a/cime_config/testdefs/testmods_dirs/cam/scm_prep/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/scm_prep/user_nl_cam
index da53953a7b..24fa6cf2e5 100644
--- a/cime_config/testdefs/testmods_dirs/cam/scm_prep/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/scm_prep/user_nl_cam
@@ -2,3 +2,4 @@ NDENS = 1,1
MFILT = 1,10
nhtfrq = 0,1
inithist_all = .true.
+write_nstep0 = .true.
diff --git a/cime_config/testdefs/testmods_dirs/cam/scm_prep_c6/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/scm_prep_c6/user_nl_cam
index da53953a7b..24fa6cf2e5 100644
--- a/cime_config/testdefs/testmods_dirs/cam/scm_prep_c6/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/scm_prep_c6/user_nl_cam
@@ -2,3 +2,4 @@ NDENS = 1,1
MFILT = 1,10
nhtfrq = 0,1
inithist_all = .true.
+write_nstep0 = .true.
diff --git a/cime_config/testdefs/testmods_dirs/cam/scmarm/shell_commands b/cime_config/testdefs/testmods_dirs/cam/scmarm/shell_commands
index 31a36fb678..2898a75de3 100644
--- a/cime_config/testdefs/testmods_dirs/cam/scmarm/shell_commands
+++ b/cime_config/testdefs/testmods_dirs/cam/scmarm/shell_commands
@@ -3,7 +3,6 @@
./xmlchange GLC_NCPL=\$ATM_NCPL
./xmlchange EPS_AAREA=9.0e-4
./xmlchange EPS_AGRID=9.0e-5
-./xmlchange MPILIB=mpi-serial
./xmlchange REST_OPTION=never
./xmlchange CAM_NML_USE_CASE=UNSET
./xmlchange PTS_LAT=36.6
diff --git a/cime_config/testdefs/testmods_dirs/cam/scmarm/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/scmarm/user_nl_cam
index 6dd50018a8..aea4e2f56c 100644
--- a/cime_config/testdefs/testmods_dirs/cam/scmarm/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/scmarm/user_nl_cam
@@ -1,3 +1,4 @@
mfilt=1500
nhtfrq = 1
history_budget=.true.
+write_nstep0 = .true.
diff --git a/cime_config/testdefs/testmods_dirs/cam/silhs/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/silhs/user_nl_cam
index 5013701c14..d322c3706a 100644
--- a/cime_config/testdefs/testmods_dirs/cam/silhs/user_nl_cam
+++ b/cime_config/testdefs/testmods_dirs/cam/silhs/user_nl_cam
@@ -1,5 +1,6 @@
dtime = 1800
nhtfrq = 0,-24,-6,-3
+write_nstep0 = .true.
mfilt = 1,5000,5000
ndens = 2,2,2,2,2,2
history_budget = .true.
diff --git a/cime_config/usermods_dirs/CMIP6_B1850/user_nl_cam b/cime_config/usermods_dirs/CMIP6_B1850/user_nl_cam
index 45e18d1a6a..7958c8cd03 100644
--- a/cime_config/usermods_dirs/CMIP6_B1850/user_nl_cam
+++ b/cime_config/usermods_dirs/CMIP6_B1850/user_nl_cam
@@ -1,64 +1,62 @@
-nhtfrq = 0, -24, -6, -3, -1, 1, -24,-120,-240
+nhtfrq = 0, -24, -6, -3, -1, 1, -24,-120,-240
-mfilt = 1, 5, 20, 40, 120, 240, 365, 73, 365
+mfilt = 1, 5, 20, 40, 120, 240, 365, 73, 365
ndens = 2, 2, 2, 2, 2, 2, 1, 1, 1
-fincl1 = 'ABSORB:A', 'ACTREL:A', 'AODABSdn:A', 'AODBCdn:A', 'AODdnDUST1:A', 'AODdnDUST2:A',
- 'AODdnDUST3:A', 'AODdnMODE1:A', 'AODdnMODE2:A', 'AODdnMODE3:A', 'AODDUST2:A', 'AODDUST:A', 'AODNIRstdn:A', 'AODPOMdn:A', 'AODSO4dn:A', 'AODSOAdn:A', 'AODSSdn:A',
- 'AODUVdn:A', 'AODUVstdn:A', 'AODVIS:A', 'AODVISdn:A', 'AODVISstdn:A', 'AQ_SO2:A', 'AREA:A', 'AREI:A', 'AREL:A', 'bc_a1:A', 'bc_a1DDF:A',
- 'bc_a1SFWET:A', 'bc_a4:A', 'bc_a4DDF:A', 'bc_a4SFWET:A', 'bc_c1:A', 'bc_c1DDF:A', 'bc_c1SFWET:A', 'bc_c4:A', 'bc_c4DDF:A',
- 'bc_c4SFWET:A', 'BROX:A', 'BROY:A', 'BURDENBCdn', 'BURDENDUSTdn:A', 'BURDENPOMdn:A', 'BURDENSEASALTdn:A', 'BURDENSO4dn:A',
- 'BURDENSOAdn:A', 'CDNUMC:A', 'CLDICE:A', 'CLDLIQ:A', 'CLDTOT:A', 'CLOUD:A', 'CLOX:A', 'CLOY:A', 'CME:A', 'CMFDQ:A', 'CMFMC:A',
- 'CMFMC_DP:A', 'CO2:A', 'CONCLD:A', 'DF_H2O2:A', 'DF_H2SO4:A',
- 'DF_SO2:A', 'dgnumwet1:A', 'dgnumwet2:A', 'dgnumwet3:A', 'DH2O2CHM:A', 'DMS:A', 'dry_deposition_NHx_as_N:A',
- 'dry_deposition_NOy_as_N:A', 'Dso4_a1CHM:A', 'Dso4_a2CHM:A', 'Dso4_a3CHM:A', 'dst_a1:A', 'dst_a1DDF:A', 'dst_a1SFWET:A', 'dst_a2:A', 'dst_a2DDF:A',
- 'dst_a2SFWET:A', 'dst_a3:A', 'dst_a3DDF:A', 'dst_a3SFWET:A', 'dst_c1:A', 'dst_c1DDF:A', 'dst_c1SFWET:A', 'dst_c2:A', 'dst_c2DDF:A', 'dst_c2SFWET:A',
- 'dst_c3:A', 'dst_c3DDF:A', 'dst_c3SFWET:A', 'DTCORE:A', 'EVAPPREC:A',
- 'EVAPQZM:A', 'EVAPTZM:A', 'EXTINCTdn:A', 'EXTINCTNIRdn:A', 'EXTINCTUVdn:A', 'EXTxASYMdn:A', 'FCTL:A',
- 'FLDS:A', 'FLDSC:A', 'FLNR:A', 'FLNS:A', 'FLNSC:A', 'FLNT:A', 'FLNTC:A', 'FLUT:A', 'FLUTC:A', 'FREQI:A', 'FREQL:A', 'FREQZM:A', 'FSDS:A',
- 'FSDSC:A', 'FSNR:A', 'FSNS:A', 'FSNSC:A', 'FSNT:A', 'FSNTC:A', 'FSNTOAC:A', 'FSUTOA:A',
- 'GS_SO2:A', 'H2O2:A', 'H2O:A', 'H2SO4:A', 'H2SO4M_C:A', 'H2SO4_sfnnuc1:A',
+fincl1 = 'ABSORB:A', 'ACTREL:A', 'AODABSdn:A', 'AODBCdn:A', 'AODdnDUST01:A', 'AODdnDUST02:A',
+ 'AODdnDUST03:A', 'AODdn_aitken:A', 'AODdn_accum:A', 'AODdn_coarse:A', 'AODDUST02:A', 'AODDUST:A', 'AODNIRstdn:A', 'AODPOMdn:A', 'AODSO4dn:A', 'AODSOAdn:A', 'AODSSdn:A',
+ 'AODUVdn:A', 'AODUVstdn:A', 'AODVIS:A', 'AODVISdn:A', 'AODVISstdn:A', 'AQ_SO2:A', 'AREA:A', 'AREI:A', 'AREL:A', 'bc_a1:A', 'bc_a1DDF:A',
+ 'bc_a1SFWET:A', 'bc_a4:A', 'bc_a4DDF:A', 'bc_a4SFWET:A', 'bc_c1:A', 'bc_c1DDF:A', 'bc_c1SFWET:A', 'bc_c4:A', 'bc_c4DDF:A',
+ 'bc_c4SFWET:A', 'BROX:A', 'BROY:A', 'BURDENBCdn', 'BURDENDUSTdn:A', 'BURDENPOMdn:A', 'BURDENSEASALTdn:A', 'BURDENSO4dn:A',
+ 'BURDENSOAdn:A', 'CDNUMC:A', 'CLDICE:A', 'CLDLIQ:A', 'CLDTOT:A', 'CLOUD:A', 'CLOX:A', 'CLOY:A', 'CME:A', 'CMFDQ:A', 'CMFMC:A',
+ 'CMFMC_DP:A', 'CO2:A', 'CONCLD:A', 'DF_H2O2:A', 'DF_H2SO4:A',
+ 'DF_SO2:A', 'dgnumwet1:A', 'dgnumwet2:A', 'dgnumwet3:A', 'DH2O2CHM:A', 'DMS:A', 'dry_deposition_NHx_as_N:A',
+ 'dry_deposition_NOy_as_N:A', 'Dso4_a1CHM:A', 'Dso4_a2CHM:A', 'Dso4_a3CHM:A', 'dst_a1:A', 'dst_a1DDF:A', 'dst_a1SFWET:A', 'dst_a2:A', 'dst_a2DDF:A',
+ 'dst_a2SFWET:A', 'dst_a3:A', 'dst_a3DDF:A', 'dst_a3SFWET:A', 'dst_c1:A', 'dst_c1DDF:A', 'dst_c1SFWET:A', 'dst_c2:A', 'dst_c2DDF:A', 'dst_c2SFWET:A',
+ 'dst_c3:A', 'dst_c3DDF:A', 'dst_c3SFWET:A', 'DTCORE:A', 'EVAPPREC:A',
+ 'EVAPQZM:A', 'EVAPTZM:A', 'EXTINCTdn:A', 'EXTINCTNIRdn:A', 'EXTINCTUVdn:A', 'EXTxASYMdn:A', 'FCTL:A',
+ 'FLDS:A', 'FLDSC:A', 'FLNR:A', 'FLNS:A', 'FLNSC:A', 'FLNT:A', 'FLNTC:A', 'FLUT:A', 'FLUTC:A', 'FREQI:A', 'FREQL:A', 'FREQZM:A', 'FSDS:A',
+ 'FSDSC:A', 'FSNR:A', 'FSNS:A', 'FSNSC:A', 'FSNT:A', 'FSNTC:A', 'FSNTOAC:A', 'FSUTOA:A',
+ 'GS_SO2:A', 'H2O2:A', 'H2O:A', 'H2SO4:A', 'H2SO4M_C:A', 'H2SO4_sfnnuc1:A',
'HCL_GAS:A', 'HNO3_GAS:A', 'HNO3_NAT:A', 'HNO3_STS:A', 'HO2:A', 'ICEFRAC:A','jh2o2:A','KVH_CLUBB:A', 'LANDFRAC:A', 'LHFLX:A', 'MASS:A',
- 'ncl_a1:A', 'ncl_a1DDF:A', 'ncl_a1SFWET:A', 'ncl_a2:A', 'ncl_a2DDF:A', 'ncl_a2SFWET:A', 'ncl_a3:A', 'ncl_a3DDF:A', 'ncl_a3SFWET:A', 'ncl_c1:A',
+ 'ncl_a1:A', 'ncl_a1DDF:A', 'ncl_a1SFWET:A', 'ncl_a2:A', 'ncl_a2DDF:A', 'ncl_a2SFWET:A', 'ncl_a3:A', 'ncl_a3DDF:A', 'ncl_a3SFWET:A', 'ncl_c1:A',
'ncl_c1DDF:A', 'ncl_c1SFWET:A', 'ncl_c2:A', 'ncl_c2DDF:A', 'ncl_c2SFWET:A', 'ncl_c3:A', 'ncl_c3DDF:A', 'ncl_c3SFWET:A',
'NITROP_PD:A', 'NO3:A', 'NOX:A', 'NOY:A',
- 'num_a1:A', 'num_a1_CLXF:A', 'num_a1DDF:A', 'num_a2:A', 'num_a2_CLXF:A', 'num_a2DDF:A', 'num_a2_sfnnuc1:A', 'num_a3:A', 'num_a3DDF:A', 'num_a4:A',
+ 'num_a1:A', 'num_a1_CLXF:A', 'num_a1DDF:A', 'num_a2:A', 'num_a2_CLXF:A', 'num_a2DDF:A', 'num_a2_sfnnuc1:A', 'num_a3:A', 'num_a3DDF:A', 'num_a4:A',
'num_a4DDF:A', 'num_c1:A', 'num_c1DDF:A', 'num_c2:A', 'num_c2DDF:A', 'num_c3:A', 'num_c3DDF:A', 'num_c4:A', 'num_c4DDF:A', 'NUMLIQ:A', 'O3:A',
- 'OH:A', 'OMEGA:A', 'OMEGAT:A', 'PBLH:A', 'PDELDRY:A', 'PHIS:A', 'pom_a1:A', 'pom_a1DDF:A', 'pom_a1SFWET:A',
- 'pom_a4:A', 'pom_a4DDF:A', 'pom_a4SFWET:A', 'pom_c1:A', 'pom_c1DDF:A', 'pom_c1SFWET:A', 'pom_c4:A', 'pom_c4DDF:A', 'pom_c4SFWET:A',
- 'PRECC:A', 'PRECT:A', 'PS:A', 'PSL:A', 'PTEQ:A', 'PTTEND:A', 'Q:A', 'QFLX:A', 'QRAIN:A', 'QREFHT:A', 'QRL:A', 'QRLC:A', 'QRS:A',
+ 'OH:A', 'OMEGA:A', 'OMEGAT:A', 'PBLH:A', 'PDELDRY:A', 'PHIS:A', 'pom_a1:A', 'pom_a1DDF:A', 'pom_a1SFWET:A',
+ 'pom_a4:A', 'pom_a4DDF:A', 'pom_a4SFWET:A', 'pom_c1:A', 'pom_c1DDF:A', 'pom_c1SFWET:A', 'pom_c4:A', 'pom_c4DDF:A', 'pom_c4SFWET:A',
+ 'PRECC:A', 'PRECT:A', 'PS:A', 'PSL:A', 'PTEQ:A', 'PTTEND:A', 'Q:A', 'QFLX:A', 'QRAIN:A', 'QREFHT:A', 'QRL:A', 'QRLC:A', 'QRS:A',
'QRSC:A', 'QSNOW:A', 'RAD_ICE:A', 'RAD_LNAT:A', 'RAD_SULFC:A', 'REFF_AERO:A', 'RELHUM:A', 'RHREFHT:A',
'SAD_AERO:A', 'SAD_ICE:A', 'SAD_LNAT:A', 'SAD_SULFC:A', 'SAD_TROP:A', 'SFbc_a4:A',
- 'SFDMS:A', 'SFdst_a1:A', 'SFdst_a2:A', 'SFdst_a3:A',
- 'SFncl_a1:A', 'SFncl_a2:A', 'SFncl_a3:A', 'SFnum_a1:A', 'SFnum_a2:A',
- 'SFnum_a3:A', 'SFpom_a4:A', 'SFSO2:A', 'SFso4_a1:A', 'SFso4_a2:A', 'SHFLX:A', 'SO2:A',
- 'SO2_CHML:A', 'SO2_CHMP:A', 'SO2_CLXF:A', 'SO2_XFRC:A', 'so4_a1:A', 'so4_a1_CHMP:A', 'so4_a1_CLXF:A', 'so4_a1DDF:A', 'so4_a1_sfgaex1:A', 'so4_a1SFWET:A',
- 'so4_a2:A', 'so4_a2_CHMP:A', 'so4_a2_CLXF:A', 'so4_a2DDF:A', 'so4_a2_sfgaex1:A', 'so4_a2_sfnnuc1:A', 'so4_a2SFWET:A', 'so4_a3:A',
- 'so4_a3DDF:A', 'so4_a3_sfgaex1:A', 'so4_a3SFWET:A', 'so4_c1:A', 'so4_c1AQH2SO4:A', 'so4_c1AQSO4:A', 'so4_c1DDF:A', 'so4_c1SFWET:A', 'so4_c2:A', 'so4_c2AQH2SO4:A',
- 'so4_c2AQSO4:A', 'so4_c2DDF:A', 'so4_c2SFWET:A', 'so4_c3:A', 'so4_c3AQH2SO4:A', 'so4_c3AQSO4:A', 'so4_c3DDF:A', 'so4_c3SFWET:A',
+ 'SFDMS:A', 'SFdst_a1:A', 'SFdst_a2:A', 'SFdst_a3:A',
+ 'SFncl_a1:A', 'SFncl_a2:A', 'SFncl_a3:A', 'SFnum_a1:A', 'SFnum_a2:A',
+ 'SFnum_a3:A', 'SFpom_a4:A', 'SFSO2:A', 'SFso4_a1:A', 'SFso4_a2:A', 'SHFLX:A', 'SO2:A',
+ 'SO2_CHML:A', 'SO2_CHMP:A', 'SO2_CLXF:A', 'SO2_XFRC:A', 'so4_a1:A', 'so4_a1_CHMP:A', 'so4_a1_CLXF:A', 'so4_a1DDF:A', 'so4_a1_sfgaex1:A', 'so4_a1SFWET:A',
+ 'so4_a2:A', 'so4_a2_CHMP:A', 'so4_a2_CLXF:A', 'so4_a2DDF:A', 'so4_a2_sfgaex1:A', 'so4_a2_sfnnuc1:A', 'so4_a2SFWET:A', 'so4_a3:A',
+ 'so4_a3DDF:A', 'so4_a3_sfgaex1:A', 'so4_a3SFWET:A', 'so4_c1:A', 'so4_c1AQH2SO4:A', 'so4_c1AQSO4:A', 'so4_c1DDF:A', 'so4_c1SFWET:A', 'so4_c2:A', 'so4_c2AQH2SO4:A',
+ 'so4_c2AQSO4:A', 'so4_c2DDF:A', 'so4_c2SFWET:A', 'so4_c3:A', 'so4_c3AQH2SO4:A', 'so4_c3AQSO4:A', 'so4_c3DDF:A', 'so4_c3SFWET:A',
'SOLIN:A', 'SOLLD:A', 'SOLSD:A', 'SSAVIS:A', 'SST:A',
'T:A', 'TAQ:A', 'TAUBLJX:A', 'TAUBLJY:A', 'TAUGWX:A', 'TAUGWY:A', 'TAUX:A', 'TAUY:A', 'TBRY:A', 'TCLY:A',
- 'TGCLDIWP:A', 'TGCLDLWP:A', 'TMDMS:A', 'TMQ:A', 'TMSO2:A',
- 'TMso4_a1:A', 'TMso4_a2:A', 'TMso4_a3:A', 'TOT_CLD_VISTAU:A', 'TOTH:A', 'TREFHT:A', 'TREFHTMN:A', 'TREFHTMX:A', 'TROP_P:A',
+ 'TGCLDIWP:A', 'TGCLDLWP:A', 'TMDMS:A', 'TMQ:A', 'TMSO2:A',
+ 'TMso4_a1:A', 'TMso4_a2:A', 'TMso4_a3:A', 'TOT_CLD_VISTAU:A', 'TOTH:A', 'TREFHT:A', 'TREFHTMN:A', 'TREFHTMX:A', 'TROP_P:A',
'TROP_T:A', 'TROP_Z:A', 'TS:A', 'TSMN:M', 'TSMX:X', 'TTEND_TOT:A', 'TTGWORO:A', 'U10:A', 'U:A', 'UTGWORO:A',
'UU:A', 'V:A', 'VD01:A', 'VV:A', 'WD_H2O2:A', 'WD_H2SO4:A', 'WD_SO2:A', 'wet_deposition_NHx_as_N:A', 'wet_deposition_NOy_as_N:A',
'Z3:A', 'ZMDQ:A', 'ZMDT:A', 'ZMMTT:A', 'ZMMU:A'
- ! 'dst_a1_SRF:A', 'dst_a3_SRF:A', 'AODABS:A', 'soa_a1:A', 'soa_a2:A', 'soa_c1:A', 'soa_c2:A',
+ ! 'dst_a1_SRF:A', 'dst_a3_SRF:A', 'AODABS:A', 'soa_a1:A', 'soa_a2:A', 'soa_c1:A', 'soa_c2:A',
! 'soa_a1SFWET:A', 'soa_a2SFWET:A', 'soa_c1SFWET:A', 'soa_c2SFWET:A', 'soa_a1DDF:A', 'soa_a2DDF:A', 'soa_c1DDF:A', 'soa_c2DDF:A', 'bc_a4_CLXF:A',
! 'pom_a4_CLXF:A', 'soa_a1_sfgaex1:A', 'soa_a2_sfgaex1:A', 'ADRAIN:A', 'ADSNOW:A', 'ANRAIN:A', 'ANSNOW:A', 'AQRAIN:A', 'AQSNOW:A', 'AQSO4_H2O2:A',
- ! 'AQSO4_O3:A', 'AWNC:A', 'AWNI:A', 'CCN3:A', 'CLDHGH:A', 'CLDLOW:A', 'CLDMED:A', 'FICE:A', 'FREQR:A', 'FREQS:A', 'FSNTOA:A', 'FSNTOA:A', 'H2SO4_sfgaex1:A',
- ! 'ICIMR:A', 'ICWMR:A', 'IWC:A', 'LWCF:A', 'PRECL:A', 'PRECSC:A', 'PRECSL:A', 'QT:A', 'RAINQM:A', 'RCM_CLUBB:A', 'RELVAR:A', 'RTP2_CLUBB:A', 'RTPTHLP_CLUBB:A',
- ! 'SFSOAG:A', 'SNOWQM:A', 'SWCF:A', 'TGCLDCWP:A', 'UP2_CLUBB:A', 'UPWP_CLUBB:A', 'VP2_CLUBB:A', 'VPWP_CLUBB:A', 'VQ:A', 'VU:A', 'WP2_CLUBB:A', 'WP3_CLUBB:A',
+ ! 'AQSO4_O3:A', 'AWNC:A', 'AWNI:A', 'CCN3:A', 'CLDHGH:A', 'CLDLOW:A', 'CLDMED:A', 'FICE:A', 'FREQR:A', 'FREQS:A', 'FSNTOA:A', 'FSNTOA:A', 'H2SO4_sfgaex1:A',
+ ! 'ICIMR:A', 'ICWMR:A', 'IWC:A', 'LWCF:A', 'PRECL:A', 'PRECSC:A', 'PRECSL:A', 'QT:A', 'RAINQM:A', 'RCM_CLUBB:A', 'RELVAR:A', 'RTP2_CLUBB:A', 'RTPTHLP_CLUBB:A',
+ ! 'SFSOAG:A', 'SNOWQM:A', 'SWCF:A', 'TGCLDCWP:A', 'UP2_CLUBB:A', 'UPWP_CLUBB:A', 'VP2_CLUBB:A', 'VPWP_CLUBB:A', 'VQ:A', 'VU:A', 'WP2_CLUBB:A', 'WP3_CLUBB:A',
! 'WPRCP_CLUBB:A', 'WPRTP_CLUBB:A', 'WPTHLP_CLUBB:A', 'WPTHVP_CLUBB:A', 'WSUB:A', 'bc_a1_SRF:A', 'bc_a4_SRF:A', 'O3colAbove:A'
fincl2 = 'ACTNL:A', 'ACTREL:A', 'BURDENBCdn:A', 'BURDENDUSTdn:A', 'BURDENPOMdn:A', 'BURDENSEASALTdn:A', 'BURDENSO4dn:A', 'BURDENSOAdn:A',
- 'CDNUMC:A', 'CLDICE:A', 'CLDLIQ:A', 'CLDTOT:A', 'CLOUD:A', 'CMFMC:A', 'CMFMC_DP:A', 'FCTL:A', 'FLDS:A', 'FLDSC:A', 'FLNR:A', 'FLNS:A', 'FLNSC:A',
- 'FLNT:A', 'FLNTC:A', 'FLUT:A', 'FLUTC:A', 'FSDS:A', 'FSDSC:A', 'FSNR:A', 'FSNS:A', 'FSNSC:A', 'FSNTOA:A', 'FSNTOAC:A', 'LHFLX:A', 'MASS:A', 'OMEGA:A',
- 'OMEGA500:A', 'PBLH:A', 'PDELDRY:A', 'PRECC:A', 'PRECT:A', 'PS:A', 'PSL:A', 'Q:A', 'QREFHT:A', 'QSNOW:A', 'RELHUM:A', 'RHREFHT:A', 'SHFLX:A',
- 'SOLIN:A', 'SOLLD:A', 'SOLSD:A', 'T:A', 'T500:A', 'T700:A', 'T850:A', 'TAUBLJX:A', 'TAUBLJY:A', 'TAUGWX:A', 'TAUGWY:A', 'TAUX:A', 'TAUY:A',
+ 'CDNUMC:A', 'CLDICE:A', 'CLDLIQ:A', 'CLDTOT:A', 'CLOUD:A', 'CMFMC:A', 'CMFMC_DP:A', 'FCTL:A', 'FLDS:A', 'FLDSC:A', 'FLNR:A', 'FLNS:A', 'FLNSC:A',
+ 'FLNT:A', 'FLNTC:A', 'FLUT:A', 'FLUTC:A', 'FSDS:A', 'FSDSC:A', 'FSNR:A', 'FSNS:A', 'FSNSC:A', 'FSNTOA:A', 'FSNTOAC:A', 'LHFLX:A', 'MASS:A', 'OMEGA:A',
+ 'OMEGA500:A', 'PBLH:A', 'PDELDRY:A', 'PRECC:A', 'PRECT:A', 'PS:A', 'PSL:A', 'Q:A', 'QREFHT:A', 'QSNOW:A', 'RELHUM:A', 'RHREFHT:A', 'SHFLX:A',
+ 'SOLIN:A', 'SOLLD:A', 'SOLSD:A', 'T:A', 'T500:A', 'T700:A', 'T850:A', 'TAUBLJX:A', 'TAUBLJY:A', 'TAUGWX:A', 'TAUGWY:A', 'TAUX:A', 'TAUY:A',
'TGCLDIWP:A', 'TGCLDLWP:A', 'TMQ:A', 'TREFHT:A', 'TREFHTMN:A', 'TREFHTMX:A', 'TS:A', 'TSMN:M', 'TSMX:X', 'U:A', 'U10:A', 'UTGWORO:A',
'V:A', 'Z3:A', 'Z500:A'
-
-
diff --git a/cime_config/usermods_dirs/CMIP6_B1850_WACCM/user_nl_cam b/cime_config/usermods_dirs/CMIP6_B1850_WACCM/user_nl_cam
index 1b78d3bd33..033ae322f8 100644
--- a/cime_config/usermods_dirs/CMIP6_B1850_WACCM/user_nl_cam
+++ b/cime_config/usermods_dirs/CMIP6_B1850_WACCM/user_nl_cam
@@ -2,7 +2,7 @@
nhtfrq = 0,-24,-6,-3,-1,1,-24,-120,-240
fincl1 = 'ABSORB', 'ACBZO2', 'ACTREL', 'ALKNIT', 'ALKO2', 'ALKOOH', 'AOA1', 'AOA_NH', 'AODABSdn',
- 'AODBCdn', 'AODdnDUST1', 'AODdnDUST2', 'AODdnDUST3', 'AODdnMODE1', 'AODdnMODE2', 'AODdnMODE3', 'AODDUST2', 'AODDUST',
+ 'AODBCdn', 'AODdnDUST01', 'AODdnDUST02', 'AODdnDUST03', 'AODdn_aitken', 'AODdn_accum', 'AODdn_coarse', 'AODDUST02', 'AODDUST',
'AODNIRstdn', 'AODPOMdn', 'AODSO4dn', 'AODSOAdn', 'AODSSdn', 'AODUVdn', 'AODUVstdn', 'AODVIS', 'AODVISdn',
'AODVISstdn', 'AQ_SO2', 'AREA', 'AREI', 'AREL', 'bc_a1', 'bc_a1DDF', 'bc_a1SFWET', 'bc_a4',
'bc_a4_CLXF', 'bc_a4DDF', 'bc_a4SFWET', 'BCARY', 'bc_c1', 'bc_c1DDF', 'bc_c1SFWET', 'bc_c4', 'bc_c4DDF',
@@ -20,7 +20,7 @@ fincl1 = 'ABSORB', 'ACBZO2', 'ACTREL', 'ALKNIT', 'ALKO2', 'ALKOOH', 'AOA1', 'AO
'DF_ALKNIT', 'DF_ALKOOH', 'DF_BENZOOH', 'DF_BZOOH', 'DF_C2H5OH', 'DF_C2H5OOH', 'DF_C3H7OOH', 'DF_C6H5OOH', 'DF_CH2O',
'DF_CH3CHO', 'DF_CH3CN', 'DF_CH3COCH3', 'DF_CH3COCHO', 'DF_CH3COOH', 'DF_CH3COOOH', 'DF_CH3OH', 'DF_CH3OOH', 'DF_CO',
'DF_EOOH', 'DF_GLYALD', 'DF_H2O2', 'DF_H2SO4', 'DF_HCN', 'DF_HCOOH', 'DF_HNO3', 'DF_HO2NO2', 'DF_HONITR',
- 'DF_HPALD', 'DF_HYAC', 'DF_HYDRALD', 'DF_IEPOX', 'DF_ISOPNITA', 'DF_ISOPNITB', 'DF_ISOPNO3', 'DF_ISOPNOOH', 'DF_ISOPOOH',
+ 'DF_HPALD', 'DF_HYAC', 'DF_HYDRALD', 'DF_IEPOX', 'DF_ISOPNITA', 'DF_ISOPNITB', 'DF_ISOP', 'DF_ISOPNOOH', 'DF_ISOPOOH',
'DF_IVOC', 'DF_MACROOH', 'DF_MEKOOH', 'DF_MPAN', 'DF_NC4CH2OH', 'DF_NC4CHO', 'DF_NH3', 'DF_NH4', 'DF_NO2',
'DF_NO', 'DF_NOA', 'DF_NTERPOOH', 'DF_O3', 'DF_ONITR', 'DF_PAN', 'DF_PHENOOH', 'DF_POOH', 'DF_ROOH',
'DF_SO2', 'DF_SOAG0', 'DF_SOAG1', 'DF_SOAG2', 'DF_SOAG3', 'DF_SOAG4', 'DF_SVOC', 'DF_TERP2OOH', 'DF_TERPNIT',
@@ -66,7 +66,7 @@ fincl1 = 'ABSORB', 'ACBZO2', 'ACTREL', 'ALKNIT', 'ALKO2', 'ALKOOH', 'AOA1', 'AO
'SFBIGENE', 'SFC2H2', 'SFC2H4', 'SFC2H5OH', 'SFC2H6', 'SFC3H6', 'SFC3H8', 'SFCH2O', 'SFCH3CHO',
'SFCH3CN', 'SFCH3COCH3', 'SFCH3COCHO', 'SFCH3COOH', 'SFCH3OH', 'SFCO', 'SFDMS', 'SFdst_a1', 'SFdst_a2',
'SFdst_a3', 'SFGLYALD', 'SFHCN', 'SFHCOOH', 'SFISOP', 'SFIVOC', 'SFMEK', 'SFMTERP', 'SFncl_a1',
- 'SFncl_a2', 'SFncl_a3', 'SFNH3', 'SFNO2', 'SFNO', 'SFnum_a1', 'SFnum_a2', 'SFnum_a3', 'SFpom_a4',
+ 'SFncl_a2', 'SFncl_a3', 'SFNH3', 'SFNO', 'SFnum_a1', 'SFnum_a2', 'SFnum_a3', 'SFpom_a4',
'SFSO2', 'SFso4_a1', 'SFso4_a2', 'SFSVOC', 'SFTOLUENE', 'SFXYLENES', 'SHFLX', 'SO2', 'SO2_CHML',
'SO2_CHMP', 'SO2_CLXF', 'SO2_XFRC', 'SO3', 'so4_a1', 'so4_a1_CHMP', 'so4_a1_CLXF', 'so4_a1DDF', 'so4_a1_sfgaex1',
'so4_a1SFWET', 'so4_a2', 'so4_a2_CHMP', 'so4_a2_CLXF', 'so4_a2DDF', 'so4_a2_sfgaex1', 'so4_a2_sfnnuc1', 'so4_a2SFWET', 'so4_a3',
@@ -94,7 +94,7 @@ fincl1 = 'ABSORB', 'ACBZO2', 'ACTREL', 'ALKNIT', 'ALKO2', 'ALKOOH', 'AOA1', 'AO
'WD_CH2O', 'WD_CH3CHO', 'WD_CH3CN', 'WD_CH3COCH3', 'WD_CH3COCHO', 'WD_CH3COOH', 'WD_CH3COOOH', 'WD_CH3OH', 'WD_CH3OOH',
'WD_CLONO2', 'WD_COF2', 'WD_COFCL', 'WD_EOOH', 'WD_GLYALD', 'WD_H2O2', 'WD_H2SO4', 'WD_HBR', 'WD_HCL',
'WD_HCN', 'WD_HCOOH', 'WD_HF', 'WD_HNO3', 'WD_HO2NO2', 'WD_HOBR', 'WD_HOCL', 'WD_HONITR', 'WD_HPALD',
- 'WD_HYAC', 'WD_HYDRALD', 'WD_IEPOX', 'WD_ISOPNITA', 'WD_ISOPNITB', 'WD_ISOPNO3', 'WD_ISOPNOOH', 'WD_ISOPOOH', 'WD_IVOC',
+ 'WD_HYAC', 'WD_HYDRALD', 'WD_IEPOX', 'WD_ISOPNITA', 'WD_ISOPNITB', 'WD_ISOP', 'WD_ISOPNOOH', 'WD_ISOPOOH', 'WD_IVOC',
'WD_MACR', 'WD_MACROOH', 'WD_MEKOOH', 'WD_MVK', 'WD_NC4CH2OH', 'WD_NC4CHO', 'WD_NDEP', 'WD_NH3', 'WD_NH4',
'WD_NHDEP', 'WD_NOA', 'WD_NTERPOOH', 'WD_ONITR', 'WD_PHENOOH', 'WD_POOH', 'WD_ROOH', 'WD_SO2', 'WD_SOAG0',
'WD_SOAG1', 'WD_SOAG2', 'WD_SOAG3', 'WD_SOAG4', 'WD_SVOC', 'WD_TERP2OOH', 'WD_TERPNIT', 'WD_TERPOOH', 'WD_TERPROD1',
diff --git a/cime_config/usermods_dirs/CMIP6_BHIST/user_nl_cam b/cime_config/usermods_dirs/CMIP6_BHIST/user_nl_cam
index e9b1c0c5b0..9918e4e878 100644
--- a/cime_config/usermods_dirs/CMIP6_BHIST/user_nl_cam
+++ b/cime_config/usermods_dirs/CMIP6_BHIST/user_nl_cam
@@ -5,8 +5,8 @@ mfilt = 1, 5, 20, 40, 120, 240, 365, 73, 365
ndens = 2, 2, 2, 2, 2, 2, 1, 1, 1
-fincl1 = 'ABSORB:A', 'ACTREL:A', 'AODABSdn:A', 'AODBCdn:A', 'AODdnDUST1:A', 'AODdnDUST2:A',
- 'AODdnDUST3:A', 'AODdnMODE1:A', 'AODdnMODE2:A', 'AODdnMODE3:A', 'AODDUST2:A', 'AODDUST:A', 'AODNIRstdn:A', 'AODPOMdn:A', 'AODSO4dn:A', 'AODSOAdn:A', 'AODSSdn:A',
+fincl1 = 'ABSORB:A', 'ACTREL:A', 'AODABSdn:A', 'AODBCdn:A', 'AODdnDUST01:A', 'AODdnDUST02:A',
+ 'AODdnDUST03:A', 'AODdn_aitken:A', 'AODdn_accum:A', 'AODdn_coarse:A', 'AODDUST02:A', 'AODDUST:A', 'AODNIRstdn:A', 'AODPOMdn:A', 'AODSO4dn:A', 'AODSOAdn:A', 'AODSSdn:A',
'AODUVdn:A', 'AODUVstdn:A', 'AODVIS:A', 'AODVISdn:A', 'AODVISstdn:A', 'AQ_SO2:A', 'AREA:A', 'AREI:A', 'AREL:A', 'bc_a1:A', 'bc_a1DDF:A',
'bc_a1SFWET:A', 'bc_a4:A', 'bc_a4DDF:A', 'bc_a4SFWET:A', 'bc_c1:A', 'bc_c1DDF:A', 'bc_c1SFWET:A', 'bc_c4:A', 'bc_c4DDF:A',
'bc_c4SFWET:A', 'BROX:A', 'BROY:A', 'BURDENBCdn', 'BURDENDUSTdn:A', 'BURDENPOMdn:A', 'BURDENSEASALTdn:A', 'BURDENSO4dn:A',
diff --git a/cime_config/usermods_dirs/CMIP6_BHIST_WACCM/user_nl_cam b/cime_config/usermods_dirs/CMIP6_BHIST_WACCM/user_nl_cam
index 9a68109bc3..36485414c6 100644
--- a/cime_config/usermods_dirs/CMIP6_BHIST_WACCM/user_nl_cam
+++ b/cime_config/usermods_dirs/CMIP6_BHIST_WACCM/user_nl_cam
@@ -1,8 +1,8 @@
- mfilt = 1, 5, 20, 40, 120, 240, 365, 73, 365
+ mfilt = 1, 5, 20, 40, 120, 240, 365, 73, 365
nhtfrq = 0,-24,-6,-3,-1,1,-24,-120,-240
fincl1 = 'ABSORB', 'ACBZO2', 'ACTREL', 'ALKNIT', 'ALKO2', 'ALKOOH', 'AOA1', 'AOA_NH', 'AODABSdn',
- 'AODBCdn', 'AODdnDUST1', 'AODdnDUST2', 'AODdnDUST3', 'AODdnMODE1', 'AODdnMODE2', 'AODdnMODE3', 'AODDUST2', 'AODDUST',
+ 'AODBCdn', 'AODdnDUST01', 'AODdnDUST02', 'AODdnDUST03', 'AODdn_aitken', 'AODdn_accum', 'AODdn_coarse', 'AODDUST02', 'AODDUST',
'AODNIRstdn', 'AODPOMdn', 'AODSO4dn', 'AODSOAdn', 'AODSSdn', 'AODUVdn', 'AODUVstdn', 'AODVIS', 'AODVISdn',
'AODVISstdn', 'AQ_SO2', 'AREA', 'AREI', 'AREL', 'bc_a1', 'bc_a1DDF', 'bc_a1SFWET', 'bc_a4',
'bc_a4_CLXF', 'bc_a4DDF', 'bc_a4SFWET', 'BCARY', 'bc_c1', 'bc_c1DDF', 'bc_c1SFWET', 'bc_c4', 'bc_c4DDF',
@@ -20,7 +20,7 @@
'DF_ALKNIT', 'DF_ALKOOH', 'DF_BENZOOH', 'DF_BZOOH', 'DF_C2H5OH', 'DF_C2H5OOH', 'DF_C3H7OOH', 'DF_C6H5OOH', 'DF_CH2O',
'DF_CH3CHO', 'DF_CH3CN', 'DF_CH3COCH3', 'DF_CH3COCHO', 'DF_CH3COOH', 'DF_CH3COOOH', 'DF_CH3OH', 'DF_CH3OOH', 'DF_CO',
'DF_EOOH', 'DF_GLYALD', 'DF_H2O2', 'DF_H2SO4', 'DF_HCN', 'DF_HCOOH', 'DF_HNO3', 'DF_HO2NO2', 'DF_HONITR',
- 'DF_HPALD', 'DF_HYAC', 'DF_HYDRALD', 'DF_IEPOX', 'DF_ISOPNITA', 'DF_ISOPNITB', 'DF_ISOPNO3', 'DF_ISOPNOOH', 'DF_ISOPOOH',
+ 'DF_HPALD', 'DF_HYAC', 'DF_HYDRALD', 'DF_IEPOX', 'DF_ISOPNITA', 'DF_ISOPNITB', 'DF_ISOP', 'DF_ISOPNOOH', 'DF_ISOPOOH',
'DF_IVOC', 'DF_MACROOH', 'DF_MEKOOH', 'DF_MPAN', 'DF_NC4CH2OH', 'DF_NC4CHO', 'DF_NH3', 'DF_NH4', 'DF_NO2',
'DF_NO', 'DF_NOA', 'DF_NTERPOOH', 'DF_O3', 'DF_ONITR', 'DF_PAN', 'DF_PHENOOH', 'DF_POOH', 'DF_ROOH',
'DF_SO2', 'DF_SOAG0', 'DF_SOAG1', 'DF_SOAG2', 'DF_SOAG3', 'DF_SOAG4', 'DF_SVOC', 'DF_TERP2OOH', 'DF_TERPNIT',
@@ -66,7 +66,7 @@
'SFBIGENE', 'SFC2H2', 'SFC2H4', 'SFC2H5OH', 'SFC2H6', 'SFC3H6', 'SFC3H8', 'SFCH2O', 'SFCH3CHO',
'SFCH3CN', 'SFCH3COCH3', 'SFCH3COCHO', 'SFCH3COOH', 'SFCH3OH', 'SFCO', 'SFDMS', 'SFdst_a1', 'SFdst_a2',
'SFdst_a3', 'SFGLYALD', 'SFHCN', 'SFHCOOH', 'SFISOP', 'SFIVOC', 'SFMEK', 'SFMTERP', 'SFncl_a1',
- 'SFncl_a2', 'SFncl_a3', 'SFNH3', 'SFNO2', 'SFNO', 'SFnum_a1', 'SFnum_a2', 'SFnum_a3', 'SFpom_a4',
+ 'SFncl_a2', 'SFncl_a3', 'SFNH3', 'SFNO', 'SFnum_a1', 'SFnum_a2', 'SFnum_a3', 'SFpom_a4',
'SFSO2', 'SFso4_a1', 'SFso4_a2', 'SFSVOC', 'SFTOLUENE', 'SFXYLENES', 'SHFLX', 'SO2', 'SO2_CHML',
'SO2_CHMP', 'SO2_CLXF', 'SO2_XFRC', 'SO3', 'so4_a1', 'so4_a1_CHMP', 'so4_a1_CLXF', 'so4_a1DDF', 'so4_a1_sfgaex1',
'so4_a1SFWET', 'so4_a2', 'so4_a2_CHMP', 'so4_a2_CLXF', 'so4_a2DDF', 'so4_a2_sfgaex1', 'so4_a2_sfnnuc1', 'so4_a2SFWET', 'so4_a3',
@@ -94,7 +94,7 @@
'WD_CH2O', 'WD_CH3CHO', 'WD_CH3CN', 'WD_CH3COCH3', 'WD_CH3COCHO', 'WD_CH3COOH', 'WD_CH3COOOH', 'WD_CH3OH', 'WD_CH3OOH',
'WD_CLONO2', 'WD_COF2', 'WD_COFCL', 'WD_EOOH', 'WD_GLYALD', 'WD_H2O2', 'WD_H2SO4', 'WD_HBR', 'WD_HCL',
'WD_HCN', 'WD_HCOOH', 'WD_HF', 'WD_HNO3', 'WD_HO2NO2', 'WD_HOBR', 'WD_HOCL', 'WD_HONITR', 'WD_HPALD',
- 'WD_HYAC', 'WD_HYDRALD', 'WD_IEPOX', 'WD_ISOPNITA', 'WD_ISOPNITB', 'WD_ISOPNO3', 'WD_ISOPNOOH', 'WD_ISOPOOH', 'WD_IVOC',
+ 'WD_HYAC', 'WD_HYDRALD', 'WD_IEPOX', 'WD_ISOPNITA', 'WD_ISOPNITB', 'WD_ISOP', 'WD_ISOPNOOH', 'WD_ISOPOOH', 'WD_IVOC',
'WD_MACR', 'WD_MACROOH', 'WD_MEKOOH', 'WD_MVK', 'WD_NC4CH2OH', 'WD_NC4CHO', 'WD_NDEP', 'WD_NH3', 'WD_NH4',
'WD_NHDEP', 'WD_NOA', 'WD_NTERPOOH', 'WD_ONITR', 'WD_PHENOOH', 'WD_POOH', 'WD_ROOH', 'WD_SO2', 'WD_SOAG0',
'WD_SOAG1', 'WD_SOAG2', 'WD_SOAG3', 'WD_SOAG4', 'WD_SVOC', 'WD_TERP2OOH', 'WD_TERPNIT', 'WD_TERPOOH', 'WD_TERPROD1',
diff --git a/cime_config/usermods_dirs/CMIP6_GENERIC/user_nl_cam b/cime_config/usermods_dirs/CMIP6_GENERIC/user_nl_cam
index 45e18d1a6a..9ae154c7bb 100644
--- a/cime_config/usermods_dirs/CMIP6_GENERIC/user_nl_cam
+++ b/cime_config/usermods_dirs/CMIP6_GENERIC/user_nl_cam
@@ -4,8 +4,8 @@ mfilt = 1, 5, 20, 40, 120, 240, 365, 73, 365
ndens = 2, 2, 2, 2, 2, 2, 1, 1, 1
-fincl1 = 'ABSORB:A', 'ACTREL:A', 'AODABSdn:A', 'AODBCdn:A', 'AODdnDUST1:A', 'AODdnDUST2:A',
- 'AODdnDUST3:A', 'AODdnMODE1:A', 'AODdnMODE2:A', 'AODdnMODE3:A', 'AODDUST2:A', 'AODDUST:A', 'AODNIRstdn:A', 'AODPOMdn:A', 'AODSO4dn:A', 'AODSOAdn:A', 'AODSSdn:A',
+fincl1 = 'ABSORB:A', 'ACTREL:A', 'AODABSdn:A', 'AODBCdn:A', 'AODdnDUST01:A', 'AODdnDUST02:A',
+ 'AODdnDUST03:A', 'AODdn_aitken:A', 'AODdn_accum:A', 'AODdn_coarse:A', 'AODDUST02:A', 'AODDUST:A', 'AODNIRstdn:A', 'AODPOMdn:A', 'AODSO4dn:A', 'AODSOAdn:A', 'AODSSdn:A',
'AODUVdn:A', 'AODUVstdn:A', 'AODVIS:A', 'AODVISdn:A', 'AODVISstdn:A', 'AQ_SO2:A', 'AREA:A', 'AREI:A', 'AREL:A', 'bc_a1:A', 'bc_a1DDF:A',
'bc_a1SFWET:A', 'bc_a4:A', 'bc_a4DDF:A', 'bc_a4SFWET:A', 'bc_c1:A', 'bc_c1DDF:A', 'bc_c1SFWET:A', 'bc_c4:A', 'bc_c4DDF:A',
'bc_c4SFWET:A', 'BROX:A', 'BROY:A', 'BURDENBCdn', 'BURDENDUSTdn:A', 'BURDENPOMdn:A', 'BURDENSEASALTdn:A', 'BURDENSO4dn:A',
diff --git a/cime_config/usermods_dirs/scam_mandatory/shell_commands b/cime_config/usermods_dirs/scam_mandatory/shell_commands
index 0772ae5f3c..5230507d8a 100755
--- a/cime_config/usermods_dirs/scam_mandatory/shell_commands
+++ b/cime_config/usermods_dirs/scam_mandatory/shell_commands
@@ -2,8 +2,8 @@
# these are necessary for scam runs.
#========================================
#
-# SCAM works in SPMD mode with a single task, but the default is to run serially.
-./xmlchange MPILIB=mpi-serial
+# SCAM works in SPMD mode with a single task.
+./xmlchange NTASKS=1
# SCAM doesn't have restart functionality yet.
./xmlchange REST_OPTION=never
diff --git a/doc/ChangeLog b/doc/ChangeLog
index d09f63077b..a81de9b635 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,5 +1,6944 @@
===============================================================
+Tag name: cam6_3_147
+Originator(s): lizziel, jimmielin, fritzt
+Date:
+One-line Summary: Add GEOS-Chem chemistry as new chemistry option in CAM
+Github PR URL: https://github.com/ESCOMP/CAM/pull/484
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+ - Include GEOS-Chem 14.1.2 chemistry as alternative to CAM-chem
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: fvitt, brian-eaton, cacraigucar, gold2718, jedwards4b
+
+List all files that are renamed and why:
+R100 bld/namelist_files/master_aer_drydep_list.xml
+R100 bld/namelist_files/master_aer_wetdep_list.xml
+R100 bld/namelist_files/master_gas_drydep_list.xml
+R100 bld/namelist_files/master_gas_wetdep_list.xml
+ - Renamed with prefix mozart_ to distinguish from GEOS-Chem lists
+
+R099 src/chemistry/aerosol/drydep_mod.F90
+ - Renamed to aer_drydep_mod.F90 to avoid module conflict name in GEOS-Chem
+ - Changed module name in file from drydep_mod to aer_drydep_mod
+
+List all files added and what they do:
+A bld/namelist_files/geoschem_master_aer_drydep_list.xml
+A bld/namelist_files/geoschem_master_aer_wetdep_list.xml
+A bld/namelist_files/geoschem_master_gas_drydep_list.xml
+A bld/namelist_files/geoschem_master_gas_wetdep_list.xml
+ - New deposition lists for use in GEOS-Chem only
+
+A bld/namelist_files/use_cases/2000_geoschem.xml
+A bld/namelist_files/use_cases/2010_geoschem.xml
+A bld/namelist_files/use_cases/hist_geoschem.xml
+A bld/namelist_files/use_cases/hist_geoschem_nudged.xml
+ - Use case files for four GEOS-Chem chemistry compsets
+
+A cime_config/cam.case_setup.py
+ - Script called during CESM case setup for CAM-specific commands
+ - Copies GEOS-Chem config files from source to case directory if using GEOS-Chem
+
+A src/chemistry/geoschem/.exclude
+ - List of GEOS-Chem source files to skip during build
+
+A src/chemistry/geoschem/chem_mods.F90
+ - GEOS-Chem version of chem_mods.F90 equivalent to Mozart pre-processed files
+
+A src/chemistry/geoschem/chemistry.F90
+ - GEOS-Chem implementation of chemistry module used in CAM
+
+A src/chemistry/geoschem/geoschem_diagnostics_mod.F90
+ - GEOS-Chem diagnostics module
+
+A src/chemistry/geoschem/geoschem_emissions_mod.F90
+ - GEOS-Chem emissions module
+
+A src/chemistry/geoschem/geoschem_history_mod.F90
+ - Interface file to connect GEOS-Chem state arrays to CAM history
+
+A src/chemistry/geoschem/m_spc_id.F90
+ - GEOS-Chem version of m_spc_id.F90 equivalent to Mozart pre-processed files
+
+A src/chemistry/geoschem/mo_sim_dat.F90
+ - GEOS-Chem version of m_spc_id.F90 equivalent to Mozart pre-processed files
+
+List all existing files that have been modified, and describe the changes:
+M .gitignore
+ - Added GEOS-Chem directory which is its own git repository
+
+M Externals_CAM.cfg
+ - Added GEOS-Chem repository, tag 14.1.2
+
+M bld/build-namelist
+ - Updates for GEOS-Chem namelists
+
+M bld/config_files/definition.xml
+ - Added geoschem_mam4 to list of chemistry packages
+
+M bld/configure
+ - Updates to build GEOS-Chem
+
+M bld/namelist_files/namelist_defaults_cam.xml
+ - Set GEOS-Chem default wave params and path to Henry's coeff file for deposition
+
+M bld/namelist_files/namelist_definition.xml
+ - Added GEOS-Chem input data path as new entry
+ - Added geoschem_mam4 to chem package list
+
+M bld/perl5lib/Build/ChemNamelist.pm
+ - Added log prints of all deposition species lists
+ - Updates to use different deposition lists based on chemistry selection
+
+M cime_config/buildnml
+ - Copy GEOS-Chem config files from case to run directory if using GEOS-Chem
+
+M cime_config/config_component.xml
+ - Added GEOS-Chem as chemistry option
+ - Set GEOS-Chem compset aliases
+
+M cime_config/config_compsets.xml
+ - Defined four GEOS-Chem compsets
+
+M cime_config/testdefs/testlist_cam.xml
+ - Added tests for all four GEOS-Chem compsets as category geoschem
+ - Included FCHIST_GC in aux_cam tests and FCnudged_GC in prealpha tests
+
+M doc/ChangeLog
+M src/chemistry/bulk_aero/aero_model.F90
+ - Renamed drydep_mod to aer_drydep_mod in use statements
+
+M src/chemistry/modal_aero/aero_model.F90
+ - Renamed drydep_mod to aer_drydep_mod in use statements
+
+M src/chemistry/modal_aero/modal_aero_data.F90
+ - Distinguish between SOAG and SOAGX since SOAGX a species in GEOS-Chem
+
+M src/chemistry/modal_aero/modal_aero_gasaerexch.F90
+ - Skip MSA tendency if using GEOS-Chem
+
+M src/chemistry/modal_aero/sox_cldaero_mod.F90
+ - Exit prior to in-cloud sulfur oxidation if using GEOS-Chem to avoid double-counting
+
+M src/chemistry/mozart/chemistry.F90
+ - Add call to new subroutine short_lived_species_final
+
+M src/chemistry/mozart/mo_chem_utls.F90
+ - Add optional argument in get_spc_ndx to ignore case in string compariosn
+
+M src/chemistry/mozart/mo_neu_wetdep.F90
+ - Skip aerosol mapping if using GEOS-Chem; assume all species in dep_data_file
+
+M src/chemistry/mozart/short_lived_species.F90
+ - Added array slvd_ref_mmr to store short-lived species reference values
+ - Initialized short-lived species not found to ref values if available
+ - Initialized GEOS-Chem short-lived species from slvd_lst not solsym
+ - Added set/get subroutines for GEOS-Chem short-lived species
+ - Added new subroutine short_lived_species_final to deallocate new array
+
+M src/cpl/nuopc/atm_import_export.F90
+ - Added So_ustar to atm imports for use in GEOS-Chem dry dep over ocean
+
+M src/physics/cam/constituents.F90
+ - Improved existing error handling messages for clarity
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+derecho/intel/aux_cam:
+
+izumi/nag/aux_cam:
+
+izumi/gnu/aux_cam:
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_146
+Originator(s): cacraig
+Date: Jan 23, 2024
+One-line Summary: ZM clean up in preparation for using via CCPP and remove zmconv_microp feature
+Github PR URL: https://github.com/ESCOMP/CAM/pull/890
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+ - Work to make ZM compatible with CCPP conversion process
+ - Removed CAM3 switch from ZM in move to no longer support CAM3
+ - Remove microphysics embedded in ZM: https://github.com/ESCOMP/CAM/issues/889
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist:
+ - removed zmconv_microp namelist
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: nusbaume, mwaxmonsky
+
+List all files eliminated:
+D src/physics/cam/zm_microphysics.F90
+ - removed zmconv_microp capability as it is not used
+
+D src/physics/cam/zm_conv.F90
+ - moved ZM to ESCOMP/atcmospheric_physics and broke into separate modules
+
+D cime_config/testdefs/testmods_dirs/cam/outfrq3s_convmic/shell_commands
+D cime_config/testdefs/testmods_dirs/cam/outfrq3s_convmic/user_nl_cam
+D cime_config/testdefs/testmods_dirs/cam/outfrq3s_convmic/user_nl_clm
+D cime_config/testdefs/testmods_dirs/cam/outfrq3s_convmic/user_nl_cpl
+ - removed test which tested zmconv_microp
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+M Externals_CAM.cfg
+ - updated ESCOMP/atmospheric_physics to bring in tag with ZM
+
+M bld/build-namelist
+M bld/namelist_files/namelist_defaults_cam.xml
+M bld/namelist_files/namelist_definition.xml
+M src/physics/cam/clubb_intr.F90
+ - removed zmconv_microp namelist and associated code
+
+M bld/configure
+ - add location for src/atmos_phys/zm
+
+M cime_config/testdefs/testlist_cam.xml
+ - removed test which tested zmconv_microp and CAM3
+
+M src/physics/cam/macrop_driver.F90
+ - removed zmconv_microp namelist and associated code
+ - Changes needed to support ZM no longer having pcols dimension
+
+M src/chemistry/modal_aero/modal_aero_convproc.F90
+M src/physics/cam/cloud_fraction.F90
+M src/physics/cam/convect_shallow.F90
+M src/physics/cam/rk_stratiform.F90
+M src/physics/spcam/crmclouds_camaerosols.F90
+ - Changes needed to support ZM no longer having pcols dimension
+
+M src/physics/cam/zm_conv_intr.F90
+ - Changes to prepare this routine to support CCPP conversion
+ - Pass in variables which were being "use"d in ZM previously
+ - Only pass :ncol sections of arrays since pcols has been removed from ZM
+ - removed zmconv_microp namelist and associated code
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+derecho/intel/aux_cam: all BFB except:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 (Overall: PEND) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL) details:
+ - preexisting failures
+
+izumi/nag/aux_cam: all BFB except:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - preexisting failure
+
+izumi/gnu/aux_cam: all BFB
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_145
+Originator(s): katetc, cacraigucar, andrewgettelman
+Date: 05 Jan 2024
+One-line Summary: New PUMAS External with adjusted vapor deposition onto snow
+Github PR URL: https://github.com/ESCOMP/CAM/pull/938
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+ A one-line change in PUMAS resulting in a new tag for the external. Adds a corresponding
+ limiter for vapor deposition onto snow as used for rain. Also updates the test lists from
+ Cheyenne to Derecho in all cases.
+ Resolves Issue 936 - PUMAS update for vapor deposition onto snow
+ Resolves Issue 947 - Rename all cheyenne tests to derecho
+
+Describe any changes made to build system: None
+
+Describe any changes made to the namelist: None
+
+List any changes to the defaults for the boundary datasets: None
+
+Describe any substantial timing or memory changes: None
+
+Code reviewed by: PeterHjortLauritzen, cacraigucar, adamrher
+
+List all files eliminated: None
+
+List all files added and what they do: None
+
+List all existing files that have been modified, and describe the changes:
+
+M Externals_CAM.cfg
+ - Point to new pumas tag pumas_cam-release_v1.35
+
+M cime_config/testdefs/testlist_cam.xml
+ - Change all Cheyenne to Derecho tests
+ - Change wallclock time from 00:10:00 to 00:20:00 for Derecho test
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.derecho_intel.cam-outfrq9s
+
+M test/system/archive_baseline.sh
+ - Change cheyenne to Derecho, remove support for Cheyenne
+
+M test/system/test_driver.sh
+ - Remove support for Cheyenne, updates for Derecho
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+derecho/intel/aux_cam:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 (Overall: PEND)
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL)
+ - pre-existing failures
+
+ ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF)
+ ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.derecho_intel.cam-outfrq9s (Overall: DIFF)
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.derecho_intel.cam-outfrq9s_mg3 (Overall: DIFF)
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.derecho_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: DIFF)
+ SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF)
+ SMS_D_Ln9_Vnuopc_P1280x1.ne30pg3_ne30pg3_mg17.FCLTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF)
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.derecho_intel.cam-outfrq1d (Overall: DIFF)
+ - Expected answer changes due to PUMAS update
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - pre-existing failure
+
+izumi/gnu/aux_cam:
+ SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s (Overall: DIFF)
+ - Expected answer changes due to PUMAS update
+
+Summarize any changes to answers:
+
+ Small but climate-changing impacts. Discussion and diagnostics here: https://github.com/NCAR/amwg_dev/issues/445
+
+===============================================================
+
+
+===============================================================
+
+Tag name: cam6_3_144
+Originator(s): katetc, cacraigucar, andrewgettelman, wkchuang, djgagne
+Date: 02 Jan 2024
+One-line Summary: Introduce changes needed to support machine learning in PUMAS microphysics
+Github PR URL: https://github.com/ESCOMP/CAM/pull/858
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+ PR with the tag for PUMAS now including early support for a machine learning kernel. Fixes #801
+ - Bring in Machine Learning warm rain capability. Also includes micro_mg_vtrms namelist for the
+ CAM7 PPE. Also includes addition of an aux_pumas test suite.
+
+Describe any changes made to build system:
+ Added "pumas" as a valid microphysics scheme in the configure script. Currently the "pumas"
+ option is set to "mg3" in configure, as full support is left for a later tag.
+
+Describe any changes made to the namelist:
+
+. Added micro_mg_warm_rain: Choices for the PUMAS warm rain accretion formulation.
+ Options include sb2001, kk2000, tau and emulated (machine learning). kk2000 is default.
+. Added micro_mg_vtrms_factor: A microphysics parameter for adjusting the snow fall speed. Default
+ is 1.0 to maintain answers in cam_dev.
+. Added pumas_stochastic_tau_kernal_filename: Coefficients for the stochastic collection kernel used
+ by the TAU stochastic collection code, invoked in PUMAS with micro_pumas_warm_rain = 'tau'
+. Added stochastic_emulated_filename_quantile: Neural net file for warm_rain machine learning
+. Added stochastic_emulated_filename_input_scale: Neural net input scaling values file for warm_rain
+ machine learning
+. Added stochastic_emulated_filename_output_scale: Neural net output scaling values file for warm_rain
+ machine learning
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: cacraigucar, peverwhee, nusbaume, sjsprecious
+
+List all files eliminated: N/A
+
+List all files added and what they do:
+
+A cime_config/SystemTests/mgp.py
+ - Added system test to ensure that "pumas" and "mg3" microphysics options give the same answers.
+ Used in the aux_puams test suite
+
+A cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_emulated/shell_commands
+A cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_emulated/user_nl_cam
+A cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_emulated/user_nl_clm
+ - Added test for the "emulated" pumas warm rain option, used in aux_pumas test suite
+
+A cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_sb2001/shell_commands
+A cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_sb2001/user_nl_cam
+A cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_sb2001/user_nl_clm
+ - Added test for the "sb2001" pumas warm rain option, used in aux_pumas test suite
+
+A cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_tau/shell_commands
+A cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_tau/user_nl_cam
+A cime_config/testdefs/testmods_dirs/cam/outfrq9s_pumas_tau/user_nl_clm
+ - Added test for the "tau" pumas warm rain option, used in aux_pumas test suite
+
+A src/physics/cam_dev/stochastic_emulated_cam.F90
+A src/physics/cam_dev/stochastic_tau_cam.F90
+ - Supporting code for the PUMAS warm rain machine learning neural net
+
+List all existing files that have been modified, and describe the changes:
+
+M Externals_CAM.cfg
+ - New PUMAS external with machine learning support and vtrms namelist support
+
+M bld/build-namelist
+M bld/namelist_files/namelist_defaults_cam.xml
+M bld/namelist_files/namelist_definition.xml
+ - Added support for micro_mg_warm_rain, micro_mg_vtrms and pumas_stochastic_tau_kernal_filename.
+ Also several namelist fields for pumas machine learning, but not set to default
+
+M bld/config_files/definition.xml
+M bld/configure
+ - Added "pumas" as a valid configure microphysics option. Currently set to mg3 immediately.
+
+M cime_config/config_tests.xml
+M cime_config/testdefs/testlist_cam.xml
+ - Added support for the mgp test and the aux_pumas test suite
+
+M src/physics/cam_dev/micro_pumas_cam.F90
+ - Support for the machine learning warm rain options for PUMAS, the vtrms_factor namelist field,
+ adding some history fields related to the machine learning and new warm rain options.
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+derecho/intel/aux_cam:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 (Overall: FAIL)
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL)
+ - pre-existing failures
+
+ ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.derecho_intel.cam-outfrq9s (Overall: NLFAIL)
+ ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.derecho_intel.cam-outfrq9s (Overall: NLFAIL)
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.derecho_intel.cam-outfrq9s_mg3 (Overall: NLFAIL)
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.derecho_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: NLFAIL)
+ SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.derecho_intel.cam-outfrq9s (Overall: NLFAIL)
+ SMS_D_Ln9_Vnuopc_P1280x1.ne30pg3_ne30pg3_mg17.FCLTHIST.derecho_intel.cam-outfrq9s (Overall: NLFAIL)
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.derecho_intel.cam-outfrq1d (Overall: NLFAIL)
+ - Expected namelist differences due to new PUMAS namelist options (in cam_dev)
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - pre-existing failure
+
+izumi/gnu/aux_cam:
+ SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s (Overall: NLFAIL)
+ - Expected namelist differences due to new PUMAS namelist options (in cam_dev)
+
+Summarize any changes to answers: bit-for-bit unchanged
+
+===============================================================
+
+===============================================================
+
+Tag name: cam6_3_143
+Originator(s): fvitt
+Date: 20 Dec 2023
+One-line Summary: Reduce memory footprint of IC file output in SE CSLAM
+Github PR URL: https://github.com/ESCOMP/CAM/pull/939
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+ Implement memory friendly mapping of advected tracers from physics grid to dynamics grid
+ for output to CAM generated IC file when SE CSLAM dynamics is used. This resolves the
+ memory issue described in github issue #932 (Memory issues in SE CSLAM when writing IC files).
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: PeterHjortLauritzen, cacraigucar
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+M src/dynamics/se/dycore/fvm_mapping.F90
+ - implement physics-to-dynmics grid mapping routine for a single tracer
+
+M src/dynamics/se/dycore/fvm_mod.F90
+ - implement exchange buffer for a single tracer
+
+M src/dynamics/se/stepon.F90
+ - remap to dynamics grid and output to the cam generated IC one tracer at a time
+ - add memory allocate checks
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+derecho/intel/aux_cam:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 (Overall: PEND) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL) details:
+ - pre-existing failures
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - pre-existing failure
+
+izumi/gnu/aux_cam: All PASS
+
+Summarize any changes to answers: bit-for-bit unchanged
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_142
+Originator(s): jedwards, ekluzek, goldy, bstephens82, eaton
+Date: 13 December 2023
+One-line Summary: Resolve miscellaneous issues
+Github PR URL: https://github.com/ESCOMP/CAM/pull/937
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+. https://github.com/ESCOMP/CAM/issues/863 - Incorrect error message
+ - remove the code in cam_history that was checking fincl input for the
+ names of zonal mean fields and writing a message to the atm log file if
+ the dycore was not FV. These messages are now incorrect and have been
+ removed.
+
+. https://github.com/ESCOMP/CAM/issues/837 - Remove setting of CTSM fsurdat
+ file and LND_DOMAIN_FILE in mpas testmods
+ - The LND_DOMAIN_FILE is no longer needed. The fsurdat file is now
+ appropriately set by CTSM.
+
+. https://github.com/ESCOMP/CAM/pull/792 - changes to fix single-exe option
+ for PLB tests
+ - Fix from jedwards
+
+. https://github.com/ESCOMP/CAM/issues/931 - Bad outfld calls in
+ cam_development?
+ - Fix several bad outfld calls. The size of the 1st dimension of the
+ passed data did not match the size passed as a separate argument.
+
+. https://github.com/ESCOMP/CAM/pull/855 - Bug fix for SILHS history output
+ being garbled.
+ - Fix from bstephens82.
+
+. resolves #863
+. resolves #837
+. resolves #792
+. resolves #931
+. resolves #855
+
+
+Describe any changes made to build system: none
+
+Describe any changes made to the namelist: none
+
+List any changes to the defaults for the boundary datasets: none for cam, but
+. The fsurdat file has changed for mpasa grids.
+
+Describe any substantial timing or memory changes: none
+
+Code reviewed by: cacraigucar, nusbaume
+
+List all files eliminated: none
+
+List all files added and what they do: none
+
+List all existing files that have been modified, and describe the changes:
+
+bld/namelist_files/use_cases/waccmx_ma_2000_cam6.xml
+. add dyn="fv" attribute to fincl7 element so that zonal mean output is only
+ requested for the FV dycore.
+
+cime_config/buildnml
+cime_config/config_tests.xml
+. fix single-exe option for PLB tests (from Jim Edwards)
+
+cime_config/testdefs/testmods_dirs/cam/outfrq1d_physgrid_tem_mpasa120_wcmsc/shell_commands
+cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa120/shell_commands
+cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa480/shell_commands
+. remove xmlchange for LND_DOMAIN_FILE.
+
+cime_config/testdefs/testmods_dirs/cam/outfrq1d_physgrid_tem_mpasa120_wcmsc/user_nl_clm
+cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa120/user_nl_clm
+cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa480/user_nl_clm
+. remove setting for fsurdat
+
+src/control/cam_history.F90
+. subroutine fldlst
+ - remove code that inspects the fincl lists for the zonal mean fields
+ that used to only be available when using FV dycore. This code removed
+ these fields from the fincl list and printed a message to the atm log
+ file. These messages are no longer correct and have been removed.
+. subroutine addfld_nd
+ - fix conditional so that is_subcol gets set correctly for fields
+ representing subcolumns.
+
+src/physics/cam/cam_diagnostics.F90
+src/physics/cam/vertical_diffusion.F90
+src/physics/rrtmg/rrtmg_state.F90
+src/physics/spcam/spcam_drivers.F90
+src/physics/waccm/mo_aurora.F90
+. fix several outfld calls - make sure 1st dimension of the data array matches
+ the value passed as the size of the 1st dimension
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+derecho/intel/aux_cam:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 (Overall: PEND) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL) details:
+- pre-existing failures
+
+ ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.derecho_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details:
+ ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.derecho_intel.cam-outfrq9s_mpasa480 (Overall: DIFF) details:
+- fsurdat file changed resulting in baseline comparison failures
+
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+- use_case file modified to exclude the fincl7 list of zonal mean fields.
+ Previous code was ignoring these fields and printing a message to the
+ atm.log file.
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+- pre-existing failure
+
+izumi/gnu/aux_cam: All PASS
+
+CAM tag used for the baseline comparison tests if different than previous
+tag:
+
+Summarize any changes to answers: BFB except for MPAS tests due to a change
+in the fsurdat file specified by CTSM.
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_141
+Originator(s): eaton
+Date: 8 December 2023
+One-line Summary: Improve handling of 0th / initial time in history output
+Github PR URL: https://github.com/ESCOMP/CAM/pull/929
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+. Issue #459 - Improve handling of 0th / initial time in history output
+ - Add namelist variable, write_nstep0, to control output of nstep==0 time
+ sample. This output is now turned OFF by default.
+
+. resolves #459
+
+Describe any changes made to build system: none
+
+Describe any changes made to the namelist:
+. Add logical variable write_nstep0 to namelist group cam_history_nl.
+ Default value is .false.
+
+List any changes to the defaults for the boundary datasets: none
+
+Describe any substantial timing or memory changes: none
+
+Code reviewed by: cacraigucar, peverwhee
+
+List all files eliminated: none
+
+List all files added and what they do: none
+
+List all existing files that have been modified, and describe the changes:
+
+bld/namelist_files/namelist_definition.xml
+. Add logical variable write_nstep0 to namelist group cam_history_nl.
+ Default value is .false.
+
+doc/ChangeLog_template
+. remove cheyenne test results section
+
+cime_config/testdefs/testmods_dirs/cam/cam4_port/user_nl_cam
+cime_config/testdefs/testmods_dirs/cam/cam4_port5d/user_nl_cam
+cime_config/testdefs/testmods_dirs/cam/cam5_port_f45/user_nl_cam
+cime_config/testdefs/testmods_dirs/cam/cam5_port_ne30/user_nl_cam
+cime_config/testdefs/testmods_dirs/cam/cam6_port_f09/user_nl_cam
+cime_config/testdefs/testmods_dirs/cam/nudging/user_nl_cam
+cime_config/testdefs/testmods_dirs/cam/outfrq1d/user_nl_cam
+cime_config/testdefs/testmods_dirs/cam/outfrq3h/user_nl_cam
+cime_config/testdefs/testmods_dirs/cam/outfrq3s/user_nl_cam
+cime_config/testdefs/testmods_dirs/cam/outfrq3s_cospsathist/user_nl_cam
+cime_config/testdefs/testmods_dirs/cam/outfrq3s_diags/user_nl_cam
+cime_config/testdefs/testmods_dirs/cam/outfrq9s/user_nl_cam
+cime_config/testdefs/testmods_dirs/cam/outfrq9s_apmee/user_nl_cam
+cime_config/testdefs/testmods_dirs/cam/outfrq9s_mee_fluxes/user_nl_cam
+cime_config/testdefs/testmods_dirs/cam/reduced_hist1d/user_nl_cam
+cime_config/testdefs/testmods_dirs/cam/scm_prep/user_nl_cam
+cime_config/testdefs/testmods_dirs/cam/scm_prep_c6/user_nl_cam
+cime_config/testdefs/testmods_dirs/cam/scmarm/user_nl_cam
+cime_config/testdefs/testmods_dirs/cam/silhs/user_nl_cam
+. add write_nstep0=.true.
+ - This change to the namelist keeps the output files unchanged so
+ baselines pass. It also keeps the nstep==0 output which is useful for
+ debugging.
+
+src/control/cam_history.F90
+. add write_nstep0 to namelist input and echo to atm.log file
+. wshist
+ - add logic for nstep==0 to the code section that determines when history
+ buffers are written to files. If history buffers are not written at
+ nstep==0, then zero them. This partial time step from the
+ initialization process shouldn't be accumulated with subsequent
+ timestep output.
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+derecho/intel/aux_cam:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 (Overall: PEND) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL) details:
+- pre-existing failures
+
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPMOZ.derecho_intel.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPX2000.derecho_intel.cam-outfrq3s (Overall: NLFAIL) details:
+ ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_D_Ln9_Vnuopc.f09_f09_mg17.QSC6.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ld3_Vnuopc.f09_f09_mg17.FWHIST.derecho_intel.cam-reduced_hist1d (Overall: NLFAIL) details:
+ ERP_Lh12_Vnuopc.f19_f19_mg17.FW4madSD.derecho_intel.cam-outfrq3h (Overall: NLFAIL) details:
+ ERP_Ln9_P24x3_Vnuopc.f45_f45_mg37.QPWmaC6.derecho_intel.cam-outfrq9s_mee_fluxes (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FSPCAMS.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC5.derecho_intel.cam-scm_prep (Overall: NLFAIL) details:
+ SMS_D_Ld5_Vnuopc.f19_f19_mg17.PC4.derecho_intel.cam-cam4_port5d (Overall: NLFAIL) details:
+ SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCvbsxHIST.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC5M7.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.QPX2000.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc_P1280x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc_P1280x1.ne30pg3_ne30pg3_mg17.FCLTHIST.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.T42_T42.FSCAM.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_Ld1_Vnuopc.f09_f09_mg17.FW2000climo.derecho_intel.cam-outfrq1d (Overall: NLFAIL) details:
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.derecho_intel.cam-outfrq1d (Overall: NLFAIL) details:
+ SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.derecho_intel.cam-outfrq1d (Overall: NLFAIL) details:
+ SMS_Ld5_Vnuopc.f09_f09_mg17.PC6.derecho_intel.cam-cam6_port_f09 (Overall: NLFAIL) details:
+ SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq3h (Overall: NLFAIL) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.F2010climo.derecho_intel.cam-nudging (Overall: NLFAIL) details:
+ SMS_Ln9_Vnuopc.f19_f19.F2000climo.derecho_intel.cam-silhs (Overall: NLFAIL) details:
+- added write_nstep0=.true. to tests
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+- pre-existing failure
+
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QSPCAMS.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ ERS_Ln27_Vnuopc.ne5pg3_ne5pg3_mg37.FKESSLER.izumi_nag.cam-outfrq9s (Overall: NLFAIL) details:
+ ERS_Ln9_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq9s (Overall: NLFAIL) details:
+ PEM_D_Ln9_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ SMS_D_Ln3_Vnuopc.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ SMS_D_Ln7_Vnuopc.T42_T42_mg17.QPSCAMC5.izumi_nag.cam-scmarm (Overall: NLFAIL) details:
+ SMS_D_Ln9_P1x1_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ SUB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+- added write_nstep0=.true. to tests
+
+izumi/gnu/aux_cam:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC4.izumi_gnu.cam-outfrq3s_diags (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPSPCAMM.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne5pg2_ne5pg2_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne5pg4_ne5pg4_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.ne5_ne5_mg37.FHS94.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
+ PEM_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC4.izumi_gnu.cam-scm_prep (Overall: NLFAIL) details:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC6.izumi_gnu.cam-scm_prep_c6 (Overall: NLFAIL) details:
+ SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC4.izumi_gnu.cam-outfrq9s_apmee (Overall: NLFAIL) details:
+ SMS_P48x1_D_Ln9_Vnuopc.f19_f19_mg17.FW4madSD.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
+- added write_nstep0=.true. to tests
+
+CAM tag used for the baseline comparison tests if different than previous
+tag:
+
+Summarize any changes to answers: BFB
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_140
+Originator(s): peverwhee
+Date: 6 December 2023
+One-line Summary: Separate history tapes into hXi and hXa
+Github PR URL: https://github.com/ESCOMP/CAM/pull/903
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+ - Change "time" value for averaged quantities to midpoint of averaging period (#159)
+ - Modify naming and attributes of time variables on history files to be
+ consistent with other CESM components (#554)
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: cacraigucar brian-eaton nusbaume
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+M cime_config/SystemTests/sct.py
+ - change references to history file to include "i" flag
+
+M src/control/cam_history.F90
+ - change 'time_bnds' to 'time_bounds'
+ - split history stream into two files: instantaneous and accumulated
+ - accumulated file has all non-instantaneous fields and 'time', 'date',
+ 'datesec' fields are the midpoint time
+ - accumulated file is only generated when one or more accumulated fields
+ - filename includes 'a' flag
+ is included in the fincl list
+ - instantaneous file has all instantaneous fields (including scalars that
+ are always written) and 'time', 'date', and 'datesec' fields are the end
+ time
+ - instantaneous file is always generated (with, at minimum, those
+ scalars like solar forcing data, current timestep, etc
+ - filename includes 'i' flag
+ - change 'cell_methods' to always include 'time: x' attribute to specify flag
+ - "time: point" for instantaneous fields
+
+M src/control/cam_history_support.F90
+ - add functionality for multiple files per history stream
+
+M src/control/filenames.F90
+ - update interpret_filename_spec to include 'a' or 'i' flag in filename
+
+M src/control/sat_hist.F90
+ - update to comply with new Files array (multiple files per stream)
+
+M src/utils/cam_grid_support.F90
+ - updates to get around logic that prevented fields to be written twice (need
+ to be written once per file instead of once overall)
+
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s (Overall: FAIL) details:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 (Overall: PEND) details:
+ - pre-existing failures
+ ERC_D_Ln9_P144x1_Vnuopc.ne16pg3_ne16pg3_mg17.QPC6HIST.cheyenne_intel.cam-outfrq3s_ttrac_usecase (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq3s_cosp (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPMOZ.cheyenne_intel.cam-outfrq3s (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPX2000.cheyenne_intel.cam-outfrq3s (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.FADIAB.cheyenne_intel.cam-terminator (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC5HIST.cheyenne_intel.cam-outfrq3s_usecase (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.T42_T42_mg17.FDABIP04.cheyenne_intel.cam-outfrq3s_usecase (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.T42_T42_mg17.FHS94.cheyenne_intel.cam-outfrq3s_usecase (Overall: DIFF) details:
+ ERI_D_Ln18_Vnuopc.f45_f45_mg37.QPC41850.cheyenne_intel.cam-co2rmp_usecase (Overall: DIFF) details:
+ ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vnuopc.f09_f09_mg17.QSC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ld3_Vnuopc.f09_f09_mg17.FWHIST.cheyenne_intel.cam-reduced_hist1d (Overall: DIFF) details:
+ ERP_Lh12_Vnuopc.f19_f19_mg17.FW4madSD.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ ERP_Ln9_P24x3_Vnuopc.f45_f45_mg37.QPWmaC6.cheyenne_intel.cam-outfrq9s_mee_fluxes (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: DIFF) details:
+ ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details:
+ ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FSPCAMS.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.ne0TESTONLYne5x4_ne0TESTONLYne5x4_mg37.FADIAB.cheyenne_intel.cam-outfrq3s_refined (Overall: DIFF) details:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC5.cheyenne_intel.cam-scm_prep (Overall: DIFF) details:
+ SMS_D_Ld2_Vnuopc.f19_f19_mg17.QPC5HIST.cheyenne_intel.cam-volc_usecase (Overall: DIFF) details:
+ SMS_D_Ld5_Vnuopc.f19_f19_mg17.PC4.cheyenne_intel.cam-cam4_port5d (Overall: DIFF) details:
+ SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCts2nudged.cheyenne_intel.cam-outfrq9s_leapday (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCvbsxHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC2000climo.cheyenne_intel.cam-outfrq3s_usecase (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC5M7.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.QPX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P1280x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P1280x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.T42_T42.FSCAM.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.f09_f09_mg17.FW2000climo.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld5_Vnuopc.f09_f09_mg17.PC6.cheyenne_intel.cam-cam6_port_f09 (Overall: DIFF) details:
+ SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ SMS_Lm13_Vnuopc.f10_f10_mg37.F2000climo.cheyenne_intel.cam-outfrq1m (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-nudging (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.FW1850.cheyenne_intel.cam-reduced_hist3s (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f19_f19.F2000climo.cheyenne_intel.cam-silhs (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f19_f19_mg17.FHIST.cheyenne_intel.cam-outfrq9s_nochem (Overall: DIFF) details:
+ - Confirmed no fields lost; no field data changed except date, datesec, and
+ time (now reflect midpoints in 'a' files); field 'time_bnds' changed to 'time_bounds'
+
+derecho/intel/aux_cam:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 (Overall: PEND) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL) details:
+ - pre-existing failures
+ ERC_D_Ln9_P144x1_Vnuopc.ne16pg3_ne16pg3_mg17.QPC6HIST.derecho_intel.cam-outfrq3s_ttrac_usecase (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.derecho_intel.cam-outfrq3s_cosp (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPMOZ.derecho_intel.cam-outfrq3s (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPX2000.derecho_intel.cam-outfrq3s (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.FADIAB.derecho_intel.cam-terminator (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC5HIST.derecho_intel.cam-outfrq3s_usecase (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.T42_T42_mg17.FDABIP04.derecho_intel.cam-outfrq3s_usecase (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.T42_T42_mg17.FHS94.derecho_intel.cam-outfrq3s_usecase (Overall: DIFF) details:
+ ERI_D_Ln18_Vnuopc.f45_f45_mg37.QPC41850.derecho_intel.cam-co2rmp_usecase (Overall: DIFF) details:
+ ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vnuopc.f09_f09_mg17.QSC6.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ld3_Vnuopc.f09_f09_mg17.FWHIST.derecho_intel.cam-reduced_hist1d (Overall: DIFF) details:
+ ERP_Lh12_Vnuopc.f19_f19_mg17.FW4madSD.derecho_intel.cam-outfrq3h (Overall: DIFF) details:
+ ERP_Ln9_P24x3_Vnuopc.f45_f45_mg37.QPWmaC6.derecho_intel.cam-outfrq9s_mee_fluxes (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.derecho_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.derecho_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: DIFF) details:
+ ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.derecho_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details:
+ ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.derecho_intel.cam-outfrq9s_mpasa480 (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FSPCAMS.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.ne0TESTONLYne5x4_ne0TESTONLYne5x4_mg37.FADIAB.derecho_intel.cam-outfrq3s_refined (Overall: DIFF) details:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC5.derecho_intel.cam-scm_prep (Overall: DIFF) details:
+ SMS_D_Ld2_Vnuopc.f19_f19_mg17.QPC5HIST.derecho_intel.cam-volc_usecase (Overall: DIFF) details:
+ SMS_D_Ld5_Vnuopc.f19_f19_mg17.PC4.derecho_intel.cam-cam4_port5d (Overall: DIFF) details:
+ SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCts2nudged.derecho_intel.cam-outfrq9s_leapday (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCvbsxHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.derecho_intel.cam-outfrq9s_amie (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC2000climo.derecho_intel.cam-outfrq3s_usecase (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC5M7.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.QPX2000.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P1280x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P1280x1.ne30pg3_ne30pg3_mg17.FCLTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.T42_T42.FSCAM.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.f09_f09_mg17.FW2000climo.derecho_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.derecho_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.derecho_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld5_Vnuopc.f09_f09_mg17.PC6.derecho_intel.cam-cam6_port_f09 (Overall: DIFF) details:
+ SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq3h (Overall: DIFF) details:
+ SMS_Lm13_Vnuopc.f10_f10_mg37.F2000climo.derecho_intel.cam-outfrq1m (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.F2010climo.derecho_intel.cam-nudging (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.FW1850.derecho_intel.cam-reduced_hist3s (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f19_f19.F2000climo.derecho_intel.cam-silhs (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f19_f19_mg17.FHIST.derecho_intel.cam-outfrq9s_nochem (Overall: DIFF) details:
+ - Confirmed no fields lost; no field data changed except date, datesec, and
+ time (now reflect midpoints in 'a' files); field 'time_bnds' changed to 'time_bounds'
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - preexisting failure
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-carma_sea_salt (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_cosp (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_subcol (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am (Overall: DIFF)details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_convmic (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QSPCAMS.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.mpasa480z32_mpasa480.FHS94.izumi_nag.cam-outfrq3s_usecase (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.ne16pg3_ne16pg3_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-outfrq3s_ttrac (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.T5_T5_mg37.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: DIFF) details:
+ ERI_D_Ln18_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac (Overall: DIFF) details:
+ ERI_D_Ln18_Vnuopc.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 (Overall: DIFF) details:
+ ERI_D_Ln18_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s_bwic (Overall: DIFF) details:
+ ERI_D_Ln18_Vnuopc.ne5pg3_ne5pg3_mg37.FADIAB.izumi_nag.cam-outfrq3s_bwic (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: DIFF) details:
+ ERS_Ln27_Vnuopc.ne5pg3_ne5pg3_mg37.FKESSLER.izumi_nag.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq9s (Overall: DIFF) details:
+ PEM_D_Ln9_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: DIFF) details:
+ SMS_D_Ld2_Vnuopc.f45_f45_mg37.PC5.izumi_nag.cam-outfrq24h_port (Overall: DIFF) details:
+ SMS_D_Ln3_Vnuopc.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ SMS_D_Ln6_Vnuopc.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem (Overall: DIFF) details:
+ SMS_D_Ln7_Vnuopc.T42_T42_mg17.QPSCAMC5.izumi_nag.cam-scmarm (Overall: DIFF) details:
+ SMS_D_Ln9_P1x1_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-rad_diag_mam (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_ba (Overall: DIFF) details:
+ SMS_P48x1_D_Ln3_Vnuopc.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase (Overall: DIFF) details:
+ SUB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ TMC_D_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac (Overall: DIFF) details:
+ TMC_D_Vnuopc.T5_T5_mg37.QPC5.izumi_nag.cam-ghgrmp_e8 (Overall: DIFF) details:
+ - Confirmed no fields lost; no field data changed except date, datesec, and
+ time (now reflect midpoints in 'a' files); field 'time_bnds' changed to 'time_bounds'
+
+izumi/gnu/aux_cam:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.FADIAB.izumi_gnu.cam-terminator (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC4.izumi_gnu.cam-outfrq3s_diags (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_gnu.cam-outfrq3s_unicon (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_gnu.cam-rad_diag (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPSPCAMM.izumi_gnu.cam-outfrq3s (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC4.izumi_gnu.cam-outfrq3s_nudging_ne5_L26 (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq3s_ba (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.ne5pg2_ne5pg2_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.ne5pg4_ne5pg4_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.T5_T5_mg37.QPC3.izumi_gnu.cam-outfrq3s_usecase (Overall: DIFF) details:
+ ERI_D_Ln18_Vnuopc.T5_T5_mg37.QPC4.izumi_gnu.cam-co2rmp (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne5_ne5_mg37.FHS94.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ PEM_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal0 (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal1 (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal3 (Overall: DIFF) details:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC4.izumi_gnu.cam-scm_prep (Overall: DIFF) details:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC6.izumi_gnu.cam-scm_prep_c6 (Overall: DIFF) details:
+ SMS_D_Ln3_Vnuopc.f10_f10_mg37.QPMOZ.izumi_gnu.cam-outfrq3s_chemproc (Overall: DIFF) details:
+ SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC4.izumi_gnu.cam-outfrq9s_apmee (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-outfrq3s_ttrac (Overall: DIFF) details:
+ SMS_P48x1_D_Ln9_Vnuopc.f19_f19_mg17.FW4madSD.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ - Confirmed no fields lost; no field data changed except date, datesec, and
+ time (now reflect midpoints in 'a' files); field 'time_bnds' changed to 'time_bounds'
+
+Summarize any changes to answers: No answer changes except midpoint time,
+date, datesec for accumulated files
+
+===============================================================
+
+Tag name: cam6_3_139
+Originator(s): fvitt, tilmes
+Date: 1 Dec 2023
+One-line Summary: Aircraft emissions and derecho PE layouts
+Github PR URL: https://github.com/ESCOMP/CAM/pull/925
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+ Include aircraft emissions for LT and MT compsets (issue #852).
+
+ Provide functional PE layouts for CAMChem and WACCM on ne30 SE grid
+ which fixes failing regression test in issue #917.
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: cacraigucar nusbaume adamrher
+
+List all files eliminated:
+D cime_config/testdefs/testmods_dirs/cam/outfrq9s_wcm_ne30/shell_commands
+D cime_config/testdefs/testmods_dirs/cam/outfrq9s_wcm_ne30/user_nl_cam
+D cime_config/testdefs/testmods_dirs/cam/outfrq9s_wcm_ne30/user_nl_clm
+D cime_config/testdefs/testmods_dirs/cam/outfrq9s_wcm_ne30/user_nl_cpl
+ - no longer needed
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+M bld/build-namelist
+ - set default aircraft emissions for ghg_mam chemistry
+
+M bld/namelist_files/namelist_defaults_cam.xml
+ - default ne30pg3 aircraft emissions
+
+M bld/namelist_files/use_cases/sd_waccm_tsmlt_cam6.xml
+ - fix fincl list
+
+M bld/namelist_files/use_cases/waccm_ma_2000_cam6.xml
+ - remove ne30pg IC from use case (not stable)
+
+M cime_config/config_pes.xml
+ - default PE layouts for:
+ . WACCM and CAMChem on ne30 grid
+ . WACCM(X) and CAMChem on f19 grid
+
+M cime_config/testdefs/testlist_cam.xml
+ - adjust tests for waccm on ne30 grids
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 (Overall: PEND) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s (Overall: FAIL) details:
+ - pre-existing failures
+
+ ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: NLFAIL) details:
+ SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P1280x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ - expected baseline test failures due to aircraft emissions
+
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ - new passing test
+
+derecho/intel/aux_cam:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 (Overall: PEND) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL) details:
+ - pre-existing failures
+
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPX2000.derecho_intel.cam-outfrq3s (Overall: NLFAIL) details:
+ ERP_Lh12_Vnuopc.f19_f19_mg17.FW4madSD.derecho_intel.cam-outfrq3h (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.derecho_intel.cam-outfrq9s_amie (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC2000climo.derecho_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.derecho_intel.cam-outfrq1d (Overall: NLFAIL) details:
+ - new derecho PE layouts
+
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.derecho_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: NLFAIL) details:
+ ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P1280x1.ne30pg3_ne30pg3_mg17.FCLTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ - expected baseline test failures due to aircraft emissions
+
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ - new passing test
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - pre-existing failure
+
+izumi/gnu/aux_cam: All PASS
+
+Summarize any changes to answers: larger than roundoff but same climate
+
+If this tag changes climate describe the run(s) done to evaluate the new
+climate in enough detail that it(they) could be reproduced, i.e.,
+- source tag (all code used must be in the repository): cam6_3_132
+- platform/compilers: derecho / intel
+- configure commandline: ./create_newcase --compset FMTHIST --res ne30pg3_ne30pg3_mg17
+- build-namelist command (or complete namelist):
+ case :
+ /glade/p/cesmdata/cseg/runs/cesm2_0/f.cam6_3_132.FMTHIST_ne30.aircraft
+- location of output:
+ /glade/derecho/scratch/tilmes/archive/f.cam6_3_132.FMTHIST_ne30.aircraft/atm/hist
+
+URL for AMWG diagnostics output used to validate new climate:
+https://webext.cgd.ucar.edu/FMTHIST/f.cam6_3_132.FMTHIST_ne30.aircraft/atm/f.cam6_3_132.FMTHIST_ne30.aircraft_1995_2006_vs_f.cam6_3_132.FMTHIST_ne30.001_1995_2006/
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_138
+Originator(s): fvitt, skamaroc
+Date: 1 Dec 2023
+One-line Summary: Frontogenesis gravity waves with MPAS dynamical core
+Github PR URL: https://github.com/ESCOMP/CAM/pull/688
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+ Add the capability to generate frontal gravity wave forcings when the MPAS dynamical core
+ is used. See github issue #400.
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: cacraigucar brian-eaton jtruesdal nusbaume
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+M bld/namelist_files/namelist_defaults_cam.xml
+ - default namelist settings for waccm on mpasa120 grid
+
+M cime_config/config_pes.xml
+ - working cheyenne and derecho PE layouts for waccm on mpasa120 grid
+
+M cime_config/testdefs/testlist_cam.xml
+ - tests for waccm-sc on mpasa120 grid
+
+M cime_config/testdefs/testmods_dirs/cam/outfrq1d_physgrid_tem_mpasa120_wcmsc/user_nl_cam
+ - mpas namelist setting moved to namelist_defaults_cam.xml
+
+M src/dynamics/mpas/dp_coupling.F90
+ - implement function for front generated gravity wave forcings
+ - code cleanup
+
+M src/dynamics/mpas/driver/cam_mpas_subdriver.F90
+ - add MPAS stream fields for cell gradient coeffecients
+ - code cleanup
+
+M src/dynamics/mpas/dyn_comp.F90
+ - set dyn_out pointers for frontogenesis calculations
+ - code cleanup
+
+M src/dynamics/mpas/dyn_grid.F90
+ - minor code cleanup
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 MODEL_BUILD time=2
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s COMPARE_base_rest
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_137: DIFF
+ - pre-existing failures
+
+derecho/intel/aux_cam:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 (Overall: PEND) details:
+ PEND ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 SHAREDLIB_BUILD RERUN
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s COMPARE_base_rest
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_wcm_ne30 (Overall: PEND) details:
+ PEND ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_wcm_ne30 RUN
+ PEND ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_wcm_ne30 COMPARE_base_rest
+ - pre-existing failures
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ FAIL DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae RUN time=10
+ PEND DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae COMPARE_base_da
+ - pre-existing failure
+
+izumi/gnu/aux_cam: All PASS
+
+Summarize any changes to answers: bit-for-bit unchanged
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_137
+Originator(s): gdicker
+Date: Nov 29, 2023
+One-line Summary: Update MPAS-A within CAM to v8.0
+Github PR URL: https://https://github.com/ESCOMP/CAM/pull/908
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+ - Update MPAS-A within CAM to v8.0.1: https://github.com/ESCOMP/CAM/issues/861
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist:
+ - Added new namelist variable mpas_cam_damping_levels. Determines how many layers from
+ model top to apply CAM-SE-like horizontal diffusion in MPAS.
+
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: cacraigucar, jtruesdal, PeterHjortLauritzen
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+M Externals_CAM.cfg
+ - Update mpas hash to point a few commits after MPAS-Dev/MPAS-Model 'v8.0.1' tag
+
+M src/dynamics/mpas/Makefile
+ - Add MPAS_PIO_SUPPORT to CPPFLAGS to ensure PIO is used instead of the new SMIOL
+ - Rename diagnostics with "mpas_" prefix that was added
+ - Add mpas_string_utils, mpas_halo, mpas_atm_halos modules
+
+M bld/build-namelist
+M bld/namelist_files/namelist_defaults_cam.xml
+M bld/namelist_files/namelist_definition.xml
+ - Add mpas_cam_damping_levels namelist argument and update mpas_cam_coef
+ description
+
+M src/dynamics/mpas/driver/cam_mpas_subdriver.F90
+ - Update arguments for {postread,prewrite}_reindex subroutines
+ - Add calls to create/destroy mpas halo_groups during init and finalize
+ - Modify some halo exchange calls to use exchange_halo_group routine pointer
+
+M src/dynamics/mpas/dyn_comp.F90
+ - Add config_halo_exch_method to configs pool with default value 'mpas_halo'
+ - Add mpas_cam_damping_levels namelist argument
+
+M cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa480/user_nl_cam
+ - Modify F2000climo test using mpasa480_mpasa480 to test the mpas_cam damping
+
+M test/system/archive_baseline.sh
+ - Modify baselinedir path for derecho to point to /glade/campaign location
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 (Overall: PEND) details:
+ PEND ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 MODEL_BUILD RERUN
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s COMPARE_base_rest
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_133: DIFF
+ - pre-existing failures
+
+ ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 (Overall: NLFAIL) details:
+ FAIL ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 NLCOMP
+ found extra variable: 'mpas_cam_damping_levels'
+ - expected failure, added mpas_cam_damping_levels to namelist
+
+ ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 (Overall: DIFF) details:
+ FAIL ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 NLCOMP
+ found extra variable: 'mpas_cam_damping_levels'
+ FAIL ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 BASELINE /glade/ p/cesm/amwg/cesm_baselines/cam6_3_136: DIFF
+ - expected failure, added mpas_cam_damping_levels to namelist and modified test via outfrq9s_mpasa480/user_nl_cam
+
+derecho/intel/aux_cam:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 (Overall: PEND) details:
+ PEND ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 SHAREDLIB_BUILD RERUN
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/derecho_baselines/cam6_3_136: DIFF
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_wcm_ne30 (Overall: PEND) details:
+ PEND ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_wcm_ne30 RUN
+ PEND ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_wcm_ne30 COMPARE_base_rest
+ SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq3h (Overall: DIFF) details:
+ FAIL SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq3h BASELINE /glade/p/cesm/amwg/derecho_baselines/cam6_3_136: DIFF
+ - pre-existing failures
+
+ ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.derecho_intel.cam-outfrq9s_mpasa120 (Overall: NLFAIL) details:
+ FAIL ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.derecho_intel.cam-outfrq9s_mpasa120 NLCOMP
+ found extra variable: 'mpas_cam_damping_levels'
+ - expected failure, added mpas_cam_damping_levels to namelist
+
+ ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.derecho_intel.cam-outfrq9s_mpasa480 (Overall: DIFF) details:
+ FAIL ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.derecho_intel.cam-outfrq9s_mpasa480 NLCOMP
+ found extra variable: 'mpas_cam_damping_levels'
+ FAIL ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.derecho_intel.cam-outfrq9s_mpasa480 BASELINE /glade/p/cesm/amwg/derecho_baselines/cam6_3_136: DIFF
+ - expected failure, added mpas_cam_damping_levels to namelist and modified to use mpas_cam damping
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ FAIL DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae RUN time=10
+ - pre-existing failure
+
+ ERC_D_Ln9_Vnuopc.mpasa480z32_mpasa480.FHS94.izumi_nag.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ FAIL ERC_D_Ln9_Vnuopc.mpasa480z32_mpasa480.FHS94.izumi_nag.cam-outfrq3s_usecase NLCOMP
+ found extra variable: 'mpas_cam_damping_levels'
+ - expected failure, added mpas_cam_damping_levels to namelist
+
+izumi/gnu/aux_cam: All PASS
+
+Summarize any changes to answers: bit-for-bit unchanged
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_136
+Originator(s): cacraig, fischer
+Date: Nov 18, 2023
+One-line Summary: Update externals to match cesm2_3_alpha16g and fix failing derecho tests
+Github PR URL: https://github.com/ESCOMP/CAM/pull/914
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+- Fix failing derecho regression tests: https://github.com/ESCOMP/CAM/issues/892
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: nusbaume
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+M Externals.cfg
+ - update Externals to match cesm2_3_alpha16g
+
+M cime_config/SystemTests/tmc.py
+ - Fix from Chris Fischer for failing TMC regression test
+
+M cime_config/config_pes.xml
+ - Update derecho PE layouts
+
+M doc/ChangeLog_template
+ - Add derecho regression testing
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+All tests had namelist changes due to externals update
+
+cheyenne/intel/aux_cam:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 MODEL_BUILD time=3
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s COMPARE_base_rest
+ SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ FAIL SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_135: DIFF
+ - pre-existing failures
+
+ ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ld3_Vnuopc.f09_f09_mg17.FWHIST.cheyenne_intel.cam-reduced_hist1d (Overall: DIFF) details:
+ ERP_Lh12_Vnuopc.f19_f19_mg17.FW4madSD.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: DIFF) details:
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: DIFF) details:
+ ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details:
+ ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FSPCAMS.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCts2nudged.cheyenne_intel.cam-outfrq9s_leapday (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCvbsxHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P1280x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P1280x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.f09_f09_mg17.FW2000climo.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ SMS_Lm13_Vnuopc.f10_f10_mg37.F2000climo.cheyenne_intel.cam-outfrq1m (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-nudging (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.FW1850.cheyenne_intel.cam-reduced_hist3s (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f19_f19.F2000climo.cheyenne_intel.cam-silhs (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f19_f19_mg17.FHIST.cheyenne_intel.cam-outfrq9s_nochem (Overall: DIFF) details:
+ - Differences due to externals updated
+
+derecho/intel/aux_cam: no baseline comparisons due to being first official testing on derecho
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 (Overall: PEND) details:
+ PEND ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 SHAREDLIB_BUILD
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s COMPARE_base_rest
+ - pre-existing failures on cheyenne
+
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_wcm_ne30 (Overall: PEND) details:
+ PEND ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_wcm_ne30 RUN
+ PEND ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_wcm_ne30 COMPARE_base_rest
+ - unknown test failure - repeatable
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ FAIL DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae RUN time=80
+ - pre-existing failure
+
+
+izumi/gnu/aux_cam:
+ SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ SMS_P48x1_D_Ln9_Vnuopc.f19_f19_mg17.FW4madSD.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ - baseline diffs due to externals update
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_135
+Originator(s): jedwards, nusbaume
+Date: 16 Nov 2023
+One-line Summary: removes svn sparse checkout
+Github PR URL: https://github.com/ESCOMP/CAM/pull/913
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+Use git sparse checkout for all repos, combine clubb and silhs into clubb.
+git sparse checkout has been available in manage_externals since version 1.2.1.
+
+Fixes #912 -> cosp2 svn access to github support is ending soon
+
+Describe any changes made to build system:
+
+Build path were modified in the "configure" Perl script, as well
+as in the COSP Makefile.in file, in order to account for the
+new source code paths.
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: nusbaume, cacraigucar, gold2718
+
+List all files eliminated: N/A
+
+List all files added and what they do:
+
+A src/physics/.clubb_sparse_checkout
+ - Provides information on how to do the git sparse checkout of CLUBB and SILHS
+
+A src/physics/cosp2/.cosp_sparse_checkout
+ - Provides information on how to do the git sparse checkout of COSP
+
+List all existing files that have been modified, and describe the changes:
+
+M Externals_CAM.cfg
+ - Change the Github-SVN bridge method to git sparse checkout
+
+M bld/configure
+ - Update source code paths for CLUBB, SILHS, and COSP
+
+M src/physics/cosp2/Makefile.in
+ - Update source code paths for relevant COSP files.
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 MODEL_BUILD time=3
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s COMPARE_base_rest
+ SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ FAIL SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_134: DIFF
+ - pre-existing failure
+
+izumi/nag/aux_cam:
+
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ FAIL DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae RUN time=10
+ - pre-existing failure
+
+izumi/gnu/aux_cam: ALL PASS
+
+Summarize any changes to answers: bit-for-bit unchanged
+
+===============================================================
+
+Tag name: cam6_3_134
+Originator(s): nusbaume, jimmielin
+Date: 31 Oct 2023
+One-line Summary: Update atmospheric_physics external
+Github PR URL: https://github.com/ESCOMP/CAM/pull/891
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+This PR updates the atmospheric_physics external in CAM,
+which requires some source modifications on the CAM-side.
+There has also been some replacement of CAM code with CCPP
+physics routines in order to reduce duplication.
+
+This PR also fixes a bug found in Kessler where it was using
+the wrong pressure when converting to/from potential temperature
+via the exner function.
+
+Finally, this change also brings in a rename of the SE
+dycore's 'time_mod' module to 'se_dyn_time_mod' in order
+to avoid name collision with GEOS-Chem code.
+
+Fixes #752 -> Update atmospheric_physics external
+Fixes #802 -> Kessler physics using inconsistent reference pressures
+
+Closes #904 -> Rename SE dycore time_mod to dyn_time_mod (PR)
+
+Describe any changes made to build system:
+
+Added the "src/utils/cam_ccpp" and "src/atmos_phys/utilities" directory
+to the list of directories used during compilation.
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: cacraigucar, PeterHjortLauritzen, jtruesdal, peverwhee
+
+List all files eliminated:
+
+R src/dynamics/se/dycore/time_mod.F90
+ - Renamed to 'se_dyn_time_mod'
+R src/utils/ccpp_kinds.F90
+ - Moved to 'src/utils/cam_ccpp/ccpp_kinds.F90'
+
+List all files added and what they do:
+
+A src/utils/cam_ccpp/ccpp_constituent_prop_mod.F90
+ - Creates a "CCPP Constituent Properties" object for CAM.
+
+List all existing files that have been modified, and describe the changes:
+
+M Externals_CAM.cfg
+ - Update 'atmospheric_physics' external
+
+M bld/configure
+ - Add 'src/utils/cam_ccpp' and 'src/atmos_phys/utilities' to build file paths
+
+M src/dynamics/se/dp_coupling.F90
+ - Use CCPP-ized 'update_dry_static_energy_run' subroutine
+
+M src/physics/cam/geopotential.F90
+ - Use CCPP-ized 'geopotential_temp_run' subroutine
+
+M src/physics/cam/ref_pres.F90
+ - Update comment in order to avoid future confusion
+
+M src/physics/cam/physpkg.F90
+M src/physics/cam_dev/physpkg.F90
+M src/physics/simple/held_suarez_cam.F90
+M src/physics/simple/physpkg.F90
+ - Update physics calls and add new const. prop. DDT to work with new
+ atmospheric_physics external
+
+M src/physics/simple/kessler_cam.F90
+- Update physics calls and add new const. prop. DDT to work with new
+ atmospheric_physics external. Also replace use of "standard pressure"
+ with "reference pressure" in order to avoid unphysical mismatches.
+
+M src/dynamics/se/dycore/fvm_consistent_se_cslam.F90
+M src/dynamics/se/dycore/prim_advance_mod.F90
+M src/dynamics/se/dycore/prim_advection_mod.F90
+M src/dynamics/se/dycore/prim_driver_mod.F90
+M src/dynamics/se/dycore/prim_init.F90
+M src/dynamics/se/dycore/prim_state_mod.F90
+M src/dynamics/se/stepon.F90
+ - Replace 'time_mod' with 'se_dyn_time_mod'
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+
+ All tests have NLCOMP failures due to changes in input data paths on Cheyenne.
+
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 NLCOMP
+ FAIL ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 MODEL_BUILD time=3
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s COMPARE_base_rest
+ SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ FAIL SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h NLCOMP
+ FAIL SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_133: DIFF
+ - pre-existing failure
+
+izumi/nag/aux_cam:
+
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ FAIL DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae RUN time=9
+ - pre-existing failure
+
+ ERS_Ln27_Vnuopc.ne5pg3_ne5pg3_mg37.FKESSLER.izumi_nag.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERS_Ln27_Vnuopc.ne5pg3_ne5pg3_mg37.FKESSLER.izumi_nag.cam-outfrq9s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_133_nag: DIFF
+ - expected failure
+
+izumi/gnu/aux_cam: All PASS
+
+Summarize any changes to answers:
+ All compsets which use Kessler idealized physics
+ will have larger-than-roundoff answer changes due
+ to reference pressure bug fix.
+
+===============================================================
+
+Tag name: cam6_3_133
+Originator(s): fvitt
+Date: 19 Oct 2023
+One-line Summary: Misc updates for WACCM-X
+Github PR URL: https://github.com/ESCOMP/CAM/pull/897
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+ Introduce a hybrid PGF option in the SE dycore for WACCM-x to be consistent
+ with PGF used in CAM in the troposphere and traditional PGF formulation above
+ to solve stability issues with the SE dycore (issue #896)
+
+ Correction to geometric height diagnostic (issue #681)
+
+ Implements PHIHM history field for waccmx -- High Latitude Electric Potential
+
+ Set reasonable default PE layouts for WACCM(x) and CAMChem on derecho. This
+ solves some of the regression test failures on derecho listed in issue #892
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/a
+
+Code reviewed by: PeterHjortLauritzen cacraigucar nusbaume
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+
+M bld/namelist_files/namelist_defaults_cam.xml
+ - default IC for ne30pg3 L130 waccmx
+
+M bld/namelist_files/namelist_definition.xml
+ - add hybrid option for PGF formulation used by waccmx
+
+M cime_config/config_pes.xml
+ - default derecho PE layouts for
+ ne16, ne30 waccmx
+ f09 waccmx, waccm, and camchem
+
+M src/control/cam_history.F90
+ - deallocate arrays at the end of write_restart_history
+
+M src/dynamics/se/dycore/global_norms_mod.F90
+ - for waccmx set umax to 800 m/s used in stability assessment
+
+M src/dynamics/se/dycore/prim_advance_mod.F90
+ - add hybrid option for PGF formulation used by waccmx
+
+M src/ionosphere/waccmx/edyn_init.F90
+M src/ionosphere/waccmx/edynamo.F90
+ - add PHIHM history field diagnostic
+
+M src/ionosphere/waccmx/ionosphere_interface.F90
+ - correction to Z3GM geometric height diagnostic
+ - replace "/gravit" with "*rga" in height calc
+
+M src/physics/cam/vertical_diffusion.F90
+ - raise the lid of eddy diffusion for waccmx (ntop_eddy_pres=1.e-7 Pa)
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 MODEL_BUILD time=3
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s COMPARE_base_rest
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_132: DIFF
+ SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ FAIL SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_132: DIFF
+ - pre-existing failure
+
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPX2000.cheyenne_intel.cam-outfrq3s (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPX2000.cheyenne_intel.cam-outfrq3s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_132: DIFF
+ ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_132: DIFF
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_132: DIFF
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_132: DIFF
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_132: DIFF
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.QPX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.QPX2000.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.QPX2000.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_132: DIFF
+ - expected failures
+
+izumi/nag/aux_cam:
+
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ FAIL DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae RUN time=205
+ - pre-existing failure
+
+ SMS_D_Ln3_Vnuopc.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ FAIL SMS_D_Ln3_Vnuopc.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s NLCOMP
+ FAIL SMS_D_Ln3_Vnuopc.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_132_nag: DIFF
+ - expected failure
+
+izumi/gnu/aux_cam: All PASS
+
+Summarize any changes to answers:
+ larger than roundoff for SE WACCMX, roundoff for FV WACCMX,
+ otherwise bit-for-bit unchanged
+
+===============================================================
+===============================================================
+
+Tag name:cam6_3_132
+Originator(s): cacraig, adamher, Thomas Toniazzo, hannay
+Date: Oct 18, 2023
+One-line Summary: Bring in changes to match run 51
+Github PR URL: https://github.com/ESCOMP/CAM/pull/900
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+ - Update cam_development to match current tuning runs: https://github.com/ESCOMP/CAM/issues/895
+ - Discussion also occurred at: https://github.com/NCAR/amwg_dev/discussions/412
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist:
+ - When running cam_dev, change the values for:
+ micro_mg_dcs
+ clubb_gamma_coef
+ clubb_gamma_coefb
+ microp_aero_wsub_scale
+ microp_aero_wsubi_scale
+ microp_aero_wsub_min
+ micro_mg_vtrmi_factor
+
+ - New namelists implemented:
+ microp_aero_wsub_min_asf: min subgrid vertical velocity (after scale factor) See namelist definition for full description
+ cldfrc2m_do_avg_aist_algs: for small ice cloud concentrations, take the geometric mean of the iceopt=4 and 5 area fractions
+ cldfrc2m_qist_min: min in-stratus ice IWC constraint
+ cldfrc2m_qist_max: max in-stratus ice IWC constraint
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: nusbaume, pel, adamrher
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+M bld/build-namelist
+M bld/namelist_files/namelist_defaults_cam.xml
+M src/physics/cam/cldfrc2m.F90
+M src/physics/cam/microp_aero.F90
+M src/physics/cam/ndrop.F90
+M src/physics/spcam/crmclouds_camaerosols.F90
+ - Change namelist as discussed in the issue/PR and group discussion
+
+M bld/namelist_files/namelist_definition.xml
+ - Update descriptions and add new ones
+
+M cime_config/testdefs/testlist_cam.xml
+ - Change a few tests to have them work on derecho
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 (Overall: PEND) details:
+ PEND ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 MODEL_BUILD RERUN
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s COMPARE_base_rest
+ SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ - pre-existing failure
+
+ ERC_D_Ln9_P144x1_Vnuopc.ne16pg3_ne16pg3_mg17.QPC6HIST.cheyenne_intel.cam-outfrq3s_ttrac_usecase (Overall: DIFF) details:
+ ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: DIFF) details:
+ SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P1280x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P1280x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ - expected baseline differences due to removal of cam6 tuning factor for SE dy
+
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ - expected baseline differences for cam_dev runs
+
+ SMS_D_Ln9_Vnuopc_P1280x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P1280x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ -Changed layout and hence the testname, so no baselines to compare with
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL)
+ - pre-existing failure
+
+ ERP_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: DIFF) details:
+ - expected baseline differences due to removal of cam6 tuning factor for SE dy
+
+izumi/gnu/aux_cam:
+ SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ - expected baseline differences for cam_dev runs
+
+NOTE: Most tests have namelist changes
+
+CAM tag used for the baseline comparison tests if different than previous
+tag: N/A
+
+Summarize any changes to answers, i.e.,
+- what code configurations: All cam_dev and SE cam6
+- what platforms/compilers: All
+- nature of change (roundoff; larger than roundoff but same climate; new
+ climate): Tuning changes - Climate changing for cam_dev
+
+If this tag changes climate describe the run(s) done to evaluate the new
+climate in enough detail that it(they) could be reproduced, i.e.,
+ - Run which was the prelimiary source of the changes: https://github.com/NCAR/amwg_dev/tree/b.e23_alpha16b.BLT1850.ne30_t232.051
+ - It is important to note that further changes were made to this tag as discussed in the issue/PR and discussion - Adam ran a test
+ to verify the final changes.
+
+===============================================================
+
+Tag name: cam6_3_131
+Originator(s): cacraig
+Date: Oct 17, 2023
+One-line Summary: Update externals to get job_priority setting on derecho
+Github PR URL: https://github.com/ESCOMP/CAM/pull/906
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+ - Update externals for job_priority and other derecho enhancements: https://github.com/ESCOMP/CAM/issues/905
+ NOTE -- This change brings in an updated CMEPS which is answer changing (see https://github.com/ESCOMP/CMEPS/pull/394)
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: nusbaume (and Adam and Cecile gave their approval for this to proceed)
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+M Externals.cfg
+ - Update the externals
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 MODEL_BUILD time=2
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s COMPARE_base_rest
+ SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ - pre-existing failure
+
+ ERC_D_Ln9_P144x1_Vnuopc.ne16pg3_ne16pg3_mg17.QPC6HIST.cheyenne_intel.cam-outfrq3s_ttrac_usecase (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq3s_cosp (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPMOZ.cheyenne_intel.cam-outfrq3s (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPX2000.cheyenne_intel.cam-outfrq3s (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC5HIST.cheyenne_intel.cam-outfrq3s_usecase (Overall: DIFF) details:
+ ERI_D_Ln18_Vnuopc.f45_f45_mg37.QPC41850.cheyenne_intel.cam-co2rmp_usecase (Overall: DIFF) details:
+ ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vnuopc.f09_f09_mg17.QSC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ld3_Vnuopc.f09_f09_mg17.FWHIST.cheyenne_intel.cam-reduced_hist1d (Overall: DIFF) details:
+ ERP_Lh12_Vnuopc.f19_f19_mg17.FW4madSD.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ ERP_Ln9_P24x3_Vnuopc.f45_f45_mg37.QPWmaC6.cheyenne_intel.cam-outfrq9s_mee_fluxes (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: DIFF) details:
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: DIFF) details:
+ ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details:
+ ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FSPCAMS.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC5.cheyenne_intel.cam-scm_prep (Overall: DIFF) details:
+ SMS_D_Ld2_Vnuopc.f19_f19_mg17.QPC5HIST.cheyenne_intel.cam-volc_usecase (Overall: DIFF) details:
+ SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCts2nudged.cheyenne_intel.cam-outfrq9s_leapday (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCvbsxHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC2000climo.cheyenne_intel.cam-outfrq3s_usecase (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC5M7.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.QPX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.f09_f09_mg17.FW2000climo.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Lm13_Vnuopc.f10_f10_mg37.F2000climo.cheyenne_intel.cam-outfrq1m (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-nudging (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.FW1850.cheyenne_intel.cam-reduced_hist3s (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f19_f19.F2000climo.cheyenne_intel.cam-silhs (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f19_f19_mg17.FHIST.cheyenne_intel.cam-outfrq9s_nochem (Overall: DIFF) details:
+ - answer changes due to CMEPS update
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ FAIL DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae RUN time=188
+ PEND DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae COMPARE_base_da
+ - pre-existing failure
+
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-carma_sea_salt (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_cosp (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_subcol (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_convmic (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QSPCAMS.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.ne16pg3_ne16pg3_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-outfrq3s_ttrac (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.T5_T5_mg37.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: DIFF) details:
+ ERI_D_Ln18_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac (Overall: DIFF) details:
+ ERI_D_Ln18_Vnuopc.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: DIFF) details:
+ SMS_D_Ln3_Vnuopc.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ SMS_D_Ln6_Vnuopc.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem (Overall: DIFF) details:
+ SMS_D_Ln7_Vnuopc.T42_T42_mg17.QPSCAMC5.izumi_nag.cam-scmarm (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-rad_diag_mam (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_ba (Overall: DIFF) details:
+ SMS_P48x1_D_Ln3_Vnuopc.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase (Overall: DIFF) details:
+ SUB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ TMC_D_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac (Overall: DIFF) details:
+ TMC_D_Vnuopc.T5_T5_mg37.QPC5.izumi_nag.cam-ghgrmp_e8 (Overall: DIFF) details:
+ - answer changes due to CMEPS update
+
+izumi/gnu/aux_cam:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC4.izumi_gnu.cam-outfrq3s_diags (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_gnu.cam-outfrq3s_unicon (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_gnu.cam-rad_diag (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPSPCAMM.izumi_gnu.cam-outfrq3s (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC4.izumi_gnu.cam-outfrq3s_nudging_ne5_L26 (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq3s_ba (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.T5_T5_mg37.QPC3.izumi_gnu.cam-outfrq3s_usecase (Overall: DIFF) details:
+ ERI_D_Ln18_Vnuopc.T5_T5_mg37.QPC4.izumi_gnu.cam-co2rmp (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal0 (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal1 (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal3 (Overall: DIFF) details:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC4.izumi_gnu.cam-scm_prep (Overall: DIFF) details:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC6.izumi_gnu.cam-scm_prep_c6 (Overall: DIFF) details:
+ SMS_D_Ln3_Vnuopc.f10_f10_mg37.QPMOZ.izumi_gnu.cam-outfrq3s_chemproc (Overall: DIFF) details:
+ SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s (Overall:
+DIFF) details:
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC4.izumi_gnu.cam-outfrq9s_apmee (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-outfrq3s_ttrac (Overall: DIFF) details:
+ SMS_P48x1_D_Ln9_Vnuopc.f19_f19_mg17.FW4madSD.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ - answer changes due to CMEPS update
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_130
+Originator(s): pel, jet, cacraig
+Date: Oct 06, 2023
+One-line Summary: WACCMX-FV bug fix (correct calling sequenc of wet/dry species conversion), Derecho archive update
+Github PR URL: https://github.com/ESCOMP/CAM/pull/887
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+ This tag closes the following issues:
+ - Add Derecho support for archiving baselines (https://github.com/ESCOMP/CAM/issue/893)
+ - bug fix: correct timing of wet/dry mixing ratio conversion (https://github.com/ESCOMP/CAM/issues/885)
+ - bug fix: correct se_sponge_del4_nu_div_fac and se_sponge_del4_lev NL type definitions (https://github.com/ESCOMP/CAM/issues/690)
+
+Describe any changes made to build system:
+ Added Derecho support for archiving baselines
+
+Describe any changes made to the namelist:
+ Corrected namelist type definitions for se_sponge_del4_nu_div_fac and se_sponge_del4_lev
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: cacraig, nusbaume, pel
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+
+M bld/namelist_files/namelist_definition.xml
+ - correct namelist type definitions for se_sponge_del4_nu_div_fac and se_sponge_del4_lev
+
+M src/dynamics/fv/dp_coupling.F90
+ - correct calling sequence for wet/dry constituent conversion
+
+M test/system/archive_baseline.sh
+ - Update to archive Derecho baselines
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam: All BFB except
+ FAIL ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 MODEL_BUILD time=2
+ - pre-existing failure
+
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s COMPARE_base_rest
+ FAIL SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h (Overall: DIFF)
+ - pre-existing failure
+
+ FAIL ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPX2000.cheyenne_intel.cam-outfrq3s (Overall: DIFF)
+ FAIL ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ FAIL ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ FAIL SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie (Overall: DIFF)
+ - expected failures: WACCMX differences from correcting calling sequence for wet/dry mixing ratio conversion
+
+izumi/nag/aux_cam: All BFB except
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL)
+ - pre-existing failure
+
+izumi/gnu/aux_cam: All BFB
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_129
+Originator(s): cacraig, fischer, hplin, jet, jedwards
+Date: Oct 04, 2023
+One-line Summary: Update externals to match cesm2_3_alpha16d and bring in test_driver which supports derecho
+Github PR URL: https://github.com/ESCOMP/CAM/pull/888
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+ - Add derecho support to test_driver (https://github.com/ESCOMP/CAM/pull/879)
+ - Fix long line in HEMCO external (https://github.com/ESCOMP/CAM/issues/871)
+ - Fix building older FMS library (no issue as was discovered during testing, but discussion is in PR#888)
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: nusbaume, jet, fvitt
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+
+M Externals.cfg
+ - update externals to match cesm2_3_alpha16d (ccs_config external is one tag newer)
+
+M Externals_CAM.cfg
+ - update HEMCO tag to get fix for line too long
+
+M cime_config/buildlib
+ - Updates for building older FMS library (required with changes in external). NOTE - The regression test
+ which tests FV3 (C96_C96_mg17) is broken. It was verified that the actual test works, but the regression test
+ no longer compiles properly due to changes in the SHARED_LIB build process.
+
+M test/system/test_driver.sh
+ - add derecho functionality (uses cheyenne aux_cam hooks to determine tests to run)
+ It is important to note that there are a number of failures when the tests are run on derecho (see
+ github issue https://github.com/ESCOMP/CAM/issues/892 for details)
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ FAIL ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 MODEL_BUILD time=2
+ - Failure of FMS library compilation when more than one regression test is made due to changes in SHAREDLIB_BUILD
+ Was approved at AMP SE/scientist meeting to have this test fail until the upcoming FV3 PR is brought in
+
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s COMPARE_base_rest
+ FAIL SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ - pre-existing failure
+
+ ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ld3_Vnuopc.f09_f09_mg17.FWHIST.cheyenne_intel.cam-reduced_hist1d (Overall: DIFF) details:
+ ERP_Lh12_Vnuopc.f19_f19_mg17.FW4madSD.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: DIFF) details:
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: DIFF) details:
+ ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details:
+ ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FSPCAMS.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCts2nudged.cheyenne_intel.cam-outfrq9s_leapday (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCvbsxHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.T42_T42.FSCAM.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.f09_f09_mg17.FW2000climo.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Lm13_Vnuopc.f10_f10_mg37.F2000climo.cheyenne_intel.cam-outfrq1m (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f19_f19_mg17.FHIST.cheyenne_intel.cam-outfrq9s_nochem (Overall: DIFF) details:
+ - answer changes due to updated externals
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - pre-existing failure
+
+izumi/gnu/aux_cam:
+ FAIL SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_128_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL SMS_P48x1_D_Ln9_Vnuopc.f19_f19_mg17.FW4madSD.izumi_gnu.cam-outfrq9s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_128_gnu: DIFF
+ - answer changes due to updated externals
+
+All tests had namelist changes as well
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_128
+Originator(s): fvitt
+Date: 13 Sep 2023
+One-line Summary: Enable use of CARMA aerosol packages with unstructured grids
+Github PR URL: https://github.com/ESCOMP/CAM/pull/650
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+Address issues:
+ Need capability to run existing CARMA models on unstructured grids #649
+ refractive_aerosol_optics_mod.F90 is missing an r8 qualifier #882
+
+Describe any changes made to build system: n/a
+
+Describe any changes made to the namelist: n/a
+
+List any changes to the defaults for the boundary datasets: n/a
+
+Describe any substantial timing or memory changes: n/a
+
+Code reviewed by: cacraigucar nusbaume
+
+List all files eliminated: n/a
+
+List all files added and what they do: n/a
+
+List all existing files that have been modified, and describe the changes:
+M Externals_CAM.cfg
+ - update CARMA base tag carma4_01
+
+M bld/namelist_files/namelist_defaults_cam.xml
+ - default IC file for QPWmaC6 on ne5 grid
+
+M cime_config/testdefs/testlist_cam.xml
+ - new tests carma models, mostly for coarse SE grids
+
+M cime_config/testdefs/testmods_dirs/cam/carma_dust/user_nl_cam
+ - include CRSLERFC in h1 output
+
+M cime_config/testdefs/testmods_dirs/cam/carma_meteor_impact/user_nl_cam
+ - set wide impact zone for coarse grid testing
+
+M cime_config/testdefs/testmods_dirs/cam/carma_mixed_sulfate/user_nl_cam
+M cime_config/testdefs/testmods_dirs/cam/carma_sulfate/user_nl_cam
+ - increase carma_maxretries
+ - specified UBCs
+
+M src/chemistry/aerosol/refractive_aerosol_optics_mod.F90
+ - include "_r8" kind in limit constant
+
+M src/physics/carma/cam/carma_constants_mod.F90
+ - remove commented out line
+
+M src/physics/carma/cam/carma_intr.F90
+ - remove Cartesian coordinate and spacing stuff
+ - misc clean up and corrections
+
+M src/physics/carma/models/dust/carma_model_mod.F90
+M src/physics/carma/models/meteor_impact/carma_model_mod.F90
+ - changes for generalized grid columns
+
+M src/physics/carma/models/sea_salt/carma_model_mod.F90
+ - removed ununsed lat/lon indices
+
+M src/physics/carma/models/meteor_smoke/carma_model_mod.F90
+M src/physics/carma/models/mixed_sulfate/carma_model_mod.F90
+M src/physics/carma/models/pmc/carma_model_mod.F90
+M src/physics/carma/models/sulfate/carma_model_mod.F90
+M src/physics/carma/models/test_growth/carma_model_mod.F90
+M src/physics/carma/models/test_passive/carma_model_mod.F90
+M src/physics/carma/models/test_radiative/carma_model_mod.F90
+M src/physics/carma/models/test_swelling/carma_model_mod.F90
+M src/physics/carma/models/test_tracers/carma_model_mod.F90
+M src/physics/carma/models/test_tracers2/carma_model_mod.F90
+ - minor clean up -- remove unused "module uses"
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s (Overall: FAIL) details:
+ SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ - pre-existing failures
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - pre-existing failure
+
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-carma_sea_salt (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-carma_sea_salt BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_127_nag: DIFF
+ - round-off level changes in carma base code
+
+izumi/gnu/aux_cam: All PASS
+
+Summarize any changes to answers: CARMA round-off level changes, otherwise bit-for-bit unchanged
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_127
+Originator(s): pel, jet
+Date: Sept 12, 2023
+One-line Summary: Option to turn on HB where CLUBB is not active
+Github PR URL: https://github.com/ESCOMP/CAM/pull/849
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+ - Free atmosphere Richardson number based mixing (using the free atmosphere
+ part of the Holtslag-Boville PBL scheme) for those layers where CLUBB is
+ not active (turned on in cam6 or cam_dev). Also helps stabilize less diffusive
+ dynamical cores. The issue for this PR is #846 and it will also address issue #772
+
+Describe any changes made to build system: NA
+
+Describe any changes made to the namelist:
+ - Introduced namelist variable do_hb_above_clubb. Default False unless using cam6 or cam_dev then
+ Holtslag-Boville PBL scheme will be used above CLUBB top)
+ - new namelist variable se_pgf_formulation to allow use of older pgf calculation to help with waccm regression errors
+ Can have an interger value of 1 or 2.
+ 1: Exner version of pressure gradient force (PGF)
+ 2: Traditional pressure gradient formulation (grad p)
+
+List any changes to the defaults for the boundary datasets: N/A
+ - New Boundary data for ERP and SMS WACCM runs - these runs require a spun up IC.
+ inputdata/atm/waccm/ic/FW2000.ne30pg3_ne30pg3_nlev70_c230906.nc
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by:fvitt, pel, eaton, cacraig, jesse
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+
+M bld/build-namelist
+ - Turn on HB scheme where CLUBB not active
+
+M bld/namelist_files/namelist_defaults_cam.xml
+M bld/namelist_files/namelist_definition.xml
+ - add new namelist parameter for do_hb_above_clubb
+ - add new ic file to fix existing waccm regression test failures
+
+M cime_config/testdefs/testmods_dirs/cam/outfrq9s_wcm_ne30/user_nl_cam
+ - use default se_nsplit for waccm runs using new ic file
+
+M src/dynamics/mpas/dp_coupling.F90
+ - bug fix, looping should only be over wet species
+
+M src/dynamics/se/dp_coupling.F90
+ - bug fix, looping should only be over wet species
+
+M src/dynamics/se/dycore/global_norms_mod.F90
+M src/physics/cam/clubb_intr.F90
+ - set pbuf field so that HB scheme is only applied above CLUBB top
+
+M src/physics/cam/hb_diff.F90
+M src/physics/cam/vertical_diffusion.F90
+ - add call to run HB scheme where CLUBB not active
+
+M src/physics/cam/geopotential.F90
+ - bug fix for converting wet to dry mixing ratio
+
+M src/physics/cam/phys_control.F90
+ - do_hb_above_clubb defined here and provided via getopts.
+
+M src/dynamics/se/dycore/prim_advance_mod.F90
+M src/dynamics/se/dyn_comp.F90
+M src/dynamics/se/dycore/control_mod.F90
+ - remove duplicate timing call
+ - allow use of older pgf formulation to help with waccm regression errors
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam: all BFB except:
+
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s (Overall: FAIL) details:
+ - pre-existing failure
+
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.FADIAB.cheyenne_intel.cam-terminator (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC5HIST.cheyenne_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERS_Ln9_Vnuopc.ne0TESTONLYne5x4_ne0TESTONLYne5x4_mg37.FADIAB.cheyenne_intel.cam-outfrq3s_refined (Overall: NLFAIL) details:
+ - expected NLFAIL due to new se_pgf_formulation namelist variable.
+
+ SMS_Ld5_Vnuopc.f09_f09_mg17.PC6.cheyenne_intel.cam-cam6_port_f09 (Overall: NLFAIL) details:
+ - expected NLFAIL due to new do_hb_above_clubb namelist variable.
+
+ ERC_D_Ln9_P144x1_Vnuopc.ne16pg3_ne16pg3_mg17.QPC6HIST.cheyenne_intel.cam-outfrq3s_ttrac_usecase (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq3s_cosp (Overall: DIFF) details:
+ ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vnuopc.f09_f09_mg17.QSC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ld3_Vnuopc.f09_f09_mg17.FWHIST.cheyenne_intel.cam-reduced_hist1d (Overall: DIFF) details:
+ ERP_Ln9_P24x3_Vnuopc.f45_f45_mg37.QPWmaC6.cheyenne_intel.cam-outfrq9s_mee_fluxes (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: DIFF) details:
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: DIFF) details:
+ ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details:
+ ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCts2nudged.cheyenne_intel.cam-outfrq9s_leapday (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCvbsxHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC2000climo.cheyenne_intel.cam-outfrq3s_usecase (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.QPX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.T42_T42.FSCAM.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.f09_f09_mg17.FW2000climo.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ SMS_Lm13_Vnuopc.f10_f10_mg37.F2000climo.cheyenne_intel.cam-outfrq1m (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-nudging (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.FW1850.cheyenne_intel.cam-reduced_hist3s (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f19_f19.F2000climo.cheyenne_intel.cam-silhs (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f19_f19_mg17.FHIST.cheyenne_intel.cam-outfrq9s_nochem (Overall: DIFF) details:
+ - expected diff for cam_dev and cam6 run using do_hb_above_clubb=.true.
+
+
+izumi/nag/aux_cam: all BFB except:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL)
+ - pre-existing failure
+
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-outfrq3s_ttrac (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne16pg3_ne16pg3_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERI_D_Ln18_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s_bwic (Overall: NLFAIL) details:
+ ERI_D_Ln18_Vnuopc.ne5pg3_ne5pg3_mg37.FADIAB.izumi_nag.cam-outfrq3s_bwic (Overall: NLFAIL) details:
+ ERS_Ln27_Vnuopc.ne5pg3_ne5pg3_mg37.FKESSLER.izumi_nag.cam-outfrq9s (Overall: NLFAIL) details:
+ ERS_Ln9_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq9s (Overall: NLFAIL) details:
+ PEM_D_Ln9_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: NLFAIL) details:
+ SMS_D_Ln6_Vnuopc.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem (Overall: NLFAIL) details:
+ SMS_D_Ln9_P1x1_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ - expected NLFAIL due to new se_pgf_formulation namelist variable.
+
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_convmic (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ ERI_D_Ln18_Vnuopc.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: DIFF) details:
+ SMS_D_Ln3_Vnuopc.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_ba (Overall: DIFF) details:
+ SMS_P48x1_D_Ln3_Vnuopc.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase (Overall: DIFF) details:
+ - expected diff for cam_dev/cam6 runs using do_hb_above_clubb=.true.
+
+izumi/gnu/aux_cam: all BFB except:
+
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC4.izumi_gnu.cam-outfrq3s_nudging_ne5_L26 (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq3s_ba (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne5pg2_ne5pg2_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne5pg4_ne5pg4_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.ne5_ne5_mg37.FHS94.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
+ PEM_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal0 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal1 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal3 (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-outfrq3s_ttrac (Overall: NLFAIL) details:
+ - expected NLFAIL due to new se_pgf_formulation namelist variable.
+
+ SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s (Overall: DIFF)
+ - expected diff for cam_dev/cam6 runs using do_hb_above_clubb=.true.
+
+Summarize any changes to answers: climate changing for cam6/cam-dev runs using CLUBB
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_126
+Originator(s): gdicker
+Date: 6 Sep 2023
+One-line Summary: Add MPAS-A 60 and 30km analytic-ic ncdata
+Github PR URL: https://github.com/ESCOMP/CAM/pull/848
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+ - Add 60 and 30km MPAS-A meshes w/ 32L for analytic ICs: https://github.com/ESCOMP/CAM/issues/847
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist:
+ - See specific details below in file section.
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: cacraig, jtruesdal, nusbaume
+
+List all files eliminated:
+
+List all files added and what they do:
+
+List all existing files that have been modified, and describe the changes:
+M bld/namelist_files/namelist_defaults_cam.xml
+ - Adds two new MPAS-A notopo files to ncdata section for runs with analytic_ic
+ - Adds mpas_dt for mpasa60 and mpasa30 hgrids
+ - Adds mpas_len_disp for mpasa60 and mpasa30 hgrids
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s (Overall: FAIL) details:
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: FAIL) details:
+ SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ - pre-existing failures
+
+izumi/nag/aux_cam:
+ TR8 test FAIL: src/chemistry/aerosol/refractive_aerosol_optics_mod.F90:288 crefin(icol) = crefin(icol)/max(self%wetvol(icol,ilev), 1.e-40)
+ - missing r8 qualifier, see Issue #882
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - pre-existing failure
+
+izumi/gnu/aux_cam: All PASS
+
+Summarize any changes to answers: bit-for-bit unchanged
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_125
+Originator(s): fvitt
+Date: 29 Aug 2023
+One-line Summary: Introduce abstract interface to aerosol optics
+Github PR URL: https://github.com/ESCOMP/CAM/pull/824
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+ Issue #816 -- Refactor aerosol optics to use abstract aerosol optics class which can be
+ extended for different aerosol representations such as MAM and CARMA
+
+Describe any changes made to build system: n/a
+
+Describe any changes made to the namelist:
+
+ Namelist group "modal_aer_opt_nl" is renamed as "aerosol_optics_nl"
+
+List any changes to the defaults for the boundary datasets: n/a
+
+Describe any substantial timing or memory changes: n/a
+
+Code reviewed by: cacraigucar mattldawson nusbaume
+
+List all files eliminated:
+
+D src/physics/cam/modal_aer_opt.F90
+ - replaced by generalized aer_rad_props module
+
+List all files added and what they do:
+
+A src/chemistry/aerosol/aerosol_optics_mod.F90
+ - abstract interface to aerosol optics
+
+A src/chemistry/aerosol/refractive_aerosol_optics_mod.F90
+ - index of refaction based aerosol optics
+
+A src/physics/cam/aerosol_optics_cam.F90
+ - generalized aerosol optics module
+
+List all existing files that have been modified, and describe the changes:
+
+M bld/namelist_files/namelist_definition.xml
+ - modal_aer_opt_nl group renamed as aerosol_optics_nl
+
+M src/chemistry/aerosol/aerosol_properties_mod.F90
+M src/chemistry/aerosol/modal_aerosol_properties_mod.F90
+ - add methods for optical parameters
+
+M src/chemistry/aerosol/aerosol_state_mod.F90
+M src/chemistry/aerosol/modal_aerosol_state_mod.F90
+ - add methods for optics
+
+M src/control/runtime_opts.F90
+ - modal_aer_opt --> aerosol_optics_cam
+
+M src/physics/cam/aer_rad_props.F90
+ - modal_aer_opt --> aerosol_optics_cam
+
+M src/physics/cam/rad_constituents.F90
+ - add opticstype arg to rad_cnst_get_mode_props
+
+M src/physics/rrtmg/radiation.F90
+ - remove modal_aer_opt_init call
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: FAIL) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s (Overall: FAIL) details:
+ SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ - pre-existing failures
+
+ ERC_D_Ln9_P144x1_Vnuopc.ne16pg3_ne16pg3_mg17.QPC6HIST.cheyenne_intel.cam-outfrq3s_ttrac_usecase (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq3s_cosp (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC5HIST.cheyenne_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_D_Ln9_Vnuopc.f09_f09_mg17.QSC6.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ld3_Vnuopc.f09_f09_mg17.FWHIST.cheyenne_intel.cam-reduced_hist1d (Overall: NLFAIL) details:
+ ERP_Ln9_P24x3_Vnuopc.f45_f45_mg37.QPWmaC6.cheyenne_intel.cam-outfrq9s_mee_fluxes (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: NLFAIL) details:
+ ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 (Overall: NLFAIL) details:
+ ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 (Overall: NLFAIL) details:
+ ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC5.cheyenne_intel.cam-scm_prep (Overall: NLFAIL) details:
+ SMS_D_Ld2_Vnuopc.f19_f19_mg17.QPC5HIST.cheyenne_intel.cam-volc_usecase (Overall: NLFAIL) details:
+ SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCts2nudged.cheyenne_intel.cam-outfrq9s_leapday (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCvbsxHIST.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC2000climo.cheyenne_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC5M7.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.T42_T42.FSCAM.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_Ld1_Vnuopc.f09_f09_mg17.FW2000climo.cheyenne_intel.cam-outfrq1d (Overall: NLFAIL) details:
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d (Overall: NLFAIL) details:
+ SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.cheyenne_intel.cam-outfrq1d (Overall: NLFAIL) details:
+ SMS_Ld5_Vnuopc.f09_f09_mg17.PC6.cheyenne_intel.cam-cam6_port_f09 (Overall: NLFAIL) details:
+ SMS_Lm13_Vnuopc.f10_f10_mg37.F2000climo.cheyenne_intel.cam-outfrq1m (Overall: NLFAIL) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-nudging (Overall: NLFAIL) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.FW1850.cheyenne_intel.cam-reduced_hist3s (Overall: NLFAIL) details:
+ SMS_Ln9_Vnuopc.f19_f19.F2000climo.cheyenne_intel.cam-silhs (Overall: NLFAIL) details:
+ - modal_aer_opt_nl namelist group renamed as aerosol_optics_nl
+
+izumi/nag/aux_cam:
+
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - pre-existing failure
+
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-carma_sea_salt (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_cosp (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_subcol (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_convmic (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-outfrq3s_ttrac (Overall: NLFAIL) details:
+ ERI_D_Ln18_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac (Overall: NLFAIL) details:
+ ERI_D_Ln18_Vnuopc.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: NLFAIL) details:
+ SMS_D_Ld2_Vnuopc.f45_f45_mg37.PC5.izumi_nag.cam-outfrq24h_port (Overall: NLFAIL) details:
+ SMS_D_Ln7_Vnuopc.T42_T42_mg17.QPSCAMC5.izumi_nag.cam-scmarm (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-rad_diag_mam (Overall: NLFAIL) details:
+ SMS_P48x1_D_Ln3_Vnuopc.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase (Overall: NLFAIL) details:
+ SUB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ TMC_D_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac (Overall: NLFAIL) details:
+ TMC_D_Vnuopc.T5_T5_mg37.QPC5.izumi_nag.cam-ghgrmp_e8 (Overall: NLFAIL) details:
+ - modal_aer_opt_nl namelist group renamed as aerosol_optics_nl
+
+izumi/gnu/aux_cam:
+
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_gnu.cam-outfrq3s_unicon (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPSPCAMM.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal0 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal1 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal3 (Overall: NLFAIL) details:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC6.izumi_gnu.cam-scm_prep_c6 (Overall: NLFAIL) details:
+ SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-outfrq3s_ttrac (Overall: NLFAIL) details:
+ - modal_aer_opt_nl namelist group renamed as aerosol_optics_nl
+
+Summarize any changes to answers: bit-for-bit unchanged
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_124
+Originator(s): fvitt
+Date: 23 Aug 2023
+One-line Summary: Fix issues exposed by FMTHIST; add regression tests for FLTHIST and FMTHIST
+Github PR URL: https://github.com/ESCOMP/CAM/pull/872
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+ Fix memory issue in code that reads input data on the native unstructured model grid.
+ Fix floating point exception issue in aerosol wet deposition caused by undefined values in
+ BERGSO (conversion of cloud water to snow) above above pumus active region
+
+ Address github issues:
+ Increase PE layout for MT runs #812
+ Introduce regression tests for FLTHIST and FMTHIST #841
+
+Describe any changes made to build system: n/a
+
+Describe any changes made to the namelist: n/a
+
+List any changes to the defaults for the boundary datasets: n/a
+
+Describe any substantial timing or memory changes: n/a
+
+Code reviewed by: cacraigucar nusbaume
+
+List all files eliminated: n/a
+
+List all files added and what they do: n/a
+
+List all existing files that have been modified, and describe the changes:
+M Externals.cfg
+M bld/namelist_files/namelist_defaults_cam.xml
+ - default spun-up IC file for L93 ne30 CAM-Chem-SE
+
+M cime_config/config_compsets.xml
+ - remove "_v0d" from FLTHIST and FMTHIST compset short names
+
+M cime_config/config_pes.xml
+ - set default PE layouts for FLTHIST and FMTHIST compsets
+
+M cime_config/testdefs/testlist_cam.xml
+ - add cheyenne regression tests for FLTHIST and FMTHIST compsets
+
+M src/chemistry/utils/tracer_data.F90
+ - remove unused ps field that was allocated using undefined sizes when
+ the input file was on the native unsctructured model grid
+
+M src/dynamics/se/dyn_comp.F90
+ - write "Molecular viscosity" message only if masterproc
+
+M src/physics/cam_dev/micro_pumas_cam.F90
+ - zero bergo field above top_lev
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s COMPARE_base_rest
+ SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ FAIL SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_123: DIFF
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 RUN time=287
+ PEND ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 COMPARE_base_rest
+ - pre-extisting failures
+
+ ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_123: ERROR BFAIL baseline directory '/glade/p/cesm/amwg/cesm_baselines/cam6_3_123/ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.cheyenne_intel.cam-outfrq9s' does not exist
+ SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_123: ERROR BFAIL baseline directory '/glade/p/cesm/amwg/cesm_baselines/cam6_3_123/SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.cheyenne_intel.cam-outfrq9s' does not exist
+ - new tests
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ FAIL DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae RUN time=10
+ - pre-extisting failure
+
+izumi/gnu/aux_cam: All PASS
+
+Summarize any changes to answers: bit-for-bit unchanged
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_123
+Originator(s): cacraig, jedwards, fvitt
+Date: August 16, 2023
+One-line Summary: Fix Derecho bugs
+Github PR URL: https://github.com/ESCOMP/CAM/pull/878
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+ - cam_history field order: https://github.com/ESCOMP/CAM/issues/876
+ - build failure on derecho: https://github.com/ESCOMP/ALI-ARMS/issues/2
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: nusbaume
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+M Externals_CAM.cfg
+ - Update ALI-ARMS external
+
+M src/control/cam_history.F90
+ - Improve history writing for derecho
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam: all BFB except:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s COMPARE_base_rest
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_122: DIFF
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 RUN time=272
+ PEND ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 COMPARE_base_rest
+ SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ FAIL SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_122: DIFF
+ - pre-existing failures
+
+izumi/nag/aux_cam: all BFB
+
+izumi/gnu/aux_cam: all BFB
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_122
+Originator(s): fvitt
+Date: 11 Aug 2023
+One-line Summary: Aerosol optics updates
+Github PR URL: https://github.com/ESCOMP/CAM/pull/868
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+ Issue #865 -- Aerosol optics answer changes
+
+ Generalization of the aerosol optics has resulted in answer changes. Here these answer changing
+ code modifications (in modal_aer_opt) are merged in separately which are as follows:
+ - use table_interp_mod utility rather than binterp subroutine -- answer changing (roundoff)
+ - use rh2odens parameter -- answer changing (roundoff)
+ - use model_size_parameters subroutine in modal_aero_lw rather than using separate
+ code block to compute the chebychev parameters -- answer changing (roundoff)
+
+ Updates to aerosol optics diagnostics:
+ - generalize history field names that will accumulate multiple bins of a sectional aerosol model
+ - add short wave diagnostic AODTOT
+ - add long wave diagnostics AODABSLW (at 10 microns) and TOTABSLW
+
+ Change in results are near roundoff level
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: cacraigucar nusbaume
+
+List all files eliminated: N/A
+
+List all files added and what they do:
+A src/utils/table_interp_mod.F90
+ - utility module for interpolation of aerosol optics tables
+
+List all existing files that have been modified, and describe the changes:
+
+M src/physics/cam/modal_aer_opt.F90
+ - use table_interp_mod utility rather than binterp subroutine -- answer changing (roundoff)
+ - use rh2odens parameter -- answer changing (roundoff)
+ - use model_size_parameters subroutine in modal_aero_lw rather than
+ using separate code block to compute the chebychev parameters -- answer changing (roundoff)
+ - generalize history field names that will accumulate multiple bins of a sectional aerosol model
+ - add AODTOT SW diagnostic
+ - add AODABSLW (at 10 microns) and TOTABSLW diagnostics
+
+M src/physics/simple/radconstants.F90
+ - add stub subroutine get_lw_spectral_boundaries for building simple models
+
+M bld/namelist_files/use_cases/2000_trop_strat_vbs_cam6.xml
+M bld/namelist_files/use_cases/2010_trop_strat_vbs_cam6.xml
+M bld/namelist_files/use_cases/hist_trop_strat_nudged_cam6.xml
+M bld/namelist_files/use_cases/hist_trop_strat_vbs_cam6.xml
+M bld/namelist_files/use_cases/hist_trop_strat_vbsext_cam6.xml
+M bld/namelist_files/use_cases/hist_trop_strat_vbsfire_cam6.xml
+M bld/namelist_files/use_cases/sd_trop_strat2_cam6.xml
+M bld/namelist_files/use_cases/sd_trop_strat_vbs_cam6.xml
+M bld/namelist_files/use_cases/sd_waccm_tsmlt_cam6.xml
+M bld/namelist_files/use_cases/waccm_tsmlt_1850_cam6.xml
+M bld/namelist_files/use_cases/waccm_tsmlt_2000_cam6.xml
+M bld/namelist_files/use_cases/waccm_tsmlt_2010_cam6.xml
+M bld/namelist_files/use_cases/waccm_tsmlt_hist_cam6.xml
+M cime_config/usermods_dirs/CMIP6_B1850/user_nl_cam
+M cime_config/usermods_dirs/CMIP6_B1850_WACCM/user_nl_cam
+M cime_config/usermods_dirs/CMIP6_BHIST/user_nl_cam
+M cime_config/usermods_dirs/CMIP6_BHIST_WACCM/user_nl_cam
+M cime_config/usermods_dirs/CMIP6_GENERIC/user_nl_cam
+ - adjust history field names
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s COMPARE_base_rest
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ FAIL SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h NLCOMP
+ FAIL SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: PEND) details:
+ FAIL ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 NLCOMP
+ - pre-existing failures
+
+ ERC_D_Ln9_P144x1_Vnuopc.ne16pg3_ne16pg3_mg17.QPC6HIST.cheyenne_intel.cam-outfrq3s_ttrac_usecase (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_P144x1_Vnuopc.ne16pg3_ne16pg3_mg17.QPC6HIST.cheyenne_intel.cam-outfrq3s_ttrac_usecase BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq3s_cosp (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq3s_cosp BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC5HIST.cheyenne_intel.cam-outfrq3s_usecase (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC5HIST.cheyenne_intel.cam-outfrq3s_usecase BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ ERP_D_Ln9_Vnuopc.f09_f09_mg17.QSC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_D_Ln9_Vnuopc.f09_f09_mg17.QSC6.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ ERP_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ ERP_Ld3_Vnuopc.f09_f09_mg17.FWHIST.cheyenne_intel.cam-reduced_hist1d (Overall: DIFF) details:
+ FAIL ERP_Ld3_Vnuopc.f09_f09_mg17.FWHIST.cheyenne_intel.cam-reduced_hist1d BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ ERP_Ln9_P24x3_Vnuopc.f45_f45_mg37.QPWmaC6.cheyenne_intel.cam-outfrq9s_mee_fluxes (Overall: DIFF) details:
+ FAIL ERP_Ln9_P24x3_Vnuopc.f45_f45_mg37.QPWmaC6.cheyenne_intel.cam-outfrq9s_mee_fluxes BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: DIFF) details:
+ FAIL ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details:
+ FAIL ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 (Overall: DIFF) details:
+ FAIL ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC5.cheyenne_intel.cam-scm_prep (Overall: DIFF) details:
+ FAIL SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC5.cheyenne_intel.cam-scm_prep BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ SMS_D_Ld2_Vnuopc.f19_f19_mg17.QPC5HIST.cheyenne_intel.cam-volc_usecase (Overall: DIFF) details:
+ FAIL SMS_D_Ld2_Vnuopc.f19_f19_mg17.QPC5HIST.cheyenne_intel.cam-volc_usecase BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCts2nudged.cheyenne_intel.cam-outfrq9s_leapday (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCts2nudged.cheyenne_intel.cam-outfrq9s_leapday NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCts2nudged.cheyenne_intel.cam-outfrq9s_leapday BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCvbsxHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCvbsxHIST.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCvbsxHIST.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s_waccm_ma_mam4 BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC2000climo.cheyenne_intel.cam-outfrq3s_usecase (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC2000climo.cheyenne_intel.cam-outfrq3s_usecase NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC2000climo.cheyenne_intel.cam-outfrq3s_usecase BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC5M7.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC5M7.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ SMS_D_Ln9_Vnuopc_P720x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc_P720x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ SMS_D_Ln9_Vnuopc_P720x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc_P720x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc_P720x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ SMS_D_Ln9_Vnuopc_P720x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc_P720x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc_P720x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ SMS_D_Ln9_Vnuopc.T42_T42.FSCAM.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.T42_T42.FSCAM.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ SMS_Ld1_Vnuopc.f09_f09_mg17.FW2000climo.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ FAIL SMS_Ld1_Vnuopc.f09_f09_mg17.FW2000climo.cheyenne_intel.cam-outfrq1d NLCOMP
+ FAIL SMS_Ld1_Vnuopc.f09_f09_mg17.FW2000climo.cheyenne_intel.cam-outfrq1d BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ FAIL SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ FAIL SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.cheyenne_intel.cam-outfrq1d NLCOMP
+ FAIL SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.cheyenne_intel.cam-outfrq1d BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ SMS_Ld5_Vnuopc.f09_f09_mg17.PC6.cheyenne_intel.cam-cam6_port_f09 (Overall: DIFF) details:
+ FAIL SMS_Ld5_Vnuopc.f09_f09_mg17.PC6.cheyenne_intel.cam-cam6_port_f09 BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ SMS_Lm13_Vnuopc.f10_f10_mg37.F2000climo.cheyenne_intel.cam-outfrq1m (Overall: DIFF) details:
+ FAIL SMS_Lm13_Vnuopc.f10_f10_mg37.F2000climo.cheyenne_intel.cam-outfrq1m BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ SMS_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-nudging (Overall: DIFF) details:
+ FAIL SMS_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-nudging BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ SMS_Ln9_Vnuopc.f09_f09_mg17.FW1850.cheyenne_intel.cam-reduced_hist3s (Overall: DIFF) details:
+ FAIL SMS_Ln9_Vnuopc.f09_f09_mg17.FW1850.cheyenne_intel.cam-reduced_hist3s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ SMS_Ln9_Vnuopc.f19_f19.F2000climo.cheyenne_intel.cam-silhs (Overall: DIFF) details:
+ FAIL SMS_Ln9_Vnuopc.f19_f19.F2000climo.cheyenne_intel.cam-silhs BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_121: DIFF
+ - expected baseline failures due to changes in aerosol optics
+ - namelist compare failures due changes in aerosol optics diagnostics field names
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ FAIL DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae RUN time=10
+ - pre-existing failures
+
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-carma_sea_salt (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-carma_sea_salt BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_nag: DIFF
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_cosp (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_cosp BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_nag: DIFF
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_subcol (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_subcol BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_nag: DIFF
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_nag: DIFF
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_convmic (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_convmic BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_nag: DIFF
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_nag: DIFF
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_nag: DIFF
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_nag: DIFF
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-outfrq3s_ttrac (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-outfrq3s_ttrac BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_nag: DIFF
+ ERI_D_Ln18_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac (Overall: DIFF) details:
+ FAIL ERI_D_Ln18_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_nag: DIFF
+ ERI_D_Ln18_Vnuopc.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 (Overall: DIFF) details:
+ FAIL ERI_D_Ln18_Vnuopc.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_nag: DIFF
+ ERP_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_nag: DIFF
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: DIFF) details:
+ FAIL PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_nag: DIFF
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: DIFF) details:
+ FAIL PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_nag: DIFF
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: DIFF) details:
+ FAIL PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_nag: DIFF
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: DIFF) details:
+ FAIL PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_nag: DIFF
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: DIFF) details:
+ FAIL PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_nag: DIFF
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: DIFF) details:
+ FAIL PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_nag: DIFF
+ SMS_D_Ln7_Vnuopc.T42_T42_mg17.QPSCAMC5.izumi_nag.cam-scmarm (Overall: DIFF) details:
+ FAIL SMS_D_Ln7_Vnuopc.T42_T42_mg17.QPSCAMC5.izumi_nag.cam-scmarm BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-rad_diag_mam (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-rad_diag_mam BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_nag: DIFF
+ SMS_P48x1_D_Ln3_Vnuopc.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase (Overall: DIFF) details:
+ FAIL SMS_P48x1_D_Ln3_Vnuopc.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_nag: DIFF
+ SUB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ FAIL SUB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_nag: DIFF
+ TMC_D_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac (Overall: DIFF) details:
+ FAIL TMC_D_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_nag: DIFF
+ TMC_D_Vnuopc.T5_T5_mg37.QPC5.izumi_nag.cam-ghgrmp_e8 (Overall: DIFF) details:
+ FAIL TMC_D_Vnuopc.T5_T5_mg37.QPC5.izumi_nag.cam-ghgrmp_e8 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_nag: DIFF
+ - expected baseline failures due to changes in aerosol optics
+
+izumi/gnu/aux_cam:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_gnu.cam-outfrq3s_unicon (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_gnu.cam-outfrq3s_unicon BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_gnu: DIFF
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPSPCAMM.izumi_gnu.cam-outfrq3s (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPSPCAMM.izumi_gnu.cam-outfrq3s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_gnu: DIFF
+ ERP_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq9s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_gnu: DIFF
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal0 (Overall: DIFF) details:
+ FAIL PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal0 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_gnu: DIFF
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal1 (Overall: DIFF) details:
+ FAIL PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal1 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_gnu: DIFF
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal3 (Overall: DIFF) details:
+ FAIL PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal3 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_gnu: DIFF
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC6.izumi_gnu.cam-scm_prep_c6 (Overall: DIFF) details:
+ FAIL SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC6.izumi_gnu.cam-scm_prep_c6 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_gnu: DIFF
+ SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_gnu: DIFF
+ SMS_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-outfrq3s_ttrac (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-outfrq3s_ttrac BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_121_gnu: DIFF
+ - expected baseline failures due to changes in aerosol optics
+ - namelist compare failures due changes in aerosol optics diagnostics field names
+
+ NOTE: Independent testing showed that the combination of round-off level changes
+ to modal_aer_opt (listed above) results in near round-off level changes in the
+ aerosol optics (~12-16 significant digits of agreement).
+
+Summarize any changes to answers: near roundoff
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_121
+Originator(s): fvitt
+Date: 8 Aug 2023
+One-line Summary: Update SOAE emissions factors
+Github PR URL: https://github.com/ESCOMP/CAM/pull/870
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+ Corrections to default namelist settings for:
+ - SAOE emissions factors (issue: Need to adjust SAOE emissions factors #860)
+ - 10x15 CAMChem IC file (issue: Unusable namelist default? #867)
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: cacraigucar nusbaume
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+M bld/build-namelist
+M bld/namelist_files/use_cases/2000_cam6.xml
+M bld/namelist_files/use_cases/2010_cam6.xml
+M bld/namelist_files/use_cases/waccm_sc_2000_cam6.xml
+M bld/namelist_files/use_cases/waccm_sc_2010_cam6.xml
+ - update SAOE emissions factors
+
+M bld/namelist_files/namelist_defaults_cam.xml
+ - correction to default 10x15 CAMChem IC file
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ FAIL SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_120: DIFF
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s COMPARE_base_rest
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 RUN time=284
+ PEND ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 COMPARE_base_rest
+ - pre-existing failures
+
+ ERC_D_Ln9_P144x1_Vnuopc.ne16pg3_ne16pg3_mg17.QPC6HIST.cheyenne_intel.cam-outfrq3s_ttrac_usecase (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_P144x1_Vnuopc.ne16pg3_ne16pg3_mg17.QPC6HIST.cheyenne_intel.cam-outfrq3s_ttrac_usecase NLCOMP
+ FAIL ERC_D_Ln9_P144x1_Vnuopc.ne16pg3_ne16pg3_mg17.QPC6HIST.cheyenne_intel.cam-outfrq3s_ttrac_usecase BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_120: DIFF
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq3s_cosp (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq3s_cosp NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq3s_cosp BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_120: DIFF
+ ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_120: DIFF
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 NLCOMP
+ FAIL ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_120: DIFF
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_120: DIFF
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_120: DIFF
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 NLCOMP
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_120: DIFF
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_120: DIFF
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_120: DIFF
+ ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_120: DIFF
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: DIFF) details:
+ FAIL ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev NLCOMP
+ FAIL ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_120: DIFF
+ ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details:
+ FAIL ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 NLCOMP
+ FAIL ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_120: DIFF
+ ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 (Overall: DIFF) details:
+ FAIL ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 NLCOMP
+ FAIL ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_120: DIFF
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_120: DIFF
+ SMS_D_Ln9_Vnuopc_P720x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc_P720x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc_P720x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_120: DIFF
+ SMS_D_Ln9_Vnuopc.T42_T42.FSCAM.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.T42_T42.FSCAM.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.T42_T42.FSCAM.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_120: DIFF
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ FAIL SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d NLCOMP
+ FAIL SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_120: DIFF
+ SMS_Lm13_Vnuopc.f10_f10_mg37.F2000climo.cheyenne_intel.cam-outfrq1m (Overall: DIFF) details:
+ FAIL SMS_Lm13_Vnuopc.f10_f10_mg37.F2000climo.cheyenne_intel.cam-outfrq1m NLCOMP
+ FAIL SMS_Lm13_Vnuopc.f10_f10_mg37.F2000climo.cheyenne_intel.cam-outfrq1m BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_120: DIFF
+ SMS_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-nudging (Overall: DIFF) details:
+ FAIL SMS_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-nudging NLCOMP
+ FAIL SMS_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-nudging BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_120: DIFF
+ SMS_Ln9_Vnuopc.f19_f19.F2000climo.cheyenne_intel.cam-silhs (Overall: DIFF) details:
+ FAIL SMS_Ln9_Vnuopc.f19_f19.F2000climo.cheyenne_intel.cam-silhs NLCOMP
+ FAIL SMS_Ln9_Vnuopc.f19_f19.F2000climo.cheyenne_intel.cam-silhs BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_120: DIFF
+ - expected baseline failures due to update SAOE emissions factors
+
+ SMS_Ld5_Vnuopc.f09_f09_mg17.PC6.cheyenne_intel.cam-cam6_port_f09 (Overall: NLFAIL) details:
+ FAIL SMS_Ld5_Vnuopc.f09_f09_mg17.PC6.cheyenne_intel.cam-cam6_port_f09 NLCOMP
+ - expected namelist compare failures due to update SAOE emissions factors
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ FAIL DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae RUN time=16
+ PEND DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae COMPARE_base_da
+ - pre-existing failure
+
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_120_nag: DIFF
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_convmic (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_convmic NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_convmic BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_120_nag: DIFF
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_120_nag: DIFF
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_120_nag: DIFF
+ ERI_D_Ln18_Vnuopc.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 (Overall: DIFF) details:
+ FAIL ERI_D_Ln18_Vnuopc.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 NLCOMP
+ FAIL ERI_D_Ln18_Vnuopc.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_120_nag: DIFF
+ SMS_P48x1_D_Ln3_Vnuopc.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase (Overall: DIFF) details:
+ FAIL SMS_P48x1_D_Ln3_Vnuopc.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase NLCOMP
+ FAIL SMS_P48x1_D_Ln3_Vnuopc.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_120_nag: DIFF
+ - expected baseline failures due to update SAOE emissions factors
+
+izumi/gnu/aux_cam:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC6.izumi_gnu.cam-scm_prep_c6 (Overall: DIFF) details:
+ FAIL SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC6.izumi_gnu.cam-scm_prep_c6 NLCOMP
+ FAIL SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC6.izumi_gnu.cam-scm_prep_c6 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_120_gnu: DIFF
+ SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s NLCOMP
+ FAIL SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_120_gnu: DIFF
+ - expected baseline failures due to update SAOE emissions factors
+
+Summarize any changes to answers: larger than roundoff
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_120
+Originator(s): fvitt
+Date: 28 Jul 2023
+One-line Summary: Add O3S diagnostic tracer to WACCM-MA; move gravity wave parameter to namelist
+Github PR URL: https://github.com/ESCOMP/CAM/pull/851
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+ Make frontal gravity wave spectrum half-width a namelist variable (issue #839)
+ MA chemistry scheme (waccm_ma_mam4) needs O3S (issue #793)
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist:
+
+ New namelist parameter:
+ front_gaussian_width
+ Width of gaussian used to create frontogenesis tau profile [m/s].
+ Defaults to 30 m/s
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: cacraigucar nusbaume
+
+List all files eliminated: none
+
+List all files added and what they do: none
+
+List all existing files that have been modified, and describe the changes:
+
+M bld/namelist_files/namelist_definition.xml
+ - new front_gaussian_width namelist parameter
+
+M bld/build-namelist
+ - set default front_gaussian_width
+
+M bld/namelist_files/namelist_defaults_cam.xml
+ - namelist defaults:
+ front_gaussian_width
+ O3S_Loss for WACCM-MA and SolIonRate_Tot for WACCM-X
+
+M bld/namelist_files/use_cases/sd_waccmx_ma_cam6.xml
+M bld/namelist_files/use_cases/waccmx_ma_2000_cam6.xml
+M bld/namelist_files/use_cases/waccmx_ma_hist_cam6.xml
+ - SolIonRate_Tot set by namelist_defaults_cam.xml
+
+M src/chemistry/pp_waccm_ma_mam5/chem_mech.doc
+M src/chemistry/pp_waccm_ma_mam5/chem_mech.in
+M src/chemistry/pp_waccm_ma_mam5/chem_mods.F90
+M src/chemistry/pp_waccm_ma_mam5/m_spc_id.F90
+M src/chemistry/pp_waccm_ma_mam5/mo_indprd.F90
+M src/chemistry/pp_waccm_ma_mam5/mo_lin_matrix.F90
+M src/chemistry/pp_waccm_ma_mam5/mo_nln_matrix.F90
+M src/chemistry/pp_waccm_ma_mam5/mo_prod_loss.F90
+M src/chemistry/pp_waccm_ma_mam5/mo_rxt_rates_conv.F90
+M src/chemistry/pp_waccm_ma_mam5/mo_sim_dat.F90
+ - add diagnostic tracer O3S (explicit solver)
+
+M src/physics/cam/gw_drag.F90
+ - move hard-wired parameter front_gaussian_width to namelist
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 NLCOMP
+ FAIL ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 RUN time=291
+ - pre-existing failure
+
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s COMPARE_base_rest
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_119: DIFF
+ SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ FAIL SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h NLCOMP
+ FAIL SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_119: DIFF
+ - HEMCO baseline failures due to known issue with HEMCO external
+
+ ERP_Ln9_P24x3_Vnuopc.f45_f45_mg37.QPWmaC6.cheyenne_intel.cam-outfrq9s_mee_fluxes (Overall: DIFF) details:
+ FAIL ERP_Ln9_P24x3_Vnuopc.f45_f45_mg37.QPWmaC6.cheyenne_intel.cam-outfrq9s_mee_fluxes NLCOMP
+ FAIL ERP_Ln9_P24x3_Vnuopc.f45_f45_mg37.QPWmaC6.cheyenne_intel.cam-outfrq9s_mee_fluxes BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_119: FIELDLIST field lists differ (otherwise bit-for-bit)
+ - new O3S tracer field
+
+ ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_119: DIFF
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_119: DIFF
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_119: DIFF
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_119: DIFF
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_119: DIFF
+ - difference are due to O3S dry dep velocity surface fields, otherwise bit-for-bit
+
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPX2000.cheyenne_intel.cam-outfrq3s (Overall: NLFAIL) details:
+ ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ld3_Vnuopc.f09_f09_mg17.FWHIST.cheyenne_intel.cam-reduced_hist1d (Overall: NLFAIL) details:
+ ERP_Lh12_Vnuopc.f19_f19_mg17.FW4madSD.cheyenne_intel.cam-outfrq3h (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCts2nudged.cheyenne_intel.cam-outfrq9s_leapday (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCvbsxHIST.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC2000climo.cheyenne_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.QPX2000.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_Ld1_Vnuopc.f09_f09_mg17.FW2000climo.cheyenne_intel.cam-outfrq1d (Overall: NLFAIL) details:
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d (Overall: NLFAIL) details:
+ SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.cheyenne_intel.cam-outfrq1d (Overall: NLFAIL) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.FW1850.cheyenne_intel.cam-reduced_hist3s (Overall: NLFAIL) details:
+ - namelist compare failures due to new front_gaussian_width namelist parameter
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ FAIL DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae RUN time=10
+ - pre-existing failure
+
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_119_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ - new O3S tracer field
+
+ SMS_D_Ln3_Vnuopc.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ SMS_D_Ln6_Vnuopc.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem (Overall: NLFAIL) details:
+ - namelist compare failures due to new front_gaussian_width namelist parameter
+
+izumi/gnu/aux_cam:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC4.izumi_gnu.cam-outfrq3s_diags (Overall: NLFAIL) details:
+ SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC4.izumi_gnu.cam-outfrq9s_apmee (Overall: NLFAIL) details:
+ SMS_P48x1_D_Ln9_Vnuopc.f19_f19_mg17.FW4madSD.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
+ - namelist compare failures due to new front_gaussian_width namelist parameter
+
+Summarize any changes to answers: bit-for-bit unchanged
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_119
+Originator(s): fvitt
+Date: 19 Jul 2023
+One-line Summary: CAM-Chem namelist updates and fix issue with maximum number of chemical emissions files
+Github PR URL: https://github.com/ESCOMP/CAM/pull/850
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+ - Updates to FCHIST and FCnudged compsets #771
+ - Issue with maximum number of chemical emissions files #538
+ -- fixes bug in SOAE emissions in cam6 configurations
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets:
+
+ FCHIST and FCnudged compsets use SPS585 boundary conditions for FV 0.9x1.25 grid
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: cacraigucar nusbaume
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+
+M bld/namelist_files/use_cases/hist_trop_strat_nudged_cam6.xml
+M bld/namelist_files/use_cases/hist_trop_strat_vbs_cam6.xml
+ - use SPS585 boundary conditions for FV 0.9x1.25 grid
+ - history_chemitry=.true. enables shortening of the fincl1 list
+
+M bld/namelist_files/use_cases/2000_cam4_trop_chem.xml
+M bld/namelist_files/use_cases/sd_waccm_tsmlt_cam6.xml
+ - remove SFNO2 from fincl list -- NO2 does not have surface emissions
+
+M bld/namelist_files/use_cases/sd_trop_strat_vbs_cam6.xml
+M bld/namelist_files/use_cases/hist_trop_strat_vbsfire_cam6.xml
+M bld/namelist_files/use_cases/waccm_tsmlt_1850_cam6.xml
+M bld/namelist_files/use_cases/waccm_tsmlt_2000_cam6.xml
+M bld/namelist_files/use_cases/waccm_tsmlt_2010_cam6.xml
+M bld/namelist_files/use_cases/waccm_tsmlt_hist_cam6.xml
+ - history_chemitry=.true. enables shortening of the fincl1 list
+
+M src/chemistry/mozart/chemistry.F90
+ - changes for longer lists of emissions files
+ - add SF* history fields only if species has surface emissions
+
+M src/chemistry/mozart/mo_chm_diags.F90
+ - add DV_* and DF_* history fields only if species has dry deposition
+
+M src/chemistry/mozart/mo_srf_emissions.F90
+M src/chemistry/mozart/mo_extfrc.F90
+ - changes for longer lists of emissions files
+
+M src/chemistry/mozart/mo_neu_wetdep.F90
+ - remove add_default for DTWR_* history fields
+
+M src/chemistry/mozart/ocean_emis.F90
+ - add ocean_emis_species function
+ - add_default for OCN_FLUX_* fields if history_chemistry is .true.
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+
+ FAIL ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 RUN time=2420
+ - pre-existing failure
+
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s COMPARE_base_rest
+ - expected failures in HEMCO tests due to known restart/reprocibility issues with HECMO
+
+ FAIL ERC_D_Ln9_P144x1_Vnuopc.ne16pg3_ne16pg3_mg17.QPC6HIST.cheyenne_intel.cam-outfrq3s_ttrac_usecase BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: DIFF
+ FAIL ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq3s_cosp BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: DIFF
+ FAIL ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: DIFF
+ FAIL ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: DIFF
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: DIFF
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: DIFF
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: DIFF
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: DIFF
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: DIFF
+ FAIL ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: DIFF
+ FAIL ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: DIFF
+ FAIL SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: DIFF
+ FAIL SMS_D_Ln9_Vnuopc.T42_T42.FSCAM.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: DIFF
+ FAIL SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: DIFF
+ FAIL SMS_Lm13_Vnuopc.f10_f10_mg37.F2000climo.cheyenne_intel.cam-outfrq1m BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: DIFF
+ FAIL SMS_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-nudging BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: DIFF
+ FAIL SMS_Ln9_Vnuopc.f19_f19.F2000climo.cheyenne_intel.cam-silhs BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: DIFF
+ - expected baseline differences due to bug fix for SOAE emissions used in cam6 (trop_mam4 chem)
+
+ FAIL SMS_D_Ln9_Vnuopc_P720x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: DIFF
+ FAIL SMS_D_Ln9_Vnuopc_P720x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: DIFF
+ FAIL SMS_D_Ln9_Vnuopc_P720x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: DIFF
+ FAIL ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: DIFF
+ FAIL SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCts2nudged.cheyenne_intel.cam-outfrq9s_leapday BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: DIFF
+ - expected baseline differences due to change in namelist settings
+
+ FAIL ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPMOZ.cheyenne_intel.cam-outfrq3s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPX2000.cheyenne_intel.cam-outfrq3s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC5HIST.cheyenne_intel.cam-outfrq3s_usecase BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL ERP_D_Ln9_Vnuopc.f09_f09_mg17.QSC6.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL ERP_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL SMS_D_Ld2_Vnuopc.f19_f19_mg17.QPC5HIST.cheyenne_intel.cam-volc_usecase BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC5M7.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.QPX2000.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL SMS_Ld1_Vnuopc.f09_f09_mg17.FW2000climo.cheyenne_intel.cam-outfrq1d BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_118: FIELDLIST field lists differ (otherwise bit-for-bit)
+ - change in default history fields, otherwise bit-for-bit
+
+izumi/nag/aux_cam:
+
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - pre-existing failure
+
+ FAIL SMS_P48x1_D_Ln3_Vnuopc.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: DIFF
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: DIFF
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: DIFF
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_convmic BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: DIFF
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: DIFF
+ FAIL ERI_D_Ln18_Vnuopc.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: DIFF
+ - expected baseline differences due to bug fix for SOAE emissions used in cam6 (trop_mam4 chem)
+
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-carma_sea_salt BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_cosp BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_subcol BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-outfrq3s_ttrac BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL ERI_D_Ln18_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL ERP_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL SMS_D_Ln3_Vnuopc.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL SMS_D_Ln7_Vnuopc.T42_T42_mg17.QPSCAMC5.izumi_nag.cam-scmarm BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-rad_diag_mam BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL SUB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL TMC_D_Vnuopc.T5_T5_mg37.QPC5.izumi_nag.cam-ghgrmp_e8 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL TMC_D_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ - change in default history fields, otherwise bit-for-bit
+
+izumi/gnu/aux_cam:
+
+ FAIL SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC6.izumi_gnu.cam-scm_prep_c6 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_gnu: DIFF
+ - expected baseline differences due to bug fix for SOAE emissions used in cam6 (trop_mam4 chem)
+
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC4.izumi_gnu.cam-outfrq3s_diags BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_gnu.cam-outfrq3s_unicon BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPSPCAMM.izumi_gnu.cam-outfrq3s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL ERP_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq9s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal0 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal1 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal3 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL SMS_D_Ln3_Vnuopc.f10_f10_mg37.QPMOZ.izumi_gnu.cam-outfrq3s_chemproc BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ FAIL SMS_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-outfrq3s_ttrac BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_118_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ - change in default history fields, otherwise bit-for-bit
+
+Summarize any changes to answers: larger than round off for cam6
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_118
+Originator(s): Haipeng Lin (jimmielin hplin@seas.harvard.edu), fvitt
+Date: 17 Jul 2023
+One-line Summary: Integration of Harmonized Emissions Component (HEMCO) as emissions infrastructure
+Github PR URL: https://github.com/ESCOMP/CAM/pull/560
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+ - Add HEMCO_CESM as interface between CAM to the Harmonized Emissions Component (HEMCO):
+ https://github.com/ESCOMP/CAM/issues/504
+ - Remove MCT test -- MCT coupling is no longer supported
+ - Remove mpi-serial MPILIB setting for SCAM
+
+Describe any changes made to build system:
+ - Adds HEMCO build paths under src/hemco
+ - Adds pre-processor constants MODEL_, MODEL_CESM, HEMCO_CESM, USE_REAL8 for use
+ by HEMCO to identify it is running in the CESM model environment and requires
+ 8-bit precision
+
+Describe any changes made to the namelist:
+ - cam_physics_mesh now is defined for all compsets instead of only for WACCMX
+ ionosphere-enabled compsets
+ - added %HEMCO component sets FC2000climo_HCO, FC2010climo_HCO, FCHIST_HCO,
+ FCnudged_HCO, FCts2nudged_HCO, and FCSD_HCO that enable HEMCO by default
+ - added use_hemco, hemco_config_file, hemco_emission_year, hemco_grid_xdim,
+ hemco_grid_ydim for configuring HEMCO
+ - ext_frc_specifier and srf_emis_specifier are ignored if use_hemco is true.
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: brian-eaton, cacragucar, nusbaume, fvitt, adamrher, lkemmons
+
+List all files eliminated: N/A
+
+List all files added and what they do:
+A src/chemistry/mozart/hco_cc_emissions.F90
+ - Provides surface emissions and external forcing when HEMCO is enabled
+
+List all existing files that have been modified, and describe the changes:
+M .gitignore
+M Externals_CAM.cfg
+ - Adds HEMCO-CESM external
+
+M bld/build-namelist
+M bld/config_files/definition.xml
+M bld/namelist_files/namelist_defaults_cam.xml
+M bld/namelist_files/namelist_definition.xml
+M bld/namelist_files/use_cases/2000_cam6.xml
+M bld/namelist_files/use_cases/2000_trop_strat_vbs_cam6.xml
+M bld/namelist_files/use_cases/2010_cam6.xml
+M bld/namelist_files/use_cases/2010_trop_strat_vbs_cam6.xml
+ - Refer to namelist changes
+
+M bld/configure
+ - Refer to build changes
+
+M cime_config/config_component.xml
+M cime_config/config_compsets.xml
+ - Adds %HEMCO compset modifier and _HCO compsets for CAM-chem compsets
+ to enable HEMCO by default
+
+M cime_config/testdefs/testlist_cam.xml
+ - Adds test for HEMCO on f09 in aux_cam and camchem_hco test sets, ne30
+ in prealpha and camchem_hco test sets to test CAM with HEMCO
+ - Remove MCT tests
+
+M cime_config/testdefs/testmods_dirs/cam/scmarm/shell_commands
+M cime_config/usermods_dirs/scam_mandatory/shell_commands
+ - Remove mpi-serial MPILIB setting for SCAM
+
+M src/chemistry/mozart/chemistry.F90
+M src/chemistry/mozart/mo_chemini.F90
+M src/chemistry/mozart/mo_gas_phase_chemdr.F90
+M src/chemistry/mozart/mo_setext.F90
+ - Calls HEMCO-provided routines in hco_cc_emissions instead of existing
+ set_srf_emissions and extfrc_set when HEMCO is enabled
+ - Adds pbuf argument to chem_emissions subroutine as necessary for
+ HEMCO-CESM interface to access pbuf to retrieve emissions computed by HEMCO
+
+M src/chemistry/pp_none/chemistry.F90
+M src/chemistry/pp_terminator/chemistry.F90
+ - Subroutine arguments added pbuf for consistent definition as mozart/chemistry.F90
+
+M src/control/runtime_opts.F90
+ - Read HEMCO namelist
+
+M src/physics/cam/phys_control.F90
+ - Read use_hemco variable from physics namelist
+
+M src/physics/cam/physpkg.F90
+M src/physics/cam_dev/physpkg.F90
+ - Call HEMCO routines in physics phase 2
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam: B4B
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: FAIL) details:
+ - pre-existing failure
+
+ ERC_D_Ln9_P144x1_Vnuopc.ne16pg3_ne16pg3_mg17.QPC6HIST.cheyenne_intel.cam-outfrq3s_ttrac_usecase (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq3s_cosp (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPMOZ.cheyenne_intel.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPX2000.cheyenne_intel.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.FADIAB.cheyenne_intel.cam-terminator (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC5HIST.cheyenne_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.T42_T42_mg17.FDABIP04.cheyenne_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.T42_T42_mg17.FHS94.cheyenne_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERI_D_Ln18_Vnuopc.f45_f45_mg37.QPC41850.cheyenne_intel.cam-co2rmp_usecase (Overall: NLFAIL) details:
+ ERP_D_Ln9_Vnuopc.f09_f09_mg17.QSC6.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ld3_Vnuopc.f09_f09_mg17.FWHIST.cheyenne_intel.cam-reduced_hist1d (Overall: NLFAIL) details:
+ ERP_Lh12_Vnuopc.f19_f19_mg17.FW4madSD.cheyenne_intel.cam-outfrq3h (Overall: NLFAIL) details:
+ ERP_Ln9_P24x3_Vnuopc.f45_f45_mg37.QPWmaC6.cheyenne_intel.cam-outfrq9s_mee_fluxes (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: NLFAIL) details:
+ ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 (Overall: NLFAIL) details:
+ ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 (Overall: NLFAIL) details:
+ ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FSPCAMS.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERS_Ln9_Vnuopc.ne0TESTONLYne5x4_ne0TESTONLYne5x4_mg37.FADIAB.cheyenne_intel.cam-outfrq3s_refined (Overall: NLFAIL) details:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC5.cheyenne_intel.cam-scm_prep (Overall: NLFAIL) details:
+ SMS_D_Ld2_Vnuopc.f19_f19_mg17.QPC5HIST.cheyenne_intel.cam-volc_usecase (Overall: NLFAIL) details:
+ SMS_D_Ld5_Vnuopc.f19_f19_mg17.PC4.cheyenne_intel.cam-cam4_port5d (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCts2nudged.cheyenne_intel.cam-outfrq9s_leapday (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCvbsxHIST.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC2000climo.cheyenne_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC5M7.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.QPX2000.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.T42_T42.FSCAM.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_Ld1_Vnuopc.f09_f09_mg17.FW2000climo.cheyenne_intel.cam-outfrq1d (Overall: NLFAIL) details:
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d (Overall: NLFAIL) details:
+ SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.cheyenne_intel.cam-outfrq1d (Overall: NLFAIL) details:
+ SMS_Ld5_Vnuopc.f09_f09_mg17.PC6.cheyenne_intel.cam-cam6_port_f09 (Overall: NLFAIL) details:
+ SMS_Lm13_Vnuopc.f10_f10_mg37.F2000climo.cheyenne_intel.cam-outfrq1m (Overall: NLFAIL) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-nudging (Overall: NLFAIL) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.FW1850.cheyenne_intel.cam-reduced_hist3s (Overall: NLFAIL) details:
+ SMS_Ln9_Vnuopc.f19_f19.F2000climo.cheyenne_intel.cam-silhs (Overall: NLFAIL) details:
+ SMS_Ln9_Vnuopc.f19_f19_mg17.FHIST.cheyenne_intel.cam-outfrq9s_nochem (Overall: NLFAIL) details:
+ - namelist compare failures due to use_hemco new namelist switch
+
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s (Overall: FAIL) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s COMPARE_base_rest
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_117: ERROR BFAIL baseline directory '/glade/p/cesm/amwg/cesm_baselines/cam6_3_117/ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq9s' does not exist
+ SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ FAIL SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h NLCOMP
+ FAIL SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_117: ERROR BFAIL baseline directory '/glade/p/cesm/amwg/cesm_baselines/cam6_3_117/SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.cheyenne_intel.cam-outfrq3h' does not exist
+ - new tests
+ - HEMCO tests are expected for fail due to known issue with reproducibility and restarts
+
+izumi/nag/aux_cam: B4B
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - pre-existing failure
+
+ ERC_D_Ln9_Vnuopc.T5_T5_mg37.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-carma_sea_salt (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_cosp (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_subcol (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_convmic (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QSPCAMS.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.mpasa480z32_mpasa480.FHS94.izumi_nag.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne16pg3_ne16pg3_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-outfrq3s_ttrac (Overall: NLFAIL) details:
+ ERI_D_Ln18_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac (Overall: NLFAIL) details:
+ ERI_D_Ln18_Vnuopc.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 (Overall: NLFAIL) details:
+ ERI_D_Ln18_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s_bwic (Overall: NLFAIL) details:
+ ERI_D_Ln18_Vnuopc.ne5pg3_ne5pg3_mg37.FADIAB.izumi_nag.cam-outfrq3s_bwic (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: NLFAIL) details:
+ ERS_Ln27_Vnuopc.ne5pg3_ne5pg3_mg37.FKESSLER.izumi_nag.cam-outfrq9s (Overall: NLFAIL) details:
+ ERS_Ln9_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq9s (Overall: NLFAIL) details:
+ PEM_D_Ln9_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: NLFAIL) details:
+ SMS_D_Ld2_Vnuopc.f45_f45_mg37.PC5.izumi_nag.cam-outfrq24h_port (Overall: NLFAIL) details:
+ SMS_D_Ln3_Vnuopc.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ SMS_D_Ln6_Vnuopc.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem (Overall: NLFAIL) details:
+ SMS_D_Ln7_Vnuopc.T42_T42_mg17.QPSCAMC5.izumi_nag.cam-scmarm (Overall: NLFAIL) details:
+ SMS_D_Ln9_P1x1_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-rad_diag_mam (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_ba (Overall: NLFAIL) details:
+ SMS_P48x1_D_Ln3_Vnuopc.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase (Overall: NLFAIL) details:
+ SUB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ TMC_D_Vnuopc.T5_T5_mg37.QPC5.izumi_nag.cam-ghgrmp_e8 (Overall: NLFAIL) details:
+ TMC_D_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac (Overall: NLFAIL) details:
+ - namelist compare failures due to use_hemco new namelist switch
+
+izumi/gnu/aux_cam: B4B
+ ERC_D_Ln9_Vnuopc.T5_T5_mg37.QPC3.izumi_gnu.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.FADIAB.izumi_gnu.cam-terminator (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC4.izumi_gnu.cam-outfrq3s_diags (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_gnu.cam-outfrq3s_unicon (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_gnu.cam-rad_diag (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPSPCAMM.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC4.izumi_gnu.cam-outfrq3s_nudging_ne5_L26 (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq3s_ba (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne5pg2_ne5pg2_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne5pg4_ne5pg4_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
+ ERI_D_Ln18_Vnuopc.T5_T5_mg37.QPC4.izumi_gnu.cam-co2rmp (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.ne5_ne5_mg37.FHS94.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
+ PEM_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal0 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal1 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal3 (Overall: NLFAIL) details:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC4.izumi_gnu.cam-scm_prep (Overall: NLFAIL) details:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC6.izumi_gnu.cam-scm_prep_c6 (Overall: NLFAIL) details:
+ SMS_D_Ln3_Vnuopc.f10_f10_mg37.QPMOZ.izumi_gnu.cam-outfrq3s_chemproc (Overall: NLFAIL) details:
+ SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC4.izumi_gnu.cam-outfrq9s_apmee (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-outfrq3s_ttrac (Overall: NLFAIL) details:
+ SMS_P48x1_D_Ln9_Vnuopc.f19_f19_mg17.FW4madSD.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
+ - namelist compare failures due to use_hemco new namelist switch
+
+Summarize any changes to answers: bit-for-bit unchanged
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_117
+Originator(s): cacraig, patc, islas
+Date: June 28, 2023
+One-line Summary: Bring in Frierson Simple Model (gray radiation)
+Github PR URL: https://github.com/ESCOMP/CAM/pull/537
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+ - Frierson gray radiation: https://github.com/ESCOMP/CAM/issues/8
+
+Describe any changes made to build system:
+ - Add physics option "grayrad"
+
+Describe any changes made to the namelist:
+ - Introduced namelist settings for Frierson Gray radiation (all prepended with "frierson")
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: fvitt, peverwhee, nusbaume
+
+List all files eliminated: N/A
+
+List all files added and what they do:
+A bld/namelist_files/use_cases/dctest_frierson.xml
+ - Add use_case for Gray radiation model
+
+A src/physics/simple/frierson.F90
+A src/physics/simple/frierson_cam.F90
+ - Bring in Frierson code along with the CAM interface code to it
+
+List all existing files that have been modified, and describe the changes:
+M bld/build-namelist
+ - introduce grayrad physics option and accompanying namelist values
+
+M bld/config_files/definition.xml
+M bld/configure
+ - introduce grayrad physics option
+
+M bld/namelist_files/namelist_defaults_cam.xml
+M bld/namelist_files/namelist_definition.xml
+ - introduce grayrad namelist values
+
+M cime_config/config_component.xml
+ - introduce %GRAYRAD compset qualifier
+
+M cime_config/config_compsets.xml
+ - introduce FGRAYRAD compset
+
+M cime_config/testdefs/testlist_cam.xml
+ - introduce prebeta test for FGRAYRAD compset
+
+M src/control/cam_control_mod.F90
+M src/control/runtime_opts.F90
+M src/physics/simple/physpkg.F90
+M src/physics/simple/restart_physics.F90
+ - mods to support gray radiation
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam: all BFB except:
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: FAIL) details:
+ - pre-existing failure
+
+izumi/nag/aux_cam: all BFB except:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - pre-existing failure
+
+izumi/gnu/aux_cam: all BFB
+
+Isla Simpson analyzed the results from these code mods and approved the release of the Gray Radiation option.
+
+===============================================================
+===============================================================
+
+Tag name:cam6_3_116
+Originator(s): cacraig, hannay, jedwards, eaton
+Date: June 23, 2023
+One-line Summary: CAM Tuning "F" and fix derecho CSLAM performance
+Github PR URL: https://github.com/ESCOMP/CAM/pull/820
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+ - Update tunings for LT and MT based on the "Tuning F": https://github.com/ESCOMP/CAM/issues/818
+ - New gw tuning to add to the trunk: https://github.com/ESCOMP/CAM/issues/829
+ - More tuning for LT and MT: https://github.com/ESCOMP/CAM/issues/838
+ - Derecho CSLAM performance issue: https://github.com/ESCOMP/CAM/discussions/827
+ - add pointers for intel performance, remove unused PI variable for nvhpc: https://github.com/ESCOMP/CAM/pull/845
+ - Introduce configure options "lt" and "mt"
+ - Use new ncdata file with required metadata for LT and MT ne30pg3 runs
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist:
+ - micro_mg_dcs is now set inside build-namelist
+ - Default settings were changed for: micro_mg_dcs, use_gw_front, use_gw_convect_dp,
+ eff_rdg_beta, eff_rdg_beta_max, tau_0_ubc, effgw_beres_dp, clubb_C7, clubb_C_uu_shr,
+ clubb_l_mono_flux_lim_um, clubb_l_mono_flux_lim_vm, clubb_l_predict_upwp_vpwp,
+ microp_aero_wsubi_scale, micro_mg_vtrmi_factor, dust_emis_fact, seasalt_emis_scale
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: fvitt, nusbaume, eaton, adamrher (jtruedal, nusbaume and Peter Lauritzen reveiwed PR#845)
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+M bld/build-namelist
+ - Add selection for micro_mg_dcs
+ - Additional settings for tuning "F"
+
+M bld/config_files/definition.xml
+M bld/configure
+M cime_config/config_component.xml
+ - Introduce model_top qualifier with lt and mt options
+
+M bld/namelist_files/namelist_defaults_cam.xml
+ - Tuning "F" namelist settings
+ - Update files to include LT and MT input files which contain metadata
+
+M bld/namelist_files/use_cases/1850_cam_lt.xml
+M bld/namelist_files/use_cases/1850_cam_mt.xml
+M bld/namelist_files/use_cases/hist_cam_lt.xml
+M bld/namelist_files/use_cases/hist_cam_mt.xml
+ - Remove ncdata files and use ones from namelist_defaults_cam.xml
+
+M cime_config/config_compsets.xml
+ - Update to FLTHIST_v0d and FMTHIST_v0d
+
+M src/control/cam_history.F90
+ - remove unused pi
+
+M src/dynamics/se/dycore/fvm_consistent_se_cslam.F90
+ - Fix derecho performance issue
+
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+Most tests had namelist differences
+
+cheyenne/intel/aux_cam: all BFB except:
+
+ Ran FLTHIST and FMTHIST with old and new ncdata file and the results were BFB
+
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: FAIL) details:
+ - pre-existing failure
+
+ ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ - cam_dev tests have answer changes due to namelist changes
+
+ SMS_Ln9_Vnuopc.f19_f19.F2000climo.cheyenne_intel.cam-silhs (Overall: DIFF) details:
+ - SILHS has answer changes due to namelist changes. Adam Herrington approved changing answers for this configuration
+
+izumi/nag/aux_cam: all BFB except:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - pre-existing failure
+
+izumi/gnu/aux_cam: all BFB except:
+ SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ - cam_dev tests have answer changes due to namelist changes
+CAM tag used for the baseline comparison tests if different than previous
+tag:
+
+Summarize any changes to answers, i.e.,
+- what code configurations:
+- what platforms/compilers:
+- nature of change (roundoff; larger than roundoff but same climate; new
+ climate):
+
+If bitwise differences were observed, how did you show they were no worse
+than roundoff?
+
+If this tag changes climate describe the run(s) done to evaluate the new
+climate in enough detail that it(they) could be reproduced, i.e.,
+- source tag (all code used must be in the repository):
+- platform/compilers:
+- configure commandline:
+- build-namelist command (or complete namelist):
+- MSS location of output:
+
+MSS location of control simulations used to validate new climate:
+
+URL for AMWG diagnostics output used to validate new climate:
+
+===============================================================
+===============================================================
+Tag name: cam6_3_115
+Originator(s): aherring, jet
+Date: June 21, 2023
+One-line Summary: Add support for coarse se grid ne3np4 and additional support for ne5 and ne16 grids
+Github PR URL: https://github.com/ESCOMP/CAM/pull/815
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+ - Create coarser grids for SE dycore and use for regression testing: https://github.com/ESCOMP/CAM/issues/726
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets: New coarse grid SE boundary data.
+ /glade/p/cesmdata/inputdata/atm/cam/inic/se/cam6_QPC6_aqua_ne3pg3_mg37_L32_01-01-31_c221214.nc
+ /glade/p/cesmdata/inputdata/atm/cam/inic/se/cam6_QPC6_aqua_ne3pg3_mg37_L58_01-01-31_c221214.nc
+ /glade/p/cesmdata/inputdata/atm/cam/inic/se/cam6_QPC6_aqua_ne3pg3_mg37_L93_01-01-31_c221214.nc
+ /glade/p/cesmdata/inputdata/atm/cam/inic/se/cam6_QPC6_topo_ne3pg3_mg37_L32_01-01-31_c221214.nc
+ /glade/p/cesmdata/inputdata/atm/cam/inic/se/cam6_QPC6_topo_ne3pg3_mg37_L58_01-01-31_c221214.nc
+ /glade/p/cesmdata/inputdata/atm/cam/inic/se/cam6_QPC6_topo_ne3pg3_mg37_L93_01-01-31_c221214.nc
+ /glade/p/cesmdata/inputdata/atm/cam/inic/se/F2000climo_ne5pg3_mg37_L32_01-01-31_c230520.nc
+ /glade/p/cesmdata/inputdata/atm/cam/inic/se/F2000climo_ne5pg3_mg37_L58_01-01-31_c230520.nc
+ /glade/p/cesmdata/inputdata/atm/cam/topo/se/ne3pg3_gmted2010_modis_bedmachine_nc0540_Laplace1000_noleak_20230209.nc
+ /glade/p/cesmdata/inputdata/atm/cam/chem/trop_mam/atmsrf_ne3np4.pg3_c221214.nc
+ /glade/p/cesmdata/inputdata/atm/cam/chem/trop_mam/atmsrf_ne5pg3_201105.nc
+ /glade/p/cesmdata/inputdata/atm/cam/chem/trop_mam/atmsrf_ne16pg3_c230520.nc
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: cacraig
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+ M bld/namelist_files/namelist_defaults_cam.xml
+ - New defaults for ne3 ne5 and ne16 boundary data
+ M cime_config/tsetdefs/testlist_cam.xml
+ - New test for ne3pg3 grid
+ M Changelog
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 (Overall: FAIL) details:
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: FAIL) details:
+ - pre-existing failures - mpasa480 failure due to corrupted initial condition file.
+
+ ERC_D_Ln9_P144x1_Vnuopc.ne16pg3_ne16pg3_mg17.QPC6HIST.cheyenne_intel.cam-outfrq3s_ttrac_usecase (Overall: DIFF) details:
+ - Expected Difference due to update dry dep surface data file
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - Pre-existing failure
+
+ ERP_Ln9_Vmct.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: DIFF) details:
+ - expected failures due to updated initial condition file.
+
+ ERP_Ln9_Vnuopc.ne3pg3_ne3pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: DIFF) details:
+ - expected failure against Baseline because this is a new test
+
+izumi/gnu/aux_cam:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal0 (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal1 (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal3 (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-outfrq3s_ttrac (Overall: DIFF) details:
+ - expected failures due to updated initial condition file.
+===============================================================
+===============================================================
+
+Tag name: cam6_3_114
+Originator(s): cacraig
+Date: June 8, 2023
+One-line Summary: Update externals to match cesm2_3_beta14 +
+Github PR URL: https://github.com/ESCOMP/CAM/pull/836
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+Update externals to cesm2_3_beta14 + : https://github.com/ESCOMP/CAM/issues/835
+Update to ccs_config_cesm0.0.72: https://github.com/ESCOMP/CAM/issues/834
+Brings in CTSM external needed by https://github.com/ESCOMP/CAM/pull/815
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: nusbaume
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+M Externals.cfg
+ Update externals to match cesm2_3_beta14 (plus more recent CTSM and ccs_config as described above)
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam: all NL changes
+ - NUOPC introduces namelist changes
+
+ ERP_Ld3_Vnuopc.f09_f09_mg17.FWHIST.cheyenne_intel.cam-reduced_hist1d (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: DIFF) details:
+ ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ - Answer changes due to CTSM
+
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: FAIL) details:
+ ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 (Overall: FAIL) details:
+ - preexisting failure
+
+izumi/nag/aux_cam: all BFB, all NL changes
+ - NUOPC introduces namelist changes
+
+ FAIL DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae RUN time=10
+ - preexisting failure
+
+
+izumi/gnu/aux_cam: all BFB, all NL changes
+ - NUOPC introduces namelist changes
+
+CAM tag used for the baseline comparison tests if different than previous
+tag: cam6_3_112 as cam6_3_113 did not have regression tests run for it
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_113
+Originator(s): cacraig
+Date: June 5, 2023
+One-line Summary: Update manage_externals to manic-1.2.22
+Github PR URL: https://github.com/ESCOMP/CAM/pull/833
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+ - Update manage_externals to latest version: https://github.com/ESCOMP/CAM/issues/740
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: nusbaume
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+A manage_externals/.github/workflows/bumpversion.yml
+A manage_externals/.github/workflows/tests.yml
+A manage_externals/test/repos/README.md
+ - Updates for manage_externals
+
+List all existing files that have been modified, and describe the changes:
+M manage_externals/.gitignore
+M manage_externals/.travis.yml
+M manage_externals/README.md
+M manage_externals/checkout_externals
+M manage_externals/manic/checkout.py
+M manage_externals/manic/externals_description.py
+M manage_externals/manic/externals_status.py
+M manage_externals/manic/repository_factory.py
+M manage_externals/manic/repository_git.py
+M manage_externals/manic/repository_svn.py
+M manage_externals/manic/sourcetree.py
+M manage_externals/manic/utils.py
+M manage_externals/test/README.md
+M manage_externals/test/test_sys_checkout.py
+M manage_externals/test/test_sys_repository_git.py
+M manage_externals/test/test_unit_externals_description.py
+M manage_externals/test/test_unit_externals_status.py
+M manage_externals/test/test_unit_repository.py
+M manage_externals/test/test_unit_repository_git.py
+M manage_externals/test/test_unit_repository_svn.py
+M manage_externals/test/test_unit_utils.py
+ - Updates for manage_externals
+
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam: None run
+
+izumi/nag/aux_cam: None run
+
+izumi/gnu/aux_cam: None run
+
+Ran manage_externals/checkout_externals on cheyenne and izumi and it worked fine
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_112
+Originator(s): fvitt
+Date: 18 May 2023
+One-line Summary: Refactor heterogeneous freezing to use abstract aerosol interfaces
+Github PR URL: https://github.com/ESCOMP/CAM/pull/714
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+ Refactor heterogeneous freezing code to use abstract aerosol interfaces
+ Issue #738
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: cacraigucar tilmes nusbaume
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+
+M src/chemistry/aerosol/aerosol_properties_mod.F90
+M src/chemistry/aerosol/aerosol_state_mod.F90
+M src/chemistry/aerosol/modal_aerosol_properties_mod.F90
+M src/chemistry/aerosol/modal_aerosol_state_mod.F90
+ - interfaces expanded for heterogeneous freezing
+
+M src/physics/cam/hetfrz_classnuc.F90
+ - refactored to work with an arbitrary number of modes/bins
+ - treat black carbon modes separately -- differences larger than round off
+ - use constants from physconst module -- differences larger than round off
+
+M src/physics/cam/hetfrz_classnuc_cam.F90
+ - refactored to use abstract aerosol interfaces
+
+M src/physics/cam/microp_aero.F90
+ - pass aerosol objects to het freeze routines
+
+M src/utils/physconst.F90
+ - moved amu constant from hetfrz_classnuc
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: FAIL) details:
+ ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 (Overall: FAIL) details:
+ - pre-existing failures
+
+ ERC_D_Ln9_P144x1_Vnuopc.ne16pg3_ne16pg3_mg17.QPC6HIST.cheyenne_intel.cam-outfrq3s_ttrac_usecase (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq3s_cosp (Overall: DIFF) details:
+ ERP_D_Ln9_Vmct.f09_f09_mg17.QSC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vmct.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vnuopc.f09_f09_mg17.QSC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ld3_Vnuopc.f09_f09_mg17.FWHIST.cheyenne_intel.cam-reduced_hist1d (Overall: DIFF) details:
+ ERP_Ln9_P24x3_Vnuopc.f45_f45_mg37.QPWmaC6.cheyenne_intel.cam-outfrq9s_mee_fluxes (Overall: DIFF) details:
+ ERP_Ln9_Vmct.f09_f09_mg17.2000_CAM60_CLM50%SP_CICE5%PRES_DOCN%DOM_MOSART_SGLC_SWAV.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: DIFF) details:
+ ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCts2nudged.cheyenne_intel.cam-outfrq9s_leapday (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCvbsxHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC2000climo.cheyenne_intel.cam-outfrq3s_usecase (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.f09_f09_mg17.FW2000climo.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Lm13_Vnuopc.f10_f10_mg37.F2000climo.cheyenne_intel.cam-outfrq1m (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-nudging (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.FW1850.cheyenne_intel.cam-reduced_hist3s (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f19_f19.F2000climo.cheyenne_intel.cam-silhs (Overall: DIFF) details:
+ - expected baseline differences for cases where use_hetfrz_classnuc is .true.
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - pre-existing failure
+
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_convmic (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ ERI_D_Ln18_Vnuopc.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 (Overall: DIFF) details:
+ ERP_Ln9_Vmct.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: DIFF) details:
+ SMS_P48x1_D_Ln3_Vnuopc.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase (Overall: DIFF) details:
+ - expected baseline differences for cases where use_hetfrz_classnuc is .true.
+
+izumi/gnu/aux_cam:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC6.izumi_gnu.cam-scm_prep_c6 (Overall: DIFF) details:
+ SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ - expected baseline differences for cases where use_hetfrz_classnuc is .true.
+
+Summarize any changes to answers: larger than roundoff but same climate
+
+If this tag changes climate describe the run(s) done to evaluate the new
+climate in enough detail that it(they) could be reproduced, i.e.,
+ source:
+ git@github.com:fvitt/CAM.git
+ branch hetfrz_rfctr
+ hash 2171325
+
+ platform/compilers:
+ cheyenne/intel
+
+ configuration:
+ create_newcase --compset FHIST --res f09_f09_mg17
+ case dirs:
+ /glade/u/home/fvitt/cesm/cases/f.e22.Fnudged.f09_f09_mg17.cam6_3_097.2018.hetfrz.001
+ /glade/u/home/fvitt/cesm/cases/f.e22.Fnudged.f09_f09_mg17.cam6_3_097.2018.hetfrz.002
+
+MSS location of output:
+ /glade/campaign/acom/acom-climate/fvitt/archive/f.e22.Fnudged.f09_f09_mg17.cam6_3_097.2018.hetfrz.002
+
+MSS location of control simulations used to validate new climate:
+ /glade/campaign/acom/acom-climate/fvitt/archive/f.e22.Fnudged.f09_f09_mg17.cam6_3_097.2018.hetfrz.001
+
+URL for AMWG diagnostics output used to validate new climate:
+ https://webext.cgd.ucar.edu/FHIST/f.e22.Fnudged.f09_f09_mg17.cam6_3_097.2018.hetfrz.002/atm/
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_111
+Originator(s): cacraig, hannay, fvitt
+Date: May 17, 2023
+One-line Summary: create CAM LT and MT 1850 use_cases
+Github PR URL: https://github.com/ESCOMP/CAM/pull/806
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+ - Add use_cases for 1850 LT and MT compsets: https://github.com/ESCOMP/CAM/issues/804
+
+ *** IMPORTANT NOTE -- MT compsets do not run successfully for 9 time steps
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist:
+ - See specific details below in file section:
+ Updated namelist settings based on discussion in: https://github.com/NCAR/amwg_dev/discussions/261
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: hannay, nusbaume
+
+List all files eliminated: N/A
+
+List all files added and what they do:
+A bld/namelist_files/use_cases/1850_cam_lt.xml
+A bld/namelist_files/use_cases/1850_cam_mt.xml
+ - Initial use cases - setup for BLT1850 and BMT1850 to use
+
+List all existing files that have been modified, and describe the changes:
+M bld/build-namelist
+ - Remove H2O ext_file from ghg_mam runs
+
+M bld/namelist_files/namelist_defaults_cam.xml
+ - Added gw_apply_tndmz defaults for ghg_mam4 93 and 58 level
+ - Added se_hypervis_subcycle default for ne30np4, npg3, 58 level
+
+M bld/namelist_files/use_cases/hist_cam_lt.xml
+M bld/namelist_files/use_cases/hist_cam_mt.xml
+ - Removed the above settings and others which are set properly via namelist_defaults
+
+M cime_config/config_component.xml
+ - Added hooks for 1850 LT and MT use_cases
+
+M cime_config/config_compsets.xml
+ - Added for Testing purposes ONLY - FLT1850_TESTINGONLY_v0c and FMT1850_TESTINGONLY_v0c
+
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ FAIL ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 RUN time=266
+ - preexisting failure
+
+ FAIL ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 RUN time=357
+ - This test passed for Brian Eaton when he made cam6_3_110. We retested and Francis Vitt had it fail for
+ cam6_3_109. Cheryl Craig tested using cam6_3_110 and cam6_3_108 and it failed in both of these version.
+ Saying this is a preexisting failure and will be researched later
+
+ FAIL ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev BASELINE
+ FAIL SMS_D_Ln9_Vnuopc_P720x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s BASELINE
+ - expected baselines differences due to namelist changes
+
+
+izumi/nag/aux_cam: all BFB except:
+ FAIL DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae RUN time=10
+
+
+izumi/gnu/aux_cam: all BFB
+
+ADDITIONAL TESTS RUN:
+
+ Cecile ran FLTHIST and FLT1850 tests with restart and they ran properly (with user_nl_cam, user_nl_clm, CLM SourceMods and
+ various XML settings):
+ /glade/scratch/hannay/cases/f.cam6_3_111.FLT1850.001
+ /glade/scratch/hannay/cases/f.cam6_3_111.FLTHIST_v0c.001
+
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_110
+Originator(s): eaton, bstephens
+Date: Tue May 9 01:46:34 PM EDT 2023
+One-line Summary: Resolve miscellaneous issues.
+Github PR URL: https://github.com/ESCOMP/CAM/pull/797
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+. Issue #371 - Grid matches in refcases will need to change from
+ gland4 to gris4 if they are re-enabled
+ (https://github.com/ESCOMP/CAM/issues/371).
+ - Resolved by removing entries for old refcases.
+
+. Issue #741 - Updates to address CLUBB variable-name length limit.
+ (https://github.com/ESCOMP/CAM/issues/741)
+ - Use cam_history_support::max_fieldname_len to replace hardcoded 16.
+ - PR #743 will be resolved by this PR.
+
+. Issue #608 - Fix path for buildlib/buildnml
+ (https://github.com/ESCOMP/CAM/issues/608)
+ - Fix one wrong occurance of the old path 'cime/scripts/Tools'. Don't
+ see any problem with paths for buildlib/buildnml.
+
+. Issue #749 - Correct description of low-level wind output
+ (https://github.com/ESCOMP/CAM/issues/749)
+ - fix description as suggested
+
+. Issue #803 - Add missing GHGMAM4 to FMTHIST compset
+ (https://github.com/ESCOMP/CAM/issues/803)
+ - add missing %GHGMAM4 to FMTHIST compset
+ - change FLTHIST_v0b to FLTHIST_v0c
+ - change FMTHIST_v0b to FMTHIST_v0c
+
+. resolves #371
+. resolves #741
+. resolves #743
+. resolves #608
+. resolves #749
+. resolves #803
+
+Describe any changes made to build system: none
+
+Describe any changes made to the namelist: none
+
+List any changes to the defaults for the boundary datasets: none
+
+Describe any substantial timing or memory changes: none
+
+Code reviewed by: fvitt, cacraigucar, nusbaume
+
+List all files eliminated: none
+
+List all files added and what they do: none
+
+List all existing files that have been modified, and describe the changes:
+
+bld/namelist_files/namelist_definition.xml
+. change type of clubb_vars_* from char*16 to char*35
+
+cime_config/config_compsets.xml
+. remove commented out lines (575-618) for old refcases
+. add missing %GHGMAM4 to FMTHIST compset
+. change FLTHIST_v0b to FLTHIST_v0c
+. change FMTHIST_v0b to FMTHIST_v0c
+
+src/physics/cam/cam_diagnostics.F90
+. change descriptions of WSPDSRFMX and WSPDSRFAV from 'at the surface' to
+ 'at surface layer midpoint'
+
+src/physics/cam/clubb_intr.F90
+. access max_fieldname_len from cam_history_support
+. replace hardcoded 16 by max_fieldname_len in 8 places that set the name
+ of the variable for an outfld call
+
+test/system/archive_baseline.sh
+. change path of bless_test_results from 'cime/scripts/Tools' to
+ 'cime/CIME/Tools'
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: FAIL) details:
+ - pre-existing failure
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - pre-existing failure
+
+izumi/gnu/aux_cam: All PASS
+
+CAM tag used for the baseline comparison tests if different than previous
+tag:
+
+Summarize any changes to answers: BFB
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_109
+Originator(s): pel, jet
+Date: 28 April 2023
+One-line Summary: Science and infrastructure updates for inline energy/mass budgets
+Github PR URL: https://github.com/ESCOMP/CAM/pull/761
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+ Add inline energy/mass budgets support. (#519) Science changes are
+ included that help close the mass and energy budgets of physics
+ and the SE/MPAS dycores (#521) as well as adding all water
+ constituents to atmospheric mass (pressure) (#520).
+
+ Extra items also included in this PR:
+ - Bugfix to correctly open an instance version of atm_in (ndep issue #790)
+ - Update FLTHIST compset and finish implementing initial FMTHIST compset (#789)
+
+ As of this commit energy/mass budgets have been roughed in for
+ physics and the SE and MPAS dycores. Similar to amwg_diagnostic
+ functionality, energy/mass budget diagnostic fields will be added
+ to a history file via the thermo_budget_histfile_num namelist
+ parameter. Globally averaged energy budget summaries are also
+ calculated and written to the atm log file every time the budget
+ history tape is written to. The period over which energy and mass
+ budgets are averaged is the same as the averaging period of the
+ history budget file. Thus history budgets can be output/averaged
+ at timestep, hour, or month resolutions using the nhtfrq variable
+ specific to the budget history file identified by
+ thermo_budget_histfile_num. The new namelist logical variable
+ thermo_buget_history is used to turn budgeting on (.true.) or off
+ (.false.) The default is .false. (no budgeting) because of the
+ global gathers needed to create the budgets.
+
+ An energy or mass budget is defined by a mathematical operation
+ (sum/difference) of two energy/mass snapshots. For instance one
+ can talk of the energy lost/gained by the physics
+ parameterizations by comparing snapshots taken before and after
+ running the physics.
+
+ An energy budget is created, logged and written to the budget history tape in four steps
+ 1) call cam_budget_em_snapshot to define multiple energy/mass snapshots
+ 2) call cam_budget_em_budget to define a budget as the difference/sum of two snapshots.
+ 3) call tot_energy_phys (or tot_energy_dyn) for each named snapshot
+ 4) setting namelist variables thermo_budget_history, thermo_budget_histfile_num, nhtfrq
+
+ Energy and mass snapshots are defined and added to the history
+ buffer via the cam_budget_em_snapshot subroutine. The cam_budget_em_snapshot routine
+ creates a set of vertically integrated energy and mass history
+ output fields based on the snapshot name parameter prepended with
+ the types of energy and mass that are carried in cam and defined
+ in cam_thermo.F90 For example calling cam_budget_em_snapshot with a name of
+ 'dAP', perhaps standing for an energy snapshot after physics is
+ called, will create a set of fields that contain kinetic (KE_dAP),
+ sensible (SE_dAP), potential (PO_dAP) and total (TE_dap) energies
+ as well as atmospheric vapor (wv_dAP), liquid (wl_dAP) and ice
+ (wi_dAP) masses. A call to calc_total_energy for the each named
+ snapshot (here placed after after the physics parameterization)
+ will calculate and outfld the 9 or so specific energy and mass
+ snapshots.
+
+ The cam_budget_em_budget routine defines a named budget composed of the
+ difference or sum of two snapshots. As with cam_budget_em_shapshot the
+ budget name is prepended with the same energies identifiers as
+ cam_budget_em_snapshot. All energy/mass snapshots as well as the budgets are
+ saved to the history buffer and written to the budget history
+ file. tot_energy_phys and tot_energy_dyn routines exists for both
+ physics and dynamics to allow snapshots tailored to thermodynamic
+ needs and data structures of those packages.
+
+
+Describe any changes made to build system:
+
+Describe any changes made to the namelist:
+ New budgeting namelist variables have been added. Interface
+ follows existing functionality to outfld standard diagnostics for
+ budgeting and diagnosis.
+
+ se_lcp_moist
+ se_phys_dyn_cp
+ - removed
+
+ thermo_budget_histfile_num: integer identifing which history file will contain
+ additional budgeting diagnostic fields
+ thermo_budget_history: logical that turns history budgeting on and off.
+ - added
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes:
+ Global gathers are done each time a thermo budgeting field is
+ written to the history file. The budgeting diagnostics are not
+ meant to be enabled during a production run.
+
+Code reviewed by: cacraigucar nusbaume brian-eaton fvitt pel
+
+List all files eliminated: N/A
+
+List all files added and what they do:
+ A src/cam/control/cam_budget.F90
+ provides support for energy/mass budgeting using cam_history infrastructure.
+
+List all existing files that have been modified, and describe the changes:
+
+ M bld/namelist_files/use_cases/hist_cam_mt.xml
+ - update FLTHIST for coupled runs
+
+ M bld/build_namelist
+ - Remove se_lcp_moist and se_phys_dyn_cp namelist flags
+
+ M namelist_defaults_cam.xml
+ - new mpas initial data default for mpasa120 aquaplanet.
+ - update cam_dev defaults to add Graupel constituent.
+
+ M namelist_definition.xml
+ - new averaging flag option for budget variables 'N' allows normalization by nsteps.
+ - nstep normalization is required to properly budget subcycled fields.
+ - new namelist parameters for budgeting
+
+ M cam_comp.F90
+ - add call to print budgets. The print_budget function needs to be defined for all dycores.
+
+ M cam_history.F90
+ - new functionality for history buffered fields
+ - new area weighted global averaging functionality for history fields.
+ - create new composed hbuf field which is created from a sum/difference operation on
+ two existing fields.
+ - restart information added for budgeting.
+
+ M cam_history_buffers.F90
+ - new subroutine for nstep field averaging
+
+ M cam_history_support.F90
+ - added support for new global average functionality
+
+ M cime_config/config_compsets.xml
+ - update FLTHIST for coupled runs
+
+ M runtime_opts.F90
+ - added budget namelist read
+
+ M atm_comp_nuopc.F90
+ - bug fix, support for E/W formatted initial data longitudes spanning -180:180
+
+ M cpl/nuopc/atm_stream_ndep.F90
+ - bug fix to allow opening instance version of atm_in namelist.
+
+ M eul/dp_coupling.F90
+ - update calling parameters
+
+ M eul/dycore_budget.F90
+ - Dummy routine for printing EUL budget - not fully supported yet.
+
+ M fv/dp_coupling.F90
+ - update calling parameters
+
+ M fv/dycore_budget.F90
+ - Dummy routine for printing FV budget - not fully supported yet.
+
+ M fv/metdata.F90
+ - thermodynamic activespecies variables
+
+ M fv3/dp_coupling.F90
+ - update calling parameters
+
+ M fv3/dycore_budget.F90
+ - Dummy routine for printing FV3 budget - not fully supported yet.
+
+ M mpas/dp_coupling.F90
+ - science updates
+ - all water constitutents added to pressure
+ - mods to further reduce bias in energy budget
+
+ M mpas/dycore_budget.F90
+ - Routine for printing MPAS budget
+
+ M mpas/dyn_comp.F90
+ - Add core budgets for mpas energy and mass - stages
+
+ M mpas/dyn_grid.F90
+ - register area weights for mpas grids
+
+ M se/advect_tend.F90
+ - refactor statements checking for use of cslam
+
+ M se/dp_coupling.F90
+ - science updates
+ - all water constitutents added to pressure
+ - mods to further reduce bias in energy budget
+
+ M se/dycore/control_mod.F90
+ - remove phys_dyn_cp energy scaling flag
+
+ M se/dycore/control_mod.F90
+ - thermal energy scaling of T
+
+ M se/dycore/dimensions_mod.F90
+ - get rid of lcp_moist now namelist variable
+
+ M se/dycore/fvm_mod.F90
+ - add use_cslam logical in place of if ntrac>0
+
+ M se/dycore/global_norms_mod.F90
+ - new interface for calculating both elem and fvm global integrals (fvm added)
+
+ M se/dycore/hybrid_mod.F90
+ - add use_cslam logical in place of if ntrac>0
+
+ M se/dycore/namelist_mod.F90
+ - add use_cslam logical in place of if ntrac>0
+
+ M se/dycore/prim_advance_mod.F90
+ - science updates to close energy budget
+ - refactor energy calc routine.
+ - new hydrostatic energy routine with potential energy now split out from SE
+
+ M se/dycore/prim_advection_mod.F90
+ - refactor for enthalpy ... internal energy to enthalpy
+
+ M se/dycore/prim_driver_mod.F90
+ - rename routine to calculate total energy
+
+ M se/dycore/prim_state_mod.F90
+ - add use_cslam logical in place of if ntrac>0
+
+ M se/dycore/viscosity.F90
+ - add use_cslam logical in place of if ntrac>0
+
+ M se/dycore_budget.F90
+ - Routine for printing SE energy/mass budgets
+
+ M se/dyn_comp.F90
+ - Add core budget variables for se energy and mass - stages
+
+ M se/dyn_grid.F90
+ - register area weights for se grids
+ - call budget_add for all SE energy/mass budget fields.
+
+ M se/dyn_grid.F90
+ - consistent naming of routine that calculates total energy
+
+ M se/restart_dynamics.F90
+ - add use_cslam logical in place of if ntrac>0
+
+ M se/stepon.F90
+ - update name calc_tot_energy_dynamics to tot_energy_dyn
+
+ M se/test_fvm_mapping.F90
+ - add use_cslam logical in place of if ntrac>0
+
+ M infrastructure/phys_grid.F90
+ - register area weights for physic grid
+ - call budget_add for all SE energy/mass budget fields.
+
+ M cam_diagnostics.F90
+ - register physics energy/mass budgets using budget_add calls
+ - physics energy/mass variables (physics budget stages)
+
+ M check_energy.F90
+ - update calls to get hydrostatic energy (include new potential energy input param)
+ - update calc energy/mass routine for potential energy calculation.
+
+ M constituents.F90
+ - clean up unused variables (NAG)
+
+ M geopotential.F90
+ - remove unused routines/variables (NAG)
+ - add computation of generalized virtual temp to geopotential_t
+
+ M phys_control.F90
+ - code cleanup
+
+ M cam/phys_grid.F90
+ - register area weights for global integrals
+
+ M physics_types.F90
+ - science updates for energy/mass budgets
+
+ M cam/physpkg.F90
+ - science updates for energy/mass budgets
+ - science updates for energy/mass budgets
+
+ M cam_dev/physpkg.F90
+ - science updates for energy/mass budgets
+
+ M simple/physpkg.F90
+ - science updates for energy/mass budgets (update dme_adjust)
+
+ M utils/air_composition.F90
+ - refactor/cleanup/rename
+
+ M utils/grid_support.F90
+ - support for global area weighting for budgets
+
+ M utils/cam_thermo.F90
+ - energy and mass budget variables and descriptions.
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam: Expecting namelist and baseline failures (SE,MPAS,FV3 climate changing, others roundoff)
+
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: FAIL)
+ - pre-existing failure
+
+ ERC_D_Ln9_P144x1_Vnuopc.ne16pg3_ne16pg3_mg17.QPC6HIST.cheyenne_intel.cam-outfrq3s_ttrac_usecase (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq3s_cosp (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPMOZ.cheyenne_intel.cam-outfrq3s (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPX2000.cheyenne_intel.cam-outfrq3s (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.FADIAB.cheyenne_intel.cam-terminator (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC5HIST.cheyenne_intel.cam-outfrq3s_usecase (Overall: DIFF)
+ ERI_D_Ln18_Vnuopc.f45_f45_mg37.QPC41850.cheyenne_intel.cam-co2rmp_usecase (Overall: DIFF)
+ ERP_D_Ln9_Vmct.f09_f09_mg17.QSC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ ERP_D_Ln9_Vmct.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ ERP_D_Ln9_Vnuopc.f09_f09_mg17.QSC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ ERP_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ ERP_Ld3_Vnuopc.f09_f09_mg17.FWHIST.cheyenne_intel.cam-reduced_hist1d (Overall: DIFF)
+ ERP_Ln9_P24x3_Vnuopc.f45_f45_mg37.QPWmaC6.cheyenne_intel.cam-outfrq9s_mee_fluxes (Overall: DIFF)
+ ERP_Ln9_Vmct.f09_f09_mg17.2000_CAM60_CLM50%SP_CICE5%PRES_DOCN%DOM_MOSART_SGLC_SWAV.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF)
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF)
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: DIFF)
+ ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 (Overall: DIFF)
+ ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 (Overall: DIFF)
+ ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FSPCAMS.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ ERS_Ln9_Vnuopc.ne0TESTONLYne5x4_ne0TESTONLYne5x4_mg37.FADIAB.cheyenne_intel.cam-outfrq3s_refined (Overall: DIFF)
+ SMS_D_Ld2_Vnuopc.f19_f19_mg17.QPC5HIST.cheyenne_intel.cam-volc_usecase (Overall: DIFF)
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCts2nudged.cheyenne_intel.cam-outfrq9s_leapday (Overall: DIFF)
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCvbsxHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: DIFF)
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie (Overall: DIFF)
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC2000climo.cheyenne_intel.cam-outfrq3s_usecase (Overall: DIFF)
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC5M7.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.QPX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ SMS_D_Ln9_Vnuopc_P720x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ SMS_D_Ln9_Vnuopc_P720x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ SMS_D_Ln9_Vnuopc_P720x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+ SMS_Ld1_Vnuopc.f09_f09_mg17.FW2000climo.cheyenne_intel.cam-outfrq1d (Overall: DIFF)
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d (Overall: DIFF)
+ SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.cheyenne_intel.cam-outfrq1d (Overall: DIFF)
+ SMS_Lm13_Vnuopc.f10_f10_mg37.F2000climo.cheyenne_intel.cam-outfrq1m (Overall: DIFF)
+ SMS_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-nudging (Overall: DIFF)
+ SMS_Ln9_Vnuopc.f09_f09_mg17.FW1850.cheyenne_intel.cam-reduced_hist3s (Overall: DIFF)
+ SMS_Ln9_Vnuopc.f19_f19.F2000climo.cheyenne_intel.cam-silhs (Overall: DIFF)
+ SMS_Ln9_Vnuopc.f19_f19_mg17.FHIST.cheyenne_intel.cam-outfrq9s_nochem (Overall: DIFF)
+ - expecting climate changing differences in SE,MPAS,FV3
+ - verified FV,EUL differences are roundoff
+
+ FAIL ERC_D_Ln9_P144x1_Vnuopc.ne16pg3_ne16pg3_mg17.QPC6HIST.cheyenne_intel.cam-outfrq3s_ttrac_usecase NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.FADIAB.cheyenne_intel.cam-terminator NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC5HIST.cheyenne_intel.cam-outfrq3s_usecase NLCOMP
+ FAIL ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 NLCOMP
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 NLCOMP
+ FAIL ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 NLCOMP
+ FAIL ERS_Ln9_Vnuopc.ne0TESTONLYne5x4_ne0TESTONLYne5x4_mg37.FADIAB.cheyenne_intel.cam-outfrq3s_refined NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.QPX2000.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc_P720x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc_P720x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc_P720x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d NLCOMP
+ FAIL SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.cheyenne_intel.cam-outfrq1d NLCOMP
+ - expected NLCOMP failures due to removal of se_lcp_moist, se_phys_dyn_cp namelist variables for SE runs
+ - expected NLCOMP failures from addition of GRAUPEL to water species for cam_dev and FV3 runs
+
+izumi/nag/aux_cam: Expecting namelist and baseline failures
+
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL)
+ - pre-existing failure
+
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-carma_sea_salt (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_cosp (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_subcol (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_convmic (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QSPCAMS.izumi_nag.cam-outfrq3s (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.mpasa480z32_mpasa480.FHS94.izumi_nag.cam-outfrq3s_usecase (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.ne16pg3_ne16pg3_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-outfrq3s_ttrac (Overall: DIFF)
+ ERI_D_Ln18_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac (Overall: DIFF)
+ ERI_D_Ln18_Vnuopc.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 (Overall: DIFF)
+ ERI_D_Ln18_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s_bwic (Overall: DIFF)
+ ERI_D_Ln18_Vnuopc.ne5pg3_ne5pg3_mg37.FADIAB.izumi_nag.cam-outfrq3s_bwic (Overall: DIFF)
+ ERP_Ln9_Vmct.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: DIFF)
+ ERP_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: DIFF)
+ ERS_Ln27_Vnuopc.ne5pg3_ne5pg3_mg37.FKESSLER.izumi_nag.cam-outfrq9s (Overall: DIFF)
+ ERS_Ln9_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq9s (Overall: DIFF)
+ PEM_D_Ln9_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s (Overall: DIFF)
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: DIFF)
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: DIFF)
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: DIFF)
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: DIFF)
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: DIFF)
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: DIFF)
+ SMS_D_Ln3_Vnuopc.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s (Overall: DIFF)
+ SMS_D_Ln6_Vnuopc.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem (Overall: DIFF)
+ SMS_D_Ln9_P1x1_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s (Overall: DIFF)
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-rad_diag_mam (Overall: DIFF)
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_ba (Overall: DIFF)
+ SMS_P48x1_D_Ln3_Vnuopc.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase (Overall: DIFF)
+ SUB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s (Overall: DIFF)
+ TMC_D_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac (Overall: DIFF)
+ - expecting climate changing differences in SE,MPAS,FV3
+ - verified FV,EUL differences are roundoff
+
+ FAIL ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.ne16pg3_ne16pg3_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-outfrq3s_ttrac NLCOMP
+ FAIL ERI_D_Ln18_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s_bwic NLCOMP
+ FAIL ERI_D_Ln18_Vnuopc.ne5pg3_ne5pg3_mg37.FADIAB.izumi_nag.cam-outfrq3s_bwic NLCOMP
+ FAIL ERP_Ln9_Vmct.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf NLCOMP
+ FAIL ERP_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf NLCOMP
+ FAIL ERS_Ln27_Vnuopc.ne5pg3_ne5pg3_mg37.FKESSLER.izumi_nag.cam-outfrq9s NLCOMP
+ FAIL ERS_Ln9_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq9s NLCOMP
+ FAIL PEM_D_Ln9_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s NLCOMP
+ FAIL PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 NLCOMP
+ FAIL PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 NLCOMP
+ FAIL PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 NLCOMP
+ FAIL SMS_D_Ln3_Vnuopc.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s NLCOMP
+ FAIL SMS_D_Ln6_Vnuopc.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem NLCOMP
+ FAIL SMS_D_Ln9_P1x1_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s NLCOMP
+ - expected NLCOMP failures due to removal of se_lcp_moist, se_phys_dyn_cp namelist variables for SE runs
+
+izumi/gnu/aux_cam: Expecting namelist and baseline failures
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.FADIAB.izumi_gnu.cam-terminator (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC4.izumi_gnu.cam-outfrq3s_diags (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_gnu.cam-outfrq3s_unicon (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_gnu.cam-rad_diag (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPSPCAMM.izumi_gnu.cam-outfrq3s (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC4.izumi_gnu.cam-outfrq3s_nudging_ne5_L26 (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq3s_ba (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.ne5pg2_ne5pg2_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: DIFF)
+ ERC_D_Ln9_Vnuopc.ne5pg4_ne5pg4_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: DIFF)
+ ERP_Ln9_Vnuopc.ne5_ne5_mg37.FHS94.izumi_gnu.cam-outfrq9s (Overall: DIFF)
+ ERP_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq9s (Overall: DIFF)
+ PEM_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: DIFF)
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal0 (Overall: DIFF)
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal1 (Overall: DIFF)
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal3 (Overall: DIFF)
+ SMS_D_Ln3_Vnuopc.f10_f10_mg37.QPMOZ.izumi_gnu.cam-outfrq3s_chemproc (Overall: DIFF)
+ SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s (Overall: DIFF)
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC4.izumi_gnu.cam-outfrq9s_apmee (Overall: DIFF)
+ SMS_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-outfrq3s_ttrac (Overall: DIFF)
+ - expecting climate changing differences in SE,MPAS,FV3
+ - verified FV,EUL differences are roundoff
+
+ FAIL ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC4.izumi_gnu.cam-outfrq3s_nudging_ne5_L26 NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq3s_ba NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.ne5pg2_ne5pg2_mg37.FADIAB.izumi_gnu.cam-outfrq3s NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.ne5pg4_ne5pg4_mg37.FADIAB.izumi_gnu.cam-outfrq3s NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.T5_T5_mg37.QPC3.izumi_gnu.cam-outfrq3s_usecase NLCOMP
+ FAIL ERP_Ln9_Vnuopc.ne5_ne5_mg37.FHS94.izumi_gnu.cam-outfrq9s NLCOMP
+ FAIL ERP_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq9s NLCOMP
+ FAIL PEM_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.FADIAB.izumi_gnu.cam-outfrq3s NLCOMP
+ FAIL PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal0 NLCOMP
+ FAIL PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal1 NLCOMP
+ FAIL PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal3 NLCOMP
+ FAIL SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-outfrq3s_ttrac NLCOMP
+ - expected NLCOMP failures due to removal of se_lcp_moist, se_phys_dyn_cp namelist variables for SE runs
+ - expected NLCOMP failures from addition of GRAUPEL to water species for cam_dev and FV3 runs
+ - expected NLCOMP failures due to change in format of water_species_in_air for EUL runs
+
+Summarize any changes to answers: climate changing for SE,MPAS due to science updates
+ climate changing for FV3 due to addition of GRAUPEL
+ roundoff for FV and EUL
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_108
+Originator(s): fvitt
+Date: 27 Apr 2023
+One-line Summary: Ocean emissions bug fix; enable passing lightning flash rates to surface models
+Github PR URLs:
+
+ https://github.com/ESCOMP/CAM/pull/795
+ https://github.com/ESCOMP/CAM/pull/747
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+ Fix issue with ocean emissions in B compsets where SSTs are zero over land. #794
+ In configurations where SSTs are zeros over land (B compsets) divide by zero
+ errors have occurred. The where block used to mask the calculations of fluxes
+ was not preforming as intended to avoid the divide by zero errors. The where
+ block is replaced with a loop over columns and explicitly check columns for
+ ocean fraction. The flux calculations are preformed only in columns not over
+ land.
+
+ Enable passing cloud-to-ground lightning flash rates to surface models. #567
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist:
+
+ atm_provides_lightning indicator added to drv_flds_in:
+ If TRUE atmosphere model will provide prognosed lightning flash frequency.
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: cacraigucar nusbaume jedwards4b jtruesdal brian-eaton
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+
+M Externals.cfg
+ - update CMEPS for lightning flash freqencies field
+
+M bld/build-namelist
+ - added namelist switch in drv_flds_in for lightning flashes
+ - set lght_no_prd_factor if chemistry includes NO
+
+M bld/namelist_files/namelist_definition.xml
+ - atm_provides lightning switch
+
+M src/chemistry/mozart/mo_chemini.F90
+M src/chemistry/mozart/chemistry.F90
+ - moved reading lightning namelist options to more general location runtime_opts.F90
+
+M src/chemistry/mozart/mo_lightning.F90
+ - add namelist reader
+ - provide cloud-to-ground flash rates
+ - enable use in configurations without chemistry
+ - calculate NOx production rates only if needed by chemistry
+
+M src/chemistry/mozart/ocean_emis.F90
+ - preform calculations on single columns
+ - replace where block with loop over columns -- calc fluxes only in columns over ocean
+
+M src/control/runtime_opts.F90
+ - invoke lightning namelist reader
+
+M src/control/camsrfexch.F90
+M src/cpl/nuopc/atm_import_export.F90
+ - add field for export of lightning flash rates
+
+M src/physics/cam/physpkg.F90
+M src/physics/cam_dev/physpkg.F90
+ - call lightning register and init routines
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam: all bit-for-bit
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: FAIL) details:
+ - pre-existing failure
+
+ ERC_D_Ln9_P144x1_Vnuopc.ne16pg3_ne16pg3_mg17.QPC6HIST.cheyenne_intel.cam-outfrq3s_ttrac_usecase (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq3s_cosp (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPMOZ.cheyenne_intel.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPX2000.cheyenne_intel.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.FADIAB.cheyenne_intel.cam-terminator (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC5HIST.cheyenne_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.T42_T42_mg17.FDABIP04.cheyenne_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.T42_T42_mg17.FHS94.cheyenne_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERI_D_Ln18_Vnuopc.f45_f45_mg37.QPC41850.cheyenne_intel.cam-co2rmp_usecase (Overall: NLFAIL) details:
+ ERP_D_Ln9_Vnuopc.f09_f09_mg17.QSC6.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ln9_P24x3_Vnuopc.f45_f45_mg37.QPWmaC6.cheyenne_intel.cam-outfrq9s_mee_fluxes (Overall: NLFAIL) details:
+ ERS_Ln9_Vnuopc.ne0TESTONLYne5x4_ne0TESTONLYne5x4_mg37.FADIAB.cheyenne_intel.cam-outfrq3s_refined (Overall: NLFAIL) details:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC5.cheyenne_intel.cam-scm_prep (Overall: NLFAIL) details:
+ SMS_D_Ld2_Vnuopc.f19_f19_mg17.QPC5HIST.cheyenne_intel.cam-volc_usecase (Overall: NLFAIL) details:
+ SMS_D_Ld5_Vnuopc.f19_f19_mg17.PC4.cheyenne_intel.cam-cam4_port5d (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC2000climo.cheyenne_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC5M7.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.QPX2000.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_Ld5_Vnuopc.f09_f09_mg17.PC6.cheyenne_intel.cam-cam6_port_f09 (Overall: NLFAIL) details:
+ - NLCOMP failures are due to new lightning_coupling_nl namelist group in drv_flds_in
+
+ ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ld3_Vnuopc.f09_f09_mg17.FWHIST.cheyenne_intel.cam-reduced_hist1d (Overall: DIFF) details:
+ ERP_Lh12_Vnuopc.f19_f19_mg17.FW4madSD.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: DIFF) details:
+ ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details:
+ ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FSPCAMS.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCts2nudged.cheyenne_intel.cam-outfrq9s_leapday (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCvbsxHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.T42_T42.FSCAM.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Lm13_Vnuopc.f10_f10_mg37.F2000climo.cheyenne_intel.cam-outfrq1m (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-nudging (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.FW1850.cheyenne_intel.cam-reduced_hist3s (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f19_f19.F2000climo.cheyenne_intel.cam-silhs (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f19_f19_mg17.FHIST.cheyenne_intel.cam-outfrq9s_nochem (Overall: DIFF) details:
+ - differences are due to new atmImp_Sa_lightning coupler field -- otherwise all bit-for-bit
+ - NLCOMP failures are due to new lightning_coupling_nl namelist group in drv_flds_in
+
+izumi/nag/aux_cam: all bit-for-bit
+
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - pre-existing failure
+
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-carma_sea_salt (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_cosp (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_subcol (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_convmic (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QSPCAMS.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.mpasa480z32_mpasa480.FHS94.izumi_nag.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne16pg3_ne16pg3_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-outfrq3s_ttrac (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.T5_T5_mg37.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERI_D_Ln18_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac (Overall: NLFAIL) details:
+ ERI_D_Ln18_Vnuopc.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 (Overall: NLFAIL) details:
+ ERI_D_Ln18_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s_bwic (Overall: NLFAIL) details:
+ ERI_D_Ln18_Vnuopc.ne5pg3_ne5pg3_mg37.FADIAB.izumi_nag.cam-outfrq3s_bwic (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: NLFAIL) details:
+ ERS_Ln27_Vnuopc.ne5pg3_ne5pg3_mg37.FKESSLER.izumi_nag.cam-outfrq9s (Overall: NLFAIL) details:
+ ERS_Ln9_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq9s (Overall: NLFAIL) details:
+ PEM_D_Ln9_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: NLFAIL) details:
+ SMS_D_Ld2_Vnuopc.f45_f45_mg37.PC5.izumi_nag.cam-outfrq24h_port (Overall: NLFAIL) details:
+ SMS_D_Ln3_Vnuopc.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ SMS_D_Ln6_Vnuopc.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem (Overall: NLFAIL) details:
+ SMS_D_Ln7_Vnuopc.T42_T42_mg17.QPSCAMC5.izumi_nag.cam-scmarm (Overall: NLFAIL) details:
+ SMS_D_Ln9_P1x1_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-rad_diag_mam (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_ba (Overall: NLFAIL) details:
+ SMS_P48x1_D_Ln3_Vnuopc.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase (Overall: NLFAIL) details:
+ SUB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ TMC_D_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac (Overall: NLFAIL) details:
+ TMC_D_Vnuopc.T5_T5_mg37.QPC5.izumi_nag.cam-ghgrmp_e8 (Overall: NLFAIL) details:
+ - NLCOMP failures are due to new lightning_coupling_nl namelist group in drv_flds_in
+
+izumi/gnu/aux_cam: all bit-for-bit
+
+ SMS_P48x1_D_Ln9_Vnuopc.f19_f19_mg17.FW4madSD.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ - differences are due to new atmImp_Sa_lightning coupler field -- otherwise all bit-for-bit
+ - NLCOMP failures are due to new lightning_coupling_nl namelist group in drv_flds_in
+
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.FADIAB.izumi_gnu.cam-terminator (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC4.izumi_gnu.cam-outfrq3s_diags (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_gnu.cam-outfrq3s_unicon (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_gnu.cam-rad_diag (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPSPCAMM.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC4.izumi_gnu.cam-outfrq3s_nudging_ne5_L26 (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq3s_ba (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne5pg2_ne5pg2_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne5pg4_ne5pg4_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.T5_T5_mg37.QPC3.izumi_gnu.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERI_D_Ln18_Vnuopc.T5_T5_mg37.QPC4.izumi_gnu.cam-co2rmp (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.ne5_ne5_mg37.FHS94.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
+ PEM_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal0 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal1 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal3 (Overall: NLFAIL) details:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC4.izumi_gnu.cam-scm_prep (Overall: NLFAIL) details:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC6.izumi_gnu.cam-scm_prep_c6 (Overall: NLFAIL) details:
+ SMS_D_Ln3_Vnuopc.f10_f10_mg37.QPMOZ.izumi_gnu.cam-outfrq3s_chemproc (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC4.izumi_gnu.cam-outfrq9s_apmee (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-outfrq3s_ttrac (Overall: NLFAIL) details:
+ - NLCOMP failures are due to new lightning_coupling_nl namelist group in drv_flds_in
+
+Summarize any changes to answers: bit-for-bit unchanged
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_107
+Originator(s): eaton
+Date: Tue Apr 18 10:27:45 AM EDT 2023
+One-line Summary: Reimplement zonal_mean_mod::Invert_Matrix using LAPACK DGESV
+Github PR URL: https://github.com/ESCOMP/CAM/pull/788
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+The Invert_Matrix subroutine in module zonal_mean_mod has been
+reimplemented using the LAPACK subroutine DGESV.
+
+Resolves:
+. Replace "Invert_Matrix" subroutine in "zonal_mean_mod.F90" with LAPACK version #736
+ (https://github.com/ESCOMP/CAM/issues/736)
+. Bug in zonal mean "Invert_Matrix" subroutine #745
+ (https://github.com/ESCOMP/CAM/issues/745)
+
+Describe any changes made to build system: none
+
+Describe any changes made to the namelist: none
+
+List any changes to the defaults for the boundary datasets: none
+
+Describe any substantial timing or memory changes: not tested
+
+Code reviewed by: fvitt, cacraigucar, peverwhee, patcal
+
+List all files eliminated: none
+
+List all files added and what they do: none
+
+List all existing files that have been modified, and describe the changes:
+
+src/utils/zonal_mean_mod.F90
+. modify subroutine Invert_Matrix to use LAPACK DGESV routine.
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: FAIL) details:
+ - pre-existing failure
+
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: DIFF) details:
+ - the zonal mean (*zm) fields in the h1 file have 2-3 significant digits of agreement
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - pre-existing failure
+
+ SMS_D_Ln6_Vnuopc.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem (Overall: DIFF) details:
+ - the zonal mean (*zm) fields in the h2 file have 2-3 significant digits of agreement
+
+izumi/gnu/aux_cam:
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC4.izumi_gnu.cam-outfrq3s_nudging_ne5_L26 (Overall: DIFF) details:
+ - diffs in all fields in h0 and h1 files. This is expected because the
+ the nudging uses the zonal_mean_mod code if Nudge_ZonalFilter is true,
+ which it is in this test.
+
+CAM tag used for the baseline comparison tests if different than previous
+tag:
+
+Summarize any changes to answers:
+
+. The only changes to answers are for runs using nudging with
+ Nudge_ZonalFilter set to true.
+
+. The zonal mean diagnostic output only agrees with previous output to a
+ couple of significant figures. That's because previous output was
+ produced with a bug in the Invert_Matrix subroutine (issue #745).
+ Independent testing showed that fixing that bug and comparing with the
+ new version of Invert_Matrix yields roundoff level differences (15-16
+ significant digits of agreement).
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_106
+Originator(s): cacraig, fvitt, eaton
+Date: Thu Apr 6 07:10:24 PM EDT 2023
+One-line Summary: Initialize CO2 when it's missing from initial file.
+Github PR URL: https://github.com/ESCOMP/CAM/pull/780
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+Fixes: When CO2 is not in IC file, needs to initialize to a non-zero value #779
+ https://github.com/ESCOMP/CAM/issues/779
+
+Describe any changes made to build system: none
+
+Describe any changes made to the namelist: none
+
+List any changes to the defaults for the boundary datasets: none
+
+Describe any substantial timing or memory changes: none
+
+Code reviewed by: brian-eaton, fvitt, nusbaume
+
+List all files eliminated: none
+
+List all files added and what they do: none
+
+List all existing files that have been modified, and describe the changes:
+
+src/chemistry/mozart/chemisty.F90
+. For ghg_chem, add CO2 to the case statement to use chem_surfvals_get
+ for initialization.
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: FAIL) details:
+ - pre-existing failure
+
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: DIFF) details:
+ - expected diff due to change in CO2 initialization
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - pre-existing failure
+
+izumi/gnu/aux_cam:
+ SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ - expected diff due to change in CO2 initialization
+
+CAM tag used for the baseline comparison tests if different than previous
+tag:
+
+Summarize any changes to answers: BFB except for any run using ghg_mam4
+ chemistry and using an initial file that doesn't contain CO2. In that
+ case the CO2 is now being initialized by chem_surf_vals. Previously it was
+ zero above the surface layer which is set by the LBC code.
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_105
+Originator(s): bstephens, eaton
+Date: Thu Apr 6 09:51:59 AM EDT 2023
+One-line Summary: fix for COSP with cam_dev physics
+Github PR URL: https://github.com/ESCOMP/CAM/pull/777
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+Fixes: Add PBUF fields to make cosp compatible with cam_dev #776
+ https://github.com/ESCOMP/CAM/issues/776
+ Note: the original fix was reimplemented to just check whether or
+ not fields used by the cosp simulator are present in the pbuf, and
+ if not then to use local arrays of zeros.
+
+Describe any changes made to build system: none
+
+Describe any changes made to the namelist: none
+
+List any changes to the defaults for the boundary datasets: none
+
+Describe any substantial timing or memory changes: none
+
+Code reviewed by: brian-eaton, cacraigucar, adamrher
+
+List all files eliminated: none
+
+List all files added and what they do: none
+
+List all existing files that have been modified, and describe the changes:
+
+src/physics/cam/cospsimulator_intr.F90
+. remove pbuf_get_index calls for SH_CLDLIQ, SH_CLDICE. The indices were
+ not being used.
+. add optional arg to pbuf_get_index calls for SH_FLXPRC, SH_FLXSNW to
+ avoid endrun calls if fields not present in the pbuf. In that case
+ negative value indices are returned and appropriate action can be taken.
+ In this case the fields are assigned values of zero.
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: FAIL) details:
+. expected failure
+
+izumi/nag/aux_cam:
+DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+. expected failure
+
+izumi/gnu/aux_cam: All PASS.
+
+CAM tag used for the baseline comparison tests if different than previous
+tag:
+
+Summarize any changes to answers: BFB
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_104
+Originator(s): fvitt
+Date: 5 Apr 2023
+One-line Summary: Misc bug fixes
+Github PR URL: https://github.com/ESCOMP/CAM/pull/785
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+ Fix issues:
+ - ghg_mam4 is not working with cam_dev regression tests #773
+ - undefined rho values in nucleate_ice_cam_calc #781
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: brian-eaton cacraigucar nusbaume
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+
+M bld/namelist_files/use_cases/2000_cam6.xml
+ - use appropriate prescribed tracer inputs for trop_mam4 and ghg_mam4 chemistry
+ -- ghg_mam4 needs HALONS
+
+M cime_config/testdefs/testlist_cam.xml
+ - add regression test for GHG chem with cam_dev phys and year 2000 use case
+
+M src/chemistry/mozart/tracer_cnst.F90
+ - add error checking
+
+M src/physics/cam/nucleate_ice_cam.F90
+ - define rho for all model layers
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: FAIL) details:
+ - pre-existing failure
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - pre-existing failure
+
+izumi/gnu/aux_cam:
+ SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ - new test
+
+Summarize any changes to answers: bit-for-bit unchanged
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_103
+Originator(s): cacraig
+Date: Apr 5, 2023
+One-line Summary: Update externals to almost match cesm2_3_alpha12d
+Github PR URL: https://github.com/ESCOMP/CAM/pull/783
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+ - CLM tag is one newer than was used in alpha12d as it contains some of the coarse grid modifications
+ - FMS is an older version (inherited from cam6_3_102)
+ - cpl7 is one tag newer (inherited from cam6_3_102)
+ - Multi-instance is broken with current CMEPS external: https://github.com/ESCOMP/CAM/issues/733
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: nusbaume, eaton
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+M Externals.cfg
+ - Externals updated as described above
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: FAIL) details:
+ - pre-existing failure
+
+ ERC_D_Ln9_P144x1_Vnuopc.ne16pg3_ne16pg3_mg17.QPC6HIST.cheyenne_intel.cam-outfrq3s_ttrac_usecase (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq3s_cosp (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPMOZ.cheyenne_intel.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPX2000.cheyenne_intel.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.FADIAB.cheyenne_intel.cam-terminator (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC5HIST.cheyenne_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.T42_T42_mg17.FDABIP04.cheyenne_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.T42_T42_mg17.FHS94.cheyenne_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERI_D_Ln18_Vnuopc.f45_f45_mg37.QPC41850.cheyenne_intel.cam-co2rmp_usecase (Overall: NLFAIL) details:
+ ERP_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Lh12_Vnuopc.f19_f19_mg17.FW4madSD.cheyenne_intel.cam-outfrq3h (Overall: NLFAIL) details:
+ ERP_Ln9_P24x3_Vnuopc.f45_f45_mg37.QPWmaC6.cheyenne_intel.cam-outfrq9s_mee_fluxes (Overall: NLFAIL) details:
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FSPCAMS.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ ERS_Ln9_Vnuopc.ne0TESTONLYne5x4_ne0TESTONLYne5x4_mg37.FADIAB.cheyenne_intel.cam-outfrq3s_refined (Overall: NLFAIL) details:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC5.cheyenne_intel.cam-scm_prep (Overall: NLFAIL) details:
+ SMS_D_Ld2_Vnuopc.f19_f19_mg17.QPC5HIST.cheyenne_intel.cam-volc_usecase (Overall: NLFAIL) details:
+ SMS_D_Ld5_Vnuopc.f19_f19_mg17.PC4.cheyenne_intel.cam-cam4_port5d (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC2000climo.cheyenne_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC5M7.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.QPX2000.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.T42_T42.FSCAM.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_Ld5_Vnuopc.f09_f09_mg17.PC6.cheyenne_intel.cam-cam6_port_f09 (Overall: NLFAIL) details:
+ - namelist differences due to 'import_data_fields' added to docn_in and nuopc.runseq run seqeunce modified
+
+ ERP_D_Ln9_Vnuopc.f09_f09_mg17.QSC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ - concluded this answer change was most likely due to the change in value of the run sequence in nuopc.runseq having
+ phases_aofluxes_run being run before the ocn elements
+
+ ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ld3_Vnuopc.f09_f09_mg17.FWHIST.cheyenne_intel.cam-reduced_hist1d (Overall: DIFF) details:
+ ERP_Ln9_Vmct.f09_f09_mg17.2000_CAM60_CLM50%SP_CICE5%PRES_DOCN%DOM_MOSART_SGLC_SWAV.cheyenne_intel.cam-outfrq9s (Overall: DIFF)
+details:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: DIFF) details:
+ ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details:
+ ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCts2nudged.cheyenne_intel.cam-outfrq9s_leapday (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCvbsxHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.f09_f09_mg17.FW2000climo.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Lm13_Vnuopc.f10_f10_mg37.F2000climo.cheyenne_intel.cam-outfrq1m (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-nudging (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.FW1850.cheyenne_intel.cam-reduced_hist3s (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f19_f19.F2000climo.cheyenne_intel.cam-silhs (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f19_f19_mg17.FHIST.cheyenne_intel.cam-outfrq9s_nochem (Overall: DIFF) details:
+ - CTSM has answer changes which expect to change F compsets
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - pre-existing failure
+
+ ERP_Vnuopc_Ln9.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: DIFF) details:
+ - baseline failure due to new test accidentally introduced in CMEPS
+
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-carma_sea_salt (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_cosp (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_subcol (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_convmic (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QSPCAMS.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.mpasa480z32_mpasa480.FHS94.izumi_nag.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne16pg3_ne16pg3_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-outfrq3s_ttrac (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.T5_T5_mg37.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERI_D_Ln18_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac (Overall: NLFAIL) details:
+ ERI_D_Ln18_Vnuopc.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 (Overall: NLFAIL) details:
+ ERI_D_Ln18_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s_bwic (Overall: NLFAIL) details:
+ ERI_D_Ln18_Vnuopc.ne5pg3_ne5pg3_mg37.FADIAB.izumi_nag.cam-outfrq3s_bwic (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: NLFAIL) details:
+ ERS_Ln27_Vnuopc.ne5pg3_ne5pg3_mg37.FKESSLER.izumi_nag.cam-outfrq9s (Overall: NLFAIL) details:
+ ERS_Ln9_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq9s (Overall: NLFAIL) details:
+ PEM_D_Ln9_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: NLFAIL) details:
+ SMS_D_Ld2_Vnuopc.f45_f45_mg37.PC5.izumi_nag.cam-outfrq24h_port (Overall: NLFAIL) details:
+ SMS_D_Ln3_Vnuopc.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ SMS_D_Ln6_Vnuopc.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem (Overall: NLFAIL) details:
+ SMS_D_Ln7_Vnuopc.T42_T42_mg17.QPSCAMC5.izumi_nag.cam-scmarm (Overall: NLFAIL) details:
+ SMS_D_Ln9_P1x1_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-rad_diag_mam (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_ba (Overall: NLFAIL) details:
+ SMS_P48x1_D_Ln3_Vnuopc.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase (Overall: NLFAIL) details:
+ SUB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ TMC_D_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac (Overall: NLFAIL) details:
+ TMC_D_Vnuopc.T5_T5_mg37.QPC5.izumi_nag.cam-ghgrmp_e8 (Overall: NLFAIL) details:
+
+izumi/gnu/aux_cam:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.FADIAB.izumi_gnu.cam-terminator (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC4.izumi_gnu.cam-outfrq3s_diags (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_gnu.cam-outfrq3s_unicon (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_gnu.cam-rad_diag (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPSPCAMM.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC4.izumi_gnu.cam-outfrq3s_nudging_ne5_L26 (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq3s_ba (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne5pg2_ne5pg2_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.ne5pg4_ne5pg4_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
+ ERC_D_Ln9_Vnuopc.T5_T5_mg37.QPC3.izumi_gnu.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ ERI_D_Ln18_Vnuopc.T5_T5_mg37.QPC4.izumi_gnu.cam-co2rmp (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.ne5_ne5_mg37.FHS94.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
+ ERP_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
+ PEM_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal0 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal1 (Overall: NLFAIL) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal3 (Overall: NLFAIL) details:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC4.izumi_gnu.cam-scm_prep (Overall: NLFAIL) details:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC6.izumi_gnu.cam-scm_prep_c6 (Overall: NLFAIL) details:
+ SMS_D_Ln3_Vnuopc.f10_f10_mg37.QPMOZ.izumi_gnu.cam-outfrq3s_chemproc (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC4.izumi_gnu.cam-outfrq9s_apmee (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-outfrq3s_ttrac (Overall: NLFAIL) details:
+ SMS_P48x1_D_Ln9_Vnuopc.f19_f19_mg17.FW4madSD.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
+ - namelist differences due to 'import_data_fields' added to docn_in and nuopc.runseq run seqeunce modified
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_102
+Originator(s): fvitt
+Date: 4 Apr 2023
+One-line Summary: Updates to TEM diagnostics
+Github PR URL: https://github.com/ESCOMP/CAM/pull/770
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+ - fix issue with TEM diagnostics not implemented in cam_dev physics #769
+ - adopt the zm naming convention for the zonal mean outputs
+ - add 'Uzm','Vzm','Wzm','THzm' output fields
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: brian-eaton cacraigucar nusbaume
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+M cime_config/testdefs/testmods_dirs/cam/outfrq1d_14dec_ghg_cam_dev/user_nl_cam
+ - include namelist options to test TEM output
+
+M cime_config/testdefs/testmods_dirs/cam/outfrq1d_physgrid_tem_mpasa120_wcmsc/user_nl_cam
+M cime_config/testdefs/testmods_dirs/cam/outfrq3s_physgrid_tem/user_nl_cam
+M cime_config/testdefs/testmods_dirs/cam/outfrq9s_physgrid_tem_1deg/user_nl_cam
+ - use zm history field names for the TEM output
+
+M src/physics/cam/phys_grid_ctem.F90
+ - adopts the zm naming convention for the zonal mean outputs
+ - add 'Uzm','Vzm','Wzm','THzm' output fields
+
+M src/physics/cam_dev/physpkg.F90
+ - add calls to the phys_grid_ctem interface
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: FAIL) details:
+ - pre-existing failure
+
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: DIFF) details:
+ FAIL ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev NLCOMP
+ FAIL ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_101: ERROR BFAIL some baseline files were missing
+ - expected failure -- TEM output added to this test
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - pre-existing failure
+
+ SMS_D_Ln6_Vnuopc.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem (Overall: DIFF) details:
+ FAIL SMS_D_Ln6_Vnuopc.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem NLCOMP
+ FAIL SMS_D_Ln6_Vnuopc.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_101_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ - change in TEM output field names
+
+izumi/gnu/aux_cam: All PASS
+
+Summarize any changes to answers: bit-for-bit unchanged
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_101
+Originator(s): cacraig, eaton, hannay, Thomas Toniazzo, Vince Larson
+Date: March 31, 2023
+One-line Summary: Create FLTHIST_v0a compset
+Github PR URL: Create initial FLTHIST and FMTHIST compsets for CAM7: https://github.com/ESCOMP/CAM/pull/767
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+ - Create testing compsets based on FLT,FMT,FW and FX: https://github.com/ESCOMP/CAM/issues/765
+ - Partially implements these compsets: FLTHIST_v0a has been worked on with Cecile
+ FMTHIST_v0a has been started, but is not complete
+ Other compsets have not been worked on
+ - Update CLUBB external (fix bug found by Thomas Toniazzo): https://github.com/ESCOMP/CAM/issues/768
+
+Describe any changes made to build system:
+ - Introduce %LT (low_top) %MT (mid_top) and %GHGMAM4 (turn on ghg_mam4 chemistry)
+ - Remove %L58 and %L93 settings and replace with %LT and %MT
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: eaton, nusbaume, fvitt
+
+List all files eliminated: N/A
+
+List all files added and what they do:
+A bld/namelist_files/use_cases/hist_cam_lt.xml
+ - use_case for FLTHIST_v0a - developed in consultation with Cecile
+
+A bld/namelist_files/use_cases/hist_cam_mt.xml
+ - template use_case for FMTHIST_v0a - not completed
+
+List all existing files that have been modified, and describe the changes:
+M Externals_CAM.cfg
+ - Bring in CLUBB bug fix tag which fixes small bug in mono_flux_limiter.F90
+
+M bld/namelist_files/namelist_defaults_cam.xml
+ - Add initial condition files for ne30np4, npg=3 for 58 and 93 levels
+ - Add topo file for ne30np4, npg=3
+
+M cime_config/config_component.xml
+ - Remove %L58 and %L93
+ - Introduce %LT, %MT and %GHGMAM4 options
+
+M cime_config/config_compsets.xml
+ - Introduce FLTHIST_v0a compset (note that a regression test was not introduced for it yet)
+ - Create FMTHIST_v0a compset (not completed)
+ - replace %L58 and %L93 with %LT and %MT
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam: all BFB except:
+ FAIL ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc_P720x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.cheyenne_intel.cam-outfrq1d NLCOMP
+ - topo file change
+
+ FAIL ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s BASELINE
+ FAIL SMS_D_Ln9_Vnuopc_P720x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s BASELINE
+ FAIL SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.cheyenne_intel.cam-outfrq1d BASELINE
+ - expected baseline changes due to new topo file
+
+ FAIL ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 RUN time=119
+ - New failing test - issue https://github.com/ESCOMP/CAM/issues/772 opened
+
+izumi/nag/aux_cam: all BFB except:
+ FAIL DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae RUN time=180
+ - pre-existing failure
+
+izumi/gnu/aux_cam: all BFB
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_100
+Originator(s): fvitt
+Date: 20 Mar 2023
+One-line Summary: Introduce prognostic GHG chemistry mechanism for CAM7
+Github PR URL: https://github.com/ESCOMP/CAM/pull/766
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+ New chemistry mechanism for CAM7 prognostic GHGs #762
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: brian-eaton jtruesdal cacraigucar nusbaume
+
+List all files eliminated: N/A
+
+List all files added and what they do:
+A src/chemistry/pp_ghg_mam4/chem_mech.doc
+A src/chemistry/pp_ghg_mam4/chem_mech.in
+A src/chemistry/pp_ghg_mam4/chem_mods.F90
+A src/chemistry/pp_ghg_mam4/m_rxt_id.F90
+A src/chemistry/pp_ghg_mam4/m_spc_id.F90
+A src/chemistry/pp_ghg_mam4/mo_adjrxt.F90
+A src/chemistry/pp_ghg_mam4/mo_exp_sol.F90
+A src/chemistry/pp_ghg_mam4/mo_imp_sol.F90
+A src/chemistry/pp_ghg_mam4/mo_indprd.F90
+A src/chemistry/pp_ghg_mam4/mo_lin_matrix.F90
+A src/chemistry/pp_ghg_mam4/mo_lu_factor.F90
+A src/chemistry/pp_ghg_mam4/mo_lu_solve.F90
+A src/chemistry/pp_ghg_mam4/mo_nln_matrix.F90
+A src/chemistry/pp_ghg_mam4/mo_phtadj.F90
+A src/chemistry/pp_ghg_mam4/mo_prod_loss.F90
+A src/chemistry/pp_ghg_mam4/mo_rxt_rates_conv.F90
+A src/chemistry/pp_ghg_mam4/mo_setrxt.F90
+A src/chemistry/pp_ghg_mam4/mo_sim_dat.F90
+ - add ghg_mam4 chemistry mechanism
+
+List all existing files that have been modified, and describe the changes:
+M bld/namelist_files/namelist_definition.xml
+M bld/config_files/definition.xml
+M bld/configure
+ - add ghg_mam4 chem option
+
+M bld/build-namelist
+M bld/namelist_files/namelist_defaults_cam.xml
+ - default namelist settings for ghg_mam4 chemistry
+
+M cime_config/testdefs/testlist_cam.xml
+ - add test for ghg_mam4
+ - replace outfrq1d_14dec_L32wsc with outfrq1d_14dec_ghg_cam_dev
+ -- replaces "-chem waccm_sc_mam4" with "-chem ghg_mam4"
+ -- this is more relevant for CAM7 development
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_ghg_cam_dev (Overall: DIFF) details:
+ - new test which replaces outfrq1d_14dec_L32wsc
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - pre-existing failure
+
+izumi/gnu/aux_cam: All PASS
+
+Summarize any changes to answers: bit-for-bit unchanged
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_099
+Originator(s): adamrher, eaton
+Date: Thu Mar 16 11:22:00 AM EDT 2023
+One-line Summary: fix drydep emissions for cam_dev physics
+Github PR URL: https://github.com/ESCOMP/CAM/pull/763
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+. Fixes #759 (https://github.com/ESCOMP/CAM/issues/759)
+ drydep of gas phase species "skipped" in cam_dev
+
+Describe any changes made to build system: none
+
+Describe any changes made to the namelist: none
+
+List any changes to the defaults for the boundary datasets: none
+
+Describe any substantial timing or memory changes: none
+
+Code reviewed by: jtruesdal, cacraigucar, fvitt, nusbaume
+
+List all files eliminated: none
+
+List all files added and what they do: none
+
+List all existing files that have been modified, and describe the changes:
+
+src/chemistry/mozart/chemistry.F90
+. add state%rpdel, state%rpdeldry to actual args in call to
+ gas_phase_chemdr
+
+src/chemistry/mozart/mo_gas_phase_chemdr.F90
+. add rpdel, rpdeldry to dummy args for gas_phase_chemdr
+. access cam_physpkg_is from phys_control module
+. access gravit from physconst
+. access cnst_type from constituents
+. if cam_dev physics then apply drydep fluxes directly to the species
+ tendency array, else apply to the emissions array.
+
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_L32wsc (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+
+ - There are baseline diffs in all tests that use cam_dev physics.
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+
+ - pre-existing failure
+
+izumi/gnu/aux_cam:
+
+ - All PASS
+
+CAM tag used for the baseline comparison tests if different than previous
+tag:
+
+Summarize any changes to answers: BFB except for cam_dev physics due to
+ fix in treatment of drydep fluxes.
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_098
+Originator(s): mvertens, eaton
+Date: Tue Mar 14 09:16:31 MDT 2023
+One-line Summary: always pass NDEP from CAM and remove sst specs
+Github PR URL: https://github.com/ESCOMP/CAM/pull/764
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+. Resolve issue #104 - https://github.com/ESCOMP/CAM/issues/104
+ Always send Nitrogen-deposition to surface components.
+
+ This PR enables CAM to read in ndep (using the CDEPS inline API) from
+ forcing files if it is not computing NDEP prognostically. As a result
+ CAM will ALWAYS send NDEP to the mediator.
+
+ Right how, CLM is not using the passed NDEP from the streams - since it
+ is still reading the drv_flds_in for NDEP.
+
+ It is now possible for the drv_flds_in entry for ndep to be removed
+ and CLM can always accept NDEP from either CAM or DATM.
+
+ New XML variables are introduced to specify the stream forcing. This is
+ being done in CTSM as well for all of its CDEPS stream specific variables.
+
+ NOTE: that CTSM also needs a new PR in order to accept these new fields
+ from CAM rather than use its own internal streams.
+
+. Remove old sst specs from the namelist. This is a cleanup.
+
+Describe any changes made to build system: none
+
+Describe any changes made to the namelist:
+. The follow variables are in new group ndep_stream_nl which is read in
+ src/cpl/nuopc/atm_stream_ndep.F90
+ stream_ndep_year_first
+ stream_ndep_year_last
+ stream_ndep_year_align
+ stream_ndep_data_filename
+ stream_ndep_mesh_filename
+
+List any changes to the defaults for the boundary datasets:
+. NDEP datasets are added by cime_config/config_component.xml
+
+Describe any substantial timing or memory changes: not tested
+
+Code reviewed by: gold2718, fvitt, cacraigucar, nusbaume, brian-eaton
+
+List all files eliminated: none
+
+List all files added and what they do:
+
+src/cpl/nuopc/atm_stream_ndep.F90
+. Contains methods for reading in nitrogen deposition data file. Also
+ includes functions for dynamic ndep file handling and interpolation.
+. Reads namelist group ndep_stream_nl from the atm_in file.
+
+List all existing files that have been modified, and describe the changes:
+bld/configure
+. remove documentation for -ocn option.
+
+bld/namelist_files/namelist_defaults_cam.xml
+. remove old settings for bndtvs, bndtvs_domain, and focndomain. DOM and
+ DOCN are no longer used.
+
+bld/namelist_files/namelist_definition.xml
+. 5 new variables, stream_ndep_*, are added to group ndep_stream_nl
+. bndtvs, focndomain, and bndtvs_domain removed
+. 5 new variables, *_ndep, added to group ndep_stream_nml
+
+bld/namelist_files/use_cases/1850-2005_cam5.xml
+bld/namelist_files/use_cases/sd_waccm_sulfur.xml
+bld/namelist_files/use_cases/waccm_carma_bc_2013_cam4.xml
+. remove defaults for stream_year_*, bndtvs, sstcyc
+
+bld/namelist_files/use_cases/aquaplanet_cam3.xml
+bld/namelist_files/use_cases/aquaplanet_cam4.xml
+bld/namelist_files/use_cases/aquaplanet_cam5.xml
+bld/namelist_files/use_cases/aquaplanet_cam6.xml
+bld/namelist_files/use_cases/aquaplanet_rce_cam6.xml
+. remove default for aqua_planet (no longer in the namelist definition file)
+
+cime_config/buildnml
+. get values of stream_ndep_* from the corresponding case variables
+ (CAM_STREAM_NDEP_*). Add the namelist key=value pairs to the string that
+ is generated to be passed via the -namelist option.
+
+cime_config/config_component.xml
+. add values for the case variables CAM_STREAM_NDEP_*
+
+src/control/camsrfexch.F90
+. remove conditionals from allocation of cam_out%nhx_nitrogen_flx and
+ cam_out%noy_nitrogen_flx. CAM always provides this data now.
+
+src/cpl/nuopc/atm_comp_nuopc.F90
+. add explicit use/only statements for ESMF module
+. add ESMF Mesh and clock objects with module scope, and add to the calling
+ args for export_fields. They are needed to generate streams.
+
+src/cpl/nuopc/atm_import_export.F90
+. mods so that nhx/noy are always in the list of fields that are exported.
+ If ndep_nflds=0 then the set_active_Faxa_* flags are set false.
+. model_mesh, model_clock added to export_fields arg list
+. add code to export_fields to use the stream code to set nhx/noy
+ deposition if it hasn't been computed.
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ ERC_D_Ln9_P144x1_Vnuopc.ne16pg3_ne16pg3_mg17.QPC6HIST.cheyenne_intel.cam-outfrq3s_ttrac_usecase (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_P144x1_Vnuopc.ne16pg3_ne16pg3_mg17.QPC6HIST.cheyenne_intel.cam-outfrq3s_ttrac_usecase NLCOMP
+ FAIL ERC_D_Ln9_P144x1_Vnuopc.ne16pg3_ne16pg3_mg17.QPC6HIST.cheyenne_intel.cam-outfrq3s_ttrac_usecase BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERC_D_Ln9_Vmct.T42_T42_mg17.FDABIP04.cheyenne_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ FAIL ERC_D_Ln9_Vmct.T42_T42_mg17.FDABIP04.cheyenne_intel.cam-outfrq3s_usecase NLCOMP
+ ERC_D_Ln9_Vmct.T42_T42_mg17.FHS94.cheyenne_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ FAIL ERC_D_Ln9_Vmct.T42_T42_mg17.FHS94.cheyenne_intel.cam-outfrq3s_usecase NLCOMP
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq3s_cosp (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq3s_cosp NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq3s_cosp BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPMOZ.cheyenne_intel.cam-outfrq3s (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPMOZ.cheyenne_intel.cam-outfrq3s NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPMOZ.cheyenne_intel.cam-outfrq3s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPX2000.cheyenne_intel.cam-outfrq3s (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPX2000.cheyenne_intel.cam-outfrq3s NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPX2000.cheyenne_intel.cam-outfrq3s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.FADIAB.cheyenne_intel.cam-terminator (Overall: NLFAIL) details:
+ FAIL ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.FADIAB.cheyenne_intel.cam-terminator NLCOMP
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC5HIST.cheyenne_intel.cam-outfrq3s_usecase (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC5HIST.cheyenne_intel.cam-outfrq3s_usecase NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC5HIST.cheyenne_intel.cam-outfrq3s_usecase BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERC_D_Ln9_Vnuopc.T42_T42_mg17.FDABIP04.cheyenne_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ FAIL ERC_D_Ln9_Vnuopc.T42_T42_mg17.FDABIP04.cheyenne_intel.cam-outfrq3s_usecase NLCOMP
+ ERC_D_Ln9_Vnuopc.T42_T42_mg17.FHS94.cheyenne_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ FAIL ERC_D_Ln9_Vnuopc.T42_T42_mg17.FHS94.cheyenne_intel.cam-outfrq3s_usecase NLCOMP
+ ERI_D_Ln18_Vnuopc.f45_f45_mg37.QPC41850.cheyenne_intel.cam-co2rmp_usecase (Overall: DIFF) details:
+ FAIL ERI_D_Ln18_Vnuopc.f45_f45_mg37.QPC41850.cheyenne_intel.cam-co2rmp_usecase NLCOMP
+ FAIL ERI_D_Ln18_Vnuopc.f45_f45_mg37.QPC41850.cheyenne_intel.cam-co2rmp_usecase BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERP_D_Ln9_Vmct.f09_f09_mg17.QSC6.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ FAIL ERP_D_Ln9_Vmct.f09_f09_mg17.QSC6.cheyenne_intel.cam-outfrq9s NLCOMP
+ ERP_D_Ln9_Vmct.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ FAIL ERP_D_Ln9_Vmct.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s NLCOMP
+ ERP_D_Ln9_Vnuopc.f09_f09_mg17.QSC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_D_Ln9_Vnuopc.f09_f09_mg17.QSC6.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERP_D_Ln9_Vnuopc.f09_f09_mg17.QSC6.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERP_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERP_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERP_Ld3_Vnuopc.f09_f09_mg17.FWHIST.cheyenne_intel.cam-reduced_hist1d (Overall: NLFAIL) details:
+ FAIL ERP_Ld3_Vnuopc.f09_f09_mg17.FWHIST.cheyenne_intel.cam-reduced_hist1d NLCOMP
+ ERP_Lh12_Vnuopc.f19_f19_mg17.FW4madSD.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ FAIL ERP_Lh12_Vnuopc.f19_f19_mg17.FW4madSD.cheyenne_intel.cam-outfrq3h NLCOMP
+ FAIL ERP_Lh12_Vnuopc.f19_f19_mg17.FW4madSD.cheyenne_intel.cam-outfrq3h BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERP_Ln9_P24x3_Vnuopc.f45_f45_mg37.QPWmaC6.cheyenne_intel.cam-outfrq9s_mee_fluxes (Overall: DIFF) details:
+ FAIL ERP_Ln9_P24x3_Vnuopc.f45_f45_mg37.QPWmaC6.cheyenne_intel.cam-outfrq9s_mee_fluxes NLCOMP
+ FAIL ERP_Ln9_P24x3_Vnuopc.f45_f45_mg37.QPWmaC6.cheyenne_intel.cam-outfrq9s_mee_fluxes BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERP_Ln9_Vmct.f09_f09_mg17.2000_CAM60_CLM50%SP_CICE5%PRES_DOCN%DOM_MOSART_SGLC_SWAV.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ FAIL ERP_Ln9_Vmct.f09_f09_mg17.2000_CAM60_CLM50%SP_CICE5%PRES_DOCN%DOM_MOSART_SGLC_SWAV.cheyenne_intel.cam-outfrq9s NLCOMP
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 NLCOMP
+ FAIL ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 NLCOMP
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ FAIL ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.cheyenne_intel.cam-outfrq9s NLCOMP
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: NLFAIL) details:
+ FAIL ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 NLCOMP
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_L32wsc (Overall: DIFF) details:
+ FAIL ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_L32wsc NLCOMP
+ FAIL ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_L32wsc BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details:
+ FAIL ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 NLCOMP
+ FAIL ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 (Overall: DIFF) details:
+ FAIL ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 NLCOMP
+ FAIL ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FSPCAMS.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERS_Ln9_Vnuopc.f19_f19_mg17.FSPCAMS.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERS_Ln9_Vnuopc.f19_f19_mg17.FSPCAMS.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERS_Ln9_Vnuopc.ne0TESTONLYne5x4_ne0TESTONLYne5x4_mg37.FADIAB.cheyenne_intel.cam-outfrq3s_refined (Overall: NLFAIL) details:
+ FAIL ERS_Ln9_Vnuopc.ne0TESTONLYne5x4_ne0TESTONLYne5x4_mg37.FADIAB.cheyenne_intel.cam-outfrq3s_refined NLCOMP
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC5.cheyenne_intel.cam-scm_prep (Overall: DIFF) details:
+ FAIL SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC5.cheyenne_intel.cam-scm_prep NLCOMP
+ FAIL SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC5.cheyenne_intel.cam-scm_prep BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_D_Ld2_Vnuopc.f19_f19_mg17.QPC5HIST.cheyenne_intel.cam-volc_usecase (Overall: DIFF) details:
+ FAIL SMS_D_Ld2_Vnuopc.f19_f19_mg17.QPC5HIST.cheyenne_intel.cam-volc_usecase NLCOMP
+ FAIL SMS_D_Ld2_Vnuopc.f19_f19_mg17.QPC5HIST.cheyenne_intel.cam-volc_usecase BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_D_Ld5_Vnuopc.f19_f19_mg17.PC4.cheyenne_intel.cam-cam4_port5d (Overall: NLFAIL) details:
+ FAIL SMS_D_Ld5_Vnuopc.f19_f19_mg17.PC4.cheyenne_intel.cam-cam4_port5d NLCOMP
+ SMS_D_Ln9_Vmct.T42_T42.2000_CAM60%SCAM_CLM50%SP_CICE5%PRES_DOCN%DOM_SROF_SGLC_SWAV.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ FAIL SMS_D_Ln9_Vmct.T42_T42.2000_CAM60%SCAM_CLM50%SP_CICE5%PRES_DOCN%DOM_SROF_SGLC_SWAV.cheyenne_intel.cam-outfrq9s NLCOMP
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCts2nudged.cheyenne_intel.cam-outfrq9s_leapday (Overall: NLFAIL) details:
+ FAIL SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCts2nudged.cheyenne_intel.cam-outfrq9s_leapday NLCOMP
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCvbsxHIST.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ FAIL SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCvbsxHIST.cheyenne_intel.cam-outfrq9s NLCOMP
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s_waccm_ma_mam4 NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s_waccm_ma_mam4 BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC2000climo.cheyenne_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ FAIL SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC2000climo.cheyenne_intel.cam-outfrq3s_usecase NLCOMP
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC5M7.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC5M7.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC5M7.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.QPX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.QPX2000.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.QPX2000.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_D_Ln9_Vnuopc_P720x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc_P720x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc_P720x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_D_Ln9_Vnuopc_P720x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ FAIL SMS_D_Ln9_Vnuopc_P720x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.cheyenne_intel.cam-outfrq9s NLCOMP
+ SMS_D_Ln9_Vnuopc_P720x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ FAIL SMS_D_Ln9_Vnuopc_P720x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s NLCOMP
+ SMS_D_Ln9_Vnuopc.T42_T42.FSCAM.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.T42_T42.FSCAM.cheyenne_intel.cam-outfrq9s NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.T42_T42.FSCAM.cheyenne_intel.cam-outfrq9s BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_Ld1_Vnuopc.f09_f09_mg17.FW2000climo.cheyenne_intel.cam-outfrq1d (Overall: NLFAIL) details:
+ FAIL SMS_Ld1_Vnuopc.f09_f09_mg17.FW2000climo.cheyenne_intel.cam-outfrq1d NLCOMP
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ FAIL SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d NLCOMP
+ FAIL SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.cheyenne_intel.cam-outfrq1d (Overall: NLFAIL) details:
+ FAIL SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.cheyenne_intel.cam-outfrq1d NLCOMP
+ SMS_Ld5_Vnuopc.f09_f09_mg17.PC6.cheyenne_intel.cam-cam6_port_f09 (Overall: NLFAIL) details:
+ FAIL SMS_Ld5_Vnuopc.f09_f09_mg17.PC6.cheyenne_intel.cam-cam6_port_f09 NLCOMP
+ SMS_Lm13_Vnuopc.f10_f10_mg37.F2000climo.cheyenne_intel.cam-outfrq1m (Overall: DIFF) details:
+ FAIL SMS_Lm13_Vnuopc.f10_f10_mg37.F2000climo.cheyenne_intel.cam-outfrq1m NLCOMP
+ FAIL SMS_Lm13_Vnuopc.f10_f10_mg37.F2000climo.cheyenne_intel.cam-outfrq1m BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-nudging (Overall: DIFF) details:
+ FAIL SMS_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-nudging NLCOMP
+ FAIL SMS_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-nudging BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_Ln9_Vnuopc.f09_f09_mg17.FW1850.cheyenne_intel.cam-reduced_hist3s (Overall: NLFAIL) details:
+ FAIL SMS_Ln9_Vnuopc.f09_f09_mg17.FW1850.cheyenne_intel.cam-reduced_hist3s NLCOMP
+ SMS_Ln9_Vnuopc.f19_f19.F2000climo.cheyenne_intel.cam-silhs (Overall: DIFF) details:
+ FAIL SMS_Ln9_Vnuopc.f19_f19.F2000climo.cheyenne_intel.cam-silhs NLCOMP
+ FAIL SMS_Ln9_Vnuopc.f19_f19.F2000climo.cheyenne_intel.cam-silhs BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_Ln9_Vnuopc.f19_f19_mg17.FHIST.cheyenne_intel.cam-outfrq9s_nochem (Overall: DIFF) details:
+ FAIL SMS_Ln9_Vnuopc.f19_f19_mg17.FHIST.cheyenne_intel.cam-outfrq9s_nochem NLCOMP
+ FAIL SMS_Ln9_Vnuopc.f19_f19_mg17.FHIST.cheyenne_intel.cam-outfrq9s_nochem BASELINE /glade/p/cesm/amwg/cesm_baselines/cam6_3_097: FIELDLIST field lists differ (otherwise bit-for-bit)
+
+The NLCOMP failures are due to adding the ndep_stream_nl group to atm_in.
+The BASELINE test failures are due to different field list in the cpl.hi files.
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ FAIL DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae NLCOMP
+ FAIL DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae RUN time=223
+ PEND DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae COMPARE_base_da
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-carma_sea_salt (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-carma_sea_salt NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-carma_sea_salt BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_cosp (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_cosp NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_cosp BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_subcol (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_subcol NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_subcol BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_convmic (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_convmic NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_convmic BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QSPCAMS.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QSPCAMS.izumi_nag.cam-outfrq3s NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QSPCAMS.izumi_nag.cam-outfrq3s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERC_D_Ln9_Vnuopc.mpasa480z32_mpasa480.FHS94.izumi_nag.cam-outfrq3s_usecase (Overall: NLFAIL) details:
+ FAIL ERC_D_Ln9_Vnuopc.mpasa480z32_mpasa480.FHS94.izumi_nag.cam-outfrq3s_usecase NLCOMP
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERC_D_Ln9_Vnuopc.ne16pg3_ne16pg3_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.ne16pg3_ne16pg3_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.ne16pg3_ne16pg3_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-outfrq3s_ttrac (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-outfrq3s_ttrac NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-outfrq3s_ttrac BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERC_D_Ln9_Vnuopc.T5_T5_mg37.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.T5_T5_mg37.QPC4.izumi_nag.cam-outfrq3s_usecase NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.T5_T5_mg37.QPC4.izumi_nag.cam-outfrq3s_usecase BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERI_D_Ln18_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac (Overall: DIFF) details:
+ FAIL ERI_D_Ln18_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac NLCOMP
+ FAIL ERI_D_Ln18_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERI_D_Ln18_Vnuopc.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 (Overall: DIFF) details:
+ FAIL ERI_D_Ln18_Vnuopc.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 NLCOMP
+ FAIL ERI_D_Ln18_Vnuopc.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERI_D_Ln18_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s_bwic (Overall: NLFAIL) details:
+ FAIL ERI_D_Ln18_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s_bwic NLCOMP
+ ERI_D_Ln18_Vnuopc.ne5pg3_ne5pg3_mg37.FADIAB.izumi_nag.cam-outfrq3s_bwic (Overall: NLFAIL) details:
+ FAIL ERI_D_Ln18_Vnuopc.ne5pg3_ne5pg3_mg37.FADIAB.izumi_nag.cam-outfrq3s_bwic NLCOMP
+ ERP_Ln9_Vmct.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: NLFAIL) details:
+ FAIL ERP_Ln9_Vmct.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf NLCOMP
+ ERP_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf NLCOMP
+ FAIL ERP_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERS_Ln27_Vnuopc.ne5pg3_ne5pg3_mg37.FKESSLER.izumi_nag.cam-outfrq9s (Overall: NLFAIL) details:
+ FAIL ERS_Ln27_Vnuopc.ne5pg3_ne5pg3_mg37.FKESSLER.izumi_nag.cam-outfrq9s NLCOMP
+ ERS_Ln9_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq9s (Overall: NLFAIL) details:
+ FAIL ERS_Ln9_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq9s NLCOMP
+ PEM_D_Ln9_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ FAIL PEM_D_Ln9_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s NLCOMP
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: DIFF) details:
+ FAIL PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 NLCOMP
+ FAIL PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: DIFF) details:
+ FAIL PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 NLCOMP
+ FAIL PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: DIFF) details:
+ FAIL PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 NLCOMP
+ FAIL PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: DIFF) details:
+ FAIL PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 NLCOMP
+ FAIL PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: DIFF) details:
+ FAIL PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 NLCOMP
+ FAIL PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: DIFF) details:
+ FAIL PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 NLCOMP
+ FAIL PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_D_Ld2_Vnuopc.f45_f45_mg37.PC5.izumi_nag.cam-outfrq24h_port (Overall: NLFAIL) details:
+ FAIL SMS_D_Ld2_Vnuopc.f45_f45_mg37.PC5.izumi_nag.cam-outfrq24h_port NLCOMP
+ SMS_D_Ln3_Vnuopc.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ FAIL SMS_D_Ln3_Vnuopc.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s NLCOMP
+ FAIL SMS_D_Ln3_Vnuopc.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_D_Ln6_Vnuopc.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem (Overall: DIFF) details:
+ FAIL SMS_D_Ln6_Vnuopc.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem NLCOMP
+ FAIL SMS_D_Ln6_Vnuopc.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_D_Ln7_Vnuopc.T42_T42_mg17.QPSCAMC5.izumi_nag.cam-scmarm (Overall: DIFF) details:
+ FAIL SMS_D_Ln7_Vnuopc.T42_T42_mg17.QPSCAMC5.izumi_nag.cam-scmarm NLCOMP
+ FAIL SMS_D_Ln7_Vnuopc.T42_T42_mg17.QPSCAMC5.izumi_nag.cam-scmarm BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_D_Ln9_P1x1_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
+ FAIL SMS_D_Ln9_P1x1_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s NLCOMP
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-rad_diag_mam (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-rad_diag_mam NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-rad_diag_mam BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_ba (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_ba NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_ba BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_P48x1_D_Ln3_Vnuopc.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase (Overall: DIFF) details:
+ FAIL SMS_P48x1_D_Ln3_Vnuopc.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase NLCOMP
+ FAIL SMS_P48x1_D_Ln3_Vnuopc.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SUB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ FAIL SUB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s NLCOMP
+ FAIL SUB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_nag: FIELDLIST field lists differ (otherwise bit-for-bit)
+ TMC_D_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac (Overall: NLFAIL) details:
+ FAIL TMC_D_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac NLCOMP
+ TMC_D_Vnuopc.T5_T5_mg37.QPC5.izumi_nag.cam-ghgrmp_e8 (Overall: NLFAIL) details:
+ FAIL TMC_D_Vnuopc.T5_T5_mg37.QPC5.izumi_nag.cam-ghgrmp_e8 NLCOMP
+
+The DAE failure is pre-existing.
+The NLCOMP failures are due to adding the ndep_stream_nl group to atm_in.
+The BASELINE test failures are due to different field list in the cpl.hi files.
+
+izumi/gnu/aux_cam:
+
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.FADIAB.izumi_gnu.cam-terminator (Overall: NLFAIL) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.FADIAB.izumi_gnu.cam-terminator NLCOMP
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC4.izumi_gnu.cam-outfrq3s_diags (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC4.izumi_gnu.cam-outfrq3s_diags NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC4.izumi_gnu.cam-outfrq3s_diags BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_gnu.cam-outfrq3s_unicon (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_gnu.cam-outfrq3s_unicon NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_gnu.cam-outfrq3s_unicon BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_gnu.cam-rad_diag (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_gnu.cam-rad_diag NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_gnu.cam-rad_diag BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPSPCAMM.izumi_gnu.cam-outfrq3s (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPSPCAMM.izumi_gnu.cam-outfrq3s NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPSPCAMM.izumi_gnu.cam-outfrq3s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC4.izumi_gnu.cam-outfrq3s_nudging_ne5_L26 (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC4.izumi_gnu.cam-outfrq3s_nudging_ne5_L26 NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC4.izumi_gnu.cam-outfrq3s_nudging_ne5_L26 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq3s_ba (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq3s_ba NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq3s_ba BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERC_D_Ln9_Vnuopc.ne5pg2_ne5pg2_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
+ FAIL ERC_D_Ln9_Vnuopc.ne5pg2_ne5pg2_mg37.FADIAB.izumi_gnu.cam-outfrq3s NLCOMP
+ ERC_D_Ln9_Vnuopc.ne5pg4_ne5pg4_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
+ FAIL ERC_D_Ln9_Vnuopc.ne5pg4_ne5pg4_mg37.FADIAB.izumi_gnu.cam-outfrq3s NLCOMP
+ ERC_D_Ln9_Vnuopc.T5_T5_mg37.QPC3.izumi_gnu.cam-outfrq3s_usecase (Overall: DIFF) details:
+ FAIL ERC_D_Ln9_Vnuopc.T5_T5_mg37.QPC3.izumi_gnu.cam-outfrq3s_usecase NLCOMP
+ FAIL ERC_D_Ln9_Vnuopc.T5_T5_mg37.QPC3.izumi_gnu.cam-outfrq3s_usecase BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERI_D_Ln18_Vnuopc.T5_T5_mg37.QPC4.izumi_gnu.cam-co2rmp (Overall: DIFF) details:
+ FAIL ERI_D_Ln18_Vnuopc.T5_T5_mg37.QPC4.izumi_gnu.cam-co2rmp NLCOMP
+ FAIL ERI_D_Ln18_Vnuopc.T5_T5_mg37.QPC4.izumi_gnu.cam-co2rmp BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ ERP_Ln9_Vnuopc.ne5_ne5_mg37.FHS94.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
+ FAIL ERP_Ln9_Vnuopc.ne5_ne5_mg37.FHS94.izumi_gnu.cam-outfrq9s NLCOMP
+ ERP_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ FAIL ERP_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq9s NLCOMP
+ FAIL ERP_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq9s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ PEM_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
+ FAIL PEM_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.FADIAB.izumi_gnu.cam-outfrq3s NLCOMP
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal0 (Overall: DIFF) details:
+ FAIL PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal0 NLCOMP
+ FAIL PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal0 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal1 (Overall: DIFF) details:
+ FAIL PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal1 NLCOMP
+ FAIL PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal1 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal3 (Overall: DIFF) details:
+ FAIL PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal3 NLCOMP
+ FAIL PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal3 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC4.izumi_gnu.cam-scm_prep (Overall: DIFF) details:
+ FAIL SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC4.izumi_gnu.cam-scm_prep NLCOMP
+ FAIL SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC4.izumi_gnu.cam-scm_prep BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC6.izumi_gnu.cam-scm_prep_c6 (Overall: DIFF) details:
+ FAIL SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC6.izumi_gnu.cam-scm_prep_c6 NLCOMP
+ FAIL SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC6.izumi_gnu.cam-scm_prep_c6 BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_D_Ln3_Vnuopc.f10_f10_mg37.QPMOZ.izumi_gnu.cam-outfrq3s_chemproc (Overall: DIFF) details:
+ FAIL SMS_D_Ln3_Vnuopc.f10_f10_mg37.QPMOZ.izumi_gnu.cam-outfrq3s_chemproc NLCOMP
+ FAIL SMS_D_Ln3_Vnuopc.f10_f10_mg37.QPMOZ.izumi_gnu.cam-outfrq3s_chemproc BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC4.izumi_gnu.cam-outfrq9s_apmee (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC4.izumi_gnu.cam-outfrq9s_apmee NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC4.izumi_gnu.cam-outfrq9s_apmee BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-outfrq3s_ttrac (Overall: DIFF) details:
+ FAIL SMS_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-outfrq3s_ttrac NLCOMP
+ FAIL SMS_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-outfrq3s_ttrac BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+ SMS_P48x1_D_Ln9_Vnuopc.f19_f19_mg17.FW4madSD.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ FAIL SMS_P48x1_D_Ln9_Vnuopc.f19_f19_mg17.FW4madSD.izumi_gnu.cam-outfrq9s NLCOMP
+ FAIL SMS_P48x1_D_Ln9_Vnuopc.f19_f19_mg17.FW4madSD.izumi_gnu.cam-outfrq9s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_3_097_gnu: FIELDLIST field lists differ (otherwise bit-for-bit)
+
+The NLCOMP failures are due to adding the ndep_stream_nl group to atm_in.
+The BASELINE test failures are due to different field list in the cpl.hi files.
+
+CAM tag used for the baseline comparison tests if different than previous
+tag:
+
+Summarize any changes to answers: none.
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_097
+Originator(s): andrewgettelman, tilmes, fvitt
+Date: 13 Mar 2023
+One-line Summary: Heterogeneous freezing science updates and bug fixes
+Github PR URL: https://github.com/ESCOMP/CAM/pull/755
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+ The following science updates and bug fixes to heterogeneous freezing parameterization
+ - new namelist parameters for scaling of dust and black carbon contributions
+ to heterogeneous freezing rates
+ - use physical approach to calculate species fractions
+ - use consistent concentrations of cloud-borne and ambient aerosol
+ - include sulfate in coarse dust fraction calculation
+ Update PUMAS external
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist:
+
+ New namelist parameters:
+
+ hetfrz_bc_scalfac
+ Heterogeneous freezing scaling factor for black carbon aerosols.
+ Default: 0.01
+
+ hetfrz_dust_scalfac
+ Heterogeneous freezing scaling factor for dust aerosols.
+ Default: 0.05
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: andrewgettelman, cacraigucar, jtruesdal, adamrher, nusbaume
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+M Externals_CAM.cfg
+ - pumas update
+
+M bld/build-namelist
+M bld/namelist_files/namelist_defaults_cam.xml
+M bld/namelist_files/namelist_definition.xml
+ - new hetfrz scaling factors namelist parameters
+
+M src/physics/cam/hetfrz_classnuc_cam.F90
+ - add scaling factor for dust
+
+M src/physics/cam/hetfrz_classnuc.F90
+ - new hetfrz scaling factors namelist parameters for dust and BC
+ - remove separate interface for collection of cloud-borne aerosols
+ so that cloud-borne and ambient aerosol concentrations are consistent
+ - set num_to_mass_in to false (use physical approach to calc species fractions)
+ and calc primary carbon fraction consistently
+ - include SO4 in dst3 fraction calculation
+
+M src/physics/cam/microp_aero.F90
+ - remove separate interface for collection of cloud-borne aerosols
+ so that cloud-borne and ambient aerosol concentrations are consistent
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ ERC_D_Ln9_P144x1_Vnuopc.ne16pg3_ne16pg3_mg17.QPC6HIST.cheyenne_intel.cam-outfrq3s_ttrac_usecase (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq3s_cosp (Overall: DIFF) details:
+ ERP_D_Ln9_Vmct.f09_f09_mg17.QSC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vmct.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vnuopc.f09_f09_mg17.QSC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ld3_Vnuopc.f09_f09_mg17.FWHIST.cheyenne_intel.cam-reduced_hist1d (Overall: DIFF) details:
+ ERP_Ln9_P24x3_Vnuopc.f45_f45_mg37.QPWmaC6.cheyenne_intel.cam-outfrq9s_mee_fluxes (Overall: DIFF) details:
+ ERP_Ln9_Vmct.f09_f09_mg17.2000_CAM60_CLM50%SP_CICE5%PRES_DOCN%DOM_MOSART_SGLC_SWAV.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: DIFF) details:
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_L32wsc (Overall: DIFF) details:
+ ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details:
+ ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vmct.T42_T42.2000_CAM60%SCAM_CLM50%SP_CICE5%PRES_DOCN%DOM_SROF_SGLC_SWAV.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCts2nudged.cheyenne_intel.cam-outfrq9s_leapday (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCvbsxHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC2000climo.cheyenne_intel.cam-outfrq3s_usecase (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.T42_T42.FSCAM.cheyenne_intel.cam-outfrq9s (Overall: NLFAIL) details:
+ SMS_Ld1_Vnuopc.f09_f09_mg17.FW2000climo.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld5_Vnuopc.f09_f09_mg17.PC6.cheyenne_intel.cam-cam6_port_f09 (Overall: NLFAIL) details:
+ SMS_Lm13_Vnuopc.f10_f10_mg37.F2000climo.cheyenne_intel.cam-outfrq1m (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-nudging (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.FW1850.cheyenne_intel.cam-reduced_hist3s (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f19_f19.F2000climo.cheyenne_intel.cam-silhs (Overall: DIFF) details:
+ - expect different answers in cam6 configurations
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - pre-existing failure
+
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_convmic (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ ERI_D_Ln18_Vnuopc.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 (Overall: DIFF) details:
+ ERP_Ln9_Vmct.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: DIFF) details:
+ SMS_P48x1_D_Ln3_Vnuopc.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase (Overall: DIFF) details:
+ - expect different answers in cam6 configurations
+
+izumi/gnu/aux_cam:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC6.izumi_gnu.cam-scm_prep_c6 (Overall: DIFF) details:
+ - expect different answers in cam6 configurations
+
+Summarize any changes to answers: larger than roundoff
+
+===============================================================
+===============================================================
+
+Tag name: cam6_3_096
+Originator(s): tilmes, fvitt
+Date: 8 Mar 2023
+One-line Summary: Aqueous chemistry bug fix
+Github PR URL: https://github.com/ESCOMP/CAM/pull/760
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+
+ Exclude cloud ice from the water constituent input into the aqueous chemistry so that
+ only cloud liquid is used.
+ (See issue: Aq.chemistry update #758)
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist: N/A
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes: N/A
+
+Code reviewed by: nusbaume, cacraig, tilmes
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+
+M src/chemistry/mozart/chemistry.F90
+ - cloud water input is only the cloud liquid constituent
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+
+cheyenne/intel/aux_cam:
+ ERC_D_Ln9_P144x1_Vnuopc.ne16pg3_ne16pg3_mg17.QPC6HIST.cheyenne_intel.cam-outfrq3s_ttrac_usecase (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq3s_cosp (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPMOZ.cheyenne_intel.cam-outfrq3s (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPX2000.cheyenne_intel.cam-outfrq3s (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.ne16_ne16_mg17.QPC5HIST.cheyenne_intel.cam-outfrq3s_usecase (Overall: DIFF) details:
+ ERP_D_Ln9_Vmct.f09_f09_mg17.QSC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vmct.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vnuopc.f09_f09_mg17.QSC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ld3_Vnuopc.f09_f09_mg17.FWHIST.cheyenne_intel.cam-reduced_hist1d (Overall: DIFF) details:
+ ERP_Lh12_Vnuopc.f19_f19_mg17.FW4madSD.cheyenne_intel.cam-outfrq3h (Overall: DIFF) details:
+ ERP_Ln9_P24x3_Vnuopc.f45_f45_mg37.QPWmaC6.cheyenne_intel.cam-outfrq9s_mee_fluxes (Overall: DIFF) details:
+ ERP_Ln9_Vmct.f09_f09_mg17.2000_CAM60_CLM50%SP_CICE5%PRES_DOCN%DOM_MOSART_SGLC_SWAV.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2000dev.cheyenne_intel.cam-outfrq9s_mg3 (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_wcm_ne30 (Overall: DIFF) details:
+ ERS_Ld3_Vnuopc.f10_f10_mg37.F1850.cheyenne_intel.cam-outfrq1d_14dec_L32wsc (Overall: DIFF) details:
+ ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details:
+ ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.cheyenne_intel.cam-outfrq9s_mpasa480 (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC5.cheyenne_intel.cam-scm_prep (Overall: DIFF) details:
+ SMS_D_Ld2_Vnuopc.f19_f19_mg17.QPC5HIST.cheyenne_intel.cam-volc_usecase (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCts2nudged.cheyenne_intel.cam-outfrq9s_leapday (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCvbsxHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.cheyenne_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.FXHIST.cheyenne_intel.cam-outfrq9s_amie (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC2000climo.cheyenne_intel.cam-outfrq3s_usecase (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC5M7.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.QPX2000.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc_P720x1.ne30pg3_ne30pg3_mg17.FCLTHIST.cheyenne_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.f09_f09_mg17.FW2000climo.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.f19_f19.F2000dev.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.cheyenne_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Lm13_Vnuopc.f10_f10_mg37.F2000climo.cheyenne_intel.cam-outfrq1m (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.F2010climo.cheyenne_intel.cam-nudging (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f09_f09_mg17.FW1850.cheyenne_intel.cam-reduced_hist3s (Overall: DIFF) details:
+ SMS_Ln9_Vnuopc.f19_f19.F2000climo.cheyenne_intel.cam-silhs (Overall: DIFF) details:
+ - configurations with aqueous chemistry are expected to change answers
+
+izumi/nag/aux_cam:
+ DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
+ - pre-existing failure
+
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-carma_sea_salt (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_cosp (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_subcol (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_convmic (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-outfrq3s_ttrac (Overall: DIFF) details:
+ ERI_D_Ln18_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac (Overall: DIFF) details:
+ ERI_D_Ln18_Vnuopc.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 (Overall: DIFF) details:
+ ERP_Ln9_Vmct.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: DIFF) details:
+ SMS_D_Ln3_Vnuopc.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ SMS_D_Ln6_Vnuopc.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-rad_diag_mam (Overall: DIFF) details:
+ SMS_P48x1_D_Ln3_Vnuopc.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase (Overall: DIFF) details:
+ SUB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ TMC_D_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac (Overall: DIFF) details:
+ TMC_D_Vnuopc.T5_T5_mg37.QPC5.izumi_nag.cam-ghgrmp_e8 (Overall: DIFF) details:
+ - configurations with aqueous chemistry are expected to change answers
+
+izumi/gnu/aux_cam:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_gnu.cam-outfrq3s_unicon (Overall: DIFF) details:
+ ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPSPCAMM.izumi_gnu.cam-outfrq3s (Overall: DIFF) details:
+ ERP_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal0 (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal1 (Overall: DIFF) details:
+ PLB_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal3 (Overall: DIFF) details:
+ SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC6.izumi_gnu.cam-scm_prep_c6 (Overall: DIFF) details:
+ SMS_D_Ln3_Vnuopc.f10_f10_mg37.QPMOZ.izumi_gnu.cam-outfrq3s_chemproc (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC4.izumi_gnu.cam-outfrq9s_apmee (Overall: DIFF) details:
+ SMS_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-outfrq3s_ttrac (Overall: DIFF) details:
+ SMS_P48x1_D_Ln9_Vnuopc.f19_f19_mg17.FW4madSD.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ - configurations with aqueous chemistry are expected to change answers
+
+Summarize any changes to answers: larger than roundoff
+
+===============================================================
+===============================================================
+
Tag name: cam6_3_095
Originator(s): fvitt
Date: 15 Feb 2023
diff --git a/doc/ChangeLog_template b/doc/ChangeLog_template
index 3fdfda2367..5919b4e11a 100644
--- a/doc/ChangeLog_template
+++ b/doc/ChangeLog_template
@@ -29,7 +29,7 @@ platform, and checkin with these failures has been OK'd by the gatekeeper,
then copy the lines from the td.*.status files for the failed tests to the
appropriate machine below. All failed tests must be justified.
-cheyenne/intel/aux_cam:
+derecho/intel/aux_cam:
izumi/nag/aux_cam:
diff --git a/manage_externals/.github/workflows/bumpversion.yml b/manage_externals/.github/workflows/bumpversion.yml
new file mode 100644
index 0000000000..f4dc9b7ca5
--- /dev/null
+++ b/manage_externals/.github/workflows/bumpversion.yml
@@ -0,0 +1,19 @@
+name: Bump version
+on:
+ push:
+ branches:
+ - main
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Bump version and push tag
+ id: tag_version
+ uses: mathieudutour/github-tag-action@v5.5
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ create_annotated_tag: true
+ default_bump: patch
+ dry_run: false
+ tag_prefix: manic-
diff --git a/manage_externals/.github/workflows/tests.yml b/manage_externals/.github/workflows/tests.yml
new file mode 100644
index 0000000000..dd75b91b49
--- /dev/null
+++ b/manage_externals/.github/workflows/tests.yml
@@ -0,0 +1,30 @@
+# This is a workflow to compile the cmeps source without cime
+name: Test Manic
+
+# Controls when the action will run. Triggers the workflow on push or pull request
+# events but only for the master branch
+on:
+ push:
+ branches: [ main ]
+ pull_request:
+ branches: [ main ]
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+ test-manic:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Test Manic
+ run: |
+ pushd test
+ git config --global user.email "devnull@example.com"
+ git config --global user.name "GITHUB tester"
+ git config --global protocol.file.allow always
+ make utest
+ make stest
+ popd
+
+ - name: Setup tmate session
+ if: ${{ failure() }}
+ uses: mxschmitt/action-tmate@v3
diff --git a/manage_externals/.gitignore b/manage_externals/.gitignore
index 411de5d96e..a71ac0cd75 100644
--- a/manage_externals/.gitignore
+++ b/manage_externals/.gitignore
@@ -12,3 +12,6 @@ components/
# generated python files
*.pyc
+
+# test tmp file
+test/tmp
diff --git a/manage_externals/.travis.yml b/manage_externals/.travis.yml
index 1990cb9604..d9b24c584d 100644
--- a/manage_externals/.travis.yml
+++ b/manage_externals/.travis.yml
@@ -1,7 +1,6 @@
language: python
os: linux
-python:
- - "2.7"
+python:
- "3.4"
- "3.5"
- "3.6"
diff --git a/manage_externals/README.md b/manage_externals/README.md
index c931c8e213..9475301b5d 100644
--- a/manage_externals/README.md
+++ b/manage_externals/README.md
@@ -201,6 +201,11 @@ The root of the source tree will be referred to as `${SRC_ROOT}` below.
externals description file pointed 'useful_library/sub-xternals.cfg',
Then the main 'externals' field in the top level repo should point to
'sub-externals.cfg'.
+ Note that by default, `checkout_externals` will clone an external's
+ submodules. As a special case, the entry, `externals = None`, will
+ prevent this behavior. For more control over which externals are
+ checked out, create an externals file (and see the `from_submodule`
+ configuration entry below).
* from_submodule (True / False) : used to pull the repo_url, local_path,
and hash properties for this external from the .gitmodules file in
diff --git a/manage_externals/checkout_externals b/manage_externals/checkout_externals
index a0698baef0..48bce24010 100755
--- a/manage_externals/checkout_externals
+++ b/manage_externals/checkout_externals
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""Main driver wrapper around the manic/checkout utility.
diff --git a/manage_externals/manic/checkout.py b/manage_externals/manic/checkout.py
index edc5655954..3f5537adce 100755
--- a/manage_externals/manic/checkout.py
+++ b/manage_externals/manic/checkout.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""
Tool to assemble repositories represented in a model-description file.
@@ -227,6 +227,12 @@ def commandline_arguments(args=None):
Now, %(prog)s will process Externals.cfg and also process
Externals_LIBX.cfg as if it was a sub-external.
+ Note that by default, checkout_externals will clone an external's
+ submodules. As a special case, the entry, "externals = None", will
+ prevent this behavior. For more control over which externals are
+ checked out, create an externals file (and see the from_submodule
+ configuration entry below).
+
* from_submodule (True / False) : used to pull the repo_url, local_path,
and hash properties for this external from the .gitmodules file in
this repository. Note that the section name (the entry in square
@@ -279,6 +285,9 @@ def commandline_arguments(args=None):
help='The externals description filename. '
'Default: %(default)s.')
+ parser.add_argument('-x', '--exclude', nargs='*',
+ help='Component(s) listed in the externals file which should be ignored.')
+
parser.add_argument('-o', '--optional', action='store_true', default=False,
help='By default only the required externals '
'are checked out. This flag will also checkout the '
@@ -329,7 +338,34 @@ def commandline_arguments(args=None):
options = parser.parse_args()
return options
-
+def _dirty_local_repo_msg(program_name, config_file):
+ return """The external repositories labeled with 'M' above are not in a clean state.
+The following are four options for how to proceed:
+(1) Go into each external that is not in a clean state and issue either a 'git status' or
+ an 'svn status' command (depending on whether the external is managed by git or
+ svn). Either revert or commit your changes so that all externals are in a clean
+ state. (To revert changes in git, follow the instructions given when you run 'git
+ status'.) (Note, though, that it is okay to have untracked files in your working
+ directory.) Then rerun {program_name}.
+(2) Alternatively, you do not have to rely on {program_name}. Instead, you can manually
+ update out-of-sync externals (labeled with 's' above) as described in the
+ configuration file {config_file}. (For example, run 'git fetch' and 'git checkout'
+ commands to checkout the appropriate tags for each external, as given in
+ {config_file}.)
+(3) You can also use {program_name} to manage most, but not all externals: You can specify
+ one or more externals to ignore using the '-x' or '--exclude' argument to
+ {program_name}. Excluding externals labeled with 'M' will allow {program_name} to
+ update the other, non-excluded externals.
+(4) As a last resort, if you are confident that there is no work that needs to be saved
+ from a given external, you can remove that external (via "rm -rf [directory]") and
+ then rerun the {program_name} tool. This option is mainly useful as a workaround for
+ issues with this tool (such as https://github.com/ESMCI/manage_externals/issues/157).
+The external repositories labeled with '?' above are not under version
+control using the expected protocol. If you are sure you want to switch
+protocols, and you don't have any work you need to save from this
+directory, then run "rm -rf [directory]" before rerunning the
+{program_name} tool.
+""".format(program_name=program_name, config_file=config_file)
# ---------------------------------------------------------------------
#
# main
@@ -342,9 +378,9 @@ def main(args):
the --all option is passed.
Returns a tuple (overall_status, tree_status). overall_status is 0
- on success, non-zero on failure. tree_status gives the full status
- *before* executing the checkout command - i.e., the status that it
- used to determine if it's safe to proceed with the checkout.
+ on success, non-zero on failure. tree_status is a dict mapping local path
+ to ExternalStatus -- if no checkout is happening. If checkout is happening, tree_status
+ is None.
"""
if args.do_logging:
logging.basicConfig(filename=LOG_FILE_NAME,
@@ -360,57 +396,41 @@ def main(args):
load_all = True
root_dir = os.path.abspath(os.getcwd())
- external_data = read_externals_description_file(root_dir, args.externals)
- external = create_externals_description(
- external_data, components=args.components)
+ model_data = read_externals_description_file(root_dir, args.externals)
+ ext_description = create_externals_description(
+ model_data, components=args.components, exclude=args.exclude)
for comp in args.components:
- if comp not in external.keys():
+ if comp not in ext_description.keys():
+ # Note we can't print out the list of found externals because
+ # they were filtered in create_externals_description above.
fatal_error(
"No component {} found in {}".format(
comp, args.externals))
- source_tree = SourceTree(root_dir, external, svn_ignore_ancestry=args.svn_ignore_ancestry)
- printlog('Checking status of externals: ', end='')
- tree_status = source_tree.status()
+ source_tree = SourceTree(root_dir, ext_description, svn_ignore_ancestry=args.svn_ignore_ancestry)
+ if args.components:
+ components_str = 'specified components'
+ else:
+ components_str = 'required & optional components'
+ printlog('Checking local status of ' + components_str + ': ', end='')
+ tree_status = source_tree.status(print_progress=True)
printlog('')
if args.status:
# user requested status-only
- for comp in sorted(tree_status.keys()):
+ for comp in sorted(tree_status):
tree_status[comp].log_status_message(args.verbose)
else:
# checkout / update the external repositories.
safe_to_update = check_safe_to_update_repos(tree_status)
if not safe_to_update:
# print status
- for comp in sorted(tree_status.keys()):
+ for comp in sorted(tree_status):
tree_status[comp].log_status_message(args.verbose)
# exit gracefully
- msg = """The external repositories labeled with 'M' above are not in a clean state.
-
-The following are two options for how to proceed:
-
-(1) Go into each external that is not in a clean state and issue either
- an 'svn status' or a 'git status' command. Either revert or commit
- your changes so that all externals are in a clean state. (Note,
- though, that it is okay to have untracked files in your working
- directory.) Then rerun {program_name}.
-
-(2) Alternatively, you do not have to rely on {program_name}. Instead, you
- can manually update out-of-sync externals (labeled with 's' above)
- as described in the configuration file {config_file}.
-
-
-The external repositories labeled with '?' above are not under version
-control using the expected protocol. If you are sure you want to switch
-protocols, and you don't have any work you need to save from this
-directory, then run "rm -rf [directory]" before re-running the
-checkout_externals tool.
-""".format(program_name=program_name, config_file=args.externals)
-
printlog('-' * 70)
- printlog(msg)
+ printlog(_dirty_local_repo_msg(program_name, args.externals))
printlog('-' * 70)
else:
if not args.components:
@@ -418,6 +438,8 @@ def main(args):
for comp in args.components:
source_tree.checkout(args.verbose, load_all, load_comp=comp)
printlog('')
+ # New tree status is unknown, don't return anything.
+ tree_status = None
logging.info('%s completed without exceptions.', program_name)
# NOTE(bja, 2017-11) tree status is used by the systems tests
diff --git a/manage_externals/manic/externals_description.py b/manage_externals/manic/externals_description.py
index b0c4f736a7..546e7fdcb4 100644
--- a/manage_externals/manic/externals_description.py
+++ b/manage_externals/manic/externals_description.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""Model description
@@ -71,7 +71,8 @@ def read_externals_description_file(root_dir, file_name):
root_dir = os.path.abspath(root_dir)
msg = 'In directory : {0}'.format(root_dir)
logging.info(msg)
- printlog('Processing externals description file : {0}'.format(file_name))
+ printlog('Processing externals description file : {0} ({1})'.format(file_name,
+ root_dir))
file_path = os.path.join(root_dir, file_name)
if not os.path.exists(file_name):
@@ -87,7 +88,7 @@ def read_externals_description_file(root_dir, file_name):
externals_description = None
if file_name == ExternalsDescription.GIT_SUBMODULES_FILENAME:
- externals_description = read_gitmodules_file(root_dir, file_name)
+ externals_description = _read_gitmodules_file(root_dir, file_name)
else:
try:
config = config_parser()
@@ -150,9 +151,8 @@ def git_submodule_status(repo_dir):
"""Run the git submodule status command to obtain submodule hashes.
"""
# This function is here instead of GitRepository to avoid a dependency loop
- cwd = os.getcwd()
- os.chdir(repo_dir)
- cmd = ['git', 'submodule', 'status']
+ cmd = 'git -C {repo_dir} submodule status'.format(
+ repo_dir=repo_dir).split()
git_output = execute_subprocess(cmd, output_to_caller=True)
submodules = {}
submods = git_output.split('\n')
@@ -167,7 +167,6 @@ def git_submodule_status(repo_dir):
submodules[items[1]] = {'hash':items[0], 'status':status, 'tag':tag}
- os.chdir(cwd)
return submodules
def parse_submodules_desc_section(section_items, file_path):
@@ -180,6 +179,9 @@ def parse_submodules_desc_section(section_items, file_path):
path = item[1].strip()
elif name == 'url':
url = item[1].strip()
+ elif name == 'branch':
+ # We do not care about branch since we have a hash - silently ignore
+ pass
else:
msg = 'WARNING: Ignoring unknown {} property, in {}'
msg = msg.format(item[0], file_path) # fool pylint
@@ -187,21 +189,23 @@ def parse_submodules_desc_section(section_items, file_path):
return path, url
-def read_gitmodules_file(root_dir, file_name):
+def _read_gitmodules_file(root_dir, file_name):
# pylint: disable=deprecated-method
# Disabling this check because the method is only used for python2
+ # pylint: disable=too-many-locals
+ # pylint: disable=too-many-branches
+ # pylint: disable=too-many-statements
"""Read a .gitmodules file and convert it to be compatible with an
externals description.
"""
root_dir = os.path.abspath(root_dir)
msg = 'In directory : {0}'.format(root_dir)
logging.info(msg)
- printlog('Processing submodules description file : {0}'.format(file_name))
file_path = os.path.join(root_dir, file_name)
if not os.path.exists(file_name):
msg = ('ERROR: submodules description file, "{0}", does not '
- 'exist at path:\n {1}'.format(file_name, file_path))
+ 'exist in dir:\n {1}'.format(file_name, root_dir))
fatal_error(msg)
submodules_description = None
@@ -250,9 +254,21 @@ def read_gitmodules_file(root_dir, file_name):
ExternalsDescription.REPO_URL, url)
externals_description.set(sec_name,
ExternalsDescription.REQUIRED, 'True')
- git_hash = submods[sec_name]['hash']
- externals_description.set(sec_name,
- ExternalsDescription.HASH, git_hash)
+ if sec_name in submods:
+ submod_name = sec_name
+ else:
+ # The section name does not have to match the path
+ submod_name = path
+
+ if submod_name in submods:
+ git_hash = submods[submod_name]['hash']
+ externals_description.set(sec_name,
+ ExternalsDescription.HASH,
+ git_hash)
+ else:
+ emsg = "submodule status has no section, '{}'"
+ emsg += "\nCheck section names in externals config file"
+ fatal_error(emsg.format(submod_name))
# Required items
externals_description.add_section(DESCRIPTION_SECTION)
@@ -261,18 +277,22 @@ def read_gitmodules_file(root_dir, file_name):
return externals_description
def create_externals_description(
- model_data, model_format='cfg', components=None, parent_repo=None):
+ model_data, model_format='cfg', components=None, exclude=None, parent_repo=None):
"""Create the a externals description object from the provided data
+
+ components: list of component names to include, None to include all. If a
+ name isn't found, it is silently omitted from the return value.
+ exclude: list of component names to skip.
"""
externals_description = None
if model_format == 'dict':
externals_description = ExternalsDescriptionDict(
- model_data, components=components)
+ model_data, components=components, exclude=exclude)
elif model_format == 'cfg':
major, _, _ = get_cfg_schema_version(model_data)
if major == 1:
externals_description = ExternalsDescriptionConfigV1(
- model_data, components=components, parent_repo=parent_repo)
+ model_data, components=components, exclude=exclude, parent_repo=parent_repo)
else:
msg = ('Externals description file has unsupported schema '
'version "{0}".'.format(major))
@@ -339,8 +359,9 @@ class ExternalsDescription(dict):
input value.
"""
- # keywords defining the interface into the externals description data
- EXTERNALS = 'externals'
+ # keywords defining the interface into the externals description data; these
+ # are brought together by the schema below.
+ EXTERNALS = 'externals' # path to externals file.
BRANCH = 'branch'
SUBMODULE = 'from_submodule'
HASH = 'hash'
@@ -366,6 +387,8 @@ class ExternalsDescription(dict):
_V1_BRANCH = 'BRANCH'
_V1_REQ_SOURCE = 'REQ_SOURCE'
+ # Dictionary keys are component names. The corresponding values are laid out
+ # according to this schema.
_source_schema = {REQUIRED: True,
PATH: 'string',
EXTERNALS: 'string',
@@ -614,8 +637,11 @@ def _repo_config_from_submodule(self, field, submod_desc):
' Parent repo, "{1}" does not have submodules')
fatal_error(msg.format(field, self._parent_repo.name()))
- submod_file = read_gitmodules_file(repo_path, submod_file)
- submod_desc = create_externals_description(submod_file)
+ printlog(
+ 'Processing submodules description file : {0} ({1})'.format(
+ submod_file, repo_path))
+ submod_model_data= _read_gitmodules_file(repo_path, submod_file)
+ submod_desc = create_externals_description(submod_model_data)
# Can we find our external?
repo_url = None
@@ -707,7 +733,7 @@ class ExternalsDescriptionDict(ExternalsDescription):
"""
- def __init__(self, model_data, components=None):
+ def __init__(self, model_data, components=None, exclude=None):
"""Parse a native dictionary into a externals description.
"""
ExternalsDescription.__init__(self)
@@ -719,10 +745,15 @@ def __init__(self, model_data, components=None):
self._input_patch = 0
self._verify_schema_version()
if components:
- for key in model_data.items():
+ for key in list(model_data.keys()):
if key not in components:
del model_data[key]
+ if exclude:
+ for key in list(model_data.keys()):
+ if key in exclude:
+ del model_data[key]
+
self.update(model_data)
self._check_user_input()
@@ -733,10 +764,12 @@ class ExternalsDescriptionConfigV1(ExternalsDescription):
"""
- def __init__(self, model_data, components=None, parent_repo=None):
+ def __init__(self, model_data, components=None, exclude=None, parent_repo=None):
"""Convert the config data into a standardized dict that can be used to
construct the source objects
+ components: list of component names to include, None to include all.
+ exclude: list of component names to skip.
"""
ExternalsDescription.__init__(self, parent_repo=parent_repo)
self._schema_major = 1
@@ -746,7 +779,7 @@ def __init__(self, model_data, components=None, parent_repo=None):
get_cfg_schema_version(model_data)
self._verify_schema_version()
self._remove_metadata(model_data)
- self._parse_cfg(model_data, components=components)
+ self._parse_cfg(model_data, components=components, exclude=exclude)
self._check_user_input()
@staticmethod
@@ -758,8 +791,11 @@ def _remove_metadata(model_data):
"""
model_data.remove_section(DESCRIPTION_SECTION)
- def _parse_cfg(self, cfg_data, components=None):
+ def _parse_cfg(self, cfg_data, components=None, exclude=None):
"""Parse a config_parser object into a externals description.
+
+ components: list of component names to include, None to include all.
+ exclude: list of component names to skip.
"""
def list_to_dict(input_list, convert_to_lower_case=True):
"""Convert a list of key-value pairs into a dictionary.
@@ -775,7 +811,7 @@ def list_to_dict(input_list, convert_to_lower_case=True):
for section in cfg_data.sections():
name = config_string_cleaner(section.lower().strip())
- if components and name not in components:
+ if (components and name not in components) or (exclude and name in exclude):
continue
self[name] = {}
self[name].update(list_to_dict(cfg_data.items(section)))
diff --git a/manage_externals/manic/externals_status.py b/manage_externals/manic/externals_status.py
index d3d238f289..6bc29e9732 100644
--- a/manage_externals/manic/externals_status.py
+++ b/manage_externals/manic/externals_status.py
@@ -29,16 +29,16 @@ class ExternalStatus(object):
transactions (e.g. add, remove, rename, untracked files).
"""
- DEFAULT = '-'
+ # sync_state and clean_state can be one of the following:
+ DEFAULT = '-' # not set yet (sync_state). clean_state can be this if sync_state is EMPTY.
UNKNOWN = '?'
EMPTY = 'e'
- MODEL_MODIFIED = 's' # a.k.a. out-of-sync
- DIRTY = 'M'
-
- STATUS_OK = ' '
+ MODEL_MODIFIED = 's' # repo version != externals (sync_state only)
+ DIRTY = 'M' # repo is dirty (clean_state only)
+ STATUS_OK = ' ' # repo is clean (clean_state) or matches externals version (sync_state)
STATUS_ERROR = '!'
- # source types
+ # source_type can be one of the following:
OPTIONAL = 'o'
STANDALONE = 's'
MANAGED = ' '
@@ -55,19 +55,21 @@ def __init__(self):
def log_status_message(self, verbosity):
"""Write status message to the screen and log file
"""
- self._default_status_message()
+ printlog(self._default_status_message())
if verbosity >= VERBOSITY_VERBOSE:
- self._verbose_status_message()
+ printlog(self._verbose_status_message())
if verbosity >= VERBOSITY_DUMP:
- self._dump_status_message()
+ printlog(self._dump_status_message())
+
+ def __repr__(self):
+ return self._default_status_message()
def _default_status_message(self):
"""Return the default terse status message string
"""
- msg = '{sync}{clean}{src_type} {path}'.format(
+ return '{sync}{clean}{src_type} {path}'.format(
sync=self.sync_state, clean=self.clean_state,
src_type=self.source_type, path=self.path)
- printlog(msg)
def _verbose_status_message(self):
"""Return the verbose status message string
@@ -82,14 +84,12 @@ def _verbose_status_message(self):
if self.sync_state != self.STATUS_OK:
sync_str = '{current} --> {expected}'.format(
current=self.current_version, expected=self.expected_version)
- msg = ' {clean}, {sync}'.format(clean=clean_str, sync=sync_str)
- printlog(msg)
+ return ' {clean}, {sync}'.format(clean=clean_str, sync=sync_str)
def _dump_status_message(self):
"""Return the dump status message string
"""
- msg = indent_string(self.status_output, 12)
- printlog(msg)
+ return indent_string(self.status_output, 12)
def safe_to_update(self):
"""Report if it is safe to update a repository. Safe is defined as:
diff --git a/manage_externals/manic/repository_factory.py b/manage_externals/manic/repository_factory.py
index 80a92a9d8a..18c73ffc4b 100644
--- a/manage_externals/manic/repository_factory.py
+++ b/manage_externals/manic/repository_factory.py
@@ -15,6 +15,7 @@ def create_repository(component_name, repo_info, svn_ignore_ancestry=False):
"""Determine what type of repository we have, i.e. git or svn, and
create the appropriate object.
+ Can return None (e.g. if protocol is 'externals_only').
"""
protocol = repo_info[ExternalsDescription.PROTOCOL].lower()
if protocol == 'git':
diff --git a/manage_externals/manic/repository_git.py b/manage_externals/manic/repository_git.py
index f986051001..adc666cc57 100644
--- a/manage_externals/manic/repository_git.py
+++ b/manage_externals/manic/repository_git.py
@@ -25,7 +25,7 @@ class GitRepository(Repository):
* be isolated in separate functions with no application logic
* of the form:
- - cmd = ['git', ...]
+ - cmd = 'git -C {dirname} ...'.format(dirname=dirname).split()
- value = execute_subprocess(cmd, output_to_caller={T|F},
status_to_caller={T|F})
- return value
@@ -39,7 +39,7 @@ class GitRepository(Repository):
def __init__(self, component_name, repo):
"""
- Parse repo (a XML element).
+ repo: ExternalsDescription.
"""
Repository.__init__(self, component_name, repo)
self._gitmodules = None
@@ -99,45 +99,42 @@ def submodules_file(self, repo_path=None):
#
# ----------------------------------------------------------------
def _clone_repo(self, base_dir_path, repo_dir_name, verbosity):
- """Prepare to execute the clone by managing directory location
+ """Clones repo_dir_name into base_dir_path.
"""
- cwd = os.getcwd()
- os.chdir(base_dir_path)
- self._git_clone(self._url, repo_dir_name, verbosity)
- os.chdir(cwd)
+ self._git_clone(self._url, os.path.join(base_dir_path, repo_dir_name),
+ verbosity=verbosity)
- def _current_ref(self):
- """Determine the *name* associated with HEAD.
+ def _current_ref(self, dirname):
+ """Determine the *name* associated with HEAD at dirname.
- If we're on a branch, then returns the branch name; otherwise,
- if we're on a tag, then returns the tag name; otherwise, returns
+ If we're on a tag, then returns the tag name; otherwise, returns
the current hash. Returns an empty string if no reference can be
determined (e.g., if we're not actually in a git repository).
+
+ If we're on a branch, then the branch name is also included in
+ the returned string (in addition to the tag / hash).
"""
ref_found = False
- # If we're on a branch, then use that as the current ref
- branch_found, branch_name = self._git_current_branch()
- if branch_found:
- current_ref = branch_name
+ # If we're exactly at a tag, use that as the current ref
+ tag_found, tag_name = self._git_current_tag(dirname)
+ if tag_found:
+ current_ref = tag_name
ref_found = True
- if not ref_found:
- # Otherwise, if we're exactly at a tag, use that as the
- # current ref
- tag_found, tag_name = self._git_current_tag()
- if tag_found:
- current_ref = tag_name
- ref_found = True
-
if not ref_found:
# Otherwise, use current hash as the current ref
- hash_found, hash_name = self._git_current_hash()
+ hash_found, hash_name = self._git_current_hash(dirname)
if hash_found:
current_ref = hash_name
ref_found = True
- if not ref_found:
+ if ref_found:
+ # If we're on a branch, include branch name in current ref
+ branch_found, branch_name = self._git_current_branch(dirname)
+ if branch_found:
+ current_ref = "{} (branch {})".format(current_ref, branch_name)
+ else:
# If we still can't find a ref, return empty string. This
# can happen if we're not actually in a git repo
current_ref = ''
@@ -185,17 +182,15 @@ def compare_refs(current_ref, expected_ref):
status = ExternalStatus.MODEL_MODIFIED
return status
- cwd = os.getcwd()
- os.chdir(repo_dir_path)
-
# get the full hash of the current commit
- _, current_ref = self._git_current_hash()
+ _, current_ref = self._git_current_hash(repo_dir_path)
if self._branch:
if self._url == LOCAL_PATH_INDICATOR:
expected_ref = self._branch
else:
- remote_name = self._determine_remote_name()
+ remote_name = self._remote_name_for_url(self._url,
+ repo_dir_path)
if not remote_name:
# git doesn't know about this remote. by definition
# this is a modified state.
@@ -212,7 +207,7 @@ def compare_refs(current_ref, expected_ref):
fatal_error(msg)
# record the *names* of the current and expected branches
- stat.current_version = self._current_ref()
+ stat.current_version = self._current_ref(repo_dir_path)
stat.expected_version = copy.deepcopy(expected_ref)
if current_ref == EMPTY_STR:
@@ -220,7 +215,7 @@ def compare_refs(current_ref, expected_ref):
else:
# get the underlying hash of the expected ref
revparse_status, expected_ref_hash = self._git_revparse_commit(
- expected_ref)
+ expected_ref, repo_dir_path)
if revparse_status:
# We failed to get the hash associated with
# expected_ref. Maybe we should assign this to some special
@@ -231,18 +226,13 @@ def compare_refs(current_ref, expected_ref):
# compare the underlying hashes
stat.sync_state = compare_refs(current_ref, expected_ref_hash)
- os.chdir(cwd)
-
- def _determine_remote_name(self):
- """Return the remote name.
-
- Note that this is for the *future* repo url and branch, not
- the current working copy!
+ @classmethod
+ def _remote_name_for_url(cls, remote_url, dirname):
+ """Return the remote name matching remote_url (or None)
"""
- git_output = self._git_remote_verbose()
+ git_output = cls._git_remote_verbose(dirname)
git_output = git_output.splitlines()
- remote_name = ''
for line in git_output:
data = line.strip()
if not data:
@@ -250,10 +240,9 @@ def _determine_remote_name(self):
data = data.split()
name = data[0].strip()
url = data[1].strip()
- if self._url == url:
- remote_name = name
- break
- return remote_name
+ if remote_url == url:
+ return name
+ return None
def _create_remote_name(self):
"""The url specified in the externals description file was not known
@@ -309,19 +298,16 @@ def _checkout_ref(self, repo_dir, verbosity, submodules):
the repo's submodules
"""
# import pdb; pdb.set_trace()
- cwd = os.getcwd()
- os.chdir(repo_dir)
if self._url.strip() == LOCAL_PATH_INDICATOR:
- self._checkout_local_ref(verbosity, submodules)
+ self._checkout_local_ref(verbosity, submodules, repo_dir)
else:
- self._checkout_external_ref(verbosity, submodules)
+ self._checkout_external_ref(verbosity, submodules, repo_dir)
if self._sparse:
self._sparse_checkout(repo_dir, verbosity)
- os.chdir(cwd)
- def _checkout_local_ref(self, verbosity, submodules):
+ def _checkout_local_ref(self, verbosity, submodules, dirname):
"""Checkout the reference considering the local repo only. Do not
fetch any additional remotes or specify the remote when
checkout out the ref.
@@ -335,13 +321,18 @@ def _checkout_local_ref(self, verbosity, submodules):
else:
ref = self._hash
- self._check_for_valid_ref(ref)
- self._git_checkout_ref(ref, verbosity, submodules)
+ self._check_for_valid_ref(ref, remote_name=None,
+ dirname=dirname)
+ self._git_checkout_ref(ref, verbosity, submodules, dirname)
- def _checkout_external_ref(self, verbosity, submodules):
- """Checkout the reference from a remote repository
+ def _checkout_external_ref(self, verbosity, submodules, dirname):
+ """Checkout the reference from a remote repository into dirname.
if is True, recursively initialize and update
- the repo's submodules
+ the repo's submodules.
+ Note that this results in a 'detached HEAD' state if checking out
+ a branch, because we check out the remote branch rather than the
+ local. See https://github.com/ESMCI/manage_externals/issues/34 for
+ more discussion.
"""
if self._tag:
ref = self._tag
@@ -350,44 +341,45 @@ def _checkout_external_ref(self, verbosity, submodules):
else:
ref = self._hash
- remote_name = self._determine_remote_name()
+ remote_name = self._remote_name_for_url(self._url, dirname)
if not remote_name:
remote_name = self._create_remote_name()
- self._git_remote_add(remote_name, self._url)
- self._git_fetch(remote_name)
+ self._git_remote_add(remote_name, self._url, dirname)
+ self._git_fetch(remote_name, dirname)
# NOTE(bja, 2018-03) we need to send separate ref and remote
# name to check_for_vaild_ref, but the combined name to
# checkout_ref!
- self._check_for_valid_ref(ref, remote_name)
+ self._check_for_valid_ref(ref, remote_name, dirname)
if self._branch:
+ # Prepend remote name to branch. This means we avoid various
+ # special cases if the local branch is not tracking the remote or
+ # cannot be trivially fast-forwarded to match; but, it also
+ # means we end up in a 'detached HEAD' state.
ref = '{0}/{1}'.format(remote_name, ref)
- self._git_checkout_ref(ref, verbosity, submodules)
+ self._git_checkout_ref(ref, verbosity, submodules, dirname)
def _sparse_checkout(self, repo_dir, verbosity):
"""Use git read-tree to thin the working tree."""
- cwd = os.getcwd()
-
- cmd = ['cp', self._sparse, os.path.join(repo_dir,
- '.git/info/sparse-checkout')]
+ cmd = ['cp', os.path.join(repo_dir, self._sparse),
+ os.path.join(repo_dir,
+ '.git/info/sparse-checkout')]
if verbosity >= VERBOSITY_VERBOSE:
printlog(' {0}'.format(' '.join(cmd)))
execute_subprocess(cmd)
- os.chdir(repo_dir)
- self._git_sparse_checkout(verbosity)
-
- os.chdir(cwd)
+ self._git_sparse_checkout(verbosity, repo_dir)
- def _check_for_valid_ref(self, ref, remote_name=None):
+ def _check_for_valid_ref(self, ref, remote_name, dirname):
"""Try some basic sanity checks on the user supplied reference so we
can provide a more useful error message than calledprocess
error...
+ remote_name can be NOne
"""
- is_tag = self._ref_is_tag(ref)
- is_branch = self._ref_is_branch(ref, remote_name)
- is_hash = self._ref_is_hash(ref)
+ is_tag = self._ref_is_tag(ref, dirname)
+ is_branch = self._ref_is_branch(ref, remote_name, dirname)
+ is_hash = self._ref_is_hash(ref, dirname)
is_valid = is_tag or is_branch or is_hash
if not is_valid:
@@ -398,7 +390,8 @@ def _check_for_valid_ref(self, ref, remote_name=None):
fatal_error(msg)
if is_tag:
- is_unique_tag, msg = self._is_unique_tag(ref, remote_name)
+ is_unique_tag, msg = self._is_unique_tag(ref, remote_name,
+ dirname)
if not is_unique_tag:
msg = ('In repo "{0}": tag "{1}" {2}'.format(
self._name, self._tag, msg))
@@ -406,7 +399,7 @@ def _check_for_valid_ref(self, ref, remote_name=None):
return is_valid
- def _is_unique_tag(self, ref, remote_name):
+ def _is_unique_tag(self, ref, remote_name, dirname):
"""Verify that a reference is a valid tag and is unique (not a branch)
Tags may be tag names, or SHA id's. It is also possible that a
@@ -417,9 +410,9 @@ def _is_unique_tag(self, ref, remote_name):
error!
"""
- is_tag = self._ref_is_tag(ref)
- is_branch = self._ref_is_branch(ref, remote_name)
- is_hash = self._ref_is_hash(ref)
+ is_tag = self._ref_is_tag(ref, dirname)
+ is_branch = self._ref_is_branch(ref, remote_name, dirname)
+ is_hash = self._ref_is_hash(ref, dirname)
msg = ''
is_unique_tag = False
@@ -450,7 +443,7 @@ def _is_unique_tag(self, ref, remote_name):
return is_unique_tag, msg
- def _ref_is_tag(self, ref):
+ def _ref_is_tag(self, ref, dirname):
"""Verify that a reference is a valid tag according to git.
Note: values returned by git_showref_* and git_revparse are
@@ -458,28 +451,30 @@ def _ref_is_tag(self, ref):
error!
"""
is_tag = False
- value = self._git_showref_tag(ref)
+ value = self._git_showref_tag(ref, dirname)
if value == 0:
is_tag = True
return is_tag
- def _ref_is_branch(self, ref, remote_name=None):
+ def _ref_is_branch(self, ref, remote_name, dirname):
"""Verify if a ref is any kind of branch (local, tracked remote,
untracked remote).
+ remote_name can be None.
"""
local_branch = False
remote_branch = False
if remote_name:
- remote_branch = self._ref_is_remote_branch(ref, remote_name)
- local_branch = self._ref_is_local_branch(ref)
+ remote_branch = self._ref_is_remote_branch(ref, remote_name,
+ dirname)
+ local_branch = self._ref_is_local_branch(ref, dirname)
is_branch = False
if local_branch or remote_branch:
is_branch = True
return is_branch
- def _ref_is_local_branch(self, ref):
+ def _ref_is_local_branch(self, ref, dirname):
"""Verify that a reference is a valid branch according to git.
show-ref branch returns local branches that have been
@@ -492,12 +487,12 @@ def _ref_is_local_branch(self, ref):
"""
is_branch = False
- value = self._git_showref_branch(ref)
+ value = self._git_showref_branch(ref, dirname)
if value == 0:
is_branch = True
return is_branch
- def _ref_is_remote_branch(self, ref, remote_name):
+ def _ref_is_remote_branch(self, ref, remote_name, dirname):
"""Verify that a reference is a valid branch according to git.
show-ref branch returns local branches that have been
@@ -510,12 +505,12 @@ def _ref_is_remote_branch(self, ref, remote_name):
"""
is_branch = False
- value = self._git_lsremote_branch(ref, remote_name)
+ value = self._git_lsremote_branch(ref, remote_name, dirname)
if value == 0:
is_branch = True
return is_branch
- def _ref_is_commit(self, ref):
+ def _ref_is_commit(self, ref, dirname):
"""Verify that a reference is a valid commit according to git.
This could be a tag, branch, sha1 id, HEAD and potentially others...
@@ -525,12 +520,12 @@ def _ref_is_commit(self, ref):
error!
"""
is_commit = False
- value, _ = self._git_revparse_commit(ref)
+ value, _ = self._git_revparse_commit(ref, dirname)
if value == 0:
is_commit = True
return is_commit
- def _ref_is_hash(self, ref):
+ def _ref_is_hash(self, ref, dirname):
"""Verify that a reference is a valid hash according to git.
Git doesn't seem to provide an exact way to determine if user
@@ -545,7 +540,7 @@ def _ref_is_hash(self, ref):
"""
is_hash = False
- status, git_output = self._git_revparse_commit(ref)
+ status, git_output = self._git_revparse_commit(ref, dirname)
if status == 0:
if git_output.strip().startswith(ref):
is_hash = True
@@ -555,9 +550,7 @@ def _status_summary(self, stat, repo_dir_path):
"""Determine the clean/dirty status of a git repository
"""
- cwd = os.getcwd()
- os.chdir(repo_dir_path)
- git_output = self._git_status_porcelain_v1z()
+ git_output = self._git_status_porcelain_v1z(repo_dir_path)
is_dirty = self._status_v1z_is_dirty(git_output)
if is_dirty:
stat.clean_state = ExternalStatus.DIRTY
@@ -566,8 +559,7 @@ def _status_summary(self, stat, repo_dir_path):
# Now save the verbose status output incase the user wants to
# see it.
- stat.status_output = self._git_status_verbose()
- os.chdir(cwd)
+ stat.status_output = self._git_status_verbose(repo_dir_path)
@staticmethod
def _status_v1z_is_dirty(git_output):
@@ -602,7 +594,7 @@ def _status_v1z_is_dirty(git_output):
#
# ----------------------------------------------------------------
@staticmethod
- def _git_current_hash():
+ def _git_current_hash(dirname):
"""Return the full hash of the currently checked-out version.
Returns a tuple, (hash_found, hash), where hash_found is a
@@ -610,21 +602,51 @@ def _git_current_hash():
could mean we're not in a git repository at all). (If hash_found
is False, then hash is ''.)
"""
- status, git_output = GitRepository._git_revparse_commit("HEAD")
+ status, git_output = GitRepository._git_revparse_commit("HEAD",
+ dirname)
hash_found = not status
if not hash_found:
git_output = ''
return hash_found, git_output
@staticmethod
- def _git_current_branch():
- """Determines the name of the current branch.
+ def _git_current_remote_branch(dirname):
+ """Determines the name of the current remote branch, if any.
+
+ if dir is None, uses the cwd.
+
+ Returns a tuple, (branch_found, branch_name), where branch_found
+ is a bool specifying whether a branch name was found for
+ HEAD. (If branch_found is False, then branch_name is '').
+ branch_name is in the format '$remote/$branch', e.g. 'origin/foo'.
+ """
+ branch_found = False
+ branch_name = ''
+
+ cmd = 'git -C {dirname} log -n 1 --pretty=%d HEAD'.format(
+ dirname=dirname).split()
+ status, git_output = execute_subprocess(cmd,
+ output_to_caller=True,
+ status_to_caller=True)
+ branch_found = 'HEAD,' in git_output
+ if branch_found:
+ # git_output is of the form " (HEAD, origin/blah)"
+ branch_name = git_output.split(',')[1].strip()[:-1]
+ return branch_found, branch_name
+
+ @staticmethod
+ def _git_current_branch(dirname):
+ """Determines the name of the current local branch.
Returns a tuple, (branch_found, branch_name), where branch_found
- is a logical specifying whether a branch name was found for
+ is a bool specifying whether a branch name was found for
HEAD. (If branch_found is False, then branch_name is ''.)
+ Note that currently we check out the remote branch rather than
+ the local, so this command does not return the just-checked-out
+ branch. See _git_current_remote_branch.
"""
- cmd = ['git', 'symbolic-ref', '--short', '-q', 'HEAD']
+ cmd = 'git -C {dirname} symbolic-ref --short -q HEAD'.format(
+ dirname=dirname).split()
status, git_output = execute_subprocess(cmd,
output_to_caller=True,
status_to_caller=True)
@@ -636,15 +658,17 @@ def _git_current_branch():
return branch_found, git_output
@staticmethod
- def _git_current_tag():
+ def _git_current_tag(dirname):
"""Determines the name tag corresponding to HEAD (if any).
+ if dirname is None, uses the cwd.
+
Returns a tuple, (tag_found, tag_name), where tag_found is a
- logical specifying whether we found a tag name corresponding to
+ bool specifying whether we found a tag name corresponding to
HEAD. (If tag_found is False, then tag_name is ''.)
"""
- # git describe --exact-match --tags HEAD
- cmd = ['git', 'describe', '--exact-match', '--tags', 'HEAD']
+ cmd = 'git -C {dirname} describe --exact-match --tags HEAD'.format(
+ dirname=dirname).split()
status, git_output = execute_subprocess(cmd,
output_to_caller=True,
status_to_caller=True)
@@ -656,53 +680,54 @@ def _git_current_tag():
return tag_found, git_output
@staticmethod
- def _git_showref_tag(ref):
+ def _git_showref_tag(ref, dirname):
"""Run git show-ref check if the user supplied ref is a tag.
could also use git rev-parse --quiet --verify tagname^{tag}
"""
- cmd = ['git', 'show-ref', '--quiet', '--verify',
- 'refs/tags/{0}'.format(ref), ]
+ cmd = ('git -C {dirname} show-ref --quiet --verify refs/tags/{ref}'
+ .format(dirname=dirname, ref=ref).split())
status = execute_subprocess(cmd, status_to_caller=True)
return status
@staticmethod
- def _git_showref_branch(ref):
+ def _git_showref_branch(ref, dirname):
"""Run git show-ref check if the user supplied ref is a local or
tracked remote branch.
"""
- cmd = ['git', 'show-ref', '--quiet', '--verify',
- 'refs/heads/{0}'.format(ref), ]
+ cmd = ('git -C {dirname} show-ref --quiet --verify refs/heads/{ref}'
+ .format(dirname=dirname, ref=ref).split())
status = execute_subprocess(cmd, status_to_caller=True)
return status
@staticmethod
- def _git_lsremote_branch(ref, remote_name):
+ def _git_lsremote_branch(ref, remote_name, dirname):
"""Run git ls-remote to check if the user supplied ref is a remote
branch that is not being tracked
"""
- cmd = ['git', 'ls-remote', '--exit-code', '--heads',
- remote_name, ref, ]
+ cmd = ('git -C {dirname} ls-remote --exit-code --heads '
+ '{remote_name} {ref}').format(
+ dirname=dirname, remote_name=remote_name, ref=ref).split()
status = execute_subprocess(cmd, status_to_caller=True)
return status
@staticmethod
- def _git_revparse_commit(ref):
+ def _git_revparse_commit(ref, dirname):
"""Run git rev-parse to detect if a reference is a SHA, HEAD or other
valid commit.
"""
- cmd = ['git', 'rev-parse', '--quiet', '--verify',
- '{0}^{1}'.format(ref, '{commit}'), ]
+ cmd = ('git -C {dirname} rev-parse --quiet --verify {ref}^{commit}'
+ .format(dirname=dirname, ref=ref, commit='{commit}').split())
status, git_output = execute_subprocess(cmd, status_to_caller=True,
output_to_caller=True)
git_output = git_output.strip()
return status, git_output
@staticmethod
- def _git_status_porcelain_v1z():
+ def _git_status_porcelain_v1z(dirname):
"""Run git status to obtain repository information.
This is run with '--untracked=no' to ignore untracked files.
@@ -711,36 +736,38 @@ def _git_status_porcelain_v1z():
between git versions or *user configuration*.
"""
- cmd = ['git', 'status', '--untracked-files=no', '--porcelain', '-z']
+ cmd = ('git -C {dirname} status --untracked-files=no --porcelain -z'
+ .format(dirname=dirname)).split()
git_output = execute_subprocess(cmd, output_to_caller=True)
return git_output
@staticmethod
- def _git_status_verbose():
+ def _git_status_verbose(dirname):
"""Run the git status command to obtain repository information.
"""
- cmd = ['git', 'status']
+ cmd = 'git -C {dirname} status'.format(dirname=dirname).split()
git_output = execute_subprocess(cmd, output_to_caller=True)
return git_output
@staticmethod
- def _git_remote_verbose():
+ def _git_remote_verbose(dirname):
"""Run the git remote command to obtain repository information.
+
+ Returned string is of the form:
+ myfork git@github.com:johnpaulalex/manage_externals_jp.git (fetch)
+ myfork git@github.com:johnpaulalex/manage_externals_jp.git (push)
"""
- cmd = ['git', 'remote', '--verbose']
- git_output = execute_subprocess(cmd, output_to_caller=True)
- return git_output
+ cmd = 'git -C {dirname} remote --verbose'.format(
+ dirname=dirname).split()
+ return execute_subprocess(cmd, output_to_caller=True)
@staticmethod
- def has_submodules(repo_dir_path=None):
- """Return True iff the repository at (or the current
- directory if is None) has a '.gitmodules' file
+ def has_submodules(repo_dir_path):
+ """Return True iff the repository at has a
+ '.gitmodules' file
"""
- if repo_dir_path is None:
- fname = ExternalsDescription.GIT_SUBMODULES_FILENAME
- else:
- fname = os.path.join(repo_dir_path,
- ExternalsDescription.GIT_SUBMODULES_FILENAME)
+ fname = os.path.join(repo_dir_path,
+ ExternalsDescription.GIT_SUBMODULES_FILENAME)
return os.path.exists(fname)
@@ -751,68 +778,71 @@ def has_submodules(repo_dir_path=None):
# ----------------------------------------------------------------
@staticmethod
def _git_clone(url, repo_dir_name, verbosity):
- """Run git clone for the side effect of creating a repository.
+ """Clones url into repo_dir_name.
"""
- cmd = ['git', 'clone', '--quiet']
- subcmd = None
-
- cmd.extend([url, repo_dir_name])
+ cmd = 'git clone --quiet {url} {repo_dir_name}'.format(
+ url=url, repo_dir_name=repo_dir_name).split()
if verbosity >= VERBOSITY_VERBOSE:
printlog(' {0}'.format(' '.join(cmd)))
execute_subprocess(cmd)
- if subcmd is not None:
- os.chdir(repo_dir_name)
- execute_subprocess(subcmd)
@staticmethod
- def _git_remote_add(name, url):
+ def _git_remote_add(name, url, dirname):
"""Run the git remote command for the side effect of adding a remote
"""
- cmd = ['git', 'remote', 'add', name, url]
+ cmd = 'git -C {dirname} remote add {name} {url}'.format(
+ dirname=dirname, name=name, url=url).split()
execute_subprocess(cmd)
@staticmethod
- def _git_fetch(remote_name):
+ def _git_fetch(remote_name, dirname):
"""Run the git fetch command for the side effect of updating the repo
"""
- cmd = ['git', 'fetch', '--quiet', '--tags', remote_name]
+ cmd = 'git -C {dirname} fetch --quiet --tags {remote_name}'.format(
+ dirname=dirname, remote_name=remote_name).split()
execute_subprocess(cmd)
@staticmethod
- def _git_checkout_ref(ref, verbosity, submodules):
+ def _git_checkout_ref(ref, verbosity, submodules, dirname):
"""Run the git checkout command for the side effect of updating the repo
Param: ref is a reference to a local or remote object in the
form 'origin/my_feature', or 'tag1'.
"""
- cmd = ['git', 'checkout', '--quiet', ref]
+ cmd = 'git -C {dirname} checkout --quiet {ref}'.format(
+ dirname=dirname, ref=ref).split()
if verbosity >= VERBOSITY_VERBOSE:
printlog(' {0}'.format(' '.join(cmd)))
execute_subprocess(cmd)
if submodules:
- GitRepository._git_update_submodules(verbosity)
+ GitRepository._git_update_submodules(verbosity, dirname)
@staticmethod
- def _git_sparse_checkout(verbosity):
+ def _git_sparse_checkout(verbosity, dirname):
"""Configure repo via read-tree."""
- cmd = ['git', 'config', 'core.sparsecheckout', 'true']
+ cmd = 'git -C {dirname} config core.sparsecheckout true'.format(
+ dirname=dirname).split()
if verbosity >= VERBOSITY_VERBOSE:
printlog(' {0}'.format(' '.join(cmd)))
execute_subprocess(cmd)
- cmd = ['git', 'read-tree', '-mu', 'HEAD']
+ cmd = 'git -C {dirname} read-tree -mu HEAD'.format(
+ dirname=dirname).split()
if verbosity >= VERBOSITY_VERBOSE:
printlog(' {0}'.format(' '.join(cmd)))
execute_subprocess(cmd)
@staticmethod
- def _git_update_submodules(verbosity):
+ def _git_update_submodules(verbosity, dirname):
"""Run git submodule update for the side effect of updating this
repo's submodules.
"""
# First, verify that we have a .gitmodules file
- if os.path.exists(ExternalsDescription.GIT_SUBMODULES_FILENAME):
- cmd = ['git', 'submodule', 'update', '--init', '--recursive']
+ if os.path.exists(
+ os.path.join(dirname,
+ ExternalsDescription.GIT_SUBMODULES_FILENAME)):
+ cmd = ('git -C {dirname} submodule update --init --recursive'
+ .format(dirname=dirname)).split()
if verbosity >= VERBOSITY_VERBOSE:
printlog(' {0}'.format(' '.join(cmd)))
diff --git a/manage_externals/manic/repository_svn.py b/manage_externals/manic/repository_svn.py
index 408ed84676..922855d34e 100644
--- a/manage_externals/manic/repository_svn.py
+++ b/manage_externals/manic/repository_svn.py
@@ -43,10 +43,15 @@ def __init__(self, component_name, repo, ignore_ancestry=False):
"""
Repository.__init__(self, component_name, repo)
self._ignore_ancestry = ignore_ancestry
+ if self._url.endswith('/'):
+ # there is already a '/' separator in the URL; no need to add another
+ url_sep = ''
+ else:
+ url_sep = '/'
if self._branch:
- self._url = os.path.join(self._url, self._branch)
+ self._url = self._url + url_sep + self._branch
elif self._tag:
- self._url = os.path.join(self._url, self._tag)
+ self._url = self._url + url_sep + self._tag
else:
msg = "DEV_ERROR in svn repository. Shouldn't be here!"
fatal_error(msg)
diff --git a/manage_externals/manic/sourcetree.py b/manage_externals/manic/sourcetree.py
index b9c9c21082..cf2a5b7569 100644
--- a/manage_externals/manic/sourcetree.py
+++ b/manage_externals/manic/sourcetree.py
@@ -1,6 +1,6 @@
"""
-
-FIXME(bja, 2017-11) External and SourceTree have a circular dependancy!
+Classes to represent an externals config file (SourceTree) and the components
+within it (_External).
"""
import errno
@@ -19,62 +19,54 @@
class _External(object):
"""
- _External represents an external object inside a SourceTree
- """
+ A single component hosted in an external repository (and any children).
+ The component may or may not be checked-out upon construction.
+ """
# pylint: disable=R0902
- def __init__(self, root_dir, name, ext_description, svn_ignore_ancestry):
- """Parse an external description file into a dictionary of externals.
+ def __init__(self, root_dir, name, local_path, required, subexternals_path,
+ repo, svn_ignore_ancestry, subexternal_sourcetree):
+ """Create a single external component (checked out or not).
Input:
+ root_dir : string - the (checked-out) parent repo's root dir.
+ local_path : string - this external's (checked-out) subdir relative
+ to root_dir, e.g. "components/mom"
+ repo: Repository - the repo object for this external. Can be None (e.g. if this external just refers to another external file).
- root_dir : string - the root directory path where
- 'local_path' is relative to.
-
- name : string - name of the ext_description object. may or may not
- correspond to something in the path.
+ name : string - name of this external (as named by the parent
+ reference). May or may not correspond to something in the path.
ext_description : dict - source ExternalsDescription object
svn_ignore_ancestry : bool - use --ignore-externals with svn switch
+ subexternals_path: string - path to sub-externals config file, if any. Relative to local_path, or special value 'none'.
+ subexternal_sourcetree: SourceTree - corresponding to subexternals_path, if subexternals_path exists (it might not, if it is not checked out yet).
"""
self._name = name
- self._repo = None
- self._externals = EMPTY_STR
- self._externals_sourcetree = None
- self._stat = ExternalStatus()
- self._sparse = None
- # Parse the sub-elements
-
- # _path : local path relative to the containing source tree
- self._local_path = ext_description[ExternalsDescription.PATH]
- # _repo_dir : full repository directory
- repo_dir = os.path.join(root_dir, self._local_path)
+ self._required = required
+
+ self._stat = None # Populated in status()
+
+ self._local_path = local_path
+ # _repo_dir_path : full repository directory, e.g.
+ # "/components/mom"
+ repo_dir = os.path.join(root_dir, local_path)
self._repo_dir_path = os.path.abspath(repo_dir)
- # _base_dir : base directory *containing* the repository
+ # _base_dir_path : base directory *containing* the repository, e.g.
+ # "/components"
self._base_dir_path = os.path.dirname(self._repo_dir_path)
- # repo_dir_name : base_dir_path + repo_dir_name = rep_dir_path
+ # _repo_dir_name : base_dir_path + repo_dir_name = repo_dir_path
+ # e.g., "mom"
self._repo_dir_name = os.path.basename(self._repo_dir_path)
- assert(os.path.join(self._base_dir_path, self._repo_dir_name)
- == self._repo_dir_path)
+ self._repo = repo
- self._required = ext_description[ExternalsDescription.REQUIRED]
- self._externals = ext_description[ExternalsDescription.EXTERNALS]
- # Treat a .gitmodules file as a backup externals config
- if not self._externals:
- if GitRepository.has_submodules(self._repo_dir_path):
- self._externals = ExternalsDescription.GIT_SUBMODULES_FILENAME
-
- repo = create_repository(
- name, ext_description[ExternalsDescription.REPO],
- svn_ignore_ancestry=svn_ignore_ancestry)
- if repo:
- self._repo = repo
-
- if self._externals and (self._externals.lower() != 'none'):
- self._create_externals_sourcetree()
+ # Does this component have subcomponents aka an externals config?
+ self._subexternals_path = subexternals_path
+ self._subexternal_sourcetree = subexternal_sourcetree
+
def get_name(self):
"""
@@ -88,81 +80,97 @@ def get_local_path(self):
"""
return self._local_path
- def status(self):
- """
- If the repo destination directory exists, ensure it is correct (from
- correct URL, correct branch or tag), and possibly update the external.
- If the repo destination directory does not exist, checkout the correce
- branch or tag.
- If load_all is True, also load all of the the externals sub-externals.
+ def get_repo_dir_path(self):
+ return self._repo_dir_path
+
+ def get_subexternals_path(self):
+ return self._subexternals_path
+
+ def get_repo(self):
+ return self._repo
+
+ def status(self, force=False, print_progress=False):
"""
+ Returns status of this component and all subcomponents.
- self._stat.path = self.get_local_path()
- if not self._required:
- self._stat.source_type = ExternalStatus.OPTIONAL
- elif self._local_path == LOCAL_PATH_INDICATOR:
- # LOCAL_PATH_INDICATOR, '.' paths, are standalone
- # component directories that are not managed by
- # checkout_externals.
- self._stat.source_type = ExternalStatus.STANDALONE
- else:
- # managed by checkout_externals
- self._stat.source_type = ExternalStatus.MANAGED
+ Returns a dict mapping our local path (not component name!) to an
+ ExternalStatus dict. Any subcomponents will have their own top-level
+ path keys. Note the return value includes entries for this and all
+ subcomponents regardless of whether they are locally installed or not.
- ext_stats = {}
+ Side-effect: If self._stat is empty or force is True, calculates _stat.
+ """
+ calc_stat = force or not self._stat
+
+ if calc_stat:
+ self._stat = ExternalStatus()
+ self._stat.path = self.get_local_path()
+ if not self._required:
+ self._stat.source_type = ExternalStatus.OPTIONAL
+ elif self._local_path == LOCAL_PATH_INDICATOR:
+ # LOCAL_PATH_INDICATOR, '.' paths, are standalone
+ # component directories that are not managed by
+ # checkout_subexternals.
+ self._stat.source_type = ExternalStatus.STANDALONE
+ else:
+ # managed by checkout_subexternals
+ self._stat.source_type = ExternalStatus.MANAGED
+ subcomponent_stats = {}
if not os.path.exists(self._repo_dir_path):
- self._stat.sync_state = ExternalStatus.EMPTY
- msg = ('status check: repository directory for "{0}" does not '
- 'exist.'.format(self._name))
- logging.info(msg)
- self._stat.current_version = 'not checked out'
- # NOTE(bja, 2018-01) directory doesn't exist, so we cannot
- # use repo to determine the expected version. We just take
- # a best-guess based on the assumption that only tag or
- # branch should be set, but not both.
- if not self._repo:
- self._stat.expected_version = 'unknown'
- else:
- self._stat.expected_version = self._repo.tag() + self._repo.branch()
+ if calc_stat:
+ # No local repository.
+ self._stat.sync_state = ExternalStatus.EMPTY
+ msg = ('status check: repository directory for "{0}" does not '
+ 'exist.'.format(self._name))
+ logging.info(msg)
+ self._stat.current_version = 'not checked out'
+ # NOTE(bja, 2018-01) directory doesn't exist, so we cannot
+ # use repo to determine the expected version. We just take
+ # a best-guess based on the assumption that only tag or
+ # branch should be set, but not both.
+ if not self._repo:
+ self._stat.expected_version = 'unknown'
+ else:
+ self._stat.expected_version = self._repo.tag() + self._repo.branch()
else:
- if self._repo:
+ # Merge local repository state (e.g. clean/dirty) into self._stat.
+ if calc_stat and self._repo:
self._repo.status(self._stat, self._repo_dir_path)
- if self._externals and self._externals_sourcetree:
- # we expect externals and they exist
+ # Status of subcomponents, if any.
+ if self._subexternals_path and self._subexternal_sourcetree:
cwd = os.getcwd()
- # SourceTree expects to be called from the correct
+ # SourceTree.status() expects to be called from the correct
# root directory.
os.chdir(self._repo_dir_path)
- ext_stats = self._externals_sourcetree.status(self._local_path)
+ subcomponent_stats = self._subexternal_sourcetree.status(self._local_path, force=force, print_progress=print_progress)
os.chdir(cwd)
+ # Merge our status + subcomponent statuses into one return dict keyed
+ # by component path.
all_stats = {}
# don't add the root component because we don't manage it
# and can't provide useful info about it.
if self._local_path != LOCAL_PATH_INDICATOR:
- # store the stats under tha local_path, not comp name so
+ # store the stats under the local_path, not comp name so
# it will be sorted correctly
all_stats[self._stat.path] = self._stat
- if ext_stats:
- all_stats.update(ext_stats)
+ if subcomponent_stats:
+ all_stats.update(subcomponent_stats)
return all_stats
- def checkout(self, verbosity, load_all):
+ def checkout(self, verbosity):
"""
If the repo destination directory exists, ensure it is correct (from
- correct URL, correct branch or tag), and possibly update the external.
+ correct URL, correct branch or tag), and possibly updateit.
If the repo destination directory does not exist, checkout the correct
branch or tag.
- If load_all is True, also load all of the the externals sub-externals.
+ Does not check out sub-externals, see SourceTree.checkout().
"""
- if load_all:
- pass
# Make sure we are in correct location
-
if not os.path.exists(self._repo_dir_path):
# repository directory doesn't exist. Need to check it
# out, and for that we need the base_dir_path to exist
@@ -174,6 +182,10 @@ def checkout(self, verbosity, load_all):
self._base_dir_path)
fatal_error(msg)
+ if not self._stat:
+ self.status()
+ assert self._stat
+
if self._stat.source_type != ExternalStatus.STANDALONE:
if verbosity >= VERBOSITY_VERBOSE:
# NOTE(bja, 2018-01) probably do not want to pass
@@ -194,120 +206,147 @@ def checkout(self, verbosity, load_all):
self._repo.checkout(self._base_dir_path, self._repo_dir_name,
checkout_verbosity, self.clone_recursive())
- def checkout_externals(self, verbosity, load_all):
- """Checkout the sub-externals for this object
- """
- if self.load_externals():
- if self._externals_sourcetree:
- # NOTE(bja, 2018-02): the subtree externals objects
- # were created during initial status check. Updating
- # the external may have changed which sub-externals
- # are needed. We need to delete those objects and
- # re-read the potentially modified externals
- # description file.
- self._externals_sourcetree = None
- self._create_externals_sourcetree()
- self._externals_sourcetree.checkout(verbosity, load_all)
-
- def load_externals(self):
- 'Return True iff an externals file should be loaded'
- load_ex = False
- if os.path.exists(self._repo_dir_path):
- if self._externals:
- if self._externals.lower() != 'none':
- load_ex = os.path.exists(os.path.join(self._repo_dir_path,
- self._externals))
-
- return load_ex
+ def replace_subexternal_sourcetree(self, sourcetree):
+ self._subexternal_sourcetree = sourcetree
def clone_recursive(self):
'Return True iff any .gitmodules files should be processed'
- # Try recursive unless there is an externals entry
- recursive = not self._externals
+ # Try recursive .gitmodules unless there is an externals entry
+ recursive = not self._subexternals_path
return recursive
- def _create_externals_sourcetree(self):
- """
+
+class SourceTree(object):
+ """
+ SourceTree represents a group of managed externals.
+
+ Those externals may not be checked out locally yet, they might only
+ have Repository objects pointing to their respective repositories.
+ """
+
+ @classmethod
+ def from_externals_file(cls, parent_repo_dir_path, parent_repo,
+ externals_path):
+ """Creates a SourceTree representing the given externals file.
+
+ Looks up a git submodules file as an optional backup if there is no
+ externals file specified.
+
+ Returns None if there is no externals file (i.e. it's None or 'none'),
+ or if the externals file hasn't been checked out yet.
+
+ parent_repo_dir_path: parent repo root dir
+ parent_repo: parent repo.
+ externals_path: path to externals file, relative to parent_repo_dir_path.
"""
- if not os.path.exists(self._repo_dir_path):
+ if not os.path.exists(parent_repo_dir_path):
# NOTE(bja, 2017-10) repository has not been checked out
# yet, can't process the externals file. Assume we are
# checking status before code is checkoud out and this
# will be handled correctly later.
- return
+ return None
- cwd = os.getcwd()
- os.chdir(self._repo_dir_path)
- if self._externals.lower() == 'none':
- msg = ('Internal: Attempt to create source tree for '
- 'externals = none in {}'.format(self._repo_dir_path))
- fatal_error(msg)
+ if externals_path.lower() == 'none':
+ # With explicit 'none', do not look for git submodules file.
+ return None
- if not os.path.exists(self._externals):
- if GitRepository.has_submodules():
- self._externals = ExternalsDescription.GIT_SUBMODULES_FILENAME
+ cwd = os.getcwd()
+ os.chdir(parent_repo_dir_path)
+
+ if not externals_path:
+ if GitRepository.has_submodules(parent_repo_dir_path):
+ externals_path = ExternalsDescription.GIT_SUBMODULES_FILENAME
+ else:
+ return None
- if not os.path.exists(self._externals):
- # NOTE(bja, 2017-10) this check is redundent with the one
+ if not os.path.exists(externals_path):
+ # NOTE(bja, 2017-10) this check is redundant with the one
# in read_externals_description_file!
- msg = ('External externals description file "{0}" '
+ msg = ('Externals description file "{0}" '
'does not exist! In directory: {1}'.format(
- self._externals, self._repo_dir_path))
+ externals_path, parent_repo_dir_path))
fatal_error(msg)
- externals_root = self._repo_dir_path
+ externals_root = parent_repo_dir_path
+ # model_data is a dict-like object which mirrors the file format.
model_data = read_externals_description_file(externals_root,
- self._externals)
- externals = create_externals_description(model_data,
- parent_repo=self._repo)
- self._externals_sourcetree = SourceTree(externals_root, externals)
+ externals_path)
+ # ext_description is another dict-like object (see ExternalsDescription)
+ ext_description = create_externals_description(model_data,
+ parent_repo=parent_repo)
+ externals_sourcetree = SourceTree(externals_root, ext_description)
os.chdir(cwd)
-
-class SourceTree(object):
- """
- SourceTree represents a group of managed externals
- """
-
- def __init__(self, root_dir, model, svn_ignore_ancestry=False):
+ return externals_sourcetree
+
+ def __init__(self, root_dir, ext_description, svn_ignore_ancestry=False):
"""
- Build a SourceTree object from a model description
+ Build a SourceTree object from an ExternalDescription.
+
+ root_dir: the (checked-out) parent repo root dir.
"""
self._root_dir = os.path.abspath(root_dir)
- self._all_components = {}
+ self._all_components = {} # component_name -> _External
self._required_compnames = []
- for comp in model:
- src = _External(self._root_dir, comp, model[comp], svn_ignore_ancestry)
+ for comp, desc in ext_description.items():
+ local_path = desc[ExternalsDescription.PATH]
+ required = desc[ExternalsDescription.REQUIRED]
+ repo_info = desc[ExternalsDescription.REPO]
+ subexternals_path = desc[ExternalsDescription.EXTERNALS]
+
+ repo = create_repository(comp,
+ repo_info,
+ svn_ignore_ancestry=svn_ignore_ancestry)
+
+ sourcetree = None
+ # Treat a .gitmodules file as a backup externals config
+ if not subexternals_path:
+ parent_repo_dir_path = os.path.abspath(os.path.join(root_dir,
+ local_path))
+ if GitRepository.has_submodules(parent_repo_dir_path):
+ subexternals_path = ExternalsDescription.GIT_SUBMODULES_FILENAME
+
+ # Might return None (if the subexternal isn't checked out yet, or subexternal is None or 'none')
+ subexternal_sourcetree = SourceTree.from_externals_file(
+ os.path.join(self._root_dir, local_path),
+ repo,
+ subexternals_path)
+ src = _External(self._root_dir, comp, local_path, required,
+ subexternals_path, repo, svn_ignore_ancestry,
+ subexternal_sourcetree)
+
self._all_components[comp] = src
- if model[comp][ExternalsDescription.REQUIRED]:
+ if required:
self._required_compnames.append(comp)
- def status(self, relative_path_base=LOCAL_PATH_INDICATOR):
- """Report the status components
-
- FIXME(bja, 2017-10) what do we do about situations where the
- user checked out the optional components, but didn't add
- optional for running status? What do we do where the user
- didn't add optional to the checkout but did add it to the
- status. -- For now, we run status on all components, and try
- to do the right thing based on the results....
-
- """
+ def status(self, relative_path_base=LOCAL_PATH_INDICATOR,
+ force=False, print_progress=False):
+ """Return a dictionary of local path->ExternalStatus.
+
+ Notes about the returned dictionary:
+ * It is keyed by local path (e.g. 'components/mom'), not by
+ component name (e.g. 'mom').
+ * It contains top-level keys for all traversed components, whether
+ discovered by recursion or top-level.
+ * It contains entries for all components regardless of whether they
+ are locally installed or not, or required or optional.
+x """
load_comps = self._all_components.keys()
- summary = {}
+ summary = {} # Holds merged statuses from all components.
for comp in load_comps:
- printlog('{0}, '.format(comp), end='')
- stat = self._all_components[comp].status()
+ if print_progress:
+ printlog('{0}, '.format(comp), end='')
+ stat = self._all_components[comp].status(force=force,
+ print_progress=print_progress)
+
+ # Returned status dictionary is keyed by local path; prepend
+ # relative_path_base if not already there.
stat_final = {}
for name in stat.keys():
- # check if we need to append the relative_path_base to
- # the path so it will be sorted in the correct order.
if stat[name].path.startswith(relative_path_base):
- # use as is, without any changes to path
stat_final[name] = stat[name]
else:
- # append relative_path_base to path and store under key = updated path
modified_path = os.path.join(relative_path_base,
stat[name].path)
stat_final[modified_path] = stat[name]
@@ -316,38 +355,71 @@ def status(self, relative_path_base=LOCAL_PATH_INDICATOR):
return summary
+ def _find_installed_optional_components(self):
+ """Returns a list of installed optional component names, if any."""
+ installed_comps = []
+ for comp_name, ext in self._all_components.items():
+ if comp_name in self._required_compnames:
+ continue
+ # Note that in practice we expect this status to be cached.
+ path_to_stat = ext.status()
+
+ # If any part of this component exists locally, consider it
+ # installed and therefore eligible for updating.
+ if any(s.sync_state != ExternalStatus.EMPTY
+ for s in path_to_stat.values()):
+ installed_comps.append(comp_name)
+ return installed_comps
+
def checkout(self, verbosity, load_all, load_comp=None):
"""
- Checkout or update indicated components into the the configured
- subdirs.
+ Checkout or update indicated components into the configured subdirs.
- If load_all is True, recursively checkout all externals.
- If load_all is False, load_comp is an optional set of components to load.
- If load_all is True and load_comp is None, only load the required externals.
+ If load_all is True, checkout all externals (required + optional), recursively.
+ If load_all is False and load_comp is set, checkout load_comp (and any required subexternals, plus any optional subexternals that are already checked out, recursively)
+ If load_all is False and load_comp is None, checkout all required externals, plus any optionals that are already checked out, recursively.
"""
+ if load_all:
+ tmp_comps = self._all_components.keys()
+ elif load_comp is not None:
+ tmp_comps = [load_comp]
+ else:
+ local_optional_compnames = self._find_installed_optional_components()
+ tmp_comps = self._required_compnames + local_optional_compnames
+ if local_optional_compnames:
+ printlog('Found locally installed optional components: ' +
+ ', '.join(local_optional_compnames))
+ bad_compnames = set(local_optional_compnames) - set(self._all_components.keys())
+ if bad_compnames:
+ printlog('Internal error: found locally installed components that are not in the global list of all components: ' + ','.join(bad_compnames))
+
if verbosity >= VERBOSITY_VERBOSE:
printlog('Checking out externals: ')
else:
printlog('Checking out externals: ', end='')
- if load_all:
- load_comps = self._all_components.keys()
- elif load_comp is not None:
- load_comps = [load_comp]
- else:
- load_comps = self._required_compnames
+ # Sort by path so that if paths are nested the
+ # parent repo is checked out first.
+ load_comps = sorted(tmp_comps, key=lambda comp: self._all_components[comp].get_local_path())
- # checkout the primary externals
- for comp in load_comps:
+ # checkout.
+ for comp_name in load_comps:
if verbosity < VERBOSITY_VERBOSE:
- printlog('{0}, '.format(comp), end='')
+ printlog('{0}, '.format(comp_name), end='')
else:
# verbose output handled by the _External object, just
# output a newline
printlog(EMPTY_STR)
- self._all_components[comp].checkout(verbosity, load_all)
+ c = self._all_components[comp_name]
+ # Does not recurse.
+ c.checkout(verbosity)
+ # Recursively check out subexternals, if any. Returns None
+ # if there's no subexternals path.
+ component_subexternal_sourcetree = SourceTree.from_externals_file(
+ c.get_repo_dir_path(),
+ c.get_repo(),
+ c.get_subexternals_path())
+ c.replace_subexternal_sourcetree(component_subexternal_sourcetree)
+ if component_subexternal_sourcetree:
+ component_subexternal_sourcetree.checkout(verbosity, load_all)
printlog('')
-
- # now give each external an opportunitity to checkout it's externals.
- for comp in load_comps:
- self._all_components[comp].checkout_externals(verbosity, load_all)
diff --git a/manage_externals/manic/utils.py b/manage_externals/manic/utils.py
index f57f43930c..9c63ffe65e 100644
--- a/manage_externals/manic/utils.py
+++ b/manage_externals/manic/utils.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""
Common public utilities for manic package
diff --git a/manage_externals/test/README.md b/manage_externals/test/README.md
index 938a900eec..1e8f2eaa77 100644
--- a/manage_externals/test/README.md
+++ b/manage_externals/test/README.md
@@ -1,45 +1,25 @@
# Testing for checkout_externals
-NOTE: Python2 is the supported runtime environment. Python3 compatibility is
-in progress, complicated by the different proposed input methods
-(yaml, xml, cfg/ini, json) and their different handling of strings
-(unicode vs byte) in python2. Full python3 compatibility will be
-possible once the number of possible input formats has been narrowed.
-
-## Setup development environment
-
-Development environments should be setup for python2 and python3:
+## Unit tests
```SH
cd checkout_externals/test
- make python=python2 env
- make python=python3 env
+ make utest
```
-## Unit tests
-
-Tests should be run for both python2 and python3. It is recommended
-that you have seperate terminal windows open python2 and python3
-testing to avoid errors activating and deactivating environments.
+## System tests
```SH
cd checkout_externals/test
- . env_python2/bin/activate
- make utest
- deactivate
+ make stest
```
+Example to run a single test:
```SH
- cd checkout_externals/test
- . env_python2/bin/activate
- make utest
- deactivate
+ cd checkout_externals
+ python -m unittest test.test_sys_checkout.TestSysCheckout.test_container_simple_required
```
-## System tests
-
-Not yet implemented.
-
## Static analysis
checkout_externals is difficult to test thoroughly because it relies
@@ -51,9 +31,7 @@ regularly for automatic code formatting and linting.
```SH
cd checkout_externals/test
- . env_python2/bin/activate
make lint
- deactivate
```
The canonical formatting for the code is whatever autopep8
@@ -68,10 +46,8 @@ coverage, run the code coverage tool:
```SH
cd checkout_externals/test
- . env_python2/bin/activate
make coverage
open -a Firefox.app htmlcov/index.html
- deactivate
```
diff --git a/manage_externals/test/repos/README.md b/manage_externals/test/repos/README.md
new file mode 100644
index 0000000000..8a3502c35f
--- /dev/null
+++ b/manage_externals/test/repos/README.md
@@ -0,0 +1,33 @@
+Git repositories for testing git-related behavior. For usage and terminology notes, see test/test_sys_checkout.py.
+
+To list files and view file contents at HEAD:
+```
+cd
+git ls-tree --full-tree -r --name-only HEAD
+git cat-file -p HEAD:
+```
+
+File contents at a glance:
+```
+container.git/
+ readme.txt
+
+simple-ext.git/
+ (has branches: feature2, feature3)
+ (has tags: tag1, tag2)
+ readme.txt
+ simple_subdir/subdir_file.txt
+
+simple-ext-fork.git/
+ (has tags: abandoned-feature, forked-feature-v1, tag1)
+ (has branch: feature2)
+ readme.txt
+
+mixed-cont-ext.git/
+ (has branch: new-feature)
+ readme.txt
+ sub-externals.cfg ('simp_branch' section refers to 'feature2' branch in simple-ext.git/ repo)
+
+error/
+ (no git repo here, just a readme.txt in the clear)
+```
diff --git a/manage_externals/test/test_sys_checkout.py b/manage_externals/test/test_sys_checkout.py
index df726f2b70..ab4f77e88f 100644
--- a/manage_externals/test/test_sys_checkout.py
+++ b/manage_externals/test/test_sys_checkout.py
@@ -1,7 +1,15 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""Unit test driver for checkout_externals
+Terminology:
+ * 'container': a repo that has externals
+ * 'simple': a repo that has no externals, but is referenced as an external by another repo.
+ * 'mixed': a repo that both has externals and is referenced as an external by another repo.
+
+ * 'clean': the local repo matches the version in the externals and has no local modifications.
+ * 'empty': the external isn't checked out at all.
+
Note: this script assume the path to the manic and
checkout_externals module is already in the python path. This is
usually handled by the makefile. If you call it directly, you may need
@@ -21,7 +29,6 @@
* Erase any existing repos at the begining of the module in
setUpModule.
-
"""
# NOTE(bja, 2017-11) pylint complains that the module is too big, but
@@ -66,24 +73,51 @@
#
# ---------------------------------------------------------------------
-# environment variable names
-MANIC_TEST_BARE_REPO_ROOT = 'MANIC_TEST_BARE_REPO_ROOT'
-MANIC_TEST_TMP_REPO_ROOT = 'MANIC_TEST_TMP_REPO_ROOT'
-# directory names
-TMP_REPO_DIR_NAME = 'tmp'
+# Module-wide root directory for all the per-test subdirs we'll create on
+# the fly (which are placed under wherever $CWD is when the test runs).
+# Set by setupModule().
+module_tmp_root_dir = None
+TMP_REPO_DIR_NAME = 'tmp' # subdir under $CWD
+
+# subdir under test/ that holds all of our checked-in repositories (which we
+# will clone for these tests).
BARE_REPO_ROOT_NAME = 'repos'
-CONTAINER_REPO_NAME = 'container.git'
-MIXED_REPO_NAME = 'mixed-cont-ext.git'
-SIMPLE_REPO_NAME = 'simple-ext.git'
-SIMPLE_FORK_NAME = 'simple-ext-fork.git'
+
+# Environment var referenced by checked-in externals file in mixed-cont-ext.git,
+# which should be pointed to the fully-resolved BARE_REPO_ROOT_NAME directory.
+# We explicitly clear this after every test, via tearDown().
+MIXED_CONT_EXT_ROOT_ENV_VAR = 'MANIC_TEST_BARE_REPO_ROOT'
+
+# Subdirs under bare repo root, each holding a repository. For more info
+# on the contents of these repositories, see test/repos/README.md. In these
+# tests the 'parent' repos are cloned as a starting point, whereas the 'child'
+# repos are checked out when the tests run checkout_externals.
+CONTAINER_REPO = 'container.git' # Parent repo
+SIMPLE_REPO = 'simple-ext.git' # Child repo
+SIMPLE_FORK_REPO = 'simple-ext-fork.git' # Child repo
+MIXED_REPO = 'mixed-cont-ext.git' # Both parent and child
+
+# Standard (arbitrary) external names for test configs
+TAG_SECTION = 'simp_tag'
+BRANCH_SECTION = 'simp_branch'
+HASH_SECTION = 'simp_hash'
+
+# All the configs we construct check out their externals into these local paths.
+EXTERNALS_PATH = 'externals'
+SUB_EXTERNALS_PATH = 'src' # For mixed test repos,
+
+# For testing behavior with '.' instead of an explicit paths.
SIMPLE_LOCAL_ONLY_NAME = '.'
-ERROR_REPO_NAME = 'error'
-EXTERNALS_NAME = 'externals'
-SUB_EXTERNALS_PATH = 'src'
-CFG_NAME = 'externals.cfg'
-CFG_SUB_NAME = 'sub-externals.cfg'
-README_NAME = 'readme.txt'
+
+# Externals files.
+CFG_NAME = 'externals.cfg' # We construct this on a per-test basis.
+CFG_SUB_NAME = 'sub-externals.cfg' # Already exists in mixed-cont-ext repo.
+
+# Arbitrary text file in all the test repos.
+README_NAME = 'readme.txt'
+
+# Branch that exists in both the simple and simple-fork repos.
REMOTE_BRANCH_FEATURE2 = 'feature2'
SVN_TEST_REPO = 'https://github.com/escomp/cesm'
@@ -107,136 +141,113 @@ def setUpModule(): # pylint: disable=C0103
pass
# create clean dir for this run
os.mkdir(repo_root)
- # set into the environment so var will be expanded in externals
- # filess when executables are run
- os.environ[MANIC_TEST_TMP_REPO_ROOT] = repo_root
-
-
-class GenerateExternalsDescriptionCfgV1(object):
- """Class to provide building blocks to create
- ExternalsDescriptionCfgV1 files.
-
- Includes predefined files used in tests.
- """
+ # Make available to all tests in this file.
+ global module_tmp_root_dir
+ assert module_tmp_root_dir == None, module_tmp_root_dir
+ module_tmp_root_dir = repo_root
- def __init__(self):
- self._schema_version = '1.1.0'
- self._config = None
-
- def container_full(self, dest_dir):
- """Create the full container config file with simple and mixed use
- externals
-
- """
- self.create_config()
- self.create_section(SIMPLE_REPO_NAME, 'simp_tag',
- tag='tag1')
-
- self.create_section(SIMPLE_REPO_NAME, 'simp_branch',
- branch=REMOTE_BRANCH_FEATURE2)
-
- self.create_section(SIMPLE_REPO_NAME, 'simp_opt',
- tag='tag1', required=False)
-
- self.create_section(MIXED_REPO_NAME, 'mixed_req',
- branch='master', externals=CFG_SUB_NAME)
-
- self.write_config(dest_dir)
-
- def container_simple_required(self, dest_dir):
- """Create a container externals file with only simple externals.
-
- """
- self.create_config()
- self.create_section(SIMPLE_REPO_NAME, 'simp_tag',
- tag='tag1')
-
- self.create_section(SIMPLE_REPO_NAME, 'simp_branch',
- branch=REMOTE_BRANCH_FEATURE2)
-
- self.create_section(SIMPLE_REPO_NAME, 'simp_hash',
- ref_hash='60b1cc1a38d63')
-
- self.write_config(dest_dir)
-
- def container_simple_optional(self, dest_dir):
- """Create a container externals file with optional simple externals
+class RepoUtils(object):
+ """Convenience methods for interacting with git repos."""
+ @staticmethod
+ def create_branch(repo_base_dir, external_name, branch, with_commit=False):
+ """Create branch and optionally (with_commit) add a single commit.
"""
- self.create_config()
- self.create_section(SIMPLE_REPO_NAME, 'simp_req',
- tag='tag1')
-
- self.create_section(SIMPLE_REPO_NAME, 'simp_opt',
- tag='tag1', required=False)
-
- self.write_config(dest_dir)
-
- def container_simple_svn(self, dest_dir):
- """Create a container externals file with only simple externals.
+ # pylint: disable=R0913
+ cwd = os.getcwd()
+ repo_root = os.path.join(repo_base_dir, EXTERNALS_PATH, external_name)
+ os.chdir(repo_root)
+ cmd = ['git', 'checkout', '-b', branch, ]
+ execute_subprocess(cmd)
+ if with_commit:
+ msg = 'start work on {0}'.format(branch)
+ with open(README_NAME, 'a') as handle:
+ handle.write(msg)
+ cmd = ['git', 'add', README_NAME, ]
+ execute_subprocess(cmd)
+ cmd = ['git', 'commit', '-m', msg, ]
+ execute_subprocess(cmd)
+ os.chdir(cwd)
+ @staticmethod
+ def create_commit(repo_base_dir, external_name):
+ """Make a commit to the given external.
+
+ This is used to test sync state changes from local commits on
+ detached heads and tracking branches.
"""
- self.create_config()
- self.create_section(SIMPLE_REPO_NAME, 'simp_tag', tag='tag1')
-
- self.create_svn_external('svn_branch', branch='trunk')
- self.create_svn_external('svn_tag', tag='tags/cesm2.0.beta07')
+ cwd = os.getcwd()
+ repo_root = os.path.join(repo_base_dir, EXTERNALS_PATH, external_name)
+ os.chdir(repo_root)
- self.write_config(dest_dir)
+ msg = 'work on great new feature!'
+ with open(README_NAME, 'a') as handle:
+ handle.write(msg)
+ cmd = ['git', 'add', README_NAME, ]
+ execute_subprocess(cmd)
+ cmd = ['git', 'commit', '-m', msg, ]
+ execute_subprocess(cmd)
+ os.chdir(cwd)
- def container_sparse(self, dest_dir):
- """Create a container with a full external and a sparse external
+ @staticmethod
+ def clone_test_repo(bare_root, test_id, parent_repo_name, dest_dir_in):
+ """Clone repo at / into dest_dir_in or local per-test-subdir.
+ Returns output dir.
"""
- # Create a file for a sparse pattern match
- sparse_filename = 'sparse_checkout'
- with open(os.path.join(dest_dir, sparse_filename), 'w') as sfile:
- sfile.write('readme.txt')
-
- self.create_config()
- self.create_section(SIMPLE_REPO_NAME, 'simp_tag',
- tag='tag2')
-
- sparse_relpath = '../../{}'.format(sparse_filename)
- self.create_section(SIMPLE_REPO_NAME, 'simp_sparse',
- tag='tag2', sparse=sparse_relpath)
+ parent_repo_dir = os.path.join(bare_root, parent_repo_name)
+ if dest_dir_in is None:
+ # create unique subdir for this test
+ test_dir_name = test_id
+ print("Test repository name: {0}".format(test_dir_name))
+ dest_dir = os.path.join(module_tmp_root_dir, test_dir_name)
+ else:
+ dest_dir = dest_dir_in
- self.write_config(dest_dir)
+ # pylint: disable=W0212
+ GitRepository._git_clone(parent_repo_dir, dest_dir, VERBOSITY_DEFAULT)
+ return dest_dir
- def mixed_simple_base(self, dest_dir):
- """Create a mixed-use base externals file with only simple externals.
+ @staticmethod
+ def add_file_to_repo(under_test_dir, filename, tracked):
+ """Add a file to the repository so we can put it into a dirty state
"""
- self.create_config()
- self.create_section_ext_only('mixed_base')
- self.create_section(SIMPLE_REPO_NAME, 'simp_tag',
- tag='tag1')
-
- self.create_section(SIMPLE_REPO_NAME, 'simp_branch',
- branch=REMOTE_BRANCH_FEATURE2)
+ cwd = os.getcwd()
+ os.chdir(under_test_dir)
+ with open(filename, 'w') as tmp:
+ tmp.write('Hello, world!')
- self.create_section(SIMPLE_REPO_NAME, 'simp_hash',
- ref_hash='60b1cc1a38d63')
+ if tracked:
+ # NOTE(bja, 2018-01) brittle hack to obtain repo dir and
+ # file name
+ path_data = filename.split('/')
+ repo_dir = os.path.join(path_data[0], path_data[1])
+ os.chdir(repo_dir)
+ tracked_file = path_data[2]
+ cmd = ['git', 'add', tracked_file]
+ execute_subprocess(cmd)
- self.write_config(dest_dir)
+ os.chdir(cwd)
- def mixed_simple_sub(self, dest_dir):
- """Create a mixed-use sub externals file with only simple externals.
+class GenerateExternalsDescriptionCfgV1(object):
+ """Building blocks to create ExternalsDescriptionCfgV1 files.
- """
- self.create_config()
- self.create_section(SIMPLE_REPO_NAME, 'simp_tag',
- tag='tag1', path=SUB_EXTERNALS_PATH)
+ Basic usage: create_config() multiple create_*(), then write_config().
+ Optionally after that: write_with_*().
+ """
- self.create_section(SIMPLE_REPO_NAME, 'simp_branch',
- branch=REMOTE_BRANCH_FEATURE2,
- path=SUB_EXTERNALS_PATH)
+ def __init__(self, bare_root):
+ self._schema_version = '1.1.0'
+ self._config = None
- self.write_config(dest_dir, filename=CFG_SUB_NAME)
+ # directory where we have test repositories (which we will clone for
+ # tests)
+ self._bare_root = bare_root
def write_config(self, dest_dir, filename=CFG_NAME):
- """Write the configuration file to disk
+ """Write self._config to disk
"""
dest_path = os.path.join(dest_dir, filename)
@@ -258,27 +269,39 @@ def create_metadata(self):
self._config.set(DESCRIPTION_SECTION, VERSION_ITEM,
self._schema_version)
- def create_section(self, repo_type, name, tag='', branch='',
- ref_hash='', required=True, path=EXTERNALS_NAME,
- externals='', repo_path=None, from_submodule=False,
- sparse=''):
+ def url_for_repo_path(self, repo_path, repo_path_abs=None):
+ if repo_path_abs is not None:
+ return repo_path_abs
+ else:
+ return os.path.join(self._bare_root, repo_path)
+
+ def create_section(self, repo_path, name, tag='', branch='',
+ ref_hash='', required=True, path=EXTERNALS_PATH,
+ sub_externals='', repo_path_abs=None, from_submodule=False,
+ sparse='', nested=False):
# pylint: disable=too-many-branches
- """Create a config section with autofilling some items and handling
- optional items.
+ """Create a config ExternalsDescription section with the given name.
+ Autofills some items and handles some optional items.
+
+ repo_path_abs overrides repo_path (which is relative to the bare repo)
+ path is a subdir under repo_path to check out to.
"""
# pylint: disable=R0913
self._config.add_section(name)
if not from_submodule:
- self._config.set(name, ExternalsDescription.PATH,
- os.path.join(path, name))
+ if nested:
+ self._config.set(name, ExternalsDescription.PATH, path)
+ else:
+ self._config.set(name, ExternalsDescription.PATH,
+ os.path.join(path, name))
self._config.set(name, ExternalsDescription.PROTOCOL,
ExternalsDescription.PROTOCOL_GIT)
# from_submodules is incompatible with some other options, turn them off
if (from_submodule and
- ((repo_path is not None) or tag or ref_hash or branch)):
+ ((repo_path_abs is not None) or tag or ref_hash or branch)):
printlog('create_section: "from_submodule" is incompatible with '
'"repo_url", "tag", "hash", and "branch" options;\n'
'Ignoring those options for {}'.format(name))
@@ -287,10 +310,7 @@ def create_section(self, repo_type, name, tag='', branch='',
ref_hash = ''
branch = ''
- if repo_path is not None:
- repo_url = repo_path
- else:
- repo_url = os.path.join('${MANIC_TEST_BARE_REPO_ROOT}', repo_type)
+ repo_url = self.url_for_repo_path(repo_path, repo_path_abs)
if not from_submodule:
self._config.set(name, ExternalsDescription.REPO_URL, repo_url)
@@ -306,8 +326,9 @@ def create_section(self, repo_type, name, tag='', branch='',
if ref_hash:
self._config.set(name, ExternalsDescription.HASH, ref_hash)
- if externals:
- self._config.set(name, ExternalsDescription.EXTERNALS, externals)
+ if sub_externals:
+ self._config.set(name, ExternalsDescription.EXTERNALS,
+ sub_externals)
if sparse:
self._config.set(name, ExternalsDescription.SPARSE, sparse)
@@ -315,10 +336,8 @@ def create_section(self, repo_type, name, tag='', branch='',
if from_submodule:
self._config.set(name, ExternalsDescription.SUBMODULE, "True")
- def create_section_ext_only(self, name,
- required=True, externals=CFG_SUB_NAME):
- """Create a config section with autofilling some items and handling
- optional items.
+ def create_section_reference_to_subexternal(self, name):
+ """Just a reference to another externals file.
"""
# pylint: disable=R0913
@@ -331,10 +350,9 @@ def create_section_ext_only(self, name,
self._config.set(name, ExternalsDescription.REPO_URL,
LOCAL_PATH_INDICATOR)
- self._config.set(name, ExternalsDescription.REQUIRED, str(required))
+ self._config.set(name, ExternalsDescription.REQUIRED, str(True))
- if externals:
- self._config.set(name, ExternalsDescription.EXTERNALS, externals)
+ self._config.set(name, ExternalsDescription.EXTERNALS, CFG_SUB_NAME)
def create_svn_external(self, name, tag='', branch=''):
"""Create a config section for an svn repository.
@@ -342,7 +360,7 @@ def create_svn_external(self, name, tag='', branch=''):
"""
self._config.add_section(name)
self._config.set(name, ExternalsDescription.PATH,
- os.path.join(EXTERNALS_NAME, name))
+ os.path.join(EXTERNALS_PATH, name))
self._config.set(name, ExternalsDescription.PROTOCOL,
ExternalsDescription.PROTOCOL_SVN)
@@ -357,65 +375,19 @@ def create_svn_external(self, name, tag='', branch=''):
if branch:
self._config.set(name, ExternalsDescription.BRANCH, branch)
- @staticmethod
- def create_branch(dest_dir, repo_name, branch, with_commit=False):
- """Update a repository branch, and potentially the remote.
- """
- # pylint: disable=R0913
- cwd = os.getcwd()
- repo_root = os.path.join(dest_dir, EXTERNALS_NAME)
- repo_root = os.path.join(repo_root, repo_name)
- os.chdir(repo_root)
- cmd = ['git', 'checkout', '-b', branch, ]
- execute_subprocess(cmd)
- if with_commit:
- msg = 'start work on {0}'.format(branch)
- with open(README_NAME, 'a') as handle:
- handle.write(msg)
- cmd = ['git', 'add', README_NAME, ]
- execute_subprocess(cmd)
- cmd = ['git', 'commit', '-m', msg, ]
- execute_subprocess(cmd)
- os.chdir(cwd)
-
- @staticmethod
- def create_commit(dest_dir, repo_name, local_tracking_branch=None):
- """Make a commit on whatever is currently checked out.
-
- This is used to test sync state changes from local commits on
- detached heads and tracking branches.
+ def write_with_git_branch(self, dest_dir, name, branch, new_remote_repo_path=None):
+ """Update fields in our config and write it to disk.
- """
- cwd = os.getcwd()
- repo_root = os.path.join(dest_dir, EXTERNALS_NAME)
- repo_root = os.path.join(repo_root, repo_name)
- os.chdir(repo_root)
- if local_tracking_branch:
- cmd = ['git', 'checkout', '-b', local_tracking_branch, ]
- execute_subprocess(cmd)
-
- msg = 'work on great new feature!'
- with open(README_NAME, 'a') as handle:
- handle.write(msg)
- cmd = ['git', 'add', README_NAME, ]
- execute_subprocess(cmd)
- cmd = ['git', 'commit', '-m', msg, ]
- execute_subprocess(cmd)
- os.chdir(cwd)
-
- def update_branch(self, dest_dir, name, branch, repo_type=None,
- filename=CFG_NAME):
- """Update a repository branch, and potentially the remote.
+ name is the key of the ExternalsDescription in self._config to update.
"""
# pylint: disable=R0913
self._config.set(name, ExternalsDescription.BRANCH, branch)
- if repo_type:
- if repo_type == SIMPLE_LOCAL_ONLY_NAME:
+ if new_remote_repo_path:
+ if new_remote_repo_path == SIMPLE_LOCAL_ONLY_NAME:
repo_url = SIMPLE_LOCAL_ONLY_NAME
else:
- repo_url = os.path.join('${MANIC_TEST_BARE_REPO_ROOT}',
- repo_type)
+ repo_url = os.path.join(self._bare_root, new_remote_repo_path)
self._config.set(name, ExternalsDescription.REPO_URL, repo_url)
try:
@@ -424,9 +396,9 @@ def update_branch(self, dest_dir, name, branch, repo_type=None,
except BaseException:
pass
- self.write_config(dest_dir, filename)
+ self.write_config(dest_dir)
- def update_svn_branch(self, dest_dir, name, branch, filename=CFG_NAME):
+ def write_with_svn_branch(self, dest_dir, name, branch):
"""Update a repository branch, and potentially the remote.
"""
# pylint: disable=R0913
@@ -438,11 +410,11 @@ def update_svn_branch(self, dest_dir, name, branch, filename=CFG_NAME):
except BaseException:
pass
- self.write_config(dest_dir, filename)
+ self.write_config(dest_dir)
- def update_tag(self, dest_dir, name, tag, repo_type=None,
- filename=CFG_NAME, remove_branch=True):
- """Update a repository tag, and potentially the remote
+ def write_with_tag_and_remote_repo(self, dest_dir, name, tag, new_remote_repo_path,
+ remove_branch=True):
+ """Update a repository tag and the remote.
NOTE(bja, 2017-11) remove_branch=False should result in an
overspecified external with both a branch and tag. This is
@@ -452,8 +424,8 @@ def update_tag(self, dest_dir, name, tag, repo_type=None,
# pylint: disable=R0913
self._config.set(name, ExternalsDescription.TAG, tag)
- if repo_type:
- repo_url = os.path.join('${MANIC_TEST_BARE_REPO_ROOT}', repo_type)
+ if new_remote_repo_path:
+ repo_url = os.path.join(self._bare_root, new_remote_repo_path)
self._config.set(name, ExternalsDescription.REPO_URL, repo_url)
try:
@@ -463,10 +435,9 @@ def update_tag(self, dest_dir, name, tag, repo_type=None,
except BaseException:
pass
- self.write_config(dest_dir, filename)
+ self.write_config(dest_dir)
- def update_underspecify_branch_tag(self, dest_dir, name,
- filename=CFG_NAME):
+ def write_without_branch_tag(self, dest_dir, name):
"""Update a repository protocol, and potentially the remote
"""
# pylint: disable=R0913
@@ -482,10 +453,9 @@ def update_underspecify_branch_tag(self, dest_dir, name,
except BaseException:
pass
- self.write_config(dest_dir, filename)
+ self.write_config(dest_dir)
- def update_underspecify_remove_url(self, dest_dir, name,
- filename=CFG_NAME):
+ def write_without_repo_url(self, dest_dir, name):
"""Update a repository protocol, and potentially the remote
"""
# pylint: disable=R0913
@@ -495,22 +465,59 @@ def update_underspecify_remove_url(self, dest_dir, name,
except BaseException:
pass
- self.write_config(dest_dir, filename)
+ self.write_config(dest_dir)
- def update_protocol(self, dest_dir, name, protocol, repo_type=None,
- filename=CFG_NAME):
+ def write_with_protocol(self, dest_dir, name, protocol, repo_path=None):
"""Update a repository protocol, and potentially the remote
"""
# pylint: disable=R0913
self._config.set(name, ExternalsDescription.PROTOCOL, protocol)
- if repo_type:
- repo_url = os.path.join('${MANIC_TEST_BARE_REPO_ROOT}', repo_type)
+ if repo_path:
+ repo_url = os.path.join(self._bare_root, repo_path)
self._config.set(name, ExternalsDescription.REPO_URL, repo_url)
- self.write_config(dest_dir, filename)
+ self.write_config(dest_dir)
+
+
+def _execute_checkout_in_dir(dirname, args, debug_env=''):
+ """Execute the checkout command in the appropriate repo dir with the
+ specified additional args.
+
+ args should be a list of strings.
+ debug_env shuld be a string of the form 'FOO=bar' or the empty string.
+ Note that we are calling the command line processing and main
+ routines and not using a subprocess call so that we get code
+ coverage results! Note this means that environment variables are passed
+ to checkout_externals via os.environ; debug_env is just used to aid
+ manual reproducibility of a given call.
+ Returns (overall_status, tree_status)
+ where overall_status is 0 for success, nonzero otherwise.
+ and tree_status is set if --status was passed in, None otherwise.
+
+ Note this command executes the checkout command, it doesn't
+ necessarily do any checking out (e.g. if --status is passed in).
+ """
+ cwd = os.getcwd()
+
+ # Construct a command line for reproducibility; this command is not
+ # actually executed in the test.
+ os.chdir(dirname)
+ cmdline = ['--externals', CFG_NAME, ]
+ cmdline += args
+ manual_cmd = ('Running equivalent of:\n'
+ 'pushd {dirname}; '
+ '{debug_env} /path/to/checkout_externals {args}'.format(
+ dirname=dirname, debug_env=debug_env,
+ args=' '.join(cmdline)))
+ printlog(manual_cmd)
+ options = checkout.commandline_arguments(cmdline)
+ overall_status, tree_status = checkout.main(options)
+ os.chdir(cwd)
+ return overall_status, tree_status
+
class BaseTestSysCheckout(unittest.TestCase):
"""Base class of reusable systems level test setup for
checkout_externals
@@ -521,6 +528,7 @@ class BaseTestSysCheckout(unittest.TestCase):
# cryptic.
# pylint: disable=invalid-name
+ # Command-line args for checkout_externals, used in execute_checkout_in_dir()
status_args = ['--status']
checkout_args = []
optional_args = ['--optional']
@@ -535,384 +543,74 @@ def setUp(self):
self._test_id = self.id().split('.')[-1]
- # path to the executable
- self._checkout = os.path.join('../checkout_externals')
- self._checkout = os.path.abspath(self._checkout)
+ # find root
+ if os.path.exists(os.path.join(os.getcwd(), 'checkout_externals')):
+ root_dir = os.path.abspath(os.getcwd())
+ else:
+ # maybe we are in a subdir, search up
+ root_dir = os.path.abspath(os.path.join(os.getcwd(), os.pardir))
+ while os.path.basename(root_dir):
+ if os.path.exists(os.path.join(root_dir, 'checkout_externals')):
+ break
+ root_dir = os.path.dirname(root_dir)
+
+ if not os.path.exists(os.path.join(root_dir, 'checkout_externals')):
+ raise RuntimeError('Cannot find checkout_externals')
- # directory where we have test repositories
- self._bare_root = os.path.join(os.getcwd(), BARE_REPO_ROOT_NAME)
- self._bare_root = os.path.abspath(self._bare_root)
+ # path to the executable
+ self._checkout = os.path.join(root_dir, 'checkout_externals')
- # set into the environment so var will be expanded in externals files
- os.environ[MANIC_TEST_BARE_REPO_ROOT] = self._bare_root
+ # directory where we have test repositories (which we will clone for
+ # tests)
+ self._bare_root = os.path.abspath(
+ os.path.join(root_dir, 'test', BARE_REPO_ROOT_NAME))
# set the input file generator
- self._generator = GenerateExternalsDescriptionCfgV1()
+ self._generator = GenerateExternalsDescriptionCfgV1(self._bare_root)
# set the input file generator for secondary externals
- self._sub_generator = GenerateExternalsDescriptionCfgV1()
+ self._sub_generator = GenerateExternalsDescriptionCfgV1(self._bare_root)
def tearDown(self):
"""Tear down for individual tests
"""
- # remove the env var we added in setup
- del os.environ[MANIC_TEST_BARE_REPO_ROOT]
-
# return to our common starting point
os.chdir(self._return_dir)
-
- def setup_test_repo(self, parent_repo_name, dest_dir_in=None):
- """Setup the paths and clone the base test repo
-
- """
- # unique repo for this test
- test_dir_name = self._test_id
- print("Test repository name: {0}".format(test_dir_name))
-
- parent_repo_dir = os.path.join(self._bare_root, parent_repo_name)
- if dest_dir_in is None:
- dest_dir = os.path.join(os.environ[MANIC_TEST_TMP_REPO_ROOT],
- test_dir_name)
- else:
- dest_dir = dest_dir_in
-
- # pylint: disable=W0212
- GitRepository._git_clone(parent_repo_dir, dest_dir, VERBOSITY_DEFAULT)
- return dest_dir
-
- @staticmethod
- def _add_file_to_repo(under_test_dir, filename, tracked):
- """Add a file to the repository so we can put it into a dirty state
-
- """
- cwd = os.getcwd()
- os.chdir(under_test_dir)
- with open(filename, 'w') as tmp:
- tmp.write('Hello, world!')
-
- if tracked:
- # NOTE(bja, 2018-01) brittle hack to obtain repo dir and
- # file name
- path_data = filename.split('/')
- repo_dir = os.path.join(path_data[0], path_data[1])
- os.chdir(repo_dir)
- tracked_file = path_data[2]
- cmd = ['git', 'add', tracked_file]
- execute_subprocess(cmd)
-
- os.chdir(cwd)
+
+ # (in case this was set) Don't pollute environment of other tests.
+ os.environ.pop(MIXED_CONT_EXT_ROOT_ENV_VAR,
+ None) # Don't care if key wasn't set.
+
+ def clone_test_repo(self, parent_repo_name, dest_dir_in=None):
+ """Clones repo under self._bare_root"""
+ return RepoUtils.clone_test_repo(self._bare_root, self._test_id,
+ parent_repo_name, dest_dir_in)
+
+ def execute_checkout_in_dir(self, dirname, args, debug_env=''):
+ overall_status, tree_status = _execute_checkout_in_dir(dirname, args,
+ debug_env=debug_env)
+ self.assertEqual(overall_status, 0)
+ return tree_status
+
+ def execute_checkout_with_status(self, dirname, args, debug_env=''):
+ """Calls checkout a second time to get status if needed."""
+ tree_status = self.execute_checkout_in_dir(
+ dirname, args, debug_env=debug_env)
+ if tree_status is None:
+ tree_status = self.execute_checkout_in_dir(dirname,
+ self.status_args,
+ debug_env=debug_env)
+ self.assertNotEqual(tree_status, None)
+ return tree_status
+
+ def _check_sync_clean(self, ext_status, expected_sync_state,
+ expected_clean_state):
+ self.assertEqual(ext_status.sync_state, expected_sync_state)
+ self.assertEqual(ext_status.clean_state, expected_clean_state)
@staticmethod
- def execute_cmd_in_dir(under_test_dir, args):
- """Extecute the checkout command in the appropriate repo dir with the
- specified additional args
-
- Note that we are calling the command line processing and main
- routines and not using a subprocess call so that we get code
- coverage results!
-
- """
- cwd = os.getcwd()
- checkout_path = os.path.abspath('{0}/../../checkout_externals')
- os.chdir(under_test_dir)
- cmdline = ['--externals', CFG_NAME, ]
- cmdline += args
- repo_root = 'MANIC_TEST_BARE_REPO_ROOT={root}'.format(
- root=os.environ[MANIC_TEST_BARE_REPO_ROOT])
- manual_cmd = ('Test cmd:\npushd {cwd}; {env} {checkout} {args}'.format(
- cwd=under_test_dir, env=repo_root, checkout=checkout_path,
- args=' '.join(cmdline)))
- printlog(manual_cmd)
- options = checkout.commandline_arguments(cmdline)
- overall_status, tree_status = checkout.main(options)
- os.chdir(cwd)
- return overall_status, tree_status
-
- # ----------------------------------------------------------------
- #
- # Check results for generic perturbation of states
- #
- # ----------------------------------------------------------------
- def _check_generic_empty_default_required(self, tree, name):
- self.assertEqual(tree[name].sync_state, ExternalStatus.EMPTY)
- self.assertEqual(tree[name].clean_state, ExternalStatus.DEFAULT)
- self.assertEqual(tree[name].source_type, ExternalStatus.MANAGED)
-
- def _check_generic_ok_clean_required(self, tree, name):
- self.assertEqual(tree[name].sync_state, ExternalStatus.STATUS_OK)
- self.assertEqual(tree[name].clean_state, ExternalStatus.STATUS_OK)
- self.assertEqual(tree[name].source_type, ExternalStatus.MANAGED)
-
- def _check_generic_ok_dirty_required(self, tree, name):
- self.assertEqual(tree[name].sync_state, ExternalStatus.STATUS_OK)
- self.assertEqual(tree[name].clean_state, ExternalStatus.DIRTY)
- self.assertEqual(tree[name].source_type, ExternalStatus.MANAGED)
-
- def _check_generic_modified_ok_required(self, tree, name):
- self.assertEqual(tree[name].sync_state, ExternalStatus.MODEL_MODIFIED)
- self.assertEqual(tree[name].clean_state, ExternalStatus.STATUS_OK)
- self.assertEqual(tree[name].source_type, ExternalStatus.MANAGED)
-
- def _check_generic_empty_default_optional(self, tree, name):
- self.assertEqual(tree[name].sync_state, ExternalStatus.EMPTY)
- self.assertEqual(tree[name].clean_state, ExternalStatus.DEFAULT)
- self.assertEqual(tree[name].source_type, ExternalStatus.OPTIONAL)
-
- def _check_generic_ok_clean_optional(self, tree, name):
- self.assertEqual(tree[name].sync_state, ExternalStatus.STATUS_OK)
- self.assertEqual(tree[name].clean_state, ExternalStatus.STATUS_OK)
- self.assertEqual(tree[name].source_type, ExternalStatus.OPTIONAL)
-
- # ----------------------------------------------------------------
- #
- # Check results for individual named externals
- #
- # ----------------------------------------------------------------
- def _check_simple_tag_empty(self, tree, directory=EXTERNALS_NAME):
- name = './{0}/simp_tag'.format(directory)
- self._check_generic_empty_default_required(tree, name)
-
- def _check_simple_tag_ok(self, tree, directory=EXTERNALS_NAME):
- name = './{0}/simp_tag'.format(directory)
- self._check_generic_ok_clean_required(tree, name)
-
- def _check_simple_tag_dirty(self, tree, directory=EXTERNALS_NAME):
- name = './{0}/simp_tag'.format(directory)
- self._check_generic_ok_dirty_required(tree, name)
-
- def _check_simple_tag_modified(self, tree, directory=EXTERNALS_NAME):
- name = './{0}/simp_tag'.format(directory)
- self._check_generic_modified_ok_required(tree, name)
-
- def _check_simple_branch_empty(self, tree, directory=EXTERNALS_NAME):
- name = './{0}/simp_branch'.format(directory)
- self._check_generic_empty_default_required(tree, name)
-
- def _check_simple_branch_ok(self, tree, directory=EXTERNALS_NAME):
- name = './{0}/simp_branch'.format(directory)
- self._check_generic_ok_clean_required(tree, name)
-
- def _check_simple_branch_modified(self, tree, directory=EXTERNALS_NAME):
- name = './{0}/simp_branch'.format(directory)
- self._check_generic_modified_ok_required(tree, name)
-
- def _check_simple_hash_empty(self, tree, directory=EXTERNALS_NAME):
- name = './{0}/simp_hash'.format(directory)
- self._check_generic_empty_default_required(tree, name)
-
- def _check_simple_hash_ok(self, tree, directory=EXTERNALS_NAME):
- name = './{0}/simp_hash'.format(directory)
- self._check_generic_ok_clean_required(tree, name)
-
- def _check_simple_hash_modified(self, tree, directory=EXTERNALS_NAME):
- name = './{0}/simp_hash'.format(directory)
- self._check_generic_modified_ok_required(tree, name)
-
- def _check_simple_req_empty(self, tree, directory=EXTERNALS_NAME):
- name = './{0}/simp_req'.format(directory)
- self._check_generic_empty_default_required(tree, name)
-
- def _check_simple_req_ok(self, tree, directory=EXTERNALS_NAME):
- name = './{0}/simp_req'.format(directory)
- self._check_generic_ok_clean_required(tree, name)
-
- def _check_simple_opt_empty(self, tree, directory=EXTERNALS_NAME):
- name = './{0}/simp_opt'.format(directory)
- self._check_generic_empty_default_optional(tree, name)
-
- def _check_simple_opt_ok(self, tree, directory=EXTERNALS_NAME):
- name = './{0}/simp_opt'.format(directory)
- self._check_generic_ok_clean_optional(tree, name)
-
- def _check_mixed_ext_branch_empty(self, tree, directory=EXTERNALS_NAME):
- name = './{0}/mixed_req'.format(directory)
- self._check_generic_empty_default_required(tree, name)
-
- def _check_mixed_ext_branch_ok(self, tree, directory=EXTERNALS_NAME):
- name = './{0}/mixed_req'.format(directory)
- self._check_generic_ok_clean_required(tree, name)
-
- def _check_mixed_ext_branch_modified(self, tree, directory=EXTERNALS_NAME):
- name = './{0}/mixed_req'.format(directory)
- self._check_generic_modified_ok_required(tree, name)
-
- def _check_simple_sparse_empty(self, tree, directory=EXTERNALS_NAME):
- name = './{0}/simp_sparse'.format(directory)
- self._check_generic_empty_default_required(tree, name)
-
- def _check_simple_sparse_ok(self, tree, directory=EXTERNALS_NAME):
- name = './{0}/simp_sparse'.format(directory)
- self._check_generic_ok_clean_required(tree, name)
-
- # ----------------------------------------------------------------
- #
- # Check results for groups of externals under specific conditions
- #
- # ----------------------------------------------------------------
- def _check_container_simple_required_pre_checkout(self, overall, tree):
- self.assertEqual(overall, 0)
- self._check_simple_tag_empty(tree)
- self._check_simple_branch_empty(tree)
- self._check_simple_hash_empty(tree)
-
- def _check_container_simple_required_checkout(self, overall, tree):
- # Note, this is the internal tree status just before checkout
- self.assertEqual(overall, 0)
- self._check_simple_tag_empty(tree)
- self._check_simple_branch_empty(tree)
- self._check_simple_hash_empty(tree)
-
- def _check_container_simple_required_post_checkout(self, overall, tree):
- self.assertEqual(overall, 0)
- self._check_simple_tag_ok(tree)
- self._check_simple_branch_ok(tree)
- self._check_simple_hash_ok(tree)
-
- def _check_container_simple_required_out_of_sync(self, overall, tree):
- self.assertEqual(overall, 0)
- self._check_simple_tag_modified(tree)
- self._check_simple_branch_modified(tree)
- self._check_simple_hash_modified(tree)
-
- def _check_container_simple_optional_pre_checkout(self, overall, tree):
- self.assertEqual(overall, 0)
- self._check_simple_req_empty(tree)
- self._check_simple_opt_empty(tree)
-
- def _check_container_simple_optional_checkout(self, overall, tree):
- self.assertEqual(overall, 0)
- self._check_simple_req_empty(tree)
- self._check_simple_opt_empty(tree)
-
- def _check_container_simple_optional_post_checkout(self, overall, tree):
- self.assertEqual(overall, 0)
- self._check_simple_req_ok(tree)
- self._check_simple_opt_empty(tree)
-
- def _check_container_simple_optional_post_optional(self, overall, tree):
- self.assertEqual(overall, 0)
- self._check_simple_req_ok(tree)
- self._check_simple_opt_ok(tree)
-
- def _check_container_simple_required_sb_modified(self, overall, tree):
- self.assertEqual(overall, 0)
- self._check_simple_tag_ok(tree)
- self._check_simple_branch_modified(tree)
- self._check_simple_hash_ok(tree)
-
- def _check_container_simple_optional_st_dirty(self, overall, tree):
- self.assertEqual(overall, 0)
- self._check_simple_tag_dirty(tree)
- self._check_simple_branch_ok(tree)
-
- def _check_container_full_pre_checkout(self, overall, tree):
- self.assertEqual(overall, 0)
- self._check_simple_tag_empty(tree)
- self._check_simple_branch_empty(tree)
- self._check_simple_opt_empty(tree)
- self._check_mixed_ext_branch_required_pre_checkout(overall, tree)
-
- def _check_container_component_post_checkout(self, overall, tree):
- self.assertEqual(overall, 0)
- self._check_simple_opt_ok(tree)
- self._check_simple_tag_empty(tree)
- self._check_simple_branch_empty(tree)
-
- def _check_container_component_post_checkout2(self, overall, tree):
- self.assertEqual(overall, 0)
- self._check_simple_opt_ok(tree)
- self._check_simple_tag_empty(tree)
- self._check_simple_branch_ok(tree)
-
- def _check_container_full_post_checkout(self, overall, tree):
- self.assertEqual(overall, 0)
- self._check_simple_tag_ok(tree)
- self._check_simple_branch_ok(tree)
- self._check_simple_opt_empty(tree)
- self._check_mixed_ext_branch_required_post_checkout(overall, tree)
-
- def _check_container_full_pre_checkout_ext_change(self, overall, tree):
- self.assertEqual(overall, 0)
- self._check_simple_tag_ok(tree)
- self._check_simple_branch_ok(tree)
- self._check_simple_opt_empty(tree)
- self._check_mixed_ext_branch_required_pre_checkout_ext_change(
- overall, tree)
-
- def _check_container_full_post_checkout_subext_modified(
- self, overall, tree):
- self.assertEqual(overall, 0)
- self._check_simple_tag_ok(tree)
- self._check_simple_branch_ok(tree)
- self._check_simple_opt_empty(tree)
- self._check_mixed_ext_branch_required_post_checkout_subext_modified(
- overall, tree)
-
- def _check_mixed_ext_branch_required_pre_checkout(self, overall, tree):
- # Note, this is the internal tree status just before checkout
- self.assertEqual(overall, 0)
- self._check_mixed_ext_branch_empty(tree, directory=EXTERNALS_NAME)
- # NOTE: externals/mixed_req/src should not exist in the tree
- # since this is the status before checkout of mixed_req.
-
- def _check_mixed_ext_branch_required_post_checkout(self, overall, tree):
- # Note, this is the internal tree status just before checkout
- self.assertEqual(overall, 0)
- self._check_mixed_ext_branch_ok(tree, directory=EXTERNALS_NAME)
- check_dir = "{0}/{1}/{2}".format(EXTERNALS_NAME, "mixed_req",
- SUB_EXTERNALS_PATH)
- self._check_simple_branch_ok(tree, directory=check_dir)
-
- def _check_mixed_ext_branch_required_pre_checkout_ext_change(
- self, overall, tree):
- # Note, this is the internal tree status just after change the
- # externals description file, but before checkout
- self.assertEqual(overall, 0)
- self._check_mixed_ext_branch_modified(tree, directory=EXTERNALS_NAME)
- check_dir = "{0}/{1}/{2}".format(EXTERNALS_NAME, "mixed_req",
- SUB_EXTERNALS_PATH)
- self._check_simple_branch_ok(tree, directory=check_dir)
-
- def _check_mixed_ext_branch_required_post_checkout_subext_modified(
- self, overall, tree):
- # Note, this is the internal tree status just after change the
- # externals description file, but before checkout
- self.assertEqual(overall, 0)
- self._check_mixed_ext_branch_ok(tree, directory=EXTERNALS_NAME)
- check_dir = "{0}/{1}/{2}".format(EXTERNALS_NAME, "mixed_req",
- SUB_EXTERNALS_PATH)
- self._check_simple_branch_modified(tree, directory=check_dir)
-
- def _check_mixed_cont_simple_required_pre_checkout(self, overall, tree):
- # Note, this is the internal tree status just before checkout
- self.assertEqual(overall, 0)
- self._check_simple_tag_empty(tree, directory=EXTERNALS_NAME)
- self._check_simple_branch_empty(tree, directory=EXTERNALS_NAME)
- self._check_simple_branch_empty(tree, directory=SUB_EXTERNALS_PATH)
-
- def _check_mixed_cont_simple_required_checkout(self, overall, tree):
- # Note, this is the internal tree status just before checkout
- self.assertEqual(overall, 0)
- self._check_simple_tag_empty(tree, directory=EXTERNALS_NAME)
- self._check_simple_branch_empty(tree, directory=EXTERNALS_NAME)
- self._check_simple_branch_empty(tree, directory=SUB_EXTERNALS_PATH)
-
- def _check_mixed_cont_simple_required_post_checkout(self, overall, tree):
- # Note, this is the internal tree status just before checkout
- self.assertEqual(overall, 0)
- self._check_simple_tag_ok(tree, directory=EXTERNALS_NAME)
- self._check_simple_branch_ok(tree, directory=EXTERNALS_NAME)
- self._check_simple_branch_ok(tree, directory=SUB_EXTERNALS_PATH)
-
- def _check_container_sparse_pre_checkout(self, overall, tree):
- self.assertEqual(overall, 0)
- self._check_simple_tag_empty(tree)
- self._check_simple_sparse_empty(tree)
-
- def _check_container_sparse_post_checkout(self, overall, tree):
- self.assertEqual(overall, 0)
- self._check_simple_tag_ok(tree)
- self._check_simple_sparse_ok(tree)
-
+ def _external_path(section_name, base_path=EXTERNALS_PATH):
+ return './{0}/{1}'.format(base_path, section_name)
+
def _check_file_exists(self, repo_dir, pathname):
"Check that exists in "
self.assertTrue(os.path.exists(os.path.join(repo_dir, pathname)))
@@ -921,9 +619,9 @@ def _check_file_absent(self, repo_dir, pathname):
"Check that does not exist in "
self.assertFalse(os.path.exists(os.path.join(repo_dir, pathname)))
+
class TestSysCheckout(BaseTestSysCheckout):
"""Run systems level tests of checkout_externals
-
"""
# NOTE(bja, 2017-11) pylint complains about long method names, but
# it is hard to differentiate tests without making them more
@@ -935,214 +633,431 @@ class TestSysCheckout(BaseTestSysCheckout):
# Run systems tests
#
# ----------------------------------------------------------------
- def test_container_simple_required(self):
- """Verify that a container with simple subrepos
- generates the correct initial status.
-
+ def test_required_bytag(self):
+ """Check out a required external pointing to a git tag."""
+ cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO)
+ self._generator.create_config()
+ self._generator.create_section(SIMPLE_REPO, TAG_SECTION,
+ tag='tag1')
+ self._generator.write_config(cloned_repo_dir)
+
+ # externals start out 'empty' aka not checked out.
+ tree = self.execute_checkout_in_dir(cloned_repo_dir,
+ self.status_args)
+ local_path_rel = self._external_path(TAG_SECTION)
+ self._check_sync_clean(tree[local_path_rel],
+ ExternalStatus.EMPTY,
+ ExternalStatus.DEFAULT)
+ local_path_abs = os.path.join(cloned_repo_dir, local_path_rel)
+ self.assertFalse(os.path.exists(local_path_abs))
+
+ # after checkout, the external is 'clean' aka at the correct version.
+ tree = self.execute_checkout_with_status(cloned_repo_dir,
+ self.checkout_args)
+ self._check_sync_clean(tree[local_path_rel],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+
+ # Actually checked out the desired repo.
+ self.assertEqual('origin', GitRepository._remote_name_for_url(
+ # Which url to look up
+ self._generator.url_for_repo_path(SIMPLE_REPO),
+ # Which directory has the local checked-out repo.
+ dirname=local_path_abs))
+
+ # Actually checked out the desired tag.
+ (tag_found, tag_name) = GitRepository._git_current_tag(local_path_abs)
+ self.assertEqual(tag_name, 'tag1')
+
+ # Check existence of some simp_tag files
+ tag_path = os.path.join('externals', TAG_SECTION)
+ self._check_file_exists(cloned_repo_dir,
+ os.path.join(tag_path, README_NAME))
+ # Subrepo should not exist (not referenced by configs).
+ self._check_file_absent(cloned_repo_dir, os.path.join(tag_path,
+ 'simple_subdir',
+ 'subdir_file.txt'))
+
+ def test_required_bybranch(self):
+ """Check out a required external pointing to a git branch."""
+ cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO)
+ self._generator.create_config()
+ self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION,
+ branch=REMOTE_BRANCH_FEATURE2)
+ self._generator.write_config(cloned_repo_dir)
+
+ # externals start out 'empty' aka not checked out.
+ tree = self.execute_checkout_in_dir(cloned_repo_dir,
+ self.status_args)
+ local_path_rel = self._external_path(BRANCH_SECTION)
+ self._check_sync_clean(tree[local_path_rel],
+ ExternalStatus.EMPTY,
+ ExternalStatus.DEFAULT)
+ local_path_abs = os.path.join(cloned_repo_dir, local_path_rel)
+ self.assertFalse(os.path.exists(local_path_abs))
+
+ # after checkout, the external is 'clean' aka at the correct version.
+ tree = self.execute_checkout_with_status(cloned_repo_dir,
+ self.checkout_args)
+ self._check_sync_clean(tree[local_path_rel],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+ self.assertTrue(os.path.exists(local_path_abs))
+
+ # Actually checked out the desired repo.
+ self.assertEqual('origin', GitRepository._remote_name_for_url(
+ # Which url to look up
+ self._generator.url_for_repo_path(SIMPLE_REPO),
+ # Which directory has the local checked-out repo.
+ dirname=local_path_abs))
+
+ # Actually checked out the desired branch.
+ (branch_found, branch_name) = GitRepository._git_current_remote_branch(
+ local_path_abs)
+ self.assertEquals(branch_name, 'origin/' + REMOTE_BRANCH_FEATURE2)
+
+ def test_required_byhash(self):
+ """Check out a required external pointing to a git hash."""
+ cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO)
+ self._generator.create_config()
+ self._generator.create_section(SIMPLE_REPO, HASH_SECTION,
+ ref_hash='60b1cc1a38d63')
+ self._generator.write_config(cloned_repo_dir)
+
+ # externals start out 'empty' aka not checked out.
+ tree = self.execute_checkout_in_dir(cloned_repo_dir,
+ self.status_args)
+ local_path_rel = self._external_path(HASH_SECTION)
+ self._check_sync_clean(tree[local_path_rel],
+ ExternalStatus.EMPTY,
+ ExternalStatus.DEFAULT)
+ local_path_abs = os.path.join(cloned_repo_dir, local_path_rel)
+ self.assertFalse(os.path.exists(local_path_abs))
+
+ # after checkout, the externals are 'clean' aka at their correct version.
+ tree = self.execute_checkout_with_status(cloned_repo_dir,
+ self.checkout_args)
+ self._check_sync_clean(tree[local_path_rel],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+
+ # Actually checked out the desired repo.
+ self.assertEqual('origin', GitRepository._remote_name_for_url(
+ # Which url to look up
+ self._generator.url_for_repo_path(SIMPLE_REPO),
+ # Which directory has the local checked-out repo.
+ dirname=local_path_abs))
+
+ # Actually checked out the desired hash.
+ (hash_found, hash_name) = GitRepository._git_current_hash(
+ local_path_abs)
+ self.assertTrue(hash_name.startswith('60b1cc1a38d63'),
+ msg=hash_name)
+
+ def test_container_nested_required(self):
+ """Verify that a container with nested subrepos generates the correct initial status.
+ Tests over all possible permutations
"""
- # create repo
- under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME)
- self._generator.container_simple_required(under_test_dir)
-
- # status of empty repo
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
+ # Output subdirs for each of the externals, to test that one external can be
+ # checked out in a subdir of another.
+ NESTED_SUBDIR = ['./fred', './fred/wilma', './fred/wilma/barney']
+
+ # Assert that each type of external (e.g. tag vs branch) can be at any parent level
+ # (e.g. child/parent/grandparent).
+ orders = [[0, 1, 2], [1, 2, 0], [2, 0, 1],
+ [0, 2, 1], [2, 1, 0], [1, 0, 2]]
+ for n, order in enumerate(orders):
+ dest_dir = os.path.join(module_tmp_root_dir, self._test_id,
+ "test"+str(n))
+ cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO,
+ dest_dir_in=dest_dir)
+ self._generator.create_config()
+ # We happen to check out each section via a different reference (tag/branch/hash) but
+ # those don't really matter, we just need to check out three repos into a nested set of
+ # directories.
+ self._generator.create_section(
+ SIMPLE_REPO, TAG_SECTION, nested=True,
+ tag='tag1', path=NESTED_SUBDIR[order[0]])
+ self._generator.create_section(
+ SIMPLE_REPO, BRANCH_SECTION, nested=True,
+ branch=REMOTE_BRANCH_FEATURE2, path=NESTED_SUBDIR[order[1]])
+ self._generator.create_section(
+ SIMPLE_REPO, HASH_SECTION, nested=True,
+ ref_hash='60b1cc1a38d63', path=NESTED_SUBDIR[order[2]])
+ self._generator.write_config(cloned_repo_dir)
+
+ # all externals start out 'empty' aka not checked out.
+ tree = self.execute_checkout_in_dir(cloned_repo_dir,
self.status_args)
- self._check_container_simple_required_pre_checkout(overall, tree)
-
- # checkout
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
- self._check_container_simple_required_checkout(overall, tree)
-
- # status clean checked out
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_simple_required_post_checkout(overall, tree)
-
+ self._check_sync_clean(tree[NESTED_SUBDIR[order[0]]],
+ ExternalStatus.EMPTY,
+ ExternalStatus.DEFAULT)
+ self._check_sync_clean(tree[NESTED_SUBDIR[order[1]]],
+ ExternalStatus.EMPTY,
+ ExternalStatus.DEFAULT)
+ self._check_sync_clean(tree[NESTED_SUBDIR[order[2]]],
+ ExternalStatus.EMPTY,
+ ExternalStatus.DEFAULT)
+
+ # after checkout, all the repos are 'clean'.
+ tree = self.execute_checkout_with_status(cloned_repo_dir,
+ self.checkout_args)
+ self._check_sync_clean(tree[NESTED_SUBDIR[order[0]]],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+ self._check_sync_clean(tree[NESTED_SUBDIR[order[1]]],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+ self._check_sync_clean(tree[NESTED_SUBDIR[order[2]]],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+
def test_container_simple_optional(self):
- """Verify that container with an optional simple subrepos
- generates the correct initial status.
+ """Verify that container with an optional simple subrepos generates
+ the correct initial status.
"""
- # create repo
- under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME)
- self._generator.container_simple_optional(under_test_dir)
-
- # check status of empty repo
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_simple_optional_pre_checkout(overall, tree)
-
- # checkout required
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
- self._check_container_simple_optional_checkout(overall, tree)
-
- # status
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_simple_optional_post_checkout(overall, tree)
+ # create repo and externals config.
+ cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO)
+ self._generator.create_config()
+ self._generator.create_section(SIMPLE_REPO, 'simp_req',
+ tag='tag1')
- # checkout optional
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.optional_args)
- self._check_container_simple_optional_post_checkout(overall, tree)
+ self._generator.create_section(SIMPLE_REPO, 'simp_opt',
+ tag='tag1', required=False)
- # status
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_simple_optional_post_optional(overall, tree)
+ self._generator.write_config(cloned_repo_dir)
+
+ # all externals start out 'empty' aka not checked out.
+ tree = self.execute_checkout_in_dir(cloned_repo_dir,
+ self.status_args)
+ req_status = tree[self._external_path('simp_req')]
+ self._check_sync_clean(req_status,
+ ExternalStatus.EMPTY,
+ ExternalStatus.DEFAULT)
+ self.assertEqual(req_status.source_type, ExternalStatus.MANAGED)
+
+ opt_status = tree[self._external_path('simp_opt')]
+ self._check_sync_clean(opt_status,
+ ExternalStatus.EMPTY,
+ ExternalStatus.DEFAULT)
+ self.assertEqual(opt_status.source_type, ExternalStatus.OPTIONAL)
+
+ # after checkout, required external is clean, optional is still empty.
+ tree = self.execute_checkout_with_status(cloned_repo_dir,
+ self.checkout_args)
+ req_status = tree[self._external_path('simp_req')]
+ self._check_sync_clean(req_status,
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+ self.assertEqual(req_status.source_type, ExternalStatus.MANAGED)
+
+ opt_status = tree[self._external_path('simp_opt')]
+ self._check_sync_clean(opt_status,
+ ExternalStatus.EMPTY,
+ ExternalStatus.DEFAULT)
+ self.assertEqual(opt_status.source_type, ExternalStatus.OPTIONAL)
+
+ # after checking out optionals, the optional external is also clean.
+ tree = self.execute_checkout_with_status(cloned_repo_dir,
+ self.optional_args)
+ req_status = tree[self._external_path('simp_req')]
+ self._check_sync_clean(req_status,
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+ self.assertEqual(req_status.source_type, ExternalStatus.MANAGED)
+
+ opt_status = tree[self._external_path('simp_opt')]
+ self._check_sync_clean(opt_status,
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+ self.assertEqual(opt_status.source_type, ExternalStatus.OPTIONAL)
def test_container_simple_verbose(self):
- """Verify that container with simple subrepos runs with verbose status
- output and generates the correct initial status.
-
+ """Verify that verbose status matches non-verbose.
"""
- # create repo
- under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME)
- self._generator.container_simple_required(under_test_dir)
-
- # checkout
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
- self._check_container_simple_required_checkout(overall, tree)
-
- # check verbose status
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.verbose_args)
- self._check_container_simple_required_post_checkout(overall, tree)
+ cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO)
+ self._generator.create_config()
+ self._generator.create_section(SIMPLE_REPO, TAG_SECTION,
+ tag='tag1')
+ self._generator.write_config(cloned_repo_dir)
+
+ # after checkout, all externals should be 'clean'.
+ tree = self.execute_checkout_with_status(cloned_repo_dir,
+ self.checkout_args)
+ self._check_sync_clean(tree[self._external_path(TAG_SECTION)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+
+ # 'Verbose' status should tell the same story.
+ tree = self.execute_checkout_in_dir(cloned_repo_dir,
+ self.verbose_args)
+ self._check_sync_clean(tree[self._external_path(TAG_SECTION)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
def test_container_simple_dirty(self):
- """Verify that a container with simple subrepos
- and a dirty status exits gracefully.
-
+ """Verify that a container with a new tracked file is marked dirty.
"""
- under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME)
- self._generator.container_simple_required(under_test_dir)
-
- # checkout
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
- self._check_container_simple_required_checkout(overall, tree)
-
- # add a file to the repo
- tracked = True
- self._add_file_to_repo(under_test_dir, 'externals/simp_tag/tmp.txt',
- tracked)
-
- # checkout: pre-checkout status should be dirty, did not
- # modify working copy.
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
- self._check_container_simple_optional_st_dirty(overall, tree)
-
- # verify status is still dirty
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_simple_optional_st_dirty(overall, tree)
+ cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO)
+ self._generator.create_config()
+ self._generator.create_section(SIMPLE_REPO, TAG_SECTION,
+ tag='tag1')
+ self._generator.write_config(cloned_repo_dir)
+
+ # checkout, should start out clean.
+ tree = self.execute_checkout_with_status(cloned_repo_dir, self.checkout_args)
+ self._check_sync_clean(tree[self._external_path(TAG_SECTION)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+
+ # add a tracked file to the simp_tag external, should be dirty.
+ RepoUtils.add_file_to_repo(cloned_repo_dir,
+ 'externals/{0}/tmp.txt'.format(TAG_SECTION),
+ tracked=True)
+ tree = self.execute_checkout_in_dir(cloned_repo_dir, self.status_args)
+ self._check_sync_clean(tree[self._external_path(TAG_SECTION)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.DIRTY)
+
+ # Re-checkout; simp_tag should still be dirty.
+ tree = self.execute_checkout_with_status(cloned_repo_dir,
+ self.checkout_args)
+ self._check_sync_clean(tree[self._external_path(TAG_SECTION)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.DIRTY)
def test_container_simple_untracked(self):
"""Verify that a container with simple subrepos and a untracked files
is not considered 'dirty' and will attempt an update.
"""
- under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME)
- self._generator.container_simple_required(under_test_dir)
-
- # checkout
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
- self._check_container_simple_required_checkout(overall, tree)
-
- # add a file to the repo
- tracked = False
- self._add_file_to_repo(under_test_dir, 'externals/simp_tag/tmp.txt',
- tracked)
-
- # checkout: pre-checkout status should be clean, ignoring the
- # untracked file.
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
- self._check_container_simple_required_post_checkout(overall, tree)
-
- # verify status is still clean
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_simple_required_post_checkout(overall, tree)
+ cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO)
+ self._generator.create_config()
+ self._generator.create_section(SIMPLE_REPO, TAG_SECTION,
+ tag='tag1')
+ self._generator.write_config(cloned_repo_dir)
+
+ # checkout, should start out clean.
+ tree = self.execute_checkout_with_status(cloned_repo_dir,
+ self.checkout_args)
+ self._check_sync_clean(tree[self._external_path(TAG_SECTION)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+
+ # add an untracked file to the simp_tag external, should stay clean.
+ RepoUtils.add_file_to_repo(cloned_repo_dir,
+ 'externals/{0}/tmp.txt'.format(TAG_SECTION),
+ tracked=False)
+ tree = self.execute_checkout_in_dir(cloned_repo_dir, self.status_args)
+ self._check_sync_clean(tree[self._external_path(TAG_SECTION)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+
+ # After checkout, the external should still be 'clean'.
+ tree = self.execute_checkout_with_status(cloned_repo_dir,
+ self.checkout_args)
+ self._check_sync_clean(tree[self._external_path(TAG_SECTION)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
def test_container_simple_detached_sync(self):
"""Verify that a container with simple subrepos generates the correct
out of sync status when making commits from a detached head
- state.
+ state.
+ For more info about 'detached head' state: https://www.cloudbees.com/blog/git-detached-head
"""
- # create repo
- under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME)
- self._generator.container_simple_required(under_test_dir)
-
- # status of empty repo
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_simple_required_pre_checkout(overall, tree)
-
- # checkout
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
- self._check_container_simple_required_checkout(overall, tree)
-
- # make a commit on the detached head of the tag and hash externals
- self._generator.create_commit(under_test_dir, 'simp_tag')
- self._generator.create_commit(under_test_dir, 'simp_hash')
- self._generator.create_commit(under_test_dir, 'simp_branch')
-
- # status of repo, branch, tag and hash should all be out of sync!
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_simple_required_out_of_sync(overall, tree)
+ cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO)
+ self._generator.create_config()
+ self._generator.create_section(SIMPLE_REPO, TAG_SECTION,
+ tag='tag1')
+
+ self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION,
+ branch=REMOTE_BRANCH_FEATURE2)
+
+ self._generator.create_section(SIMPLE_REPO, 'simp_hash',
+ ref_hash='60b1cc1a38d63')
+
+ self._generator.write_config(cloned_repo_dir)
+
+ # externals start out 'empty' aka not checked out.
+ tree = self.execute_checkout_in_dir(cloned_repo_dir, self.status_args)
+ self._check_sync_clean(tree[self._external_path(TAG_SECTION)],
+ ExternalStatus.EMPTY,
+ ExternalStatus.DEFAULT)
+ self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)],
+ ExternalStatus.EMPTY,
+ ExternalStatus.DEFAULT)
+ self._check_sync_clean(tree[self._external_path(HASH_SECTION)],
+ ExternalStatus.EMPTY,
+ ExternalStatus.DEFAULT)
# checkout
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
- # same pre-checkout out of sync status
- self._check_container_simple_required_out_of_sync(overall, tree)
-
- # now status should be in-sync
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_simple_required_post_checkout(overall, tree)
+ self.execute_checkout_in_dir(cloned_repo_dir, self.checkout_args)
+
+ # Commit on top of the tag and hash (creating the detached head state in those two
+ # externals' repos)
+ # The branch commit does not create the detached head state, but here for completeness.
+ RepoUtils.create_commit(cloned_repo_dir, TAG_SECTION)
+ RepoUtils.create_commit(cloned_repo_dir, HASH_SECTION)
+ RepoUtils.create_commit(cloned_repo_dir, BRANCH_SECTION)
+
+ # sync status of all three should be 'modified' (uncommitted changes)
+ # clean status is 'ok' (matches externals version)
+ tree = self.execute_checkout_in_dir(cloned_repo_dir, self.status_args)
+ self._check_sync_clean(tree[self._external_path(TAG_SECTION)],
+ ExternalStatus.MODEL_MODIFIED,
+ ExternalStatus.STATUS_OK)
+ self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)],
+ ExternalStatus.MODEL_MODIFIED,
+ ExternalStatus.STATUS_OK)
+ self._check_sync_clean(tree[self._external_path(HASH_SECTION)],
+ ExternalStatus.MODEL_MODIFIED,
+ ExternalStatus.STATUS_OK)
+
+ # after checkout, all externals should be totally clean (no uncommitted changes,
+ # and matches externals version).
+ tree = self.execute_checkout_with_status(cloned_repo_dir, self.checkout_args)
+ self._check_sync_clean(tree[self._external_path(TAG_SECTION)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+ self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+ self._check_sync_clean(tree[self._external_path(HASH_SECTION)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
def test_container_remote_branch(self):
"""Verify that a container with remote branch change works
"""
- # create repo
- under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME)
- self._generator.container_simple_required(under_test_dir)
-
- # checkout
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
- self._check_container_simple_required_checkout(overall, tree)
-
- # update the config file to point to a different remote with
- # the same branch
- self._generator.update_branch(under_test_dir, 'simp_branch',
- REMOTE_BRANCH_FEATURE2, SIMPLE_FORK_NAME)
-
- # status of simp_branch should be out of sync
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_simple_required_sb_modified(overall, tree)
-
- # checkout new externals
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
- self._check_container_simple_required_sb_modified(overall, tree)
-
- # status should be synced
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_simple_required_post_checkout(overall, tree)
+ cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO)
+ self._generator.create_config()
+ self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION,
+ branch=REMOTE_BRANCH_FEATURE2)
+ self._generator.write_config(cloned_repo_dir)
+
+ # initial checkout
+ self.execute_checkout_in_dir(cloned_repo_dir, self.checkout_args)
+
+ # update the branch external to point to a different remote with the same branch,
+ # then simp_branch should be out of sync
+ self._generator.write_with_git_branch(cloned_repo_dir,
+ name=BRANCH_SECTION,
+ branch=REMOTE_BRANCH_FEATURE2,
+ new_remote_repo_path=SIMPLE_FORK_REPO)
+ tree = self.execute_checkout_in_dir(cloned_repo_dir, self.status_args)
+ self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)],
+ ExternalStatus.MODEL_MODIFIED,
+ ExternalStatus.STATUS_OK)
+
+ # checkout new externals, now simp_branch should be clean.
+ tree = self.execute_checkout_with_status(cloned_repo_dir, self.checkout_args)
+ self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
def test_container_remote_tag_same_branch(self):
"""Verify that a container with remote tag change works. The new tag
@@ -1151,258 +1066,324 @@ def test_container_remote_tag_same_branch(self):
the branch.
"""
- # create repo
- under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME)
- self._generator.container_simple_required(under_test_dir)
+ cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO)
+ self._generator.create_config()
+ self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION,
+ branch=REMOTE_BRANCH_FEATURE2)
+ self._generator.write_config(cloned_repo_dir)
- # checkout
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
- self._check_container_simple_required_checkout(overall, tree)
+ # initial checkout
+ self.execute_checkout_in_dir(cloned_repo_dir, self.checkout_args)
# update the config file to point to a different remote with
- # the tag instead of branch. Tag MUST NOT be in the original
- # repo!
- self._generator.update_tag(under_test_dir, 'simp_branch',
- 'forked-feature-v1', SIMPLE_FORK_NAME)
-
- # status of simp_branch should be out of sync
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_simple_required_sb_modified(overall, tree)
-
- # checkout new externals
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
- self._check_container_simple_required_sb_modified(overall, tree)
-
- # status should be synced
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_simple_required_post_checkout(overall, tree)
+ # the new tag replacing the old branch. Tag MUST NOT be in the original
+ # repo! status of simp_branch should then be out of sync
+ self._generator.write_with_tag_and_remote_repo(cloned_repo_dir, BRANCH_SECTION,
+ tag='forked-feature-v1',
+ new_remote_repo_path=SIMPLE_FORK_REPO)
+ tree = self.execute_checkout_in_dir(cloned_repo_dir,
+ self.status_args)
+ self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)],
+ ExternalStatus.MODEL_MODIFIED,
+ ExternalStatus.STATUS_OK)
+
+ # checkout new externals, then should be synced.
+ tree = self.execute_checkout_with_status(cloned_repo_dir,
+ self.checkout_args)
+ self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
def test_container_remote_tag_fetch_all(self):
"""Verify that a container with remote tag change works. The new tag
should not be in the original repo, only the new remote
- fork. It should also not be on a branch that will be fetch,
+ fork. It should also not be on a branch that will be fetched,
and therefore not fetched by default with 'git fetch'. It will
- only be retreived by 'git fetch --tags'
-
+ only be retrieved by 'git fetch --tags'
"""
- # create repo
- under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME)
- self._generator.container_simple_required(under_test_dir)
+ cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO)
+ self._generator.create_config()
+ self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION,
+ branch=REMOTE_BRANCH_FEATURE2)
+ self._generator.write_config(cloned_repo_dir)
- # checkout
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
- self._check_container_simple_required_checkout(overall, tree)
+ # initial checkout
+ self.execute_checkout_in_dir(cloned_repo_dir, self.checkout_args)
# update the config file to point to a different remote with
- # the tag instead of branch. Tag MUST NOT be in the original
- # repo!
- self._generator.update_tag(under_test_dir, 'simp_branch',
- 'abandoned-feature', SIMPLE_FORK_NAME)
-
- # status of simp_branch should be out of sync
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_simple_required_sb_modified(overall, tree)
-
- # checkout new externals
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
- self._check_container_simple_required_sb_modified(overall, tree)
-
- # status should be synced
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_simple_required_post_checkout(overall, tree)
+ # the new tag instead of the old branch. Tag MUST NOT be in the original
+ # repo! status of simp_branch should then be out of sync.
+ self._generator.write_with_tag_and_remote_repo(cloned_repo_dir, BRANCH_SECTION,
+ tag='abandoned-feature',
+ new_remote_repo_path=SIMPLE_FORK_REPO)
+ tree = self.execute_checkout_in_dir(cloned_repo_dir, self.status_args)
+ self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)],
+ ExternalStatus.MODEL_MODIFIED,
+ ExternalStatus.STATUS_OK)
+
+ # checkout new externals, should be clean again.
+ tree = self.execute_checkout_with_status(cloned_repo_dir,
+ self.checkout_args)
+ self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
def test_container_preserve_dot(self):
"""Verify that after inital checkout, modifying an external git repo
url to '.' and the current branch will leave it unchanged.
"""
- # create repo
- under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME)
- self._generator.container_simple_required(under_test_dir)
+ cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO)
+ self._generator.create_config()
+ self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION,
+ branch=REMOTE_BRANCH_FEATURE2)
+ self._generator.write_config(cloned_repo_dir)
- # checkout
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
- self._check_container_simple_required_checkout(overall, tree)
+ # initial checkout
+ self.execute_checkout_in_dir(cloned_repo_dir, self.checkout_args)
# update the config file to point to a different remote with
- # the same branch
- self._generator.update_branch(under_test_dir, 'simp_branch',
- REMOTE_BRANCH_FEATURE2, SIMPLE_FORK_NAME)
- # checkout
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
-
- # verify status is clean and unmodified
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_simple_required_post_checkout(overall, tree)
+ # the same branch.
+ self._generator.write_with_git_branch(cloned_repo_dir, name=BRANCH_SECTION,
+ branch=REMOTE_BRANCH_FEATURE2,
+ new_remote_repo_path=SIMPLE_FORK_REPO)
+ # after checkout, should be clean again.
+ tree = self.execute_checkout_with_status(cloned_repo_dir, self.checkout_args)
+ self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
# update branch to point to a new branch that only exists in
# the local fork
- self._generator.create_branch(under_test_dir, 'simp_branch',
- 'private-feature', with_commit=True)
- self._generator.update_branch(under_test_dir, 'simp_branch',
- 'private-feature',
- SIMPLE_LOCAL_ONLY_NAME)
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
-
- # verify status is clean and unmodified
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_simple_required_post_checkout(overall, tree)
-
- def test_container_full(self):
- """Verify that 'full' container with simple and mixed subrepos
- generates the correct initial status.
+ RepoUtils.create_branch(cloned_repo_dir, external_name=BRANCH_SECTION,
+ branch='private-feature', with_commit=True)
+ self._generator.write_with_git_branch(cloned_repo_dir, name=BRANCH_SECTION,
+ branch='private-feature',
+ new_remote_repo_path=SIMPLE_LOCAL_ONLY_NAME)
+ # after checkout, should be clean again.
+ tree = self.execute_checkout_with_status(cloned_repo_dir, self.checkout_args)
+ self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+
+ def test_container_mixed_subrepo(self):
+ """Verify container with mixed subrepo.
The mixed subrepo has a sub-externals file with different
sub-externals on different branches.
"""
- # create the test repository
- under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME)
-
- # create the top level externals file
- self._generator.container_full(under_test_dir)
-
- # inital checkout
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
- self._check_container_full_pre_checkout(overall, tree)
-
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_full_post_checkout(overall, tree)
-
- # Check existance of some files
- subrepo_path = os.path.join('externals', 'simp_tag')
- self._check_file_exists(under_test_dir,
- os.path.join(subrepo_path, 'readme.txt'))
- self._check_file_absent(under_test_dir, os.path.join(subrepo_path,
- 'simple_subdir',
- 'subdir_file.txt'))
-
- # update the mixed-use repo to point to different branch
- self._generator.update_branch(under_test_dir, 'mixed_req',
- 'new-feature', MIXED_REPO_NAME)
+ cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO)
- # check status out of sync for mixed_req, but sub-externals
+ self._generator.create_config()
+ self._generator.create_section(MIXED_REPO, 'mixed_req',
+ branch='master', sub_externals=CFG_SUB_NAME)
+ self._generator.write_config(cloned_repo_dir)
+
+ # The subrepo has a repo_url that uses this environment variable.
+ # It'll be cleared in tearDown().
+ os.environ[MIXED_CONT_EXT_ROOT_ENV_VAR] = self._bare_root
+ debug_env = MIXED_CONT_EXT_ROOT_ENV_VAR + '=' + self._bare_root
+
+ # inital checkout: all requireds are clean, and optional is empty.
+ tree = self.execute_checkout_with_status(cloned_repo_dir,
+ self.checkout_args,
+ debug_env=debug_env)
+ mixed_req_path = self._external_path('mixed_req')
+ self._check_sync_clean(tree[mixed_req_path],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+ sub_ext_base_path = "{0}/{1}/{2}".format(EXTERNALS_PATH, 'mixed_req', SUB_EXTERNALS_PATH)
+ # The already-checked-in subexternals file has a 'simp_branch' section
+ self._check_sync_clean(tree[self._external_path('simp_branch', base_path=sub_ext_base_path)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+
+ # update the mixed-use external to point to different branch
+ # status should become out of sync for mixed_req, but sub-externals
# are still in sync
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_full_pre_checkout_ext_change(overall, tree)
-
- # run the checkout. Now the mixed use external and it's
- # sub-exterals should be changed. Returned status is
- # pre-checkout!
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
- self._check_container_full_pre_checkout_ext_change(overall, tree)
-
- # check status out of sync for mixed_req, and sub-externals
- # are in sync.
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_full_post_checkout(overall, tree)
-
+ self._generator.write_with_git_branch(cloned_repo_dir, name='mixed_req',
+ branch='new-feature',
+ new_remote_repo_path=MIXED_REPO)
+ tree = self.execute_checkout_in_dir(cloned_repo_dir, self.status_args,
+ debug_env=debug_env)
+ self._check_sync_clean(tree[mixed_req_path],
+ ExternalStatus.MODEL_MODIFIED,
+ ExternalStatus.STATUS_OK)
+ self._check_sync_clean(tree[self._external_path('simp_branch', base_path=sub_ext_base_path)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+
+ # run the checkout. Now the mixed use external and its sub-externals should be clean.
+ tree = self.execute_checkout_with_status(cloned_repo_dir, self.checkout_args,
+ debug_env=debug_env)
+ self._check_sync_clean(tree[mixed_req_path],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+ self._check_sync_clean(tree[self._external_path('simp_branch', base_path=sub_ext_base_path)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+
def test_container_component(self):
"""Verify that optional component checkout works
"""
- # create the test repository
- under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME)
+ cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO)
# create the top level externals file
- self._generator.container_full(under_test_dir)
-
- # inital checkout, first try a nonexistant component argument noref
+ self._generator.create_config()
+ # Optional external, by tag.
+ self._generator.create_section(SIMPLE_REPO, 'simp_opt',
+ tag='tag1', required=False)
+
+ # Required external, by branch.
+ self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION,
+ branch=REMOTE_BRANCH_FEATURE2)
+
+ # Required external, by hash.
+ self._generator.create_section(SIMPLE_REPO, HASH_SECTION,
+ ref_hash='60b1cc1a38d63')
+ self._generator.write_config(cloned_repo_dir)
+
+ # inital checkout, first try a nonexistent component argument noref
checkout_args = ['simp_opt', 'noref']
checkout_args.extend(self.checkout_args)
with self.assertRaises(RuntimeError):
- self.execute_cmd_in_dir(under_test_dir, checkout_args)
+ self.execute_checkout_in_dir(cloned_repo_dir, checkout_args)
+ # Now explicitly check out one optional component..
+ # Explicitly listed component (opt) should be present, the other two not.
checkout_args = ['simp_opt']
checkout_args.extend(self.checkout_args)
-
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- checkout_args)
-
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_component_post_checkout(overall, tree)
- checkout_args.append('simp_branch')
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- checkout_args)
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_component_post_checkout2(overall, tree)
-
- def test_mixed_simple(self):
- """Verify that a mixed use repo can serve as a 'full' container,
- pulling in a set of externals and a seperate set of sub-externals.
-
+ tree = self.execute_checkout_with_status(cloned_repo_dir,
+ checkout_args)
+ self._check_sync_clean(tree[self._external_path('simp_opt')],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+ self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)],
+ ExternalStatus.EMPTY,
+ ExternalStatus.DEFAULT)
+ self._check_sync_clean(tree[self._external_path(HASH_SECTION)],
+ ExternalStatus.EMPTY,
+ ExternalStatus.DEFAULT)
+
+ # Check out a second component, this one required.
+ # Explicitly listed component (branch) should be present, the still-unlisted one (tag) not.
+ checkout_args.append(BRANCH_SECTION)
+ tree = self.execute_checkout_with_status(cloned_repo_dir,
+ checkout_args)
+ self._check_sync_clean(tree[self._external_path('simp_opt')],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+ self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+ self._check_sync_clean(tree[self._external_path(HASH_SECTION)],
+ ExternalStatus.EMPTY,
+ ExternalStatus.DEFAULT)
+
+
+ def test_container_exclude_component(self):
+ """Verify that exclude component checkout works
"""
- #import pdb; pdb.set_trace()
- # create repository
- under_test_dir = self.setup_test_repo(MIXED_REPO_NAME)
- # create top level externals file
- self._generator.mixed_simple_base(under_test_dir)
- # NOTE: sub-externals file is already in the repo so we can
- # switch branches during testing. Since this is a mixed-repo
- # serving as the top level container repo, we can't switch
- # during this test.
+ cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO)
+ self._generator.create_config()
+ self._generator.create_section(SIMPLE_REPO, TAG_SECTION,
+ tag='tag1')
+
+ self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION,
+ branch=REMOTE_BRANCH_FEATURE2)
+
+ self._generator.create_section(SIMPLE_REPO, 'simp_hash',
+ ref_hash='60b1cc1a38d63')
+
+ self._generator.write_config(cloned_repo_dir)
+
+ # inital checkout should result in all externals being clean except excluded TAG_SECTION.
+ checkout_args = ['--exclude', TAG_SECTION]
+ checkout_args.extend(self.checkout_args)
+ tree = self.execute_checkout_with_status(cloned_repo_dir, checkout_args)
+ self._check_sync_clean(tree[self._external_path(TAG_SECTION)],
+ ExternalStatus.EMPTY,
+ ExternalStatus.DEFAULT)
+ self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+ self._check_sync_clean(tree[self._external_path(HASH_SECTION)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+
+ def test_subexternal(self):
+ """Verify that an externals file can be brought in as a reference.
- # checkout
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
- self._check_mixed_cont_simple_required_checkout(overall, tree)
+ """
+ cloned_repo_dir = self.clone_test_repo(MIXED_REPO)
- # verify status is clean and unmodified
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_mixed_cont_simple_required_post_checkout(overall, tree)
+ self._generator.create_config()
+ self._generator.create_section_reference_to_subexternal('mixed_base')
+ self._generator.write_config(cloned_repo_dir)
+
+ # The subrepo has a repo_url that uses this environment variable.
+ # It'll be cleared in tearDown().
+ os.environ[MIXED_CONT_EXT_ROOT_ENV_VAR] = self._bare_root
+ debug_env = MIXED_CONT_EXT_ROOT_ENV_VAR + '=' + self._bare_root
+
+ # After checkout, confirm required's are clean and the referenced
+ # subexternal's contents are also clean.
+ tree = self.execute_checkout_with_status(cloned_repo_dir,
+ self.checkout_args,
+ debug_env=debug_env)
+
+ self._check_sync_clean(
+ tree[self._external_path(BRANCH_SECTION, base_path=SUB_EXTERNALS_PATH)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
def test_container_sparse(self):
"""Verify that 'full' container with simple subrepo
can run a sparse checkout and generate the correct initial status.
"""
- # create the test repository
- under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME)
+ cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO)
- # create the top level externals file
- self._generator.container_sparse(under_test_dir)
-
- # inital checkout
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
- self._check_container_sparse_pre_checkout(overall, tree)
-
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_sparse_post_checkout(overall, tree)
+ # Create a file to list filenames to checkout.
+ sparse_filename = 'sparse_checkout'
+ with open(os.path.join(cloned_repo_dir, sparse_filename), 'w') as sfile:
+ sfile.write(README_NAME)
- # Check existance of some files
- subrepo_path = os.path.join('externals', 'simp_tag')
- self._check_file_exists(under_test_dir,
- os.path.join(subrepo_path, 'readme.txt'))
- self._check_file_exists(under_test_dir, os.path.join(subrepo_path,
+ self._generator.create_config()
+ self._generator.create_section(SIMPLE_REPO, TAG_SECTION,
+ tag='tag2')
+
+ # Same tag as above, but with a sparse file too.
+ sparse_relpath = '../../' + sparse_filename
+ self._generator.create_section(SIMPLE_REPO, 'simp_sparse',
+ tag='tag2', sparse=sparse_relpath)
+
+ self._generator.write_config(cloned_repo_dir)
+
+ # inital checkout, confirm required's are clean.
+ tree = self.execute_checkout_with_status(cloned_repo_dir,
+ self.checkout_args)
+ self._check_sync_clean(tree[self._external_path(TAG_SECTION)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+ self._check_sync_clean(tree[self._external_path('simp_sparse')],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+
+ # Check existence of some files - full set in TAG_SECTION, and sparse set
+ # in 'simp_sparse'.
+ subrepo_path = os.path.join('externals', TAG_SECTION)
+ self._check_file_exists(cloned_repo_dir,
+ os.path.join(subrepo_path, README_NAME))
+ self._check_file_exists(cloned_repo_dir, os.path.join(subrepo_path,
'simple_subdir',
'subdir_file.txt'))
subrepo_path = os.path.join('externals', 'simp_sparse')
- self._check_file_exists(under_test_dir,
- os.path.join(subrepo_path, 'readme.txt'))
- self._check_file_absent(under_test_dir, os.path.join(subrepo_path,
+ self._check_file_exists(cloned_repo_dir,
+ os.path.join(subrepo_path, README_NAME))
+ self._check_file_absent(cloned_repo_dir, os.path.join(subrepo_path,
'simple_subdir',
'subdir_file.txt'))
@@ -1438,42 +1419,27 @@ class TestSysCheckoutSVN(BaseTestSysCheckout):
"""
- def _check_svn_branch_ok(self, tree, directory=EXTERNALS_NAME):
- name = './{0}/svn_branch'.format(directory)
- self._check_generic_ok_clean_required(tree, name)
-
- def _check_svn_branch_dirty(self, tree, directory=EXTERNALS_NAME):
- name = './{0}/svn_branch'.format(directory)
- self._check_generic_ok_dirty_required(tree, name)
-
- def _check_svn_tag_ok(self, tree, directory=EXTERNALS_NAME):
- name = './{0}/svn_tag'.format(directory)
- self._check_generic_ok_clean_required(tree, name)
-
- def _check_svn_tag_modified(self, tree, directory=EXTERNALS_NAME):
- name = './{0}/svn_tag'.format(directory)
- self._check_generic_modified_ok_required(tree, name)
-
- def _check_container_simple_svn_post_checkout(self, overall, tree):
- self.assertEqual(overall, 0)
- self._check_simple_tag_ok(tree)
- self._check_svn_branch_ok(tree)
- self._check_svn_tag_ok(tree)
-
- def _check_container_simple_svn_sb_dirty_st_mod(self, overall, tree):
- self.assertEqual(overall, 0)
- self._check_simple_tag_ok(tree)
- self._check_svn_tag_modified(tree)
- self._check_svn_branch_dirty(tree)
+ @staticmethod
+ def _svn_branch_name():
+ return './{0}/svn_branch'.format(EXTERNALS_PATH)
- def _check_container_simple_svn_sb_clean_st_mod(self, overall, tree):
- self.assertEqual(overall, 0)
- self._check_simple_tag_ok(tree)
- self._check_svn_tag_modified(tree)
- self._check_svn_branch_ok(tree)
+ @staticmethod
+ def _svn_tag_name():
+ return './{0}/svn_tag'.format(EXTERNALS_PATH)
+
+ def _check_tag_branch_svn_tag_clean(self, tree):
+ self._check_sync_clean(tree[self._external_path(TAG_SECTION)],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+ self._check_sync_clean(tree[self._svn_branch_name()],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
+ self._check_sync_clean(tree[self._svn_tag_name()],
+ ExternalStatus.STATUS_OK,
+ ExternalStatus.STATUS_OK)
@staticmethod
- def have_svn_access():
+ def _have_svn_access():
"""Check if we have svn access so we can enable tests that use svn.
"""
@@ -1486,10 +1452,10 @@ def have_svn_access():
pass
return have_svn
- def skip_if_no_svn_access(self):
+ def _skip_if_no_svn_access(self):
"""Function decorator to disable svn tests when svn isn't available
"""
- have_svn = self.have_svn_access()
+ have_svn = self._have_svn_access()
if not have_svn:
raise unittest.SkipTest("No svn access")
@@ -1497,60 +1463,55 @@ def test_container_simple_svn(self):
"""Verify that a container repo can pull in an svn branch and svn tag.
"""
- self.skip_if_no_svn_access()
+ self._skip_if_no_svn_access()
# create repo
- under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME)
- self._generator.container_simple_svn(under_test_dir)
+ cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO)
- # checkout
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
+ self._generator.create_config()
+ # Git repo.
+ self._generator.create_section(SIMPLE_REPO, TAG_SECTION, tag='tag1')
- # verify status is clean and unmodified
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_simple_svn_post_checkout(overall, tree)
+ # Svn repos.
+ self._generator.create_svn_external('svn_branch', branch='trunk')
+ self._generator.create_svn_external('svn_tag', tag='tags/cesm2.0.beta07')
+
+ self._generator.write_config(cloned_repo_dir)
+
+ # checkout, make sure all sections are clean.
+ tree = self.execute_checkout_with_status(cloned_repo_dir,
+ self.checkout_args)
+ self._check_tag_branch_svn_tag_clean(tree)
# update description file to make the tag into a branch and
# trigger a switch
- self._generator.update_svn_branch(under_test_dir, 'svn_tag', 'trunk')
+ self._generator.write_with_svn_branch(cloned_repo_dir, 'svn_tag',
+ 'trunk')
- # checkout
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
-
- # verify status is clean and unmodified
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.status_args)
- self._check_container_simple_svn_post_checkout(overall, tree)
+ # checkout, again the results should be clean.
+ tree = self.execute_checkout_with_status(cloned_repo_dir,
+ self.checkout_args)
+ self._check_tag_branch_svn_tag_clean(tree)
# add an untracked file to the repo
tracked = False
- self._add_file_to_repo(under_test_dir,
- 'externals/svn_branch/tmp.txt', tracked)
+ RepoUtils.add_file_to_repo(cloned_repo_dir,
+ 'externals/svn_branch/tmp.txt', tracked)
- # run a no-op checkout: pre-checkout status should be clean,
- # ignoring the untracked file.
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
- self._check_container_simple_svn_post_checkout(overall, tree)
+ # run a no-op checkout.
+ self.execute_checkout_in_dir(cloned_repo_dir, self.checkout_args)
# update description file to make the branch into a tag and
# trigger a modified sync status
- self._generator.update_svn_branch(under_test_dir, 'svn_tag',
- 'tags/cesm2.0.beta07')
+ self._generator.write_with_svn_branch(cloned_repo_dir, 'svn_tag',
+ 'tags/cesm2.0.beta07')
- # checkout: pre-checkout status should be clean and modified,
- # will modify working copy.
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.checkout_args)
- self._check_container_simple_svn_sb_clean_st_mod(overall, tree)
+ self.execute_checkout_in_dir(cloned_repo_dir,self.checkout_args)
# verify status is still clean and unmodified, last
# checkout modified the working dir state.
- overall, tree = self.execute_cmd_in_dir(under_test_dir,
- self.verbose_args)
- self._check_container_simple_svn_post_checkout(overall, tree)
+ tree = self.execute_checkout_in_dir(cloned_repo_dir,
+ self.verbose_args)
+ self._check_tag_branch_svn_tag_clean(tree)
class TestSubrepoCheckout(BaseTestSysCheckout):
# Need to store information at setUp time for checking
@@ -1569,7 +1530,7 @@ def setUp(self):
"""
# Run the basic setup
- super(TestSubrepoCheckout, self).setUp()
+ super().setUp()
# create test repo
# We need to do this here (rather than have a static repo) because
# git submodules do not allow for variables in .gitmodules files
@@ -1577,19 +1538,19 @@ def setUp(self):
self._bare_branch_name = 'subrepo_branch'
self._config_branch_name = 'subrepo_config_branch'
self._container_extern_name = 'externals_container.cfg'
- self._my_test_dir = os.path.join(os.environ[MANIC_TEST_TMP_REPO_ROOT],
- self._test_id)
+ self._my_test_dir = os.path.join(module_tmp_root_dir, self._test_id)
self._repo_dir = os.path.join(self._my_test_dir, self._test_repo_name)
self._checkout_dir = 'repo_with_submodules'
- check_dir = self.setup_test_repo(CONTAINER_REPO_NAME,
+ check_dir = self.clone_test_repo(CONTAINER_REPO,
dest_dir_in=self._repo_dir)
self.assertTrue(self._repo_dir == check_dir)
# Add the submodules
cwd = os.getcwd()
- fork_repo_dir = os.path.join(self._bare_root, SIMPLE_FORK_NAME)
- simple_repo_dir = os.path.join(self._bare_root, SIMPLE_REPO_NAME)
- self._simple_ext_fork_name = SIMPLE_FORK_NAME.split('.')[0]
- self._simple_ext_name = SIMPLE_REPO_NAME.split('.')[0]
+ fork_repo_dir = os.path.join(self._bare_root, SIMPLE_FORK_REPO)
+ simple_repo_dir = os.path.join(self._bare_root, SIMPLE_REPO)
+ self._simple_ext_fork_name = os.path.splitext(SIMPLE_FORK_REPO)[0]
+ self._simple_ext_name = os.path.join('sourc',
+ os.path.splitext(SIMPLE_REPO)[0])
os.chdir(self._repo_dir)
# Add a branch with a subrepo
cmd = ['git', 'branch', self._bare_branch_name, 'master']
@@ -1610,7 +1571,8 @@ def setUp(self):
execute_subprocess(cmd)
cmd = ['git', 'checkout', self._config_branch_name]
execute_subprocess(cmd)
- cmd = ['git', 'submodule', 'add', simple_repo_dir]
+ cmd = ['git', 'submodule', 'add', '--name', SIMPLE_REPO,
+ simple_repo_dir, self._simple_ext_name]
execute_subprocess(cmd)
# Checkout feature2
os.chdir(self._simple_ext_name)
@@ -1621,8 +1583,8 @@ def setUp(self):
# Save the fork repo hash for comparison
self._simple_hash_check = self.get_git_hash()
os.chdir(self._repo_dir)
- self.create_externals_file(filename=self._container_extern_name,
- dest_dir=self._repo_dir, from_submodule=True)
+ self.write_externals_config(filename=self._container_extern_name,
+ dest_dir=self._repo_dir, from_submodule=True)
cmd = ['git', 'add', self._container_extern_name]
execute_subprocess(cmd)
cmd = ['git', 'commit', '-am', "'Added simple-ext as a submodule'"]
@@ -1639,9 +1601,10 @@ def get_git_hash(revision="HEAD"):
git_out = execute_subprocess(cmd, output_to_caller=True)
return git_out.strip()
- def create_externals_file(self, name='', filename=CFG_NAME, dest_dir=None,
- branch_name=None, sub_externals=None,
- from_submodule=False):
+ def write_externals_config(self, name='', dest_dir=None,
+ filename=CFG_NAME,
+ branch_name=None, sub_externals=None,
+ from_submodule=False):
# pylint: disable=too-many-arguments
"""Create a container externals file with only simple externals.
@@ -1652,10 +1615,10 @@ def create_externals_file(self, name='', filename=CFG_NAME, dest_dir=None,
dest_dir = self._my_test_dir
if from_submodule:
- self._generator.create_section(SIMPLE_FORK_NAME,
+ self._generator.create_section(SIMPLE_FORK_REPO,
self._simple_ext_fork_name,
from_submodule=True)
- self._generator.create_section(SIMPLE_REPO_NAME,
+ self._generator.create_section(SIMPLE_REPO,
self._simple_ext_name,
branch='feature3', path='',
from_submodule=False)
@@ -1666,8 +1629,8 @@ def create_externals_file(self, name='', filename=CFG_NAME, dest_dir=None,
self._generator.create_section(self._test_repo_name,
self._checkout_dir,
branch=branch_name,
- path=name, externals=sub_externals,
- repo_path=self._repo_dir)
+ path=name, sub_externals=sub_externals,
+ repo_path_abs=self._repo_dir)
self._generator.write_config(dest_dir, filename=filename)
@@ -1676,12 +1639,10 @@ def idempotence_check(self, checkout_dir):
checkout_externals --status does not cause errors"""
cwd = os.getcwd()
os.chdir(checkout_dir)
- overall, _ = self.execute_cmd_in_dir(self._my_test_dir,
- self.checkout_args)
- self.assertTrue(overall == 0)
- overall, _ = self.execute_cmd_in_dir(self._my_test_dir,
- self.status_args)
- self.assertTrue(overall == 0)
+ self.execute_checkout_in_dir(self._my_test_dir,
+ self.checkout_args)
+ self.execute_checkout_in_dir(self._my_test_dir,
+ self.status_args)
os.chdir(cwd)
def test_submodule_checkout_bare(self):
@@ -1693,17 +1654,17 @@ def test_submodule_checkout_bare(self):
"""
simple_ext_fork_tag = "(tag1)"
simple_ext_fork_status = " "
- self.create_externals_file(branch_name=self._bare_branch_name)
- overall, _ = self.execute_cmd_in_dir(self._my_test_dir,
- self.checkout_args)
- self.assertTrue(overall == 0)
+ self.write_externals_config(branch_name=self._bare_branch_name)
+ self.execute_checkout_in_dir(self._my_test_dir,
+ self.checkout_args)
cwd = os.getcwd()
checkout_dir = os.path.join(self._my_test_dir, self._checkout_dir)
fork_file = os.path.join(checkout_dir,
self._simple_ext_fork_name, "readme.txt")
self.assertTrue(os.path.exists(fork_file))
- os.chdir(checkout_dir)
+
submods = git_submodule_status(checkout_dir)
+ print('checking status of', checkout_dir, ':', submods)
self.assertEqual(len(submods.keys()), 1)
self.assertTrue(self._simple_ext_fork_name in submods)
submod = submods[self._simple_ext_fork_name]
@@ -1713,7 +1674,6 @@ def test_submodule_checkout_bare(self):
self.assertEqual(submod['status'], simple_ext_fork_status)
self.assertTrue('tag' in submod)
self.assertEqual(submod['tag'], simple_ext_fork_tag)
- os.chdir(cwd)
self.idempotence_check(checkout_dir)
def test_submodule_checkout_none(self):
@@ -1722,11 +1682,10 @@ def test_submodule_checkout_none(self):
externals cfg file.
Correct behavior is the submodle is not checked out.
"""
- self.create_externals_file(branch_name=self._bare_branch_name,
- sub_externals="none")
- overall, _ = self.execute_cmd_in_dir(self._my_test_dir,
- self.checkout_args)
- self.assertTrue(overall == 0)
+ self.write_externals_config(branch_name=self._bare_branch_name,
+ sub_externals="none")
+ self.execute_checkout_in_dir(self._my_test_dir,
+ self.checkout_args)
cwd = os.getcwd()
checkout_dir = os.path.join(self._my_test_dir, self._checkout_dir)
fork_file = os.path.join(checkout_dir,
@@ -1744,11 +1703,10 @@ def test_submodule_checkout_config(self): # pylint: disable=too-many-locals
"""
tag_check = None # Not checked out as submodule
status_check = "-" # Not checked out as submodule
- self.create_externals_file(branch_name=self._config_branch_name,
- sub_externals=self._container_extern_name)
- overall, _ = self.execute_cmd_in_dir(self._my_test_dir,
- self.checkout_args)
- self.assertTrue(overall == 0)
+ self.write_externals_config(branch_name=self._config_branch_name,
+ sub_externals=self._container_extern_name)
+ self.execute_checkout_in_dir(self._my_test_dir,
+ self.checkout_args)
cwd = os.getcwd()
checkout_dir = os.path.join(self._my_test_dir, self._checkout_dir)
fork_file = os.path.join(checkout_dir,
@@ -1810,17 +1768,20 @@ def test_error_unknown_protocol(self):
"""
# create repo
- under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME)
- self._generator.container_simple_required(under_test_dir)
+ cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO)
+ self._generator.create_config()
+ self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION,
+ branch=REMOTE_BRANCH_FEATURE2)
+ self._generator.write_config(cloned_repo_dir)
# update the config file to point to a different remote with
# the tag instead of branch. Tag MUST NOT be in the original
# repo!
- self._generator.update_protocol(under_test_dir, 'simp_branch',
- 'this-protocol-does-not-exist')
+ self._generator.write_with_protocol(cloned_repo_dir, BRANCH_SECTION,
+ 'this-protocol-does-not-exist')
with self.assertRaises(RuntimeError):
- self.execute_cmd_in_dir(under_test_dir, self.checkout_args)
+ self.execute_checkout_in_dir(cloned_repo_dir, self.checkout_args)
def test_error_switch_protocol(self):
"""Verify that a runtime error is raised when the user switches
@@ -1831,15 +1792,18 @@ def test_error_switch_protocol(self):
"""
# create repo
- under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME)
- self._generator.container_simple_required(under_test_dir)
+ cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO)
+ self._generator.create_config()
+ self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION,
+ branch=REMOTE_BRANCH_FEATURE2)
+ self._generator.write_config(cloned_repo_dir)
# update the config file to point to a different remote with
# the tag instead of branch. Tag MUST NOT be in the original
# repo!
- self._generator.update_protocol(under_test_dir, 'simp_branch', 'svn')
+ self._generator.write_with_protocol(cloned_repo_dir, BRANCH_SECTION, 'svn')
with self.assertRaises(RuntimeError):
- self.execute_cmd_in_dir(under_test_dir, self.checkout_args)
+ self.execute_checkout_in_dir(cloned_repo_dir, self.checkout_args)
def test_error_unknown_tag(self):
"""Verify that a runtime error is raised when the user specified tag
@@ -1847,17 +1811,21 @@ def test_error_unknown_tag(self):
"""
# create repo
- under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME)
- self._generator.container_simple_required(under_test_dir)
+ cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO)
+ self._generator.create_config()
+ self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION,
+ branch=REMOTE_BRANCH_FEATURE2)
+ self._generator.write_config(cloned_repo_dir)
# update the config file to point to a different remote with
# the tag instead of branch. Tag MUST NOT be in the original
# repo!
- self._generator.update_tag(under_test_dir, 'simp_branch',
- 'this-tag-does-not-exist', SIMPLE_REPO_NAME)
+ self._generator.write_with_tag_and_remote_repo(cloned_repo_dir, BRANCH_SECTION,
+ tag='this-tag-does-not-exist',
+ new_remote_repo_path=SIMPLE_REPO)
with self.assertRaises(RuntimeError):
- self.execute_cmd_in_dir(under_test_dir, self.checkout_args)
+ self.execute_checkout_in_dir(cloned_repo_dir, self.checkout_args)
def test_error_overspecify_tag_branch(self):
"""Verify that a runtime error is raised when the user specified both
@@ -1865,18 +1833,22 @@ def test_error_overspecify_tag_branch(self):
"""
# create repo
- under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME)
- self._generator.container_simple_required(under_test_dir)
+ cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO)
+ self._generator.create_config()
+ self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION,
+ branch=REMOTE_BRANCH_FEATURE2)
+ self._generator.write_config(cloned_repo_dir)
# update the config file to point to a different remote with
# the tag instead of branch. Tag MUST NOT be in the original
# repo!
- self._generator.update_tag(under_test_dir, 'simp_branch',
- 'this-tag-does-not-exist', SIMPLE_REPO_NAME,
- remove_branch=False)
+ self._generator.write_with_tag_and_remote_repo(cloned_repo_dir, BRANCH_SECTION,
+ tag='this-tag-does-not-exist',
+ new_remote_repo_path=SIMPLE_REPO,
+ remove_branch=False)
with self.assertRaises(RuntimeError):
- self.execute_cmd_in_dir(under_test_dir, self.checkout_args)
+ self.execute_checkout_in_dir(cloned_repo_dir, self.checkout_args)
def test_error_underspecify_tag_branch(self):
"""Verify that a runtime error is raised when the user specified
@@ -1884,17 +1856,19 @@ def test_error_underspecify_tag_branch(self):
"""
# create repo
- under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME)
- self._generator.container_simple_required(under_test_dir)
+ cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO)
+ self._generator.create_config()
+ self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION,
+ branch=REMOTE_BRANCH_FEATURE2)
+ self._generator.write_config(cloned_repo_dir)
# update the config file to point to a different remote with
# the tag instead of branch. Tag MUST NOT be in the original
# repo!
- self._generator.update_underspecify_branch_tag(under_test_dir,
- 'simp_branch')
+ self._generator.write_without_branch_tag(cloned_repo_dir, BRANCH_SECTION)
with self.assertRaises(RuntimeError):
- self.execute_cmd_in_dir(under_test_dir, self.checkout_args)
+ self.execute_checkout_in_dir(cloned_repo_dir, self.checkout_args)
def test_error_missing_url(self):
"""Verify that a runtime error is raised when the user specified
@@ -1902,17 +1876,20 @@ def test_error_missing_url(self):
"""
# create repo
- under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME)
- self._generator.container_simple_required(under_test_dir)
+ cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO)
+ self._generator.create_config()
+ self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION,
+ branch=REMOTE_BRANCH_FEATURE2)
+ self._generator.write_config(cloned_repo_dir)
# update the config file to point to a different remote with
# the tag instead of branch. Tag MUST NOT be in the original
# repo!
- self._generator.update_underspecify_remove_url(under_test_dir,
- 'simp_branch')
+ self._generator.write_without_repo_url(cloned_repo_dir,
+ BRANCH_SECTION)
with self.assertRaises(RuntimeError):
- self.execute_cmd_in_dir(under_test_dir, self.checkout_args)
+ self.execute_checkout_in_dir(cloned_repo_dir, self.checkout_args)
if __name__ == '__main__':
diff --git a/manage_externals/test/test_sys_repository_git.py b/manage_externals/test/test_sys_repository_git.py
index f6dbf84284..7e5fb5020d 100644
--- a/manage_externals/test/test_sys_repository_git.py
+++ b/manage_externals/test/test_sys_repository_git.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""Tests of some of the functionality in repository_git.py that actually
interacts with git repositories.
@@ -131,12 +131,12 @@ def tearDown(self):
shutil.rmtree(self._tmpdir, ignore_errors=True)
@staticmethod
- def make_git_repo():
+ def make_cwd_git_repo():
"""Turn the current directory into an empty git repository"""
execute_subprocess(['git', 'init'])
@staticmethod
- def add_git_commit():
+ def add_cwd_git_commit():
"""Add a git commit in the current directory"""
with open('README', 'a') as myfile:
myfile.write('more info')
@@ -144,17 +144,17 @@ def add_git_commit():
execute_subprocess(['git', 'commit', '-m', 'my commit message'])
@staticmethod
- def checkout_git_branch(branchname):
+ def checkout_cwd_git_branch(branchname):
"""Checkout a new branch in the current directory"""
execute_subprocess(['git', 'checkout', '-b', branchname])
@staticmethod
- def make_git_tag(tagname):
+ def make_cwd_git_tag(tagname):
"""Make a lightweight tag at the current commit"""
execute_subprocess(['git', 'tag', '-m', 'making a tag', tagname])
@staticmethod
- def checkout_ref(refname):
+ def checkout_cwd_ref(refname):
"""Checkout the given refname in the current directory"""
execute_subprocess(['git', 'checkout', refname])
@@ -164,72 +164,72 @@ def checkout_ref(refname):
def test_currentHash_returnsHash(self):
"""Ensure that the _git_current_hash function returns a hash"""
- self.make_git_repo()
- self.add_git_commit()
- hash_found, myhash = self._repo._git_current_hash()
+ self.make_cwd_git_repo()
+ self.add_cwd_git_commit()
+ hash_found, myhash = self._repo._git_current_hash(os.getcwd())
self.assertTrue(hash_found)
self.assertIsHash(myhash)
def test_currentHash_outsideGitRepo(self):
"""Ensure that the _git_current_hash function returns False when
outside a git repository"""
- hash_found, myhash = self._repo._git_current_hash()
+ hash_found, myhash = self._repo._git_current_hash(os.getcwd())
self.assertFalse(hash_found)
self.assertEqual('', myhash)
def test_currentBranch_onBranch(self):
"""Ensure that the _git_current_branch function returns the name
of the branch"""
- self.make_git_repo()
- self.add_git_commit()
- self.checkout_git_branch('foo')
- branch_found, mybranch = self._repo._git_current_branch()
+ self.make_cwd_git_repo()
+ self.add_cwd_git_commit()
+ self.checkout_cwd_git_branch('foo')
+ branch_found, mybranch = self._repo._git_current_branch(os.getcwd())
self.assertTrue(branch_found)
self.assertEqual('foo', mybranch)
def test_currentBranch_notOnBranch(self):
"""Ensure that the _git_current_branch function returns False
when not on a branch"""
- self.make_git_repo()
- self.add_git_commit()
- self.make_git_tag('mytag')
- self.checkout_ref('mytag')
- branch_found, mybranch = self._repo._git_current_branch()
+ self.make_cwd_git_repo()
+ self.add_cwd_git_commit()
+ self.make_cwd_git_tag('mytag')
+ self.checkout_cwd_ref('mytag')
+ branch_found, mybranch = self._repo._git_current_branch(os.getcwd())
self.assertFalse(branch_found)
self.assertEqual('', mybranch)
def test_currentBranch_outsideGitRepo(self):
"""Ensure that the _git_current_branch function returns False
when outside a git repository"""
- branch_found, mybranch = self._repo._git_current_branch()
+ branch_found, mybranch = self._repo._git_current_branch(os.getcwd())
self.assertFalse(branch_found)
self.assertEqual('', mybranch)
def test_currentTag_onTag(self):
"""Ensure that the _git_current_tag function returns the name of
the tag"""
- self.make_git_repo()
- self.add_git_commit()
- self.make_git_tag('some_tag')
- tag_found, mytag = self._repo._git_current_tag()
+ self.make_cwd_git_repo()
+ self.add_cwd_git_commit()
+ self.make_cwd_git_tag('some_tag')
+ tag_found, mytag = self._repo._git_current_tag(os.getcwd())
self.assertTrue(tag_found)
self.assertEqual('some_tag', mytag)
def test_currentTag_notOnTag(self):
"""Ensure tha the _git_current_tag function returns False when
not on a tag"""
- self.make_git_repo()
- self.add_git_commit()
- self.make_git_tag('some_tag')
- self.add_git_commit()
- tag_found, mytag = self._repo._git_current_tag()
+ self.make_cwd_git_repo()
+ self.add_cwd_git_commit()
+ self.make_cwd_git_tag('some_tag')
+ self.add_cwd_git_commit()
+ tag_found, mytag = self._repo._git_current_tag(os.getcwd())
self.assertFalse(tag_found)
self.assertEqual('', mytag)
def test_currentTag_outsideGitRepo(self):
"""Ensure that the _git_current_tag function returns False when
outside a git repository"""
- tag_found, mytag = self._repo._git_current_tag()
+ tag_found, mytag = self._repo._git_current_tag(os.getcwd())
self.assertFalse(tag_found)
self.assertEqual('', mytag)
diff --git a/manage_externals/test/test_unit_externals_description.py b/manage_externals/test/test_unit_externals_description.py
index 637f760ee5..30e5288499 100644
--- a/manage_externals/test/test_unit_externals_description.py
+++ b/manage_externals/test/test_unit_externals_description.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""Unit test driver for checkout_externals
@@ -342,6 +342,40 @@ def setup_config(self):
# NOTE(goldy, 2019-03) Should test other possible keywords such as
# fetchRecurseSubmodules, ignore, and shallow
+ @staticmethod
+ def setup_dict_config():
+ """Create the full container dictionary with simple and mixed use
+ externals
+
+ """
+ rdatat = {ExternalsDescription.PROTOCOL: 'git',
+ ExternalsDescription.REPO_URL: 'simple-ext.git',
+ ExternalsDescription.TAG: 'tag1'}
+ rdatab = {ExternalsDescription.PROTOCOL: 'git',
+ ExternalsDescription.REPO_URL: 'simple-ext.git',
+ ExternalsDescription.BRANCH: 'feature2'}
+ rdatam = {ExternalsDescription.PROTOCOL: 'git',
+ ExternalsDescription.REPO_URL: 'mixed-cont-ext.git',
+ ExternalsDescription.BRANCH: 'master'}
+ desc = {'simp_tag': {ExternalsDescription.REQUIRED: True,
+ ExternalsDescription.PATH: 'simp_tag',
+ ExternalsDescription.EXTERNALS: EMPTY_STR,
+ ExternalsDescription.REPO: rdatat},
+ 'simp_branch' : {ExternalsDescription.REQUIRED: True,
+ ExternalsDescription.PATH: 'simp_branch',
+ ExternalsDescription.EXTERNALS: EMPTY_STR,
+ ExternalsDescription.REPO: rdatab},
+ 'simp_opt': {ExternalsDescription.REQUIRED: False,
+ ExternalsDescription.PATH: 'simp_opt',
+ ExternalsDescription.EXTERNALS: EMPTY_STR,
+ ExternalsDescription.REPO: rdatat},
+ 'mixed_req': {ExternalsDescription.REQUIRED: True,
+ ExternalsDescription.PATH: 'mixed_req',
+ ExternalsDescription.EXTERNALS: 'sub-ext.cfg',
+ ExternalsDescription.REPO: rdatam}}
+
+ return desc
+
def test_cfg_v1_ok(self):
"""Test that a correct cfg v1 object is created by create_externals_description
@@ -379,6 +413,49 @@ def test_dict(self):
ext = create_externals_description(desc, model_format='dict')
self.assertIsInstance(ext, ExternalsDescriptionDict)
+ def test_cfg_component_dict(self):
+ """Verify that create_externals_description works with a dictionary
+ """
+ # create the top level externals file
+ desc = self.setup_dict_config()
+ # Check external with all repos
+ external = create_externals_description(desc, model_format='dict')
+ self.assertIsInstance(external, ExternalsDescriptionDict)
+ self.assertTrue('simp_tag' in external)
+ self.assertTrue('simp_branch' in external)
+ self.assertTrue('simp_opt' in external)
+ self.assertTrue('mixed_req' in external)
+
+ def test_cfg_exclude_component_dict(self):
+ """Verify that exclude component checkout works with a dictionary
+ """
+ # create the top level externals file
+ desc = self.setup_dict_config()
+ # Test an excluded repo
+ external = create_externals_description(desc, model_format='dict',
+ exclude=['simp_tag',
+ 'simp_opt'])
+ self.assertIsInstance(external, ExternalsDescriptionDict)
+ self.assertFalse('simp_tag' in external)
+ self.assertTrue('simp_branch' in external)
+ self.assertFalse('simp_opt' in external)
+ self.assertTrue('mixed_req' in external)
+
+ def test_cfg_opt_component_dict(self):
+ """Verify that exclude component checkout works with a dictionary
+ """
+ # create the top level externals file
+ desc = self.setup_dict_config()
+ # Test an excluded repo
+ external = create_externals_description(desc, model_format='dict',
+ components=['simp_tag',
+ 'simp_opt'])
+ self.assertIsInstance(external, ExternalsDescriptionDict)
+ self.assertTrue('simp_tag' in external)
+ self.assertFalse('simp_branch' in external)
+ self.assertTrue('simp_opt' in external)
+ self.assertFalse('mixed_req' in external)
+
def test_cfg_unknown_version(self):
"""Test that a runtime error is raised when an unknown file version is
received
diff --git a/manage_externals/test/test_unit_externals_status.py b/manage_externals/test/test_unit_externals_status.py
index f8e953f756..f019514e9e 100644
--- a/manage_externals/test/test_unit_externals_status.py
+++ b/manage_externals/test/test_unit_externals_status.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""Unit test driver for the manic external status reporting module.
diff --git a/manage_externals/test/test_unit_repository.py b/manage_externals/test/test_unit_repository.py
index 5b9c242fd3..1b93861834 100644
--- a/manage_externals/test/test_unit_repository.py
+++ b/manage_externals/test/test_unit_repository.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""Unit test driver for checkout_externals
diff --git a/manage_externals/test/test_unit_repository_git.py b/manage_externals/test/test_unit_repository_git.py
index 4a0a334bb1..1c01098acf 100644
--- a/manage_externals/test/test_unit_repository_git.py
+++ b/manage_externals/test/test_unit_repository_git.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""Unit test driver for checkout_externals
@@ -67,7 +67,7 @@ def setUp(self):
def _git_current_branch(branch_found, branch_name):
"""Return a function that takes the place of
repo._git_current_branch, which returns the given output."""
- def my_git_current_branch():
+ def my_git_current_branch(dirname):
"""mock function that can take the place of repo._git_current_branch"""
return branch_found, branch_name
return my_git_current_branch
@@ -76,7 +76,7 @@ def my_git_current_branch():
def _git_current_tag(tag_found, tag_name):
"""Return a function that takes the place of
repo._git_current_tag, which returns the given output."""
- def my_git_current_tag():
+ def my_git_current_tag(dirname):
"""mock function that can take the place of repo._git_current_tag"""
return tag_found, tag_name
return my_git_current_tag
@@ -85,7 +85,7 @@ def my_git_current_tag():
def _git_current_hash(hash_found, hash_name):
"""Return a function that takes the place of
repo._git_current_hash, which returns the given output."""
- def my_git_current_hash():
+ def my_git_current_hash(dirname):
"""mock function that can take the place of repo._git_current_hash"""
return hash_found, hash_name
return my_git_current_hash
@@ -101,8 +101,8 @@ def test_ref_branch(self):
True, 'feature3')
self._repo._git_current_tag = self._git_current_tag(True, 'foo_tag')
self._repo._git_current_hash = self._git_current_hash(True, 'abc123')
- expected = 'feature3'
- result = self._repo._current_ref()
+ expected = 'foo_tag (branch feature3)'
+ result = self._repo._current_ref(os.getcwd())
self.assertEqual(result, expected)
def test_ref_detached_tag(self):
@@ -112,7 +112,7 @@ def test_ref_detached_tag(self):
self._repo._git_current_tag = self._git_current_tag(True, 'foo_tag')
self._repo._git_current_hash = self._git_current_hash(True, 'abc123')
expected = 'foo_tag'
- result = self._repo._current_ref()
+ result = self._repo._current_ref(os.getcwd())
self.assertEqual(result, expected)
def test_ref_detached_hash(self):
@@ -123,7 +123,7 @@ def test_ref_detached_hash(self):
self._repo._git_current_tag = self._git_current_tag(False, '')
self._repo._git_current_hash = self._git_current_hash(True, 'abc123')
expected = 'abc123'
- result = self._repo._current_ref()
+ result = self._repo._current_ref(os.getcwd())
self.assertEqual(result, expected)
def test_ref_none(self):
@@ -132,7 +132,7 @@ def test_ref_none(self):
self._repo._git_current_branch = self._git_current_branch(False, '')
self._repo._git_current_tag = self._git_current_tag(False, '')
self._repo._git_current_hash = self._git_current_hash(False, '')
- result = self._repo._current_ref()
+ result = self._repo._current_ref(os.getcwd())
self.assertEqual(result, EMPTY_STR)
@@ -206,11 +206,19 @@ def setUp(self):
self._repo._current_ref = self._current_ref_empty
self._create_tmp_git_dir()
+ # We have to override this class method rather than the self._repo
+ # instance method because it is called via
+ # GitRepository._remote_name_for_url, which is itself a @classmethod
+ # calls cls._git_remote_verbose().
+ self._orignal_git_remote_verbose = GitRepository._git_remote_verbose
+ GitRepository._git_remote_verbose = self._git_remote_origin_upstream
def tearDown(self):
"""Cleanup tmp stuff on the file system
"""
self._remove_tmp_git_dir()
+ GitRepository._git_remote_verbose = self._orignal_git_remote_verbose
+
def _create_tmp_git_dir(self):
"""Create a temporary fake git directory for testing purposes.
"""
@@ -227,29 +235,27 @@ def _remove_tmp_git_dir(self):
# mock methods replacing git system calls
#
@staticmethod
- def _current_ref_empty():
+ def _current_ref_empty(dirname):
"""Return an empty string.
+
+ Drop-in for GitRepository._current_ref
"""
return EMPTY_STR
@staticmethod
- def _git_remote_origin_upstream():
- """Return an info string that is a checkout hash
- """
- return GIT_REMOTE_OUTPUT_ORIGIN_UPSTREAM
+ def _git_remote_origin_upstream(dirname):
+ """Return an info string that is a checkout hash.
- @staticmethod
- def _git_remote_none():
- """Return an info string that is a checkout hash
+ Drop-in for GitRepository._git_remote_verbose.
"""
- return EMPTY_STR
+ return GIT_REMOTE_OUTPUT_ORIGIN_UPSTREAM
@staticmethod
def _git_current_hash(myhash):
"""Return a function that takes the place of repo._git_current_hash,
which returns the given hash
"""
- def my_git_current_hash():
+ def my_git_current_hash(dirname):
"""mock function that can take the place of repo._git_current_hash"""
return 0, myhash
return my_git_current_hash
@@ -263,7 +269,7 @@ def _git_revparse_commit(self, expected_ref, mystatus, myhash):
status = 0 implies success, non-zero implies failure
"""
- def my_git_revparse_commit(ref):
+ def my_git_revparse_commit(ref, dirname):
"""mock function that can take the place of repo._git_revparse_commit"""
self.assertEqual(expected_ref, ref)
return mystatus, myhash
@@ -291,9 +297,6 @@ def test_sync_dir_exist_no_git_info(self):
"""Test that a non-existent git repo returns an unknown status
"""
stat = ExternalStatus()
- # Now we over-ride the _git_remote_verbose method on the repo to return
- # a known value without requiring access to git.
- self._repo._git_remote_verbose = self._git_remote_origin_upstream
self._repo._tag = 'tag1'
self._repo._git_current_hash = self._git_current_hash('')
self._repo._git_revparse_commit = self._git_revparse_commit(
@@ -313,7 +316,6 @@ def test_sync_invalid_reference(self):
"""Test that an invalid reference returns out-of-sync
"""
stat = ExternalStatus()
- self._repo._git_remote_verbose = self._git_remote_origin_upstream
self._repo._tag = 'tag1'
self._repo._git_current_hash = self._git_current_hash('abc123')
self._repo._git_revparse_commit = self._git_revparse_commit(
@@ -333,7 +335,6 @@ def test_sync_tag_on_same_hash(self):
"""
stat = ExternalStatus()
- self._repo._git_remote_verbose = self._git_remote_origin_upstream
self._repo._tag = 'tag1'
self._repo._git_current_hash = self._git_current_hash('abc123')
self._repo._git_revparse_commit = self._git_revparse_commit(
@@ -348,7 +349,6 @@ def test_sync_tag_on_different_hash(self):
"""
stat = ExternalStatus()
- self._repo._git_remote_verbose = self._git_remote_origin_upstream
self._repo._tag = 'tag1'
self._repo._git_current_hash = self._git_current_hash('def456')
self._repo._git_revparse_commit = self._git_revparse_commit(
@@ -368,7 +368,6 @@ def test_sync_hash_on_same_hash(self):
"""
stat = ExternalStatus()
- self._repo._git_remote_verbose = self._git_remote_origin_upstream
self._repo._tag = ''
self._repo._hash = 'abc'
self._repo._git_current_hash = self._git_current_hash('abc123')
@@ -384,7 +383,6 @@ def test_sync_hash_on_different_hash(self):
"""
stat = ExternalStatus()
- self._repo._git_remote_verbose = self._git_remote_origin_upstream
self._repo._tag = ''
self._repo._hash = 'abc'
self._repo._git_current_hash = self._git_current_hash('def456')
@@ -405,7 +403,6 @@ def test_sync_branch_on_same_hash(self):
"""
stat = ExternalStatus()
- self._repo._git_remote_verbose = self._git_remote_origin_upstream
self._repo._branch = 'feature-2'
self._repo._tag = ''
self._repo._git_current_hash = self._git_current_hash('abc123')
@@ -421,7 +418,6 @@ def test_sync_branch_on_diff_hash(self):
"""
stat = ExternalStatus()
- self._repo._git_remote_verbose = self._git_remote_origin_upstream
self._repo._branch = 'feature-2'
self._repo._tag = ''
self._repo._git_current_hash = self._git_current_hash('abc123')
@@ -433,11 +429,10 @@ def test_sync_branch_on_diff_hash(self):
self.assertEqual(stat.clean_state, ExternalStatus.DEFAULT)
def test_sync_branch_diff_remote(self):
- """Test _determine_remote_name with a different remote
+ """Test _remote_name_for_url with a different remote
"""
stat = ExternalStatus()
- self._repo._git_remote_verbose = self._git_remote_origin_upstream
self._repo._branch = 'feature-2'
self._repo._tag = ''
self._repo._url = '/path/to/other/repo'
@@ -449,11 +444,10 @@ def test_sync_branch_diff_remote(self):
# expected argument
def test_sync_branch_diff_remote2(self):
- """Test _determine_remote_name with a different remote
+ """Test _remote_name_for_url with a different remote
"""
stat = ExternalStatus()
- self._repo._git_remote_verbose = self._git_remote_origin_upstream
self._repo._branch = 'feature-2'
self._repo._tag = ''
self._repo._url = '/path/to/local/repo2'
@@ -469,7 +463,6 @@ def test_sync_branch_on_unknown_remote(self):
"""
stat = ExternalStatus()
- self._repo._git_remote_verbose = self._git_remote_origin_upstream
self._repo._branch = 'feature-2'
self._repo._tag = ''
self._repo._url = '/path/to/unknown/repo'
@@ -491,7 +484,6 @@ def test_sync_branch_on_untracked_local(self):
"""
stat = ExternalStatus()
- self._repo._git_remote_verbose = self._git_remote_origin_upstream
self._repo._branch = 'feature3'
self._repo._tag = ''
self._repo._url = '.'
@@ -611,24 +603,20 @@ def setUp(self):
self._repo = GitRepository('test', repo)
@staticmethod
- def _shell_true(url, remote=None):
- _ = url
- _ = remote
+ def _shell_true(*args, **kwargs):
return 0
@staticmethod
- def _shell_false(url, remote=None):
- _ = url
- _ = remote
+ def _shell_false(*args, **kwargs):
return 1
@staticmethod
- def _mock_function_true(ref):
+ def _mock_revparse_commit(ref, dirname):
_ = ref
return (TestValidRef._shell_true, '97ebc0e0deadc0de')
@staticmethod
- def _mock_function_false(ref):
+ def _mock_revparse_commit_false(ref, dirname):
_ = ref
return (TestValidRef._shell_false, '97ebc0e0deadc0de')
@@ -638,10 +626,11 @@ def test_tag_not_tag_branch_commit(self):
self._repo._git_showref_tag = self._shell_false
self._repo._git_showref_branch = self._shell_false
self._repo._git_lsremote_branch = self._shell_false
- self._repo._git_revparse_commit = self._mock_function_false
+ self._repo._git_revparse_commit = self._mock_revparse_commit_false
self._repo._tag = 'something'
remote_name = 'origin'
- received, _ = self._repo._is_unique_tag(self._repo._tag, remote_name)
+ received, _ = self._repo._is_unique_tag(self._repo._tag, remote_name,
+ os.getcwd())
self.assertFalse(received)
def test_tag_not_tag(self):
@@ -650,10 +639,11 @@ def test_tag_not_tag(self):
self._repo._git_showref_tag = self._shell_false
self._repo._git_showref_branch = self._shell_true
self._repo._git_lsremote_branch = self._shell_true
- self._repo._git_revparse_commit = self._mock_function_false
+ self._repo._git_revparse_commit = self._mock_revparse_commit_false
self._repo._tag = 'tag1'
remote_name = 'origin'
- received, _ = self._repo._is_unique_tag(self._repo._tag, remote_name)
+ received, _ = self._repo._is_unique_tag(self._repo._tag, remote_name,
+ os.getcwd())
self.assertFalse(received)
def test_tag_indeterminant(self):
@@ -662,10 +652,11 @@ def test_tag_indeterminant(self):
self._repo._git_showref_tag = self._shell_true
self._repo._git_showref_branch = self._shell_true
self._repo._git_lsremote_branch = self._shell_true
- self._repo._git_revparse_commit = self._mock_function_true
+ self._repo._git_revparse_commit = self._mock_revparse_commit
self._repo._tag = 'something'
remote_name = 'origin'
- received, _ = self._repo._is_unique_tag(self._repo._tag, remote_name)
+ received, _ = self._repo._is_unique_tag(self._repo._tag, remote_name,
+ os.getcwd())
self.assertFalse(received)
def test_tag_is_unique(self):
@@ -674,10 +665,11 @@ def test_tag_is_unique(self):
self._repo._git_showref_tag = self._shell_true
self._repo._git_showref_branch = self._shell_false
self._repo._git_lsremote_branch = self._shell_false
- self._repo._git_revparse_commit = self._mock_function_true
+ self._repo._git_revparse_commit = self._mock_revparse_commit
self._repo._tag = 'tag1'
remote_name = 'origin'
- received, _ = self._repo._is_unique_tag(self._repo._tag, remote_name)
+ received, _ = self._repo._is_unique_tag(self._repo._tag, remote_name,
+ os.getcwd())
self.assertTrue(received)
def test_tag_is_not_hash(self):
@@ -686,10 +678,11 @@ def test_tag_is_not_hash(self):
self._repo._git_showref_tag = self._shell_false
self._repo._git_showref_branch = self._shell_false
self._repo._git_lsremote_branch = self._shell_false
- self._repo._git_revparse_commit = self._mock_function_true
+ self._repo._git_revparse_commit = self._mock_revparse_commit
self._repo._tag = '97ebc0e0'
remote_name = 'origin'
- received, _ = self._repo._is_unique_tag(self._repo._tag, remote_name)
+ received, _ = self._repo._is_unique_tag(self._repo._tag, remote_name,
+ os.getcwd())
self.assertFalse(received)
def test_hash_is_commit(self):
@@ -698,10 +691,11 @@ def test_hash_is_commit(self):
self._repo._git_showref_tag = self._shell_false
self._repo._git_showref_branch = self._shell_false
self._repo._git_lsremote_branch = self._shell_false
- self._repo._git_revparse_commit = self._mock_function_true
+ self._repo._git_revparse_commit = self._mock_revparse_commit
self._repo._tag = '97ebc0e0'
remote_name = 'origin'
- received, _ = self._repo._is_unique_tag(self._repo._tag, remote_name)
+ received, _ = self._repo._is_unique_tag(self._repo._tag, remote_name,
+ os.getcwd())
self.assertFalse(received)
@@ -746,13 +740,14 @@ def _shell_false(url, remote=None):
return 1
@staticmethod
- def _mock_function_false(ref):
+ def _mock_revparse_commit_false(ref, dirname):
_ = ref
return (TestValidRef._shell_false, '')
@staticmethod
- def _mock_function_true(ref):
+ def _mock_revparse_commit_true(ref, dirname):
_ = ref
+ _ = dirname
return (TestValidRef._shell_true, '')
def test_valid_ref_is_invalid(self):
@@ -761,10 +756,12 @@ def test_valid_ref_is_invalid(self):
self._repo._git_showref_tag = self._shell_false
self._repo._git_showref_branch = self._shell_false
self._repo._git_lsremote_branch = self._shell_false
- self._repo._git_revparse_commit = self._mock_function_false
+ self._repo._git_revparse_commit = self._mock_revparse_commit_false
self._repo._tag = 'invalid_ref'
with self.assertRaises(RuntimeError):
- self._repo._check_for_valid_ref(self._repo._tag)
+ self._repo._check_for_valid_ref(self._repo._tag,
+ remote_name=None,
+ dirname=os.getcwd())
def test_valid_tag(self):
"""Verify a valid tag return true
@@ -772,9 +769,11 @@ def test_valid_tag(self):
self._repo._git_showref_tag = self._shell_true
self._repo._git_showref_branch = self._shell_false
self._repo._git_lsremote_branch = self._shell_false
- self._repo._git_revparse_commit = self._mock_function_true
+ self._repo._git_revparse_commit = self._mock_revparse_commit_true
self._repo._tag = 'tag1'
- received = self._repo._check_for_valid_ref(self._repo._tag)
+ received = self._repo._check_for_valid_ref(self._repo._tag,
+ remote_name=None,
+ dirname=os.getcwd())
self.assertTrue(received)
def test_valid_branch(self):
@@ -783,24 +782,28 @@ def test_valid_branch(self):
self._repo._git_showref_tag = self._shell_false
self._repo._git_showref_branch = self._shell_true
self._repo._git_lsremote_branch = self._shell_false
- self._repo._git_revparse_commit = self._mock_function_true
+ self._repo._git_revparse_commit = self._mock_revparse_commit_true
self._repo._tag = 'tag1'
- received = self._repo._check_for_valid_ref(self._repo._tag)
+ received = self._repo._check_for_valid_ref(self._repo._tag,
+ remote_name=None,
+ dirname=os.getcwd())
self.assertTrue(received)
def test_valid_hash(self):
"""Verify a valid hash return true
"""
- def _mock_revparse_commit(ref):
+ def _mock_revparse_commit_true(ref, dirname):
_ = ref
return (0, '56cc0b539426eb26810af9e')
self._repo._git_showref_tag = self._shell_false
self._repo._git_showref_branch = self._shell_false
self._repo._git_lsremote_branch = self._shell_false
- self._repo._git_revparse_commit = _mock_revparse_commit
+ self._repo._git_revparse_commit = _mock_revparse_commit_true
self._repo._hash = '56cc0b5394'
- received = self._repo._check_for_valid_ref(self._repo._hash)
+ received = self._repo._check_for_valid_ref(self._repo._hash,
+ remote_name=None,
+ dirname=os.getcwd())
self.assertTrue(received)
diff --git a/manage_externals/test/test_unit_repository_svn.py b/manage_externals/test/test_unit_repository_svn.py
old mode 100644
new mode 100755
index 7ff31c4218..d9309df7f6
--- a/manage_externals/test/test_unit_repository_svn.py
+++ b/manage_externals/test/test_unit_repository_svn.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""Unit test driver for checkout_externals
@@ -60,7 +60,7 @@ def setUp(self):
self._name = 'component'
rdata = {ExternalsDescription.PROTOCOL: 'svn',
ExternalsDescription.REPO_URL:
- 'https://svn-ccsm-models.cgd.ucar.edu/',
+ 'https://svn-ccsm-models.cgd.ucar.edu',
ExternalsDescription.TAG:
'mosart/trunk_tags/mosart1_0_26',
}
diff --git a/manage_externals/test/test_unit_utils.py b/manage_externals/test/test_unit_utils.py
index c994e58ebe..80e1636649 100644
--- a/manage_externals/test/test_unit_utils.py
+++ b/manage_externals/test/test_unit_utils.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""Unit test driver for checkout_externals
diff --git a/src/chemistry/aerosol/aerosol_optics_mod.F90 b/src/chemistry/aerosol/aerosol_optics_mod.F90
new file mode 100644
index 0000000000..ae2a04bfb1
--- /dev/null
+++ b/src/chemistry/aerosol/aerosol_optics_mod.F90
@@ -0,0 +1,58 @@
+module aerosol_optics_mod
+ use shr_kind_mod, only: r8 => shr_kind_r8
+
+ implicit none
+
+ private
+ public :: aerosol_optics
+
+ !> aerosol_optics defines interfaces to optical properties of any aerosol package
+ !!
+ !! Each aerosol optics type must extend the abstract aerosol_optics class
+ !! to define details of how aerosol optics properties are derived from
+ !! aerosol states.
+ type, abstract :: aerosol_optics
+
+ contains
+
+ procedure(aeropts_sw_props),deferred :: sw_props
+ procedure(aeropts_lw_props),deferred :: lw_props
+
+ end type aerosol_optics
+
+ abstract interface
+
+ !------------------------------------------------------------------------------
+ ! returns short wave aerosol optics properties
+ !------------------------------------------------------------------------------
+ subroutine aeropts_sw_props(self, ncol, ilev, iwav, pext, pabs, palb, pasm)
+ import :: aerosol_optics, r8
+
+ class(aerosol_optics), intent(in) :: self
+ integer, intent(in) :: ncol ! number of columns
+ integer, intent(in) :: ilev ! vertical level index
+ integer, intent(in) :: iwav ! wave length index
+ real(r8),intent(out) :: pext(ncol) ! parameterized specific extinction (m2/kg)
+ real(r8),intent(out) :: pabs(ncol) ! parameterized specific absorption (m2/kg)
+ real(r8),intent(out) :: palb(ncol) ! parameterized asymmetry factor
+ real(r8),intent(out) :: pasm(ncol) ! parameterized single scattering albedo
+
+ end subroutine aeropts_sw_props
+
+ !------------------------------------------------------------------------------
+ ! returns long wave aerosol optics properties
+ !------------------------------------------------------------------------------
+ subroutine aeropts_lw_props(self, ncol, ilev, iwav, pabs)
+ import :: aerosol_optics, r8
+
+ class(aerosol_optics), intent(in) :: self
+ integer, intent(in) :: ncol ! number of columns
+ integer, intent(in) :: ilev ! vertical level index
+ integer, intent(in) :: iwav ! wave length index
+ real(r8),intent(out) :: pabs(ncol) ! parameterized specific absorption (m2/kg)
+
+ end subroutine aeropts_lw_props
+
+ end interface
+
+end module aerosol_optics_mod
diff --git a/src/chemistry/aerosol/aerosol_properties_mod.F90 b/src/chemistry/aerosol/aerosol_properties_mod.F90
index 864d14af1d..aadd56f87d 100644
--- a/src/chemistry/aerosol/aerosol_properties_mod.F90
+++ b/src/chemistry/aerosol/aerosol_properties_mod.F90
@@ -31,20 +31,27 @@ module aerosol_properties_mod
real(r8), allocatable :: f2_(:) ! eq 29 Abdul-Razzak et al 1998
! Abdul-Razzak, H., S.J. Ghan, and C. Rivera-Carpio, A parameterization of aerosol activation,
! 1, Singleaerosoltype. J. Geophys. Res., 103, 6123-6132, 1998.
+ real(r8) :: soa_equivso4_factor_ = -huge(1._r8)
+ real(r8) :: pom_equivso4_factor_ = -huge(1._r8)
contains
procedure :: initialize => aero_props_init
- procedure :: nbins
+ procedure,private :: nbins_0list
+ procedure(aero_nbins_rlist), deferred :: nbins_rlist
+ generic :: nbins => nbins_0list,nbins_rlist
procedure :: ncnst_tot
procedure,private :: nspecies_per_bin
+ procedure(aero_nspecies_rlist), deferred :: nspecies_per_bin_rlist
procedure,private :: nspecies_all_bins
- generic :: nspecies => nspecies_all_bins,nspecies_per_bin
+ generic :: nspecies => nspecies_all_bins,nspecies_per_bin,nspecies_per_bin_rlist
procedure,private :: n_masses_all_bins
procedure,private :: n_masses_per_bin
generic :: nmasses => n_masses_all_bins,n_masses_per_bin
procedure :: indexer
procedure :: maxsat
procedure(aero_amcube), deferred :: amcube
- procedure :: alogsig
+ procedure :: alogsig_0list
+ procedure(aero_alogsig_rlist), deferred :: alogsig_rlist
+ generic :: alogsig => alogsig_0list,alogsig_rlist
procedure(aero_number_transported), deferred :: number_transported
procedure(aero_props_get), deferred :: get
procedure(aero_actfracs), deferred :: actfracs
@@ -56,6 +63,13 @@ module aerosol_properties_mod
procedure(aero_icenuc_updates_num), deferred :: icenuc_updates_num
procedure(aero_icenuc_updates_mmr), deferred :: icenuc_updates_mmr
procedure(aero_apply_num_limits), deferred :: apply_number_limits
+ procedure(aero_hetfrz_species), deferred :: hetfrz_species
+ procedure :: soa_equivso4_factor ! SOA Hygroscopicity / Sulfate Hygroscopicity
+ procedure :: pom_equivso4_factor ! POM Hygroscopicity / Sulfate Hygroscopicity
+ procedure(aero_soluble), deferred :: soluble
+ procedure(aero_min_mass_mean_rad), deferred :: min_mass_mean_rad
+ procedure(aero_optics_params), deferred :: optics_params
+ procedure(aero_bin_name), deferred :: bin_name
procedure :: final=>aero_props_final
end type aerosol_properties
@@ -76,16 +90,81 @@ end function aero_number_transported
! returns aerosol properties:
! density
! hygroscopicity
+ ! species type
+ ! short wave species refractive indices
+ ! long wave species refractive indices
+ ! species morphology
!------------------------------------------------------------------------
- subroutine aero_props_get(self, bin_ndx, species_ndx, density,hygro)
+ subroutine aero_props_get(self, bin_ndx, species_ndx, list_ndx, density, hygro, &
+ spectype, specmorph, refindex_sw, refindex_lw)
import :: aerosol_properties, r8
class(aerosol_properties), intent(in) :: self
integer, intent(in) :: bin_ndx ! bin index
integer, intent(in) :: species_ndx ! species index
+ integer, optional, intent(in) :: list_ndx ! climate or a diagnostic list number
real(r8), optional, intent(out) :: density ! density (kg/m3)
real(r8), optional, intent(out) :: hygro ! hygroscopicity
+ character(len=*), optional, intent(out) :: spectype ! species type
+ character(len=*), optional, intent(out) :: specmorph ! species morphology
+ complex(r8), pointer, optional, intent(out) :: refindex_sw(:) ! short wave species refractive indices
+ complex(r8), pointer, optional, intent(out) :: refindex_lw(:) ! long wave species refractive indices
+
end subroutine aero_props_get
+ !------------------------------------------------------------------------
+ ! returns optics type and table parameters
+ !------------------------------------------------------------------------
+ subroutine aero_optics_params(self, list_ndx, bin_ndx, opticstype, extpsw, abspsw, asmpsw, absplw, &
+ refrtabsw, refitabsw, refrtablw, refitablw, ncoef, prefr, prefi, sw_hygro_ext_wtp, &
+ sw_hygro_ssa_wtp, sw_hygro_asm_wtp, lw_hygro_ext_wtp, wgtpct, nwtp, &
+ sw_hygro_coreshell_ext, sw_hygro_coreshell_ssa, sw_hygro_coreshell_asm, lw_hygro_coreshell_ext, &
+ corefrac, bcdust, kap, relh, nfrac, nbcdust, nkap, nrelh )
+
+ import :: aerosol_properties, r8
+
+ class(aerosol_properties), intent(in) :: self
+ integer, intent(in) :: bin_ndx ! bin index
+ integer, intent(in) :: list_ndx ! rad climate/diags list
+
+ character(len=*), optional, intent(out) :: opticstype
+
+ ! refactive index table parameters
+ real(r8), optional, pointer :: extpsw(:,:,:,:) ! short wave specific extinction
+ real(r8), optional, pointer :: abspsw(:,:,:,:) ! short wave specific absorption
+ real(r8), optional, pointer :: asmpsw(:,:,:,:) ! short wave asymmetry factor
+ real(r8), optional, pointer :: absplw(:,:,:,:) ! long wave specific absorption
+ real(r8), optional, pointer :: refrtabsw(:,:) ! table of short wave real refractive indices for aerosols
+ real(r8), optional, pointer :: refitabsw(:,:) ! table of short wave imaginary refractive indices for aerosols
+ real(r8), optional, pointer :: refrtablw(:,:) ! table of long wave real refractive indices for aerosols
+ real(r8), optional, pointer :: refitablw(:,:) ! table of long wave imaginary refractive indices for aerosols
+ integer, optional, intent(out) :: ncoef ! number of chebychev polynomials
+ integer, optional, intent(out) :: prefr ! number of real refractive indices in table
+ integer, optional, intent(out) :: prefi ! number of imaginary refractive indices in table
+
+ ! hygrowghtpct table parameters
+ real(r8), optional, pointer :: sw_hygro_ext_wtp(:,:) ! short wave extinction table
+ real(r8), optional, pointer :: sw_hygro_ssa_wtp(:,:) ! short wave single-scatter albedo table
+ real(r8), optional, pointer :: sw_hygro_asm_wtp(:,:) ! short wave asymmetry table
+ real(r8), optional, pointer :: lw_hygro_ext_wtp(:,:) ! long wave absorption table
+ real(r8), optional, pointer :: wgtpct(:) ! weight precent of H2SO4/H2O solution
+ integer, optional, intent(out) :: nwtp ! number of weight precent values
+
+ ! hygrocoreshell table parameters
+ real(r8), optional, pointer :: sw_hygro_coreshell_ext(:,:,:,:,:) ! short wave extinction table
+ real(r8), optional, pointer :: sw_hygro_coreshell_ssa(:,:,:,:,:) ! short wave single-scatter albedo table
+ real(r8), optional, pointer :: sw_hygro_coreshell_asm(:,:,:,:,:) ! short wave asymmetry table
+ real(r8), optional, pointer :: lw_hygro_coreshell_ext(:,:,:,:,:) ! long wave absorption table
+ real(r8), optional, pointer :: corefrac(:) ! core fraction dimension values
+ real(r8), optional, pointer :: bcdust(:) ! bc/(bc + dust) fraction dimension values
+ real(r8), optional, pointer :: kap(:) ! hygroscopicity dimension values
+ real(r8), optional, pointer :: relh(:) ! relative humidity dimension values
+ integer, optional, intent(out) :: nfrac ! core fraction dimension size
+ integer, optional, intent(out) :: nbcdust ! bc/(bc + dust) fraction dimension size
+ integer, optional, intent(out) :: nkap ! hygroscopicity dimension size
+ integer, optional, intent(out) :: nrelh ! relative humidity dimension size
+
+ end subroutine aero_optics_params
+
!------------------------------------------------------------------------
! returns species type
!------------------------------------------------------------------------
@@ -210,6 +289,95 @@ subroutine aero_apply_num_limits( self, naerosol, vaerosol, istart, istop, m )
end subroutine aero_apply_num_limits
+ !------------------------------------------------------------------------------
+ ! returns TRUE if species `spc_ndx` in aerosol subset `bin_ndx` contributes to
+ ! the particles' ability to act as heterogeneous freezing nuclei
+ !------------------------------------------------------------------------------
+ function aero_hetfrz_species(self, bin_ndx, spc_ndx) result(res)
+ import :: aerosol_properties
+ class(aerosol_properties), intent(in) :: self
+ integer, intent(in) :: bin_ndx ! bin number
+ integer, intent(in) :: spc_ndx ! species number
+
+ logical :: res
+
+ end function aero_hetfrz_species
+
+ !------------------------------------------------------------------------------
+ ! returns minimum mass mean radius (meters)
+ !------------------------------------------------------------------------------
+ function aero_min_mass_mean_rad(self,bin_ndx,species_ndx) result(minrad)
+ import :: aerosol_properties, r8
+ class(aerosol_properties), intent(in) :: self
+ integer, intent(in) :: bin_ndx ! bin number
+ integer, intent(in) :: species_ndx ! species number
+
+ real(r8) :: minrad ! meters
+
+ end function aero_min_mass_mean_rad
+
+ !------------------------------------------------------------------------------
+ ! returns TRUE if soluble
+ !------------------------------------------------------------------------------
+ logical function aero_soluble(self,bin_ndx)
+ import :: aerosol_properties
+ class(aerosol_properties), intent(in) :: self
+ integer, intent(in) :: bin_ndx ! bin number
+
+ end function aero_soluble
+
+ !------------------------------------------------------------------------------
+ ! returns the total number of bins for a given radiation list index
+ !------------------------------------------------------------------------------
+ function aero_nbins_rlist(self, list_ndx) result(res)
+ import :: aerosol_properties
+ class(aerosol_properties), intent(in) :: self
+ integer, intent(in) :: list_ndx ! radiation list number
+
+ integer :: res
+
+ end function aero_nbins_rlist
+
+ !------------------------------------------------------------------------------
+ ! returns number of species in a bin for a given radiation list index
+ !------------------------------------------------------------------------------
+ function aero_nspecies_rlist(self, list_ndx, bin_ndx) result(res)
+ import :: aerosol_properties
+ class(aerosol_properties), intent(in) :: self
+ integer, intent(in) :: list_ndx ! radiation list number
+ integer, intent(in) :: bin_ndx ! bin number
+
+ integer :: res
+
+ end function aero_nspecies_rlist
+
+ !------------------------------------------------------------------------------
+ ! returns the natural log of geometric standard deviation of the number
+ ! distribution for radiation list number and aerosol bin
+ !------------------------------------------------------------------------------
+ function aero_alogsig_rlist(self, list_ndx, bin_ndx) result(res)
+ import :: aerosol_properties, r8
+ class(aerosol_properties), intent(in) :: self
+ integer, intent(in) :: list_ndx ! radiation list number
+ integer, intent(in) :: bin_ndx ! bin number
+
+ real(r8) :: res
+
+ end function aero_alogsig_rlist
+
+ !------------------------------------------------------------------------------
+ ! returns name for a given radiation list number and aerosol bin
+ !------------------------------------------------------------------------------
+ function aero_bin_name(self, list_ndx, bin_ndx) result(name)
+ import :: aerosol_properties, r8
+ class(aerosol_properties), intent(in) :: self
+ integer, intent(in) :: list_ndx ! radiation list number
+ integer, intent(in) :: bin_ndx ! bin number
+
+ character(len=32) name
+
+ end function aero_bin_name
+
end interface
contains
@@ -231,6 +399,10 @@ subroutine aero_props_init(self, nbin, ncnst, nspec, nmasses, alogsig, f1,f2, ie
integer :: imas,ibin,indx
character(len=*),parameter :: prefix = 'aerosol_properties::aero_props_init: '
+ real(r8), parameter :: spechygro_so4 = 0.507_r8 ! Sulfate hygroscopicity
+ real(r8), parameter :: spechygro_soa = 0.14_r8 ! SOA hygroscopicity
+ real(r8), parameter :: spechygro_pom = 0.1_r8 ! POM hygroscopicity
+
ierr = 0
allocate(self%nspecies_(nbin),stat=ierr)
@@ -282,6 +454,9 @@ subroutine aero_props_init(self, nbin, ncnst, nspec, nmasses, alogsig, f1,f2, ie
self%f1_(:) = f1(:)
self%f2_(:) = f2(:)
+ self%soa_equivso4_factor_ = spechygro_soa/spechygro_so4
+ self%pom_equivso4_factor_ = spechygro_pom/spechygro_so4
+
end subroutine aero_props_init
!------------------------------------------------------------------------------
@@ -371,11 +546,12 @@ end function indexer
!------------------------------------------------------------------------------
! returns the total number of bins
!------------------------------------------------------------------------------
- pure integer function nbins(self)
+ pure function nbins_0list(self) result(nbins)
class(aerosol_properties), intent(in) :: self
+ integer :: nbins
nbins = self%nbins_
- end function nbins
+ end function nbins_0list
!------------------------------------------------------------------------------
! returns number of constituents (or elements) totaled across all bins
@@ -389,12 +565,12 @@ end function ncnst_tot
!------------------------------------------------------------------------------
! returns the natural log of geometric standard deviation of the number distribution for aerosol bin
!------------------------------------------------------------------------------
- pure real(r8) function alogsig(self, bin_ndx)
+ pure real(r8) function alogsig_0list(self, bin_ndx)
class(aerosol_properties), intent(in) :: self
integer, intent(in) :: bin_ndx ! bin number
- alogsig = self%alogsig_(bin_ndx)
- end function alogsig
+ alogsig_0list = self%alogsig_(bin_ndx)
+ end function alogsig_0list
!------------------------------------------------------------------------------
! returns maximum supersaturation
@@ -458,4 +634,24 @@ function maxsat(self, zeta,eta,smc) result(smax)
end function maxsat
+ !------------------------------------------------------------------------------
+ ! returns the ratio of SOA Hygroscopicity / Sulfate Hygroscopicity
+ !------------------------------------------------------------------------------
+ pure real(r8) function soa_equivso4_factor(self)
+ class(aerosol_properties), intent(in) :: self
+
+ soa_equivso4_factor = self%soa_equivso4_factor_
+
+ end function soa_equivso4_factor
+
+ !------------------------------------------------------------------------------
+ ! returns the ratio of POM Hygroscopicity / Sulfate Hygroscopicity
+ !------------------------------------------------------------------------------
+ pure real(r8) function pom_equivso4_factor(self)
+ class(aerosol_properties), intent(in) :: self
+
+ pom_equivso4_factor = self%pom_equivso4_factor_
+
+ end function pom_equivso4_factor
+
end module aerosol_properties_mod
diff --git a/src/chemistry/aerosol/aerosol_state_mod.F90 b/src/chemistry/aerosol/aerosol_state_mod.F90
index 7caaa5b948..b0e8d24a1e 100644
--- a/src/chemistry/aerosol/aerosol_state_mod.F90
+++ b/src/chemistry/aerosol/aerosol_state_mod.F90
@@ -1,6 +1,7 @@
module aerosol_state_mod
use shr_kind_mod, only: r8 => shr_kind_r8
use aerosol_properties_mod, only: aerosol_properties, aero_name_len
+ use physconst, only: pi
implicit none
@@ -27,7 +28,9 @@ module aerosol_state_mod
procedure(aero_get_transported), deferred :: get_transported
procedure(aero_set_transported), deferred :: set_transported
procedure(aero_get_amb_total_bin_mmr), deferred :: ambient_total_bin_mmr
- procedure(aero_get_state_mmr), deferred :: get_ambient_mmr
+ procedure(aero_get_state_mmr), deferred :: get_ambient_mmr_0list
+ procedure(aero_get_list_mmr), deferred :: get_ambient_mmr_rlist
+ generic :: get_ambient_mmr=>get_ambient_mmr_0list,get_ambient_mmr_rlist
procedure(aero_get_state_mmr), deferred :: get_cldbrne_mmr
procedure(aero_get_state_num), deferred :: get_ambient_num
procedure(aero_get_state_num), deferred :: get_cldbrne_num
@@ -40,13 +43,30 @@ module aerosol_state_mod
procedure :: icenuc_type_wght_base
procedure :: icenuc_type_wght => icenuc_type_wght_base
procedure :: nuclice_get_numdens
- end type aerosol_state
+ procedure :: get_amb_species_numdens
+ procedure :: get_cld_species_numdens
+ procedure :: coated_frac
+ procedure :: mass_mean_radius
+ procedure :: watact_mfactor
+ procedure(aero_hetfrz_size_wght), deferred :: hetfrz_size_wght
+ procedure(aero_hygroscopicity), deferred :: hygroscopicity
+ procedure(aero_water_uptake), deferred :: water_uptake
+ procedure :: refractive_index_sw
+ procedure :: refractive_index_lw
+ procedure(aero_volume), deferred :: dry_volume
+ procedure(aero_volume), deferred :: wet_volume
+ procedure(aero_volume), deferred :: water_volume
+ end type aerosol_state
! for state fields
type ptr2d_t
real(r8), pointer :: fld(:,:)
end type ptr2d_t
+ real(r8), parameter :: per_cm3 = 1.e-6_r8 ! factor for m-3 to cm-3 conversions
+ real(r8), parameter :: per_m3 = 1.e6_r8 ! factor for cm-3 to m-3 conversions
+ real(r8), parameter :: kg2mug = 1.e9_r8 ! factor for kg to micrograms (mug) conversions
+
abstract interface
!------------------------------------------------------------------------
@@ -72,9 +92,22 @@ subroutine aero_get_state_mmr(self, species_ndx, bin_ndx, mmr)
class(aerosol_state), intent(in) :: self
integer, intent(in) :: species_ndx ! species index
integer, intent(in) :: bin_ndx ! bin index
- real(r8), pointer :: mmr(:,:) ! mass mixing ratios
+ real(r8), pointer :: mmr(:,:) ! mass mixing ratios (ncol,nlev)
end subroutine aero_get_state_mmr
+ !------------------------------------------------------------------------
+ ! returns aerosol mass mixing ratio for a given species index, bin index
+ ! and raditaion climate or diagnsotic list number
+ !------------------------------------------------------------------------
+ subroutine aero_get_list_mmr(self, list_ndx, species_ndx, bin_ndx, mmr)
+ import :: aerosol_state, r8
+ class(aerosol_state), intent(in) :: self
+ integer, intent(in) :: list_ndx ! rad climate/diagnostic list index
+ integer, intent(in) :: species_ndx ! species index
+ integer, intent(in) :: bin_ndx ! bin index
+ real(r8), pointer :: mmr(:,:) ! mass mixing ratios (ncol,nlev)
+ end subroutine aero_get_list_mmr
+
!------------------------------------------------------------------------
! returns aerosol number mixing ratio for a given species index and bin index
!------------------------------------------------------------------------
@@ -82,7 +115,7 @@ subroutine aero_get_state_num(self, bin_ndx, num)
import :: aerosol_state, r8
class(aerosol_state), intent(in) :: self
integer, intent(in) :: bin_ndx ! bin index
- real(r8), pointer :: num(:,:) ! number densities
+ real(r8), pointer :: num(:,:) ! number densities (ncol,nlev)
end subroutine aero_get_state_num
!------------------------------------------------------------------------
@@ -167,6 +200,70 @@ subroutine aero_update_bin( self, bin_ndx, col_ndx, lyr_ndx, delmmr_sum, delnum_
end subroutine aero_update_bin
+ !------------------------------------------------------------------------------
+ ! returns the volume-weighted fractions of aerosol subset `bin_ndx` that can act
+ ! as heterogeneous freezing nuclei
+ !------------------------------------------------------------------------------
+ function aero_hetfrz_size_wght(self, bin_ndx, ncol, nlev) result(wght)
+ import :: aerosol_state, r8
+ class(aerosol_state), intent(in) :: self
+ integer, intent(in) :: bin_ndx ! bin number
+ integer, intent(in) :: ncol ! number of columns
+ integer, intent(in) :: nlev ! number of vertical levels
+
+ real(r8) :: wght(ncol,nlev)
+
+ end function aero_hetfrz_size_wght
+
+ !------------------------------------------------------------------------------
+ ! returns hygroscopicity for a given radiation diagnostic list number and
+ ! bin number
+ !------------------------------------------------------------------------------
+ function aero_hygroscopicity(self, list_ndx, bin_ndx) result(kappa)
+ import :: aerosol_state, r8
+ class(aerosol_state), intent(in) :: self
+ integer, intent(in) :: list_ndx ! rad climate/diagnostic list index
+ integer, intent(in) :: bin_ndx ! bin number
+
+ real(r8), pointer :: kappa(:,:) ! hygroscopicity (ncol,nlev)
+
+ end function aero_hygroscopicity
+
+ !------------------------------------------------------------------------------
+ ! returns aerosol wet diameter and aerosol water concentration for a given
+ ! radiation diagnostic list number and bin number
+ !------------------------------------------------------------------------------
+ subroutine aero_water_uptake(self, aero_props, list_idx, bin_idx, ncol, nlev, dgnumwet, qaerwat)
+ import :: aerosol_state, aerosol_properties, r8
+
+ class(aerosol_state), intent(in) :: self
+ class(aerosol_properties), intent(in) :: aero_props
+ integer, intent(in) :: list_idx ! rad climate/diags list number
+ integer, intent(in) :: bin_idx ! bin number
+ integer, intent(in) :: ncol ! number of columns
+ integer, intent(in) :: nlev ! number of levels
+ real(r8),intent(out) :: dgnumwet(ncol,nlev) ! aerosol wet diameter (m)
+ real(r8),intent(out) :: qaerwat(ncol,nlev) ! aerosol water concentration (g/g)
+
+ end subroutine aero_water_uptake
+
+ !------------------------------------------------------------------------------
+ ! aerosol volume interface
+ !------------------------------------------------------------------------------
+ function aero_volume(self, aero_props, list_idx, bin_idx, ncol, nlev) result(vol)
+ import :: aerosol_state, aerosol_properties, r8
+
+ class(aerosol_state), intent(in) :: self
+ class(aerosol_properties), intent(in) :: aero_props
+ integer, intent(in) :: list_idx ! rad climate/diags list number
+ integer, intent(in) :: bin_idx ! bin number
+ integer, intent(in) :: ncol ! number of columns
+ integer, intent(in) :: nlev ! number of levels
+
+ real(r8) :: vol(ncol,nlev) ! m3/kg
+
+ end function aero_volume
+
end interface
contains
@@ -276,10 +373,66 @@ subroutine loadaer( self, aero_props, istart, istop, k, m, cs, phase, &
end subroutine loadaer
+ !------------------------------------------------------------------------------
+ ! returns ambient aerosol number density for a given bin number and species type
+ !------------------------------------------------------------------------------
+ subroutine get_amb_species_numdens(self, bin_ndx, ncol, nlev, species_type, aero_props, rho, numdens)
+ use aerosol_properties_mod, only: aerosol_properties
+ class(aerosol_state), intent(in) :: self
+ integer, intent(in) :: bin_ndx ! bin number
+ integer, intent(in) :: ncol ! number of columns
+ integer, intent(in) :: nlev ! number of vertical levels
+ character(len=*), intent(in) :: species_type ! species type
+ class(aerosol_properties), intent(in) :: aero_props ! aerosol properties object
+ real(r8), intent(in) :: rho(:,:) ! air density (kg m-3)
+ real(r8), intent(out) :: numdens(:,:) ! species number densities (#/cm^3)
+
+ real(r8), pointer :: num(:,:)
+ real(r8) :: type_wght(ncol,nlev)
+ real(r8) :: size_wght(ncol,nlev)
+
+ size_wght = self%hetfrz_size_wght(bin_ndx, ncol, nlev)
+
+ call self%icenuc_type_wght_base(bin_ndx, ncol, nlev, species_type, aero_props, rho, type_wght)
+
+ call self%get_ambient_num(bin_ndx, num)
+
+ numdens(:ncol,:) = num(:ncol,:)*rho(:ncol,:)*type_wght(:ncol,:)*size_wght(:ncol,:)*per_cm3
+
+ end subroutine get_amb_species_numdens
+
+ !------------------------------------------------------------------------------
+ ! returns cloud-borne aerosol number density for a given bin number and species type
+ !------------------------------------------------------------------------------
+ subroutine get_cld_species_numdens(self, bin_ndx, ncol, nlev, species_type, aero_props, rho, numdens)
+ use aerosol_properties_mod, only: aerosol_properties
+ class(aerosol_state), intent(in) :: self
+ integer, intent(in) :: bin_ndx ! bin number
+ integer, intent(in) :: ncol ! number of columns
+ integer, intent(in) :: nlev ! number of vertical levels
+ character(len=*), intent(in) :: species_type ! species type
+ class(aerosol_properties), intent(in) :: aero_props ! aerosol properties object
+ real(r8), intent(in) :: rho(:,:) ! air density (kg m-3)
+ real(r8), intent(out) :: numdens(:,:) ! number densities (#/cm^3)
+
+ real(r8), pointer :: num(:,:)
+ real(r8) :: type_wght(ncol,nlev)
+ real(r8) :: size_wght(ncol,nlev)
+
+ size_wght = self%hetfrz_size_wght(bin_ndx, ncol, nlev)
+
+ call self%icenuc_type_wght_base(bin_ndx, ncol, nlev, species_type, aero_props, rho, type_wght, cloud_borne=.true.)
+
+ call self%get_cldbrne_num(bin_ndx, num)
+
+ numdens(:ncol,:) = num(:ncol,:)*rho(:ncol,:)*type_wght(:ncol,:)*size_wght(:ncol,:)*per_cm3
+
+ end subroutine get_cld_species_numdens
+
!------------------------------------------------------------------------------
! returns aerosol type weights for a given aerosol type and bin
!------------------------------------------------------------------------------
- subroutine icenuc_type_wght_base(self, bin_ndx, ncol, nlev, species_type, aero_props, rho, wght)
+ subroutine icenuc_type_wght_base(self, bin_ndx, ncol, nlev, species_type, aero_props, rho, wght, cloud_borne)
use aerosol_properties_mod, only: aerosol_properties
@@ -289,8 +442,10 @@ subroutine icenuc_type_wght_base(self, bin_ndx, ncol, nlev, species_type, aero_p
integer, intent(in) :: nlev ! number of vertical levels
character(len=*), intent(in) :: species_type ! species type
class(aerosol_properties), intent(in) :: aero_props ! aerosol properties object
- real(r8), intent(in) :: rho(:,:) ! air density (kg m-3)
+ real(r8), intent(in) :: rho(:,:) ! air density (kg m-3)
real(r8), intent(out) :: wght(:,:) ! type weights
+ logical, optional, intent(in) :: cloud_borne ! if TRUE cloud-borne aerosols are used
+ ! otherwise ambient aerosols are used
real(r8) :: mass(ncol,nlev)
real(r8) :: totalmass(ncol,nlev)
@@ -298,6 +453,13 @@ subroutine icenuc_type_wght_base(self, bin_ndx, ncol, nlev, species_type, aero_p
character(len=aero_name_len) :: spectype, sptype
integer :: ispc
+ logical :: cldbrne
+
+ if (present(cloud_borne)) then
+ cldbrne = cloud_borne
+ else
+ cldbrne = .false.
+ end if
wght(:,:) = 0._r8
totalmass(:,:) = 0._r8
@@ -311,7 +473,11 @@ subroutine icenuc_type_wght_base(self, bin_ndx, ncol, nlev, species_type, aero_p
do ispc = 1, aero_props%nspecies(bin_ndx)
- call self%get_ambient_mmr(ispc, bin_ndx, aer_bin)
+ if (cldbrne) then
+ call self%get_cldbrne_mmr(ispc, bin_ndx, aer_bin)
+ else
+ call self%get_ambient_mmr(ispc, bin_ndx, aer_bin)
+ end if
call aero_props%species_type(bin_ndx, ispc, spectype=spectype)
totalmass(:ncol,:) = totalmass(:ncol,:) + aer_bin(:ncol,:)*rho(:ncol,:)
@@ -350,8 +516,6 @@ subroutine nuclice_get_numdens(self, aero_props, use_preexisting_ice, ncol, nlev
real(r8), pointer :: num_col(:,:)
- real(r8), parameter :: per_cm3 = 1.e-6_r8 ! factor for m-3 to cm-3 conversions
-
dust_num_col(:,:) = 0._r8
sulf_num_col(:,:) = 0._r8
soot_num_col(:,:) = 0._r8
@@ -395,4 +559,300 @@ subroutine nuclice_get_numdens(self, aero_props, use_preexisting_ice, ncol, nlev
end subroutine nuclice_get_numdens
+ !------------------------------------------------------------------------------
+ ! returns the fraction of particle surface area of aerosol subset `bin_ndx` covered
+ ! by at least a monolayer of species `species_type` [0-1]
+ !------------------------------------------------------------------------------
+ function coated_frac(self, bin_ndx, species_type, ncol, nlev, aero_props, radius) result(frac)
+
+ class(aerosol_state), intent(in) :: self
+ integer, intent(in) :: bin_ndx ! bin number
+ character(len=*), intent(in) :: species_type ! species type
+ integer, intent(in) :: ncol ! number of columns
+ integer, intent(in) :: nlev ! number of vertical levels
+ class(aerosol_properties), intent(in) :: aero_props ! aerosol properties object
+ real(r8), intent(in) :: radius(:,:) ! m
+
+ real(r8) :: frac(ncol,nlev) ! coated fraction
+
+ !------------coated variables--------------------
+ real(r8), parameter :: n_so4_monolayers_dust = 1.0_r8 ! number of so4(+nh4) monolayers needed to coat a dust particle
+ real(r8), parameter :: dr_so4_monolayers_dust = n_so4_monolayers_dust * 4.76e-10_r8
+ real(r8) :: vol_shell(ncol,nlev)
+ real(r8) :: vol_core(ncol,nlev)
+ real(r8) :: alnsg, fac_volsfc
+ real(r8) :: tmp1(ncol,nlev), tmp2(ncol,nlev)
+ real(r8),pointer :: sulf_mmr(:,:)
+ real(r8),pointer :: soa_mmr(:,:)
+ real(r8),pointer :: pom_mmr(:,:)
+ real(r8),pointer :: aer_mmr(:,:)
+
+ integer :: sulf_ndx
+ integer :: soa_ndx
+ integer :: pom_ndx
+ integer :: species_ndx
+
+ real(r8) :: specdens_so4
+ real(r8) :: specdens_pom
+ real(r8) :: specdens_soa
+ real(r8) :: specdens
+
+ character(len=aero_name_len) :: spectype
+ integer :: ispc
+
+ frac = -huge(1._r8)
+
+ sulf_ndx = -1
+ pom_ndx = -1
+ soa_ndx = -1
+ species_ndx = -1
+
+ do ispc = 1, aero_props%nspecies(bin_ndx)
+ call aero_props%species_type(bin_ndx, ispc, spectype)
+
+ select case ( trim(spectype) )
+ case('sulfate')
+ sulf_ndx = ispc
+ case('p-organic')
+ pom_ndx = ispc
+ case('s-organic')
+ soa_ndx = ispc
+ end select
+ if (spectype==species_type) then
+ species_ndx = ispc
+ end if
+ end do
+
+ vol_shell(:ncol,:) = 0._r8
+
+ if (sulf_ndx>0) then
+ call aero_props%get(bin_ndx, sulf_ndx, density=specdens_so4)
+ call self%get_ambient_mmr(sulf_ndx, bin_ndx, sulf_mmr)
+ vol_shell(:ncol,:) = vol_shell(:ncol,:) + sulf_mmr(:ncol,:)/specdens_so4
+ end if
+ if (pom_ndx>0) then
+ call aero_props%get(bin_ndx, pom_ndx, density=specdens_pom)
+ call self%get_ambient_mmr(pom_ndx, bin_ndx, pom_mmr)
+ vol_shell(:ncol,:) = vol_shell(:ncol,:) + pom_mmr(:ncol,:)*aero_props%pom_equivso4_factor()/specdens_pom
+ end if
+ if (soa_ndx>0) then
+ call aero_props%get(bin_ndx, soa_ndx, density=specdens_soa)
+ call self%get_ambient_mmr(soa_ndx, bin_ndx, soa_mmr)
+ vol_shell(:ncol,:) = vol_shell(:ncol,:) + soa_mmr(:ncol,:)*aero_props%soa_equivso4_factor()/specdens_soa
+ end if
+
+ call aero_props%get(bin_ndx, species_ndx, density=specdens)
+ call self%get_ambient_mmr(species_ndx, bin_ndx, aer_mmr)
+ vol_core(:ncol,:) = aer_mmr(:ncol,:)/specdens
+
+ alnsg = aero_props%alogsig(bin_ndx)
+ fac_volsfc = exp(2.5_r8*alnsg**2)
+
+ tmp1(:ncol,:) = vol_shell(:ncol,:)*(radius(:ncol,:)*2._r8)*fac_volsfc
+ tmp2(:ncol,:) = max(6.0_r8*dr_so4_monolayers_dust*vol_core(:ncol,:), 0.0_r8)
+
+ where(tmp1(:ncol,:)>0._r8 .and. tmp2(:ncol,:)>0._r8)
+ frac(:ncol,:) = tmp1(:ncol,:)/tmp2(:ncol,:)
+ elsewhere
+ frac(:ncol,:) = 0.001_r8
+ end where
+
+ where(frac(:ncol,:)>1._r8)
+ frac(:ncol,:) = 1._r8
+ end where
+ where(frac(:ncol,:) < 0.001_r8)
+ frac(:ncol,:) = 0.001_r8
+ end where
+
+ end function coated_frac
+
+ !------------------------------------------------------------------------------
+ ! returns the radius [m] of particles in aerosol subset `bin_ndx` assuming all particles are
+ ! the same size and only species `species_ndx` contributes to the particle volume
+ !------------------------------------------------------------------------------
+ function mass_mean_radius(self, bin_ndx, species_ndx, ncol, nlev, aero_props, rho) result(radius)
+
+ class(aerosol_state), intent(in) :: self
+ integer, intent(in) :: bin_ndx ! bin number
+ integer, intent(in) :: species_ndx ! species number
+ integer, intent(in) :: ncol ! number of columns
+ integer, intent(in) :: nlev ! number of vertical levels
+ class(aerosol_properties), intent(in) :: aero_props ! aerosol properties object
+ real(r8), intent(in) :: rho(:,:) ! air density (kg m-3)
+
+ real(r8) :: radius(ncol,nlev) ! m
+
+ character(len=aero_name_len) :: species_type
+ real(r8) :: aer_numdens(ncol,nlev) ! kg/m3
+ real(r8) :: aer_massdens(ncol,nlev) ! kg/m3
+ real(r8),pointer :: aer_mmr(:,:) ! kg/kg
+
+ real(r8) :: specdens,minrad
+ real(r8) :: wght(ncol,nlev)
+ integer :: i,k
+
+ wght = self%hetfrz_size_wght(bin_ndx, ncol, nlev)
+
+ call aero_props%species_type(bin_ndx, species_ndx, spectype=species_type)
+
+ call aero_props%get(bin_ndx, species_ndx, density=specdens) ! kg/m3
+ call self%get_ambient_mmr(species_ndx, bin_ndx, aer_mmr) ! kg/kg
+ call self%get_amb_species_numdens(bin_ndx, ncol, nlev, species_type, aero_props, rho, aer_numdens) ! #/cm3
+
+ aer_massdens(:ncol,:) = aer_mmr(:ncol,:)*rho(:ncol,:)*wght(:ncol,:) ! kg/m3
+
+ minrad = aero_props%min_mass_mean_rad(bin_ndx, species_ndx)
+
+ do k = 1,nlev
+ do i = 1,ncol
+ if (aer_massdens(i,k)*1.0e-3_r8 > 1.0e-30_r8 .and. aer_numdens(i,k) > 1.0e-3_r8) then
+ radius(i,k) = (3._r8/(4*pi*specdens)*aer_massdens(i,k)/(aer_numdens(i,k)*per_m3))**(1._r8/3._r8) ! m
+ else
+ radius(i,k) = minrad
+ end if
+ end do
+ end do
+
+ end function mass_mean_radius
+
+ !------------------------------------------------------------------------------
+ ! calculates water activity mass factor -- density*(1.-(OC+BC)/(OC+BC+SO4)) [mug m-3]
+ ! of species `species_type` in subset `bin_ndx`
+ !------------------------------------------------------------------------------
+ subroutine watact_mfactor(self, bin_ndx, species_type, ncol, nlev, aero_props, rho, wact_factor)
+
+ class(aerosol_state), intent(in) :: self
+ integer, intent(in) :: bin_ndx ! bin number
+ character(len=*), intent(in) :: species_type ! species type
+ integer, intent(in) :: ncol ! number of columns
+ integer, intent(in) :: nlev ! number of vertical levels
+ class(aerosol_properties), intent(in) :: aero_props ! aerosol properties object
+ real(r8), intent(in) :: rho(:,:) ! air density (kg m-3)
+ real(r8), intent(out) :: wact_factor(:,:) ! water activity factor -- density*(1.-(OC+BC)/(OC+BC+SO4)) [mug m-3]
+
+ real(r8), pointer :: aer_mmr(:,:)
+ real(r8), pointer :: bin_num(:,:)
+ real(r8) :: tot2_mmr(ncol,nlev)
+ real(r8) :: tot1_mmr(ncol,nlev)
+ real(r8) :: aer_numdens(ncol,nlev)
+ integer :: ispc
+ character(len=aero_name_len) :: spectype
+
+ real(r8) :: awcam(ncol,nlev) ! mass density [mug m-3]
+ real(r8) :: awfacm(ncol,nlev) ! mass factor ! (OC+BC)/(OC+BC+SO4)
+
+ tot2_mmr = 0.0_r8
+ tot1_mmr = 0.0_r8
+
+ if (aero_props%soluble(bin_ndx)) then
+
+ do ispc = 1, aero_props%nspecies(bin_ndx)
+
+ call aero_props%species_type(bin_ndx, ispc, spectype)
+
+ if (trim(spectype)=='black-c' .or. trim(spectype)=='p-organic' .or. trim(spectype)=='s-organic') then
+ call self%get_ambient_mmr(ispc, bin_ndx, aer_mmr)
+ tot2_mmr(:ncol,:) = tot2_mmr(:ncol,:) + aer_mmr(:ncol,:)
+ end if
+ if (trim(spectype)=='sulfate') then
+ call self%get_ambient_mmr(ispc, bin_ndx, aer_mmr)
+ tot1_mmr(:ncol,:) = tot1_mmr(:ncol,:) + aer_mmr(:ncol,:)
+ end if
+ end do
+
+ end if
+
+ tot1_mmr(:ncol,:) = tot1_mmr(:ncol,:) + tot2_mmr(:ncol,:)
+
+ call self%get_amb_species_numdens(bin_ndx, ncol, nlev, species_type, aero_props, rho, aer_numdens) ! #/cm3
+ call self%get_ambient_num(bin_ndx, bin_num) ! #/kg
+
+ where(bin_num(:ncol,:)>0._r8)
+ awcam(:ncol,:) = ((aer_numdens(:ncol,:)*per_m3/bin_num(:ncol,:)) * tot1_mmr(:ncol,:)) * kg2mug ! [mug m-3]
+ elsewhere
+ awcam(:ncol,:) = 0._r8
+ end where
+
+ where(tot1_mmr(:ncol,:)>0)
+ awfacm(:ncol,:) = tot2_mmr(:ncol,:) / tot1_mmr(:ncol,:)
+ elsewhere
+ awfacm(:ncol,:) = 0._r8
+ end where
+
+ wact_factor(:ncol,:) = awcam(:ncol,:)*(1._r8-awfacm(:ncol,:))
+
+ end subroutine watact_mfactor
+
+ !------------------------------------------------------------------------------
+ ! aerosol short wave refactive index
+ !------------------------------------------------------------------------------
+ function refractive_index_sw(self, ncol, ilev, ilist, ibin, iwav, aero_props) result(crefin)
+
+ class(aerosol_state), intent(in) :: self
+ integer, intent(in) :: ncol ! number of columes
+ integer, intent(in) :: ilev ! level index
+ integer, intent(in) :: ilist ! radiation diagnostics list index
+ integer, intent(in) :: ibin ! bin index
+ integer, intent(in) :: iwav ! wave length index
+ class(aerosol_properties), intent(in) :: aero_props ! aerosol properties object
+
+ complex(r8) :: crefin(ncol) ! complex refractive index
+
+ real(r8), pointer :: specmmr(:,:) ! species mass mixing ratio
+ complex(r8), pointer :: specrefindex(:) ! species refractive index
+ real(r8) :: specdens ! species density (kg/m3)
+ integer :: ispec, icol
+ real(r8) :: vol(ncol)
+
+ crefin(:ncol) = (0._r8, 0._r8)
+
+ do ispec = 1, aero_props%nspecies(ilist,ibin)
+
+ call self%get_ambient_mmr(ilist,ispec,ibin,specmmr)
+ call aero_props%get(ibin, ispec, list_ndx=ilist, density=specdens, refindex_sw=specrefindex)
+
+ do icol = 1, ncol
+ vol(icol) = specmmr(icol,ilev)/specdens
+ crefin(icol) = crefin(icol) + vol(icol)*specrefindex(iwav)
+ end do
+ end do
+
+ end function refractive_index_sw
+
+ !------------------------------------------------------------------------------
+ ! aerosol long wave refactive index
+ !------------------------------------------------------------------------------
+ function refractive_index_lw(self, ncol, ilev, ilist, ibin, iwav, aero_props) result(crefin)
+
+ class(aerosol_state), intent(in) :: self
+ integer, intent(in) :: ncol ! number of columes
+ integer, intent(in) :: ilev ! level index
+ integer, intent(in) :: ilist ! radiation diagnostics list index
+ integer, intent(in) :: ibin ! bin index
+ integer, intent(in) :: iwav ! wave length index
+ class(aerosol_properties), intent(in) :: aero_props ! aerosol properties object
+
+ complex(r8) :: crefin(ncol) ! complex refractive index
+
+ real(r8), pointer :: specmmr(:,:) ! species mass mixing ratio
+ complex(r8), pointer :: specrefindex(:) ! species refractive index
+ real(r8) :: specdens ! species density (kg/m3)
+ integer :: ispec, icol
+ real(r8) :: vol(ncol)
+
+ crefin(:ncol) = (0._r8, 0._r8)
+
+ do ispec = 1, aero_props%nspecies(ilist,ibin)
+
+ call self%get_ambient_mmr(ilist,ispec,ibin,specmmr)
+ call aero_props%get(ibin, ispec, list_ndx=ilist, density=specdens, refindex_lw=specrefindex)
+
+ do icol = 1, ncol
+ vol(icol) = specmmr(icol,ilev)/specdens
+ crefin(icol) = crefin(icol) + vol(icol)*specrefindex(iwav)
+ end do
+ end do
+
+ end function refractive_index_lw
+
end module aerosol_state_mod
diff --git a/src/chemistry/aerosol/modal_aerosol_properties_mod.F90 b/src/chemistry/aerosol/modal_aerosol_properties_mod.F90
index 19f7d0fcb9..66cee40480 100644
--- a/src/chemistry/aerosol/modal_aerosol_properties_mod.F90
+++ b/src/chemistry/aerosol/modal_aerosol_properties_mod.F90
@@ -28,6 +28,15 @@ module modal_aerosol_properties_mod
procedure :: icenuc_updates_num
procedure :: icenuc_updates_mmr
procedure :: apply_number_limits
+ procedure :: hetfrz_species
+ procedure :: optics_params
+ procedure :: nbins_rlist
+ procedure :: nspecies_per_bin_rlist
+ procedure :: alogsig_rlist
+ procedure :: soluble
+ procedure :: min_mass_mean_rad
+ procedure :: bin_name
+
final :: destructor
end type modal_aerosol_properties
@@ -172,19 +181,168 @@ end function number_transported
! returns aerosol properties:
! density
! hygroscopicity
+ ! species type
+ ! short wave species refractive indices
+ ! long wave species refractive indices
+ ! species morphology
!------------------------------------------------------------------------
- subroutine get(self, bin_ndx, species_ndx, density,hygro)
+ subroutine get(self, bin_ndx, species_ndx, list_ndx, density, hygro, &
+ spectype, specmorph, refindex_sw, refindex_lw)
class(modal_aerosol_properties), intent(in) :: self
integer, intent(in) :: bin_ndx ! bin index
integer, intent(in) :: species_ndx ! species index
+ integer, optional, intent(in) :: list_ndx ! climate or a diagnostic list number
real(r8), optional, intent(out) :: density ! density (kg/m3)
real(r8), optional, intent(out) :: hygro ! hygroscopicity
+ character(len=*), optional, intent(out) :: spectype ! species type
+ character(len=*), optional, intent(out) :: specmorph ! species morphology
+ complex(r8), pointer, optional, intent(out) :: refindex_sw(:) ! short wave species refractive indices
+ complex(r8), pointer, optional, intent(out) :: refindex_lw(:) ! long wave species refractive indices
+
+ integer :: ilist
+
+ if (present(list_ndx)) then
+ ilist = list_ndx
+ else
+ ilist = 0
+ end if
- call rad_cnst_get_aer_props(0, bin_ndx, species_ndx, density_aer=density, hygro_aer=hygro)
+ call rad_cnst_get_aer_props(ilist, bin_ndx, species_ndx, &
+ density_aer=density, hygro_aer=hygro, spectype=spectype, &
+ refindex_aer_sw=refindex_sw, refindex_aer_lw=refindex_lw)
+
+ if (present(specmorph)) then
+ specmorph = 'UNKNOWN'
+ end if
end subroutine get
+ !------------------------------------------------------------------------
+ ! returns optics type and table parameters
+ !------------------------------------------------------------------------
+ subroutine optics_params(self, list_ndx, bin_ndx, opticstype, extpsw, abspsw, asmpsw, absplw, &
+ refrtabsw, refitabsw, refrtablw, refitablw, ncoef, prefr, prefi, sw_hygro_ext_wtp, &
+ sw_hygro_ssa_wtp, sw_hygro_asm_wtp, lw_hygro_ext_wtp, wgtpct, nwtp, &
+ sw_hygro_coreshell_ext, sw_hygro_coreshell_ssa, sw_hygro_coreshell_asm, lw_hygro_coreshell_ext, &
+ corefrac, bcdust, kap, relh, nfrac, nbcdust, nkap, nrelh )
+
+ class(modal_aerosol_properties), intent(in) :: self
+ integer, intent(in) :: bin_ndx ! bin index
+ integer, intent(in) :: list_ndx ! rad climate/diags list
+
+ character(len=*), optional, intent(out) :: opticstype
+
+ ! refactive index table parameters
+ real(r8), optional, pointer :: extpsw(:,:,:,:) ! short wave specific extinction
+ real(r8), optional, pointer :: abspsw(:,:,:,:) ! short wave specific absorption
+ real(r8), optional, pointer :: asmpsw(:,:,:,:) ! short wave asymmetry factor
+ real(r8), optional, pointer :: absplw(:,:,:,:) ! long wave specific absorption
+ real(r8), optional, pointer :: refrtabsw(:,:) ! table of short wave real refractive indices for aerosols
+ real(r8), optional, pointer :: refitabsw(:,:) ! table of short wave imaginary refractive indices for aerosols
+ real(r8), optional, pointer :: refrtablw(:,:) ! table of long wave real refractive indices for aerosols
+ real(r8), optional, pointer :: refitablw(:,:) ! table of long wave imaginary refractive indices for aerosols
+ integer, optional, intent(out) :: ncoef ! number of chebychev polynomials
+ integer, optional, intent(out) :: prefr ! number of real refractive indices in table
+ integer, optional, intent(out) :: prefi ! number of imaginary refractive indices in table
+
+ ! hygrowghtpct table parameters
+ real(r8), optional, pointer :: sw_hygro_ext_wtp(:,:) ! short wave extinction table
+ real(r8), optional, pointer :: sw_hygro_ssa_wtp(:,:) ! short wave single-scatter albedo table
+ real(r8), optional, pointer :: sw_hygro_asm_wtp(:,:) ! short wave asymmetry table
+ real(r8), optional, pointer :: lw_hygro_ext_wtp(:,:) ! long wave absorption table
+ real(r8), optional, pointer :: wgtpct(:) ! weight precent of H2SO4/H2O solution
+ integer, optional, intent(out) :: nwtp ! number of weight precent values
+
+ ! hygrocoreshell table parameters
+ real(r8), optional, pointer :: sw_hygro_coreshell_ext(:,:,:,:,:) ! short wave extinction table
+ real(r8), optional, pointer :: sw_hygro_coreshell_ssa(:,:,:,:,:) ! short wave single-scatter albedo table
+ real(r8), optional, pointer :: sw_hygro_coreshell_asm(:,:,:,:,:) ! short wave asymmetry table
+ real(r8), optional, pointer :: lw_hygro_coreshell_ext(:,:,:,:,:) ! long wave absorption table
+ real(r8), optional, pointer :: corefrac(:) ! core fraction dimension values
+ real(r8), optional, pointer :: bcdust(:) ! bc/(bc + dust) fraction dimension values
+ real(r8), optional, pointer :: kap(:) ! hygroscopicity dimension values
+ real(r8), optional, pointer :: relh(:) ! relative humidity dimension values
+ integer, optional, intent(out) :: nfrac ! core fraction dimension size
+ integer, optional, intent(out) :: nbcdust ! bc/(bc + dust) fraction dimension size
+ integer, optional, intent(out) :: nkap ! hygroscopicity dimension size
+ integer, optional, intent(out) :: nrelh ! relative humidity dimension size
+
+ ! refactive index table parameters
+ call rad_cnst_get_mode_props(list_ndx, bin_ndx, &
+ opticstype=opticstype, &
+ extpsw=extpsw, &
+ abspsw=abspsw, &
+ asmpsw=asmpsw, &
+ absplw=absplw, &
+ refrtabsw=refrtabsw, &
+ refitabsw=refitabsw, &
+ refrtablw=refrtablw, &
+ refitablw=refitablw, &
+ ncoef=ncoef, &
+ prefr=prefr, &
+ prefi=prefi)
+
+ ! hygrowghtpct table parameters
+ if (present(sw_hygro_ext_wtp)) then
+ nullify(sw_hygro_ext_wtp)
+ end if
+ if (present(sw_hygro_ssa_wtp)) then
+ nullify(sw_hygro_ssa_wtp)
+ end if
+ if (present(sw_hygro_asm_wtp)) then
+ nullify(sw_hygro_asm_wtp)
+ end if
+ if (present(lw_hygro_ext_wtp)) then
+ nullify(lw_hygro_ext_wtp)
+ end if
+ if (present(wgtpct)) then
+ nullify(wgtpct)
+ end if
+ if (present(nwtp)) then
+ nwtp = -1
+ end if
+
+ ! hygrocoreshell table parameters
+ if (present(sw_hygro_coreshell_ext)) then
+ nullify(sw_hygro_coreshell_ext)
+ end if
+ if (present(sw_hygro_coreshell_ssa)) then
+ nullify(sw_hygro_coreshell_ssa)
+ end if
+ if (present(sw_hygro_coreshell_asm)) then
+ nullify(sw_hygro_coreshell_asm)
+ end if
+ if (present(lw_hygro_coreshell_ext)) then
+ nullify(lw_hygro_coreshell_ext)
+ end if
+ if (present(corefrac)) then
+ nullify(corefrac)
+ end if
+ if (present(bcdust)) then
+ nullify(bcdust)
+ end if
+ if (present(kap)) then
+ nullify(kap)
+ end if
+ if (present(relh)) then
+ nullify(relh)
+ end if
+ if (present(nfrac)) then
+ nfrac = -1
+ end if
+ if (present(nbcdust)) then
+ nbcdust = -1
+ end if
+ if (present(nkap)) then
+ nkap = -1
+ end if
+ if (present(nrelh)) then
+ nrelh = -1
+ end if
+
+ end subroutine optics_params
+
!------------------------------------------------------------------------------
! returns radius^3 (m3) of a given bin number
!------------------------------------------------------------------------------
@@ -364,4 +522,147 @@ subroutine apply_number_limits( self, naerosol, vaerosol, istart, istop, m )
end subroutine apply_number_limits
+ !------------------------------------------------------------------------------
+ ! returns TRUE if species `spc_ndx` in aerosol subset `bin_ndx` contributes to
+ ! the particles' ability to act as heterogeneous freezing nuclei
+ !------------------------------------------------------------------------------
+ function hetfrz_species(self, bin_ndx, spc_ndx) result(res)
+ class(modal_aerosol_properties), intent(in) :: self
+ integer, intent(in) :: bin_ndx ! bin number
+ integer, intent(in) :: spc_ndx ! species number
+
+ logical :: res
+
+ character(len=aero_name_len) :: mode_name, species_type
+
+ res = .false.
+
+ call rad_cnst_get_info(0, bin_ndx, mode_type=mode_name)
+
+ if ((trim(mode_name)/='aitken')) then
+
+ call self%species_type(bin_ndx, spc_ndx, species_type)
+
+ if ((trim(species_type)=='black-c').or.(trim(species_type)=='dust')) then
+
+ res = .true.
+
+ end if
+
+ end if
+
+ end function hetfrz_species
+
+ !------------------------------------------------------------------------------
+ ! returns TRUE if soluble
+ !------------------------------------------------------------------------------
+ logical function soluble(self,bin_ndx)
+ class(modal_aerosol_properties), intent(in) :: self
+ integer, intent(in) :: bin_ndx ! bin number
+
+ character(len=aero_name_len) :: mode_name
+
+ call rad_cnst_get_info(0, bin_ndx, mode_type=mode_name)
+
+ soluble = trim(mode_name)/='primary_carbon'
+
+ end function soluble
+
+ !------------------------------------------------------------------------------
+ ! returns minimum mass mean radius (meters)
+ !------------------------------------------------------------------------------
+ function min_mass_mean_rad(self,bin_ndx,species_ndx) result(minrad)
+ class(modal_aerosol_properties), intent(in) :: self
+ integer, intent(in) :: bin_ndx ! bin number
+ integer, intent(in) :: species_ndx ! species number
+
+ real(r8) :: minrad ! meters
+
+ integer :: nmodes
+ character(len=aero_name_len) :: species_type, mode_type
+
+ call self%species_type(bin_ndx, species_ndx, spectype=species_type)
+ select case ( trim(species_type) )
+ case('dust')
+ call rad_cnst_get_info(0, bin_ndx, mode_type=mode_type)
+ select case ( trim(mode_type) )
+ case ('accum','fine_dust')
+ minrad = 0.258e-6_r8
+ case ('coarse','coarse_dust')
+ minrad = 1.576e-6_r8
+ case default
+ minrad = -huge(1._r8)
+ end select
+ case('black-c')
+ call rad_cnst_get_info(0, nmodes=nmodes)
+ if (nmodes==3) then
+ minrad = 0.04e-6_r8
+ else
+ minrad = 0.067e-6_r8 ! from emission size
+ endif
+ case default
+ minrad = -huge(1._r8)
+ end select
+
+ end function min_mass_mean_rad
+
+ !------------------------------------------------------------------------------
+ ! returns the total number of bins for a given radiation list index
+ !------------------------------------------------------------------------------
+ function nbins_rlist(self, list_ndx) result(res)
+ class(modal_aerosol_properties), intent(in) :: self
+ integer, intent(in) :: list_ndx ! radiation list number
+
+ integer :: res
+
+ call rad_cnst_get_info(list_ndx, nmodes=res)
+
+ end function nbins_rlist
+
+ !------------------------------------------------------------------------------
+ ! returns number of species in a bin for a given radiation list index
+ !------------------------------------------------------------------------------
+ function nspecies_per_bin_rlist(self, list_ndx, bin_ndx) result(res)
+ class(modal_aerosol_properties), intent(in) :: self
+ integer, intent(in) :: list_ndx ! radiation list number
+ integer, intent(in) :: bin_ndx ! bin number
+
+ integer :: res
+
+ call rad_cnst_get_info(list_ndx, bin_ndx, nspec=res)
+
+ end function nspecies_per_bin_rlist
+
+ !------------------------------------------------------------------------------
+ ! returns the natural log of geometric standard deviation of the number
+ ! distribution for radiation list number and aerosol bin
+ !------------------------------------------------------------------------------
+ function alogsig_rlist(self, list_ndx, bin_ndx) result(res)
+ class(modal_aerosol_properties), intent(in) :: self
+ integer, intent(in) :: list_ndx ! radiation list number
+ integer, intent(in) :: bin_ndx ! bin number
+
+ real(r8) :: res
+
+ real(r8) :: sig
+
+ call rad_cnst_get_mode_props(list_ndx, bin_ndx, sigmag=sig)
+ res = log(sig)
+
+ end function alogsig_rlist
+
+ !------------------------------------------------------------------------------
+ ! returns name for a given radiation list number and aerosol bin
+ !------------------------------------------------------------------------------
+ function bin_name(self, list_ndx, bin_ndx) result(name)
+ class(modal_aerosol_properties), intent(in) :: self
+ integer, intent(in) :: list_ndx ! radiation list number
+ integer, intent(in) :: bin_ndx ! bin number
+
+ character(len=32) name
+
+ call rad_cnst_get_info(list_ndx, bin_ndx, mode_type=name)
+
+ end function bin_name
+
end module modal_aerosol_properties_mod
diff --git a/src/chemistry/aerosol/modal_aerosol_state_mod.F90 b/src/chemistry/aerosol/modal_aerosol_state_mod.F90
index d113eb1af9..8f50e5b7e9 100644
--- a/src/chemistry/aerosol/modal_aerosol_state_mod.F90
+++ b/src/chemistry/aerosol/modal_aerosol_state_mod.F90
@@ -7,6 +7,7 @@ module modal_aerosol_state_mod
use physics_buffer, only: physics_buffer_desc, pbuf_get_field, pbuf_get_index
use physics_types, only: physics_state
use aerosol_properties_mod, only: aerosol_properties, aero_name_len
+ use physconst, only: rhoh2o
implicit none
@@ -23,7 +24,8 @@ module modal_aerosol_state_mod
procedure :: get_transported
procedure :: set_transported
procedure :: ambient_total_bin_mmr
- procedure :: get_ambient_mmr
+ procedure :: get_ambient_mmr_0list
+ procedure :: get_ambient_mmr_rlist
procedure :: get_cldbrne_mmr
procedure :: get_ambient_num
procedure :: get_cldbrne_num
@@ -32,6 +34,12 @@ module modal_aerosol_state_mod
procedure :: icenuc_size_wght_val
procedure :: icenuc_type_wght
procedure :: update_bin
+ procedure :: hetfrz_size_wght
+ procedure :: hygroscopicity
+ procedure :: water_uptake
+ procedure :: dry_volume
+ procedure :: wet_volume
+ procedure :: water_volume
final :: destructor
@@ -41,6 +49,8 @@ module modal_aerosol_state_mod
procedure :: constructor
end interface modal_aerosol_state
+ real(r8), parameter :: rh2odens = 1._r8/rhoh2o
+
contains
!------------------------------------------------------------------------------
@@ -122,14 +132,28 @@ end function ambient_total_bin_mmr
!------------------------------------------------------------------------------
! returns ambient aerosol mass mixing ratio for a given species index and bin index
!------------------------------------------------------------------------------
- subroutine get_ambient_mmr(self, species_ndx, bin_ndx, mmr)
+ subroutine get_ambient_mmr_0list(self, species_ndx, bin_ndx, mmr)
class(modal_aerosol_state), intent(in) :: self
integer, intent(in) :: species_ndx ! species index
integer, intent(in) :: bin_ndx ! bin index
- real(r8), pointer :: mmr(:,:) ! mass mixing ratios
+ real(r8), pointer :: mmr(:,:) ! mass mixing ratios (ncol,nlev)
call rad_cnst_get_aer_mmr(0, bin_ndx, species_ndx, 'a', self%state, self%pbuf, mmr)
- end subroutine get_ambient_mmr
+ end subroutine get_ambient_mmr_0list
+
+ !------------------------------------------------------------------------------
+ ! returns ambient aerosol mass mixing ratio for a given radiation diagnostics
+ ! list index, species index and bin index
+ !------------------------------------------------------------------------------
+ subroutine get_ambient_mmr_rlist(self, list_ndx, species_ndx, bin_ndx, mmr)
+ class(modal_aerosol_state), intent(in) :: self
+ integer, intent(in) :: list_ndx ! rad climate list index
+ integer, intent(in) :: species_ndx ! species index
+ integer, intent(in) :: bin_ndx ! bin index
+ real(r8), pointer :: mmr(:,:) ! mass mixing ratios (ncol,nlev)
+
+ call rad_cnst_get_aer_mmr(list_ndx, bin_ndx, species_ndx, 'a', self%state, self%pbuf, mmr)
+ end subroutine get_ambient_mmr_rlist
!------------------------------------------------------------------------------
! returns cloud-borne aerosol number mixing ratio for a given species index and bin index
@@ -138,7 +162,7 @@ subroutine get_cldbrne_mmr(self, species_ndx, bin_ndx, mmr)
class(modal_aerosol_state), intent(in) :: self
integer, intent(in) :: species_ndx ! species index
integer, intent(in) :: bin_ndx ! bin index
- real(r8), pointer :: mmr(:,:) ! mass mixing ratios
+ real(r8), pointer :: mmr(:,:) ! mass mixing ratios (ncol,nlev)
call rad_cnst_get_aer_mmr(0, bin_ndx, species_ndx, 'c', self%state, self%pbuf, mmr)
end subroutine get_cldbrne_mmr
@@ -303,7 +327,7 @@ end subroutine icenuc_size_wght_val
!------------------------------------------------------------------------------
! returns aerosol type weights for a given aerosol type and bin
!------------------------------------------------------------------------------
- subroutine icenuc_type_wght(self, bin_ndx, ncol, nlev, species_type, aero_props, rho, wght)
+ subroutine icenuc_type_wght(self, bin_ndx, ncol, nlev, species_type, aero_props, rho, wght, cloud_borne)
use aerosol_properties_mod, only: aerosol_properties
@@ -313,8 +337,10 @@ subroutine icenuc_type_wght(self, bin_ndx, ncol, nlev, species_type, aero_props,
integer, intent(in) :: nlev ! number of vertical levels
character(len=*), intent(in) :: species_type ! species type
class(aerosol_properties), intent(in) :: aero_props ! aerosol properties object
- real(r8), intent(in) :: rho(:,:) ! air density (kg m-3)
- real(r8), intent(out) :: wght(:,:) ! type weights
+ real(r8), intent(in) :: rho(:,:) ! air density (kg m-3)
+ real(r8), intent(out) :: wght(:,:) ! type weights
+ logical, optional, intent(in) :: cloud_borne ! if TRUE cloud-borne aerosols are used
+ ! otherwise ambient aerosols are used
character(len=aero_name_len) :: modetype
@@ -326,13 +352,13 @@ subroutine icenuc_type_wght(self, bin_ndx, ncol, nlev, species_type, aero_props,
if (modetype=='coarse_dust') then
wght(:ncol,:) = 1._r8
else
- call self%icenuc_type_wght_base(bin_ndx, ncol, nlev, species_type, aero_props, rho, wght)
+ call self%icenuc_type_wght_base(bin_ndx, ncol, nlev, species_type, aero_props, rho, wght, cloud_borne)
end if
else if (species_type == 'sulfate_strat') then
if (modetype=='accum') then
wght(:ncol,:) = 1._r8
elseif ( modetype=='coarse' .or. modetype=='coarse_strat') then
- call self%icenuc_type_wght_base(bin_ndx, ncol, nlev, species_type, aero_props, rho, wght)
+ call self%icenuc_type_wght_base(bin_ndx, ncol, nlev, species_type, aero_props, rho, wght, cloud_borne)
endif
else
wght(:ncol,:) = 1._r8
@@ -372,4 +398,201 @@ subroutine update_bin( self, bin_ndx, col_ndx, lyr_ndx, delmmr_sum, delnum_sum,
end subroutine update_bin
+ !------------------------------------------------------------------------------
+ ! returns the volume-weighted fractions of aerosol subset `bin_ndx` that can act
+ ! as heterogeneous freezing nuclei
+ !------------------------------------------------------------------------------
+ function hetfrz_size_wght(self, bin_ndx, ncol, nlev) result(wght)
+ class(modal_aerosol_state), intent(in) :: self
+ integer, intent(in) :: bin_ndx ! bin number
+ integer, intent(in) :: ncol ! number of columns
+ integer, intent(in) :: nlev ! number of vertical levels
+
+ real(r8) :: wght(ncol,nlev)
+
+ character(len=aero_name_len) :: modetype
+
+ wght(:,:) = 1._r8
+
+ call rad_cnst_get_info(0, bin_ndx, mode_type=modetype)
+
+ if (trim(modetype) == 'aitken') then
+ wght(:,:) = 0._r8
+ end if
+
+ end function hetfrz_size_wght
+
+ !------------------------------------------------------------------------------
+ ! returns hygroscopicity for a given radiation diagnostic list number and
+ ! bin number
+ !------------------------------------------------------------------------------
+ function hygroscopicity(self, list_ndx, bin_ndx) result(kappa)
+ class(modal_aerosol_state), intent(in) :: self
+ integer, intent(in) :: list_ndx ! rad climate list number
+ integer, intent(in) :: bin_ndx ! bin number
+
+ real(r8), pointer :: kappa(:,:) ! hygroscopicity (ncol,nlev)
+
+ nullify(kappa)
+
+ end function hygroscopicity
+
+ !------------------------------------------------------------------------------
+ ! returns aerosol wet diameter and aerosol water concentration for a given
+ ! radiation diagnostic list number and bin number
+ !------------------------------------------------------------------------------
+ subroutine water_uptake(self, aero_props, list_idx, bin_idx, ncol, nlev, dgnumwet, qaerwat)
+ use modal_aero_wateruptake, only: modal_aero_wateruptake_dr
+ use modal_aero_calcsize, only: modal_aero_calcsize_diag
+
+ class(modal_aerosol_state), intent(in) :: self
+ class(aerosol_properties), intent(in) :: aero_props
+ integer, intent(in) :: list_idx ! rad climate/diags list number
+ integer, intent(in) :: bin_idx ! bin number
+ integer, intent(in) :: ncol ! number of columns
+ integer, intent(in) :: nlev ! number of levels
+ real(r8),intent(out) :: dgnumwet(ncol,nlev) ! aerosol wet diameter (m)
+ real(r8),intent(out) :: qaerwat(ncol,nlev) ! aerosol water concentration (g/g)
+
+ integer :: istat, nmodes
+ real(r8), pointer :: dgnumdry_m(:,:,:) ! number mode dry diameter for all modes
+ real(r8), pointer :: dgnumwet_m(:,:,:) ! number mode wet diameter for all modes
+ real(r8), pointer :: qaerwat_m(:,:,:) ! aerosol water (g/g) for all modes
+ real(r8), pointer :: wetdens_m(:,:,:) !
+ real(r8), pointer :: hygro_m(:,:,:) !
+ real(r8), pointer :: dryvol_m(:,:,:) !
+ real(r8), pointer :: dryrad_m(:,:,:) !
+ real(r8), pointer :: drymass_m(:,:,:) !
+ real(r8), pointer :: so4dryvol_m(:,:,:) !
+ real(r8), pointer :: naer_m(:,:,:) !
+
+ nmodes = aero_props%nbins()
+
+ if (list_idx == 0) then
+ ! water uptake and wet radius for the climate list has already been calculated
+ call pbuf_get_field(self%pbuf, pbuf_get_index('DGNUMWET'), dgnumwet_m)
+ call pbuf_get_field(self%pbuf, pbuf_get_index('QAERWAT'), qaerwat_m)
+
+ dgnumwet(:ncol,:nlev) = dgnumwet_m(:ncol,:nlev,bin_idx)
+ qaerwat (:ncol,:nlev) = qaerwat_m(:ncol,:nlev,bin_idx)
+
+ else
+ ! If doing a diagnostic calculation then need to calculate the wet radius
+ ! and water uptake for the diagnostic modes
+ allocate(dgnumdry_m(ncol,nlev,nmodes), dgnumwet_m(ncol,nlev,nmodes), &
+ qaerwat_m(ncol,nlev,nmodes), wetdens_m(ncol,nlev,nmodes), &
+ hygro_m(ncol,nlev,nmodes), dryvol_m(ncol,nlev,nmodes), &
+ dryrad_m(ncol,nlev,nmodes), drymass_m(ncol,nlev,nmodes), &
+ so4dryvol_m(ncol,nlev,nmodes), naer_m(ncol,nlev,nmodes), stat=istat)
+ if (istat > 0) then
+ dgnumwet = -huge(1._r8)
+ qaerwat = -huge(1._r8)
+ return
+ end if
+ call modal_aero_calcsize_diag(self%state, self%pbuf, list_idx, dgnumdry_m, hygro_m, &
+ dryvol_m, dryrad_m, drymass_m, so4dryvol_m, naer_m)
+ call modal_aero_wateruptake_dr(self%state, self%pbuf, list_idx, dgnumdry_m, dgnumwet_m, &
+ qaerwat_m, wetdens_m, hygro_m, dryvol_m, dryrad_m, &
+ drymass_m, so4dryvol_m, naer_m)
+
+ dgnumwet(:ncol,:nlev) = dgnumwet_m(:ncol,:nlev,bin_idx)
+ qaerwat (:ncol,:nlev) = qaerwat_m(:ncol,:nlev,bin_idx)
+
+ deallocate(dgnumdry_m)
+ deallocate(dgnumwet_m)
+ deallocate(qaerwat_m)
+ deallocate(wetdens_m)
+ deallocate(hygro_m)
+ deallocate(dryvol_m)
+ deallocate(dryrad_m)
+ deallocate(drymass_m)
+ deallocate(so4dryvol_m)
+ deallocate(naer_m)
+ endif
+
+
+ end subroutine water_uptake
+
+ !------------------------------------------------------------------------------
+ ! aerosol dry volume (m3/kg) for given radiation diagnostic list number and bin number
+ !------------------------------------------------------------------------------
+ function dry_volume(self, aero_props, list_idx, bin_idx, ncol, nlev) result(vol)
+
+ class(modal_aerosol_state), intent(in) :: self
+ class(aerosol_properties), intent(in) :: aero_props
+
+ integer, intent(in) :: list_idx ! rad climate/diags list number
+ integer, intent(in) :: bin_idx ! bin number
+ integer, intent(in) :: ncol ! number of columns
+ integer, intent(in) :: nlev ! number of levels
+
+ real(r8) :: vol(ncol,nlev) ! m3/kg
+
+ real(r8), pointer :: mmr(:,:)
+ real(r8) :: specdens ! species density (kg/m3)
+
+ integer :: ispec
+
+ vol(:,:) = 0._r8
+
+ do ispec = 1, aero_props%nspecies(list_idx,bin_idx)
+ call self%get_ambient_mmr(list_idx, ispec, bin_idx, mmr)
+ call aero_props%get(bin_idx, ispec, list_ndx=list_idx, density=specdens)
+ vol(:ncol,:) = vol(:ncol,:) + mmr(:ncol,:)/specdens
+ end do
+
+ end function dry_volume
+
+ !------------------------------------------------------------------------------
+ ! aerosol wet volume (m3/kg) for given radiation diagnostic list number and bin number
+ !------------------------------------------------------------------------------
+ function wet_volume(self, aero_props, list_idx, bin_idx, ncol, nlev) result(vol)
+
+ class(modal_aerosol_state), intent(in) :: self
+ class(aerosol_properties), intent(in) :: aero_props
+
+ integer, intent(in) :: list_idx ! rad climate/diags list number
+ integer, intent(in) :: bin_idx ! bin number
+ integer, intent(in) :: ncol ! number of columns
+ integer, intent(in) :: nlev ! number of levels
+
+ real(r8) :: vol(ncol,nlev) ! m3/kg
+
+ real(r8) :: dryvol(ncol,nlev)
+ real(r8) :: watervol(ncol,nlev)
+
+ dryvol = self%dry_volume(aero_props, list_idx, bin_idx, ncol, nlev)
+ watervol = self%water_volume(aero_props, list_idx, bin_idx, ncol, nlev)
+
+ vol = watervol + dryvol
+
+ end function wet_volume
+
+ !------------------------------------------------------------------------------
+ ! aerosol water volume (m3/kg) for given radiation diagnostic list number and bin number
+ !------------------------------------------------------------------------------
+ function water_volume(self, aero_props, list_idx, bin_idx, ncol, nlev) result(vol)
+
+ class(modal_aerosol_state), intent(in) :: self
+ class(aerosol_properties), intent(in) :: aero_props
+
+ integer, intent(in) :: list_idx ! rad climate/diags list number
+ integer, intent(in) :: bin_idx ! bin number
+ integer, intent(in) :: ncol ! number of columns
+ integer, intent(in) :: nlev ! number of levels
+
+ real(r8) :: vol(ncol,nlev) ! m3/kg
+
+ real(r8) :: dgnumwet(ncol,nlev)
+ real(r8) :: qaerwat(ncol,nlev)
+
+ call self%water_uptake(aero_props, list_idx, bin_idx, ncol, nlev, dgnumwet, qaerwat)
+
+ vol(:ncol,:nlev) = qaerwat(:ncol,:nlev)*rh2odens
+ where (vol<0._r8)
+ vol = 0._r8
+ end where
+
+ end function water_volume
+
end module modal_aerosol_state_mod
diff --git a/src/chemistry/aerosol/refractive_aerosol_optics_mod.F90 b/src/chemistry/aerosol/refractive_aerosol_optics_mod.F90
new file mode 100644
index 0000000000..e1289a8790
--- /dev/null
+++ b/src/chemistry/aerosol/refractive_aerosol_optics_mod.F90
@@ -0,0 +1,384 @@
+module refractive_aerosol_optics_mod
+ use shr_kind_mod, only: r8 => shr_kind_r8
+ use aerosol_optics_mod, only: aerosol_optics
+ use physconst, only: rhoh2o
+ use aerosol_state_mod, only: aerosol_state
+ use aerosol_properties_mod, only: aerosol_properties
+
+ use table_interp_mod, only: table_interp, table_interp_wghts, table_interp_calcwghts
+
+ implicit none
+
+ private
+ public :: refractive_aerosol_optics
+
+ !> refractive_aerosol_optics
+ !! Table look up implementation of aerosol_optics to parameterize aerosol radiative properties in terms of
+ !! surface mode wet radius and wet refractive index using chebychev polynomials
+ type, extends(aerosol_optics) :: refractive_aerosol_optics
+
+ integer :: ibin, ilist
+ class(aerosol_state), pointer :: aero_state ! aerosol_state object
+ class(aerosol_properties), pointer :: aero_props ! aerosol_properties object
+
+ real(r8), allocatable :: watervol(:,:) ! volume concentration of water in each mode (m3/kg)
+ real(r8), allocatable :: wetvol(:,:) ! volume concentration of wet mode (m3/kg)
+ real(r8), allocatable :: cheb(:,:,:) ! chebychev polynomials
+ real(r8), allocatable :: radsurf(:,:) ! aerosol surface mode radius
+ real(r8), allocatable :: logradsurf(:,:) ! log(aerosol surface mode radius)
+
+ ! refractive index for water read in read_water_refindex
+ complex(r8), allocatable :: crefwsw(:) ! complex refractive index for water visible
+ complex(r8), allocatable :: crefwlw(:) ! complex refractive index for water infrared
+
+ real(r8), pointer :: extpsw(:,:,:,:) => null() ! specific extinction
+ real(r8), pointer :: abspsw(:,:,:,:) => null() ! specific absorption
+ real(r8), pointer :: asmpsw(:,:,:,:) => null() ! asymmetry factor
+ real(r8), pointer :: absplw(:,:,:,:) => null() ! specific absorption
+
+ real(r8), pointer :: refrtabsw(:,:) => null() ! table of real refractive indices for aerosols
+ real(r8), pointer :: refitabsw(:,:) => null() ! table of imag refractive indices for aerosols
+ real(r8), pointer :: refrtablw(:,:) => null() ! table of real refractive indices for aerosols
+ real(r8), pointer :: refitablw(:,:) => null() ! table of imag refractive indices for aerosols
+
+ ! Dimension sizes in coefficient arrays used to parameterize aerosol radiative properties
+ ! in terms of refractive index and wet radius
+ integer :: ncoef = -1 ! number of chebychev coeficients
+ integer :: prefr = -1 ! number of real refractive indices
+ integer :: prefi = -1 ! number of imaginary refractive indices
+
+ contains
+
+ procedure :: sw_props
+ procedure :: lw_props
+
+ final :: destructor
+
+ end type refractive_aerosol_optics
+
+ interface refractive_aerosol_optics
+ procedure :: constructor
+ end interface refractive_aerosol_optics
+
+ ! radius limits (m)
+ real(r8), parameter :: radmin = 0.01e-6_r8 ! min aerosol surface mode radius (m)
+ real(r8), parameter :: radmax = 25.e-6_r8 ! max aerosol surface mode radius (m)
+ real(r8), parameter :: xrmin=log(radmin) ! min log(aerosol surface mode radius)
+ real(r8), parameter :: xrmax=log(radmax) ! max log(aerosol surface mode radius)
+
+contains
+
+ !------------------------------------------------------------------------------
+ !------------------------------------------------------------------------------
+ function constructor(aero_props, aero_state, ilist, ibin, ncol, nlev, nsw, nlw, crefwsw, crefwlw) &
+ result(newobj)
+
+ class(aerosol_properties),intent(in), target :: aero_props ! aerosol_properties object
+ class(aerosol_state),intent(in), target :: aero_state ! aerosol_state object
+ integer, intent(in) :: ilist ! climate or a diagnostic list number
+ integer, intent(in) :: ibin ! bin number
+ integer, intent(in) :: ncol ! number of columns
+ integer, intent(in) :: nlev ! number of levels
+ integer, intent(in) :: nsw ! number of short wave lengths
+ integer, intent(in) :: nlw ! number of long wave lengths
+ complex(r8), intent(in) :: crefwsw(nsw) ! complex refractive index for water visible
+ complex(r8), intent(in) :: crefwlw(nlw) ! complex refractive index for water infrared
+
+ type(refractive_aerosol_optics), pointer :: newobj
+
+ integer :: ierr, icol, ilev, ispec, nspec
+ real(r8) :: vol(ncol) ! volume concentration of aerosol species (m3/kg)
+ real(r8) :: dryvol(ncol) ! volume concentration of aerosol mode (m3/kg)
+ real(r8) :: specdens ! species density (kg/m3)
+ real(r8), pointer :: specmmr(:,:) ! species mass mixing ratio
+ real(r8) :: logsigma ! geometric standard deviation of number distribution
+
+ real(r8) :: dgnumwet(ncol,nlev) ! aerosol wet number mode diameter (m)
+ real(r8) :: qaerwat(ncol,nlev) ! aerosol water (g/g)
+
+ real(r8), parameter :: rh2odens = 1._r8/rhoh2o
+
+ allocate(newobj, stat=ierr)
+ if (ierr/=0) then
+ nullify(newobj)
+ return
+ end if
+
+ ! get mode properties
+ call aero_props%optics_params(ilist, ibin, &
+ refrtabsw=newobj%refrtabsw, refitabsw=newobj%refitabsw, &
+ refrtablw=newobj%refrtablw, refitablw=newobj%refitablw,&
+ extpsw=newobj%extpsw, abspsw=newobj%abspsw, asmpsw=newobj%asmpsw, &
+ absplw=newobj%absplw, ncoef=newobj%ncoef, prefr=newobj%prefr, prefi=newobj%prefi)
+
+ allocate(newobj%watervol(ncol,nlev),stat=ierr)
+ if (ierr/=0) then
+ nullify(newobj)
+ return
+ end if
+ allocate(newobj%wetvol(ncol,nlev),stat=ierr)
+ if (ierr/=0) then
+ nullify(newobj)
+ return
+ end if
+ allocate(newobj%cheb(newobj%ncoef,ncol,nlev),stat=ierr)
+ if (ierr/=0) then
+ nullify(newobj)
+ return
+ end if
+ allocate(newobj%radsurf(ncol,nlev),stat=ierr)
+ if (ierr/=0) then
+ nullify(newobj)
+ return
+ end if
+ allocate(newobj%logradsurf(ncol,nlev),stat=ierr)
+ if (ierr/=0) then
+ nullify(newobj)
+ return
+ end if
+
+ allocate(newobj%crefwlw(nlw),stat=ierr)
+ if (ierr/=0) then
+ nullify(newobj)
+ return
+ end if
+ newobj%crefwlw(:) = crefwlw(:)
+
+ allocate(newobj%crefwsw(nsw),stat=ierr)
+ if (ierr/=0) then
+ nullify(newobj)
+ return
+ end if
+ newobj%crefwsw(:) = crefwsw(:)
+
+ call aero_state%water_uptake(aero_props, ilist, ibin, ncol, nlev, dgnumwet, qaerwat)
+
+ nspec = aero_props%nspecies(ilist,ibin)
+
+ logsigma=aero_props%alogsig(ilist,ibin)
+
+ ! calc size parameter for all columns
+ call modal_size_parameters(newobj%ncoef, ncol, nlev, logsigma, dgnumwet, &
+ newobj%radsurf, newobj%logradsurf, newobj%cheb)
+
+ do ilev = 1, nlev
+ dryvol(:ncol) = 0._r8
+ do ispec = 1, nspec
+ call aero_state%get_ambient_mmr(ilist,ispec,ibin,specmmr)
+ call aero_props%get(ibin, ispec, list_ndx=ilist, density=specdens)
+
+ do icol = 1, ncol
+ vol(icol) = specmmr(icol,ilev)/specdens
+ dryvol(icol) = dryvol(icol) + vol(icol)
+
+ newobj%watervol(icol,ilev) = qaerwat(icol,ilev)*rh2odens
+ newobj%wetvol(icol,ilev) = newobj%watervol(icol,ilev) + dryvol(icol)
+ if (newobj%watervol(icol,ilev) < 0._r8) then
+ newobj%watervol(icol,ilev) = 0._r8
+ newobj%wetvol(icol,ilev) = dryvol(icol)
+ end if
+ end do
+ end do
+ end do
+
+ newobj%aero_state => aero_state
+ newobj%aero_props => aero_props
+ newobj%ilist = ilist
+ newobj%ibin = ibin
+
+ end function constructor
+
+ !------------------------------------------------------------------------------
+ ! returns short wave aerosol optics properties
+ !------------------------------------------------------------------------------
+ subroutine sw_props(self, ncol, ilev, iwav, pext, pabs, palb, pasm)
+
+ class(refractive_aerosol_optics), intent(in) :: self
+ integer, intent(in) :: ncol ! number of columns
+ integer, intent(in) :: ilev ! vertical level index
+ integer, intent(in) :: iwav ! wave length index
+ real(r8),intent(out) :: pext(ncol) ! parameterized specific extinction (m2/kg)
+ real(r8),intent(out) :: pabs(ncol) ! parameterized specific absorption (m2/kg)
+ real(r8),intent(out) :: palb(ncol) ! parameterized asymmetry factor
+ real(r8),intent(out) :: pasm(ncol) ! parameterized single scattering albedo
+
+ real(r8) :: refr(ncol) ! real part of refractive index
+ real(r8) :: refi(ncol) ! imaginary part of refractive index
+ real(r8) :: cext(self%ncoef,ncol), cabs(self%ncoef,ncol), casm(self%ncoef,ncol)
+
+ complex(r8) :: crefin(ncol) ! complex refractive index
+ integer :: icol,icoef
+
+ type(table_interp_wghts) :: wghtsr(ncol)
+ type(table_interp_wghts) :: wghtsi(ncol)
+
+ crefin(:ncol) = self%aero_state%refractive_index_sw(ncol, ilev, self%ilist, self%ibin, iwav, self%aero_props)
+
+ do icol = 1, ncol
+ crefin(icol) = crefin(icol) + self%watervol(icol,ilev)*self%crefwsw(iwav)
+ crefin(icol) = crefin(icol)/max(self%wetvol(icol,ilev),1.e-60_r8)
+ refr(icol) = real(crefin(icol))
+ refi(icol) = abs(aimag(crefin(icol)))
+ end do
+
+ ! interpolate coefficients linear in refractive index
+
+ wghtsr = table_interp_calcwghts( self%prefr, self%refrtabsw(:,iwav), ncol, refr(:ncol) )
+ wghtsi = table_interp_calcwghts( self%prefi, self%refitabsw(:,iwav), ncol, refi(:ncol) )
+
+ cext(:,:ncol)= table_interp( self%ncoef,ncol, self%prefr,self%prefi, wghtsr,wghtsi, self%extpsw(:,:,:,iwav))
+ cabs(:,:ncol)= table_interp( self%ncoef,ncol, self%prefr,self%prefi, wghtsr,wghtsi, self%abspsw(:,:,:,iwav))
+ casm(:,:ncol)= table_interp( self%ncoef,ncol, self%prefr,self%prefi, wghtsr,wghtsi, self%asmpsw(:,:,:,iwav))
+
+ do icol = 1,ncol
+
+ if (self%logradsurf(icol,ilev) <= xrmax) then
+ pext(icol) = 0.5_r8*cext(1,icol)
+ do icoef = 2, self%ncoef
+ pext(icol) = pext(icol) + self%cheb(icoef,icol,ilev)*cext(icoef,icol)
+ enddo
+ pext(icol) = exp(pext(icol))
+ else
+ pext(icol) = 1.5_r8/(self%radsurf(icol,ilev)*rhoh2o) ! geometric optics
+ endif
+
+ ! convert from m2/kg water to m2/kg aerosol
+ pext(icol) = pext(icol)*self%wetvol(icol,ilev)*rhoh2o
+ pabs(icol) = 0.5_r8*cabs(1,icol)
+ pasm(icol) = 0.5_r8*casm(1,icol)
+ do icoef = 2, self%ncoef
+ pabs(icol) = pabs(icol) + self%cheb(icoef,icol,ilev)*cabs(icoef,icol)
+ pasm(icol) = pasm(icol) + self%cheb(icoef,icol,ilev)*casm(icoef,icol)
+ enddo
+ pabs(icol) = pabs(icol)*self%wetvol(icol,ilev)*rhoh2o
+ pabs(icol) = max(0._r8,pabs(icol))
+ pabs(icol) = min(pext(icol),pabs(icol))
+
+ palb(icol) = 1._r8-pabs(icol)/max(pext(icol),1.e-40_r8)
+
+ end do
+
+ end subroutine sw_props
+
+ !------------------------------------------------------------------------------
+ ! returns long wave aerosol optics properties
+ !------------------------------------------------------------------------------
+ subroutine lw_props(self, ncol, ilev, iwav, pabs)
+
+ class(refractive_aerosol_optics), intent(in) :: self
+ integer, intent(in) :: ncol ! number of columns
+ integer, intent(in) :: ilev ! vertical level index
+ integer, intent(in) :: iwav ! wave length index
+ real(r8),intent(out) :: pabs(ncol) ! parameterized specific absorption (m2/kg)
+
+ real(r8) :: refr(ncol) ! real part of refractive index
+ real(r8) :: refi(ncol) ! imaginary part of refractive index
+ real(r8) :: cabs(self%ncoef,ncol)
+
+ complex(r8) :: crefin(ncol) ! complex refractive index
+ integer :: icol, icoef
+
+ type(table_interp_wghts) :: wghtsr(ncol)
+ type(table_interp_wghts) :: wghtsi(ncol)
+
+ crefin(:ncol) = self%aero_state%refractive_index_lw(ncol, ilev, self%ilist, self%ibin, iwav, self%aero_props)
+
+ do icol = 1, ncol
+ crefin(icol) = crefin(icol) + self%watervol(icol,ilev)*self%crefwlw(iwav)
+ crefin(icol) = crefin(icol)/max(self%wetvol(icol,ilev), 1.e-40_r8)
+
+ refr(icol) = real(crefin(icol))
+ refi(icol) = aimag(crefin(icol))
+
+ end do
+
+ ! interpolate coefficients linear in refractive index
+
+ wghtsr = table_interp_calcwghts( self%prefr, self%refrtablw(:,iwav), ncol, refr(:ncol) )
+ wghtsi = table_interp_calcwghts( self%prefi, self%refitablw(:,iwav), ncol, refi(:ncol) )
+
+ cabs(:,:ncol)= table_interp( self%ncoef,ncol, self%prefr,self%prefi, wghtsr,wghtsi, self%absplw(:,:,:,iwav))
+
+ do icol = 1,ncol
+ pabs(icol) = 0.5_r8*cabs(1,icol)
+ do icoef = 2, self%ncoef
+ pabs(icol) = pabs(icol) + self%cheb(icoef,icol,ilev)*cabs(icoef,icol)
+ end do
+ pabs(icol) = pabs(icol)*self%wetvol(icol,ilev)*rhoh2o
+ pabs(icol) = max(0._r8,pabs(icol))
+ end do
+
+ end subroutine lw_props
+
+
+ !------------------------------------------------------------------------------
+ !------------------------------------------------------------------------------
+ subroutine destructor(self)
+
+ type(refractive_aerosol_optics), intent(inout) :: self
+
+ deallocate(self%watervol)
+ deallocate(self%wetvol)
+ deallocate(self%cheb)
+ deallocate(self%radsurf)
+ deallocate(self%logradsurf)
+ deallocate(self%crefwsw)
+ deallocate(self%crefwlw)
+
+ nullify(self%aero_state)
+ nullify(self%aero_props)
+ nullify(self%extpsw)
+ nullify(self%abspsw)
+ nullify(self%asmpsw)
+ nullify(self%absplw)
+ nullify(self%refrtabsw)
+ nullify(self%refitabsw)
+ nullify(self%refrtablw)
+ nullify(self%refitablw)
+
+ end subroutine destructor
+
+
+ ! Private routines
+ !===============================================================================
+
+ !===============================================================================
+
+ subroutine modal_size_parameters(ncoef,ncol,nlev, alnsg_amode, dgnumwet, radsurf, logradsurf, cheb)
+
+ integer, intent(in) :: ncoef,ncol,nlev
+ real(r8), intent(in) :: alnsg_amode ! geometric standard deviation of number distribution
+ real(r8), intent(in) :: dgnumwet(:,:) ! aerosol wet number mode diameter (m)
+ real(r8), intent(out) :: radsurf(:,:) ! aerosol surface mode radius
+ real(r8), intent(out) :: logradsurf(:,:) ! log(aerosol surface mode radius)
+ real(r8), intent(out) :: cheb(:,:,:)
+
+ integer :: i, k, nc
+ real(r8) :: explnsigma
+ real(r8) :: xrad(ncol) ! normalized aerosol radius
+
+ !-------------------------------------------------------------------------------
+
+ explnsigma = exp(2.0_r8*alnsg_amode*alnsg_amode)
+
+ do k = 1, nlev
+ do i = 1, ncol
+ ! convert from number mode diameter to surface area
+ radsurf(i,k) = max(0.5_r8*dgnumwet(i,k)*explnsigma,radmin)
+ logradsurf(i,k) = log(radsurf(i,k))
+ ! normalize size parameter
+ xrad(i) = max(logradsurf(i,k),xrmin)
+ xrad(i) = min(xrad(i),xrmax)
+ xrad(i) = (2._r8*xrad(i)-xrmax-xrmin)/(xrmax-xrmin)
+ ! chebyshev polynomials
+ cheb(1,i,k) = 1._r8
+ cheb(2,i,k) = xrad(i)
+ do nc = 3, ncoef
+ cheb(nc,i,k) = 2._r8*xrad(i)*cheb(nc-1,i,k)-cheb(nc-2,i,k)
+ end do
+ end do
+ end do
+
+ end subroutine modal_size_parameters
+
+end module refractive_aerosol_optics_mod
diff --git a/src/chemistry/geoschem/chem_mods.F90 b/src/chemistry/geoschem/chem_mods.F90
index 40a8828dbb..2d8a500253 100644
--- a/src/chemistry/geoschem/chem_mods.F90
+++ b/src/chemistry/geoschem/chem_mods.F90
@@ -2,25 +2,27 @@ module chem_mods
!--------------------------------------------------------------
! ... Basic chemistry parameters and arrays
!--------------------------------------------------------------
- use shr_kind_mod, only : r8 => shr_kind_r8
+ use shr_kind_mod, only : r8 => shr_kind_r8, shr_kind_cl
use constituents, only : pcnst
implicit none
save
INTEGER, PARAMETER :: nTracersMax = 267 ! Must be equal to chem_nadv
INTEGER :: nTracers
- CHARACTER(LEN=255) :: tracerNames(nTracersMax)
- CHARACTER(LEN=255) :: tracerLongNames(nTracersMax)
REAL(r8) :: ref_MMR(pcnst)
+ CHARACTER(LEN=shr_kind_cl) :: tracerNames(nTracersMax)
+ CHARACTER(LEN=shr_kind_cl) :: tracerLongNames(nTracersMax)
+
! Index of first constituent
INTEGER :: iFirstCnst
! Short-lived species (i.e. not advected)
INTEGER, PARAMETER :: nSlsMax = 500 ! UNadvected species only
- INTEGER :: nSls
- CHARACTER(LEN=255) :: slsNames(nSlsMax)
- CHARACTER(LEN=255) :: slsLongnames(nSlsMax)
+ INTEGER :: nSls
+
+ CHARACTER(LEN=shr_kind_cl) :: slsNames(nSlsMax)
+ CHARACTER(LEN=shr_kind_cl) :: slsLongnames(nSlsMax)
! Mapping between constituents and GEOS-Chem tracers
INTEGER :: map2GC(pcnst)
@@ -100,7 +102,7 @@ module chem_mods
logical :: frc_from_dataset(max(1,extcnt))
logical :: is_vector
logical :: is_scalar
- character(len=255), allocatable :: slvd_lst(:)
+ character(len=shr_kind_cl), allocatable :: slvd_lst(:)
! Mapping between chemical species and GEOS-Chem species/other tracers
INTEGER :: map2chm(gas_pcnst)
diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90
index e801587b1e..ab56200cba 100644
--- a/src/chemistry/geoschem/chemistry.F90
+++ b/src/chemistry/geoschem/chemistry.F90
@@ -1,81 +1,50 @@
-!================================================================================================
-! This is the "GEOS-Chem" chemistry module.
-!================================================================================================
-
module chemistry
- use shr_kind_mod, only : r8 => shr_kind_r8, shr_kind_cl
- use physics_types, only : physics_state, physics_ptend, physics_ptend_init
+
+ ! CAM modules
+ use cam_abortutils, only : endrun
+ use cam_logfile, only : iulog
+ use chem_mods, only : nTracersMax, nTracers, tracerNames
+ use chem_mods, only : gas_pcnst, adv_mass, ref_MMR, iFirstCnst
+ use chem_mods, only : nSlsMax, nSls, slsNames, nSlvd, slvd_Lst
+ use chem_mods, only : nAerMax, nAer, aerNames, aerAdvMass
+ use chem_mods, only : map2GC, map2GCinv, map2GC_Sls
+ use chem_mods, only : mapCnst, map2chm, map2MAM4
+ use constituents, only : pcnst, cnst_add, cnst_get_ind, cnst_name
+ use mo_tracname, only : solsym
use physics_buffer, only : physics_buffer_desc
- use ppgrid, only : begchunk, endchunk, pcols
- use ppgrid, only : pver, pverp
- use constituents, only : pcnst, cnst_add, cnst_get_ind
- use constituents, only : cnst_name
+ use physics_types, only : physics_state, physics_ptend, physics_ptend_init
+ use ppgrid, only : begchunk, endchunk, pcols, pver, pverp
use shr_const_mod, only : molw_dryair=>SHR_CONST_MWDAIR
use shr_drydep_mod, only : nddvels => n_drydep, drydep_list
+ use shr_kind_mod, only : r8 => shr_kind_r8, shr_kind_cl
use spmd_utils, only : MasterProc, myCPU=>Iam, nCPUs=>npes
- use cam_logfile, only : iulog
use string_utils, only : to_upper
-
- !--------------------------------------------------------------------
- ! Basic GEOS-Chem modules
- !--------------------------------------------------------------------
- USE DiagList_Mod, ONLY : DgnList ! Derived type for diagnostics list
- USE TaggedDiagList_Mod, ONLY : TaggedDgnList ! Derived type for tagged diagnostics list
- USE Input_Opt_Mod, ONLY : OptInput ! Derived type for Input Options
- USE State_Chm_Mod, ONLY : ChmState ! Derived type for Chemistry State object
- USE State_Diag_Mod, ONLY : DgnState ! Derived type for Diagnostics State object
- USE State_Grid_Mod, ONLY : GrdState ! Derived type for Grid State object
- USE State_Met_Mod, ONLY : MetState ! Derived type for Meteorology State object
- USE Species_Mod, ONLY : Species ! Derived type for Species object
- USE GC_Environment_Mod ! Runtime GEOS-Chem environment
- USE ErrCode_Mod ! Error codes for success or failure
- USE Error_Mod ! For error checking
- USE Precision_Mod, ONLY : fp, f4 ! Flexible precision
-
- use chem_mods, only : nSlvd, slvd_Lst
-
- !--------------------------------------------------------------------
- ! GEOS-Chem History exports module
- !--------------------------------------------------------------------
- use GeosChem_History_Mod
-
- !--------------------------------------------------------------------
- ! CAM modules
- !--------------------------------------------------------------------
- ! Exit routine in CAM
- use cam_abortutils, only : endrun
-
- use chem_mods, only : nTracersMax
- use chem_mods, only : nTracers
- use chem_mods, only : gas_pcnst
- use chem_mods, only : tracerNames
- use chem_mods, only : adv_mass
- use chem_mods, only : ref_MMR
- use chem_mods, only : iFirstCnst
- use chem_mods, only : nSlsMax
- use chem_mods, only : nSls
- use chem_mods, only : slsNames
- use chem_mods, only : nAerMax
- use chem_mods, only : nAer
- use chem_mods, only : aerNames
- use chem_mods, only : aerAdvMass
- use chem_mods, only : map2GC, map2GCinv
- use chem_mods, only : map2GC_Sls
- use chem_mods, only : mapCnst
- use chem_mods, only : map2chm
- use chem_mods, only : map2MAM4
#if defined( MODAL_AERO )
use modal_aero_data, only : ntot_amode
#endif
-
- use mo_tracname, only : solsym
+
+ ! GEOS-Chem derived types
+ USE DiagList_Mod, ONLY : DgnList ! Diagnostics list object
+ use GeosChem_History_Mod, ONLY : HistoryConfigObj ! History diagnostic object
+ USE Input_Opt_Mod, ONLY : OptInput ! Input Options
+ USE Species_Mod, ONLY : Species ! Species object
+ USE State_Chm_Mod, ONLY : ChmState ! Chemistry State object
+ USE State_Diag_Mod, ONLY : DgnState ! Diagnostics State object
+ USE State_Grid_Mod, ONLY : GrdState ! Grid State object
+ USE State_Met_Mod, ONLY : MetState ! Meteorology State object
+ USE TaggedDiagList_Mod, ONLY : TaggedDgnList ! Ragged diagnostics list
+
+ ! GEOS-Chem utilities
+ USE ErrCode_Mod, ONLY : GC_SUCCESS, GC_FAILURE
+ USE ErrCode_Mod, ONLY : GC_Error, GC_CheckVar, GC_Warning
+ USE Error_Mod, ONLY : Error_Stop
+ USE Precision_Mod, ONLY : fp, f4 ! Flexible precision
IMPLICIT NONE
PRIVATE
SAVE
- !
+
! Public interfaces
- !
public :: chem_is ! identify which chemistry is being used
public :: chem_register ! register consituents
public :: chem_is_active ! returns true if this package is active (ghg_chem=.true.)
@@ -88,7 +57,6 @@ module chemistry
public :: chem_read_restart
public :: chem_init_restart
public :: chem_readnl ! read chem namelist
-
public :: chem_emissions
public :: chem_timestep_init
@@ -98,25 +66,21 @@ module chemistry
CHARACTER(LEN=500) :: speciesDB = 'species_database.yml'
! Location of chemistry input
- CHARACTER(LEN=256) :: gc_cheminputs
+ CHARACTER(LEN=shr_kind_cl) :: geoschem_cheminputs
! Debugging
LOGICAL :: debug = .TRUE.
- !-----------------------------
! Derived type objects
- !-----------------------------
- TYPE(OptInput) :: Input_Opt ! Input Options object
- TYPE(ChmState),ALLOCATABLE :: State_Chm(:) ! Chemistry State object
- TYPE(DgnState),ALLOCATABLE :: State_Diag(:) ! Diagnostics State object
- TYPE(GrdState),ALLOCATABLE :: State_Grid(:) ! Grid State object
- TYPE(MetState),ALLOCATABLE :: State_Met(:) ! Meteorology State object
- TYPE(DgnList ) :: Diag_List ! Diagnostics list object
- TYPE(TaggedDgnList ) :: TaggedDiag_List ! Tagged diagnostics list object
-
- TYPE(HistoryConfigObj), POINTER :: HistoryConfig ! HistoryConfig object for History diagn.
-
- type(physics_buffer_desc), pointer :: hco_pbuf2d(:,:) ! Pointer to 2D pbuf
+ TYPE(OptInput) :: Input_Opt ! Input Options object
+ TYPE(ChmState),ALLOCATABLE :: State_Chm(:) ! Chemistry State object
+ TYPE(DgnState),ALLOCATABLE :: State_Diag(:) ! Diagnostics State object
+ TYPE(GrdState),ALLOCATABLE :: State_Grid(:) ! Grid State object
+ TYPE(MetState),ALLOCATABLE :: State_Met(:) ! Meteorology State object
+ TYPE(DgnList ) :: Diag_List ! Diagnostics list object
+ TYPE(TaggedDgnList ) :: TaggedDiag_List ! Tagged diagnostics list object
+ TYPE(HistoryConfigObj), POINTER :: HistoryConfig ! HistoryConfig object for History diagn.
+ type(physics_buffer_desc), POINTER :: hco_pbuf2d(:,:) ! Pointer to 2D pbuf
! Mimic code in sfcvmr_mod.F90
TYPE :: SfcMrObj
@@ -131,7 +95,6 @@ module chemistry
! Field prefix
CHARACTER(LEN=63), PARAMETER :: Prefix_SfcVMR = 'VMR_'
-
! Indices of critical species in GEOS-Chem
INTEGER :: iH2O, iO3, iCO2, iSO4
INTEGER :: iO, iH, iO2
@@ -161,31 +124,29 @@ module chemistry
INTEGER :: ixNDrop ! Cloud droplet number index
! ghg
-
LOGICAL :: ghg_chem = .false. ! .true. => use ghg chem package
CHARACTER(len=shr_kind_cl) :: bndtvg = ' ' ! pathname for greenhouse gas loss rate
CHARACTER(len=shr_kind_cl) :: h2orates = ' ' ! pathname for greenhouse gas (lyman-alpha H2O loss)
- ! lightning
- REAL(r8) :: lght_no_prd_factor = 1._r8
-
! Strings
- CHARACTER(LEN=255) :: ThisLoc
- CHARACTER(LEN=255) :: ErrMsg
+ CHARACTER(LEN=shr_kind_cl) :: ThisLoc
+ CHARACTER(LEN=shr_kind_cl) :: ErrMsg
! For dry deposition
character(len=shr_kind_cl) :: depvel_lnd_file = 'depvel_lnd_file'
-!================================================================================================
+
contains
-!================================================================================================
+ !================================================================================================
+ ! function chem_is
+ !================================================================================================
function chem_is (name) result (chem_name_is)
+ ! CAM modules
use string_utils, only : to_lower
character(len=*), intent(in) :: name
-
logical :: chem_name_is
chem_name_is = (( to_lower(name) == 'geoschem' ) .or. &
@@ -193,28 +154,33 @@ function chem_is (name) result (chem_name_is)
end function chem_is
-!================================================================================================
-
+ !================================================================================================
+ ! subroutine chem_register
+ !================================================================================================
subroutine chem_register
+ ! CAM modules
+ use chem_mods, only : drySpc_ndx
+ use mo_chem_utls, only : get_spc_ndx
+ use physconst, only : MWDry
use physics_buffer, only : pbuf_add_field, dtype_r8
- use PhysConst, only : MWDry
use short_lived_species, only : Register_Short_Lived_Species
- use State_Grid_Mod, only : Init_State_Grid, Cleanup_State_Grid
- use State_Chm_Mod, only : Init_State_Chm, Cleanup_State_Chm
- use State_Chm_Mod, only : Ind_
- use Input_Opt_Mod, only : Set_Input_Opt, Cleanup_Input_Opt
-
- use mo_sim_dat, only : set_sim_dat
- use mo_chem_utls, only : get_spc_ndx
- use chem_mods, only : drySpc_ndx
#if defined( MODAL_AERO )
use aero_model, only : aero_model_register
use modal_aero_data, only : nspec_max
use modal_aero_data, only : ntot_amode, nspec_amode
- use modal_aero_data, only : xname_massptr
+ use rad_constituents, only : rad_cnst_get_info
#endif
+ ! GEOS-Chem interface modules in CAM
+ use mo_sim_dat, only : set_sim_dat
+
+ ! GEOS-Chem modules
+ use GC_Environment_Mod, ONLY : GC_Init_Grid
+ use Input_Opt_Mod, only : Set_Input_Opt, Cleanup_Input_Opt
+ use State_Chm_Mod, only : Init_State_Chm, Cleanup_State_Chm, Ind_
+ use State_Grid_Mod, only : Init_State_Grid, Cleanup_State_Grid
+
!-----------------------------------------------------------------------
!
! Purpose: register advected constituents for chemistry
@@ -239,6 +205,7 @@ subroutine chem_register
CHARACTER(LEN=128) :: lngName
CHARACTER(LEN=64) :: cnstName
CHARACTER(LEN=64) :: trueName
+ CHARACTER(LEN=64) :: aerName
LOGICAL :: camout
LOGICAL :: ic_from_cam2
LOGICAL :: has_fixed_ubc
@@ -468,7 +435,7 @@ subroutine chem_register
map2GCinv(M) = N
ENDIF
! Map constituent onto chemically-active species (aka as indexed in solsym)
- M = get_spc_ndx(TRIM(trueName), compare_uppercase=.true.)
+ M = get_spc_ndx(TRIM(trueName), ignore_case=.true.)
IF ( M > 0 ) THEN
mapCnst(N) = M
ENDIF
@@ -518,10 +485,10 @@ subroutine chem_register
CALL cnst_get_ind('H2O', cH2O, abort=.True.)
CALL cnst_get_ind('H2SO4', cH2SO4, abort=.True.)
- !==============================================================
+ !------------------------------------------------------------
! Get mapping between dry deposition species and species set
- !==============================================================
-
+ !------------------------------------------------------------
+
nIgnored = 0
if (debug .and. masterproc) write(iulog,'(a,i4,a)') 'chem_register: looping over gas dry deposition list with ', nddvels, ' species'
@@ -530,7 +497,7 @@ subroutine chem_register
! The species names need to be convert to upper case as,
! for instance, BR2 != Br2
- drySpc_ndx(N) = get_spc_ndx( to_upper(drydep_list(N)), compare_uppercase=.true. )
+ drySpc_ndx(N) = get_spc_ndx( to_upper(drydep_list(N)), ignore_case=.true. )
if (debug .and. masterproc) write(iulog,'(a,a,a,i4,a,i4)') ' -> species ', trim(drydep_list(N)), ' in dry deposition list at index ', N, ' maps to species in solsym at index ', drySpc_ndx(N)
@@ -573,18 +540,22 @@ subroutine chem_register
map2MAM4(:,:) = -1
iSulf(:) = -1
+ ! ewl notes: xname_massptr returns a name. The select case subsets characters? e.g. 1:3, 4:5, 5:6.
+ ! so want to get a name give an L and M. Need anything else???
+
DO M = 1, ntot_amode
DO L = 1, nspec_amode(M)
- SELECT CASE ( to_upper(xname_massptr(L,M)(:3)) )
+ call rad_cnst_get_info(0,M,L,spec_name=aername)
+ SELECT CASE ( to_upper(aername(:3)) )
CASE ( 'BC_' )
- SELECT CASE ( to_upper(xname_massptr(L,M)(4:5)) )
+ SELECT CASE ( to_upper(aername(4:5)) )
CASE ( 'A1' )
CALL cnst_get_ind( 'BCPI', map2MAM4(L,M) )
CASE ( 'A4' )
CALL cnst_get_ind( 'BCPO', map2MAM4(L,M) )
END SELECT
CASE ( 'DST' )
- SELECT CASE ( to_upper(xname_massptr(L,M)(5:6)) )
+ SELECT CASE ( to_upper(aername(5:6)) )
! DST1 - Dust aerosol, Reff = 0.7 micrometers
! DST2 - Dust aerosol, Reff = 1.4 micrometers
! DST3 - Dust aerosol, Reff = 2.4 micrometers
@@ -602,7 +573,7 @@ subroutine chem_register
CALL cnst_get_ind( 'SO4', map2MAM4(L,M) )
iSulf(M) = L
CASE ( 'NCL' )
- SELECT CASE ( to_upper(xname_massptr(L,M)(5:6)) )
+ SELECT CASE ( to_upper(aername(5:6)) )
! SALA - Fine (0.01-0.05 micros) sea salt aerosol
! SALC - Coarse (0.5-8 micros) sea salt aerosol
CASE ( 'A1' )
@@ -613,7 +584,7 @@ subroutine chem_register
CALL cnst_get_ind( 'SALC', map2MAM4(L,M) )
END SELECT
CASE ( 'POM' )
- SELECT CASE ( to_upper(xname_massptr(L,M)(5:6)) )
+ SELECT CASE ( to_upper(aername(5:6)) )
CASE ( 'A1' )
CALL cnst_get_ind( 'OCPI', map2MAM4(L,M) )
CASE ( 'A4' )
@@ -625,10 +596,7 @@ subroutine chem_register
#endif
- !==============================================================
! Print summary
- !==============================================================
-
IF ( MasterProc ) THEN
Write(iulog,'(/, a)') '### Summary of GEOS-Chem species (end of chem_register): '
Write(iulog,'( a)') REPEAT( '-', 50 )
@@ -669,24 +637,27 @@ subroutine chem_register
end subroutine chem_register
-!===============================================================================
-
+ !================================================================================================
+ ! subroutine chem_readnl
+ !================================================================================================
subroutine chem_readnl(nlfile)
+ ! CAM modules
use cam_abortutils, only : endrun
- use units, only : getunit, freeunit
+ use chem_mods, only : drySpc_ndx
+ use gas_wetdep_opts, only : gas_wetdep_readnl
+ use gckpp_Model, only : nSpec, Spc_Names
use namelist_utils, only : find_group_name
+ use mo_lightning, only : lightning_readnl
+ use spmd_utils, only : mpicom, masterprocid, mpi_success
+ use spmd_utils, only : mpi_character, mpi_integer, mpi_logical
+ use units, only : getunit, freeunit
#if defined( MODAL_AERO )
use aero_model, only : aero_model_readnl
use dust_model, only : dust_readnl
#endif
- use gas_wetdep_opts, only : gas_wetdep_readnl
-#ifdef SPMD
- use mpishorthand
-#endif
- use gckpp_Model, only : nSpec, Spc_Names
- use chem_mods, only : drySpc_ndx
- use charpak_mod, only : strsplit
+ ! For dry deposition on unstructured grids
+ use mo_drydep, only : drydep_srf_file
! args
CHARACTER(LEN=*), INTENT(IN) :: nlfile ! filepath for file containing namelist input
@@ -696,27 +667,25 @@ subroutine chem_readnl(nlfile)
INTEGER :: UNITN, IERR, RC
CHARACTER(LEN=500) :: line
CHARACTER(LEN=63) :: substrs(2)
+ CHARACTER(LEN=*), PARAMETER :: subname = 'chem_readnl'
LOGICAL :: validSLS, v_bool
- ! Assume a successful return until otherwise
- RC = GC_SUCCESS
-
- namelist /chem_inparm/ lght_no_prd_factor, &
- depvel_lnd_file
+ namelist /chem_inparm/ depvel_lnd_file
+ namelist /chem_inparm/ drydep_srf_file
! ghg chem
-
namelist /chem_inparm/ bndtvg, h2orates, ghg_chem
if (debug .and. masterproc) write(iulog,'(a)') 'chem_readnl: reading namelists for GEOS-Chem chemistry'
+ ! Assume a successful return until otherwise
+ RC = GC_SUCCESS
+
ALLOCATE(drySpc_ndx(nddvels), STAT=IERR)
IF ( IERR .NE. 0 ) CALL ENDRUN('Failed to allocate drySpc_ndx')
#if defined( MODAL_AERO_4MODE )
- !==============================================================
! Get names and molar weights of aerosols in MAM4
- !==============================================================
nAer = 33
@@ -755,7 +724,9 @@ subroutine chem_readnl(nlfile)
CALL gas_wetdep_readnl(nlfile)
- CALL gc_readnl(nlfile)
+ CALL lightning_readnl(nlfile)
+
+ CALL geoschem_readnl(nlfile)
IF ( MasterProc ) THEN
@@ -771,10 +742,9 @@ subroutine chem_readnl(nlfile)
Write(iulog,'(/,a,/)') 'Now defining GEOS-Chem tracers and dry deposition mapping...'
-
- !==============================================================
+ !----------------------------------------------------------
! Read GEOS-Chem advected species from geoschem_config.yml
- !==============================================================
+ !----------------------------------------------------------
unitn = getunit()
@@ -791,7 +761,7 @@ subroutine chem_readnl(nlfile)
IF ( INDEX( LINE, 'transported_species' ) > 0 ) EXIT
ENDDO
- if (debug .and. masterproc) write(iulog,'(a)') 'chem_readnl: reading advected species list from geoschem_config.yml'
+ if (debug) write(iulog,'(a)') 'chem_readnl: reading advected species list from geoschem_config.yml'
! Read in all advected species names and add them to tracer names list
nTracers = 0
@@ -799,12 +769,11 @@ subroutine chem_readnl(nlfile)
READ(unitn,'(a)', IOSTAT=IERR) line
IF ( IERR .NE. 0 ) CALL ENDRUN('chem_readnl: error setting adv spc list')
line = ADJUSTL( ADJUSTR( line ) )
-
IF ( INDEX( line, 'passive_species' ) > 0 ) EXIT
- CALL StrSplit( line, '-', substrs, N )
IF ( INDEX( LINE, '-' ) > 0 ) THEN
+ substrs(1) = LINE(3:)
substrs(1) = ADJUSTL( ADJUSTR( substrs(1) ) )
-
+
! Remove quotes (i.e. 'NO' -> NO)
I = INDEX( substrs(1), "'" )
IF ( I > 0 ) THEN
@@ -827,11 +796,11 @@ subroutine chem_readnl(nlfile)
WRITE(tracerNames(I),'(a,I0.4)') 'GCTRC_', I
ENDDO
- !==============================================================
+ !----------------------------------------------------------
! Now go through the KPP mechanism and add any species not
! implemented by the tracer list in geoschem_config.yml
- !==============================================================
-
+ !----------------------------------------------------------
+
IF ( nSpec > nSlsMax ) THEN
CALL ENDRUN('chem_readnl: too many species - increase nSlsmax')
ENDIF
@@ -854,15 +823,17 @@ subroutine chem_readnl(nlfile)
ENDIF
ENDDO
- !==============================================================
-
unitn = getunit()
- OPEN( unitn, FILE=TRIM(nlfile), STATUS='old' )
+ OPEN( unitn, FILE=TRIM(nlfile), STATUS='old', IOSTAT=IERR )
+ IF (IERR .NE. 0) THEN
+ CALL ENDRUN('chem_readnl: ERROR opening '//TRIM(nlfile))
+ ENDIF
+
CALL find_group_name(unitn, 'chem_inparm', STATUS=IERR)
IF (IERR == 0) THEN
READ(unitn, chem_inparm, IOSTAT=IERR)
IF (IERR /= 0) THEN
- CALL endrun('chem_readnl: ERROR reading namelist')
+ CALL endrun('chem_readnl: ERROR reading namelist chem_inparm')
ENDIF
ENDIF
CLOSE(unitn)
@@ -870,23 +841,47 @@ subroutine chem_readnl(nlfile)
ENDIF
- !==================================================================
+ !----------------------------------------------------------
! Broadcast to all processors
- !==================================================================
-
-#if defined( SPMD )
- CALL MPIBCAST ( nTracers, 1, MPIINT, 0, MPICOM )
- CALL MPIBCAST ( tracerNames, LEN(tracerNames(1))*nTracersMax, MPICHAR, 0, MPICOM )
- CALL MPIBCAST ( nSls, 1, MPIINT, 0, MPICOM )
- CALL MPIBCAST ( slsNames, LEN(slsNames(1))*nSlsMax, MPICHAR, 0, MPICOM )
+ !----------------------------------------------------------
+ CALL mpi_bcast(nTracers, 1, mpi_integer, masterprocid, mpicom, ierr)
+ IF ( ierr /= mpi_success ) then
+ CALL endrun(subname//': MPI_BCAST ERROR: nTracers')
+ ENDIF
+ CALL mpi_bcast(tracerNames, LEN(tracerNames(1))*nTracersMax, mpi_character, masterprocid, mpicom, ierr)
+ IF ( ierr /= mpi_success ) then
+ CALL endrun(subname//': MPI_BCAST ERROR: tracerNames')
+ ENDIF
+ CALL mpi_bcast(nSls, 1, mpi_integer, masterprocid, mpicom, ierr)
+ IF ( ierr /= mpi_success ) then
+ CALL endrun(subname//': MPI_BCAST ERROR: nSls')
+ ENDIF
+ CALL mpi_bcast(slsNames, LEN(slsNames(1))*nSlsMax, mpi_character, masterprocid, mpicom, ierr)
+ IF ( ierr /= mpi_success ) then
+ CALL endrun(subname//': MPI_BCAST ERROR: slsNames')
+ ENDIF
! Broadcast namelist variables
- CALL MPIBCAST (depvel_lnd_file, LEN(depvel_lnd_file), MPICHAR, 0, MPICOM)
- CALL MPIBCAST (lght_no_prd_factor, 1, MPIR8, 0, MPICOM)
- CALL MPIBCAST (ghg_chem, 1, MPILOG, 0, MPICOM)
- CALL MPIBCAST (bndtvg, LEN(bndtvg), MPICHAR, 0, MPICOM)
- CALL MPIBCAST (h2orates, LEN(h2orates), MPICHAR, 0, MPICOM)
-#endif
+ CALL mpi_bcast(depvel_lnd_file, LEN(depvel_lnd_file), mpi_character, masterprocid, mpicom, ierr)
+ IF ( ierr /= mpi_success ) then
+ CALL endrun(subname//': MPI_BCAST ERROR: depvel_lnd_file')
+ ENDIF
+ CALL mpi_bcast(drydep_srf_file, LEN(drydep_srf_file), mpi_character, masterprocid, mpicom, ierr)
+ IF ( ierr /= mpi_success ) then
+ CALL endrun(subname//': MPI_BCAST ERROR: drydep_srf_file')
+ ENDIF
+ CALL mpi_bcast(ghg_chem, 1, mpi_logical, masterprocid, mpicom, ierr)
+ IF ( ierr /= mpi_success ) then
+ CALL endrun(subname//': MPI_BCAST ERROR: ghg_chem')
+ ENDIF
+ CALL mpi_bcast(bndtvg, LEN(bndtvg), mpi_character, masterprocid, mpicom, ierr)
+ IF ( ierr /= mpi_success ) then
+ CALL endrun(subname//': MPI_BCAST ERROR: bndtvg')
+ ENDIF
+ CALL mpi_bcast(h2orates, LEN(h2orates), mpi_character, masterprocid, mpicom, ierr)
+ IF ( ierr /= mpi_success ) then
+ CALL endrun(subname//': MPI_BCAST ERROR: h2orates')
+ ENDIF
IF ( nSls .NE. nSlvd ) THEN
write(iulog,'(a,i4)') 'nSlvd in geoschem/chem_mods.F90 does not match # non-advected KPP species. Set nSlvd to ', nSls
@@ -903,37 +898,31 @@ subroutine chem_readnl(nlfile)
end subroutine chem_readnl
-!================================================================================================
-
+ !================================================================================================
+ ! function chem_is_active
+ !================================================================================================
function chem_is_active()
- !-----------------------------------------------------------------------
+
logical :: chem_is_active
- !-----------------------------------------------------------------------
chem_is_active = .true.
end function chem_is_active
-!================================================================================================
-
+ !================================================================================================
+ ! function chem_implements_cnst
+ !================================================================================================
function chem_implements_cnst(name)
- !-----------------------------------------------------------------------
- !
! Purpose: return true if specified constituent is implemented by this package
- !
! Author: B. Eaton
- !
- !-----------------------------------------------------------------------
+
IMPLICIT NONE
- !-----------------------------Arguments---------------------------------
CHARACTER(LEN=*), INTENT(IN) :: name ! constituent name
LOGICAL :: chem_implements_cnst ! return value
-
INTEGER :: M
chem_implements_cnst = .false.
-
DO M = 1, gas_pcnst
IF (TRIM(solsym(M)) .eq. TRIM(name)) THEN
chem_implements_cnst = .true.
@@ -943,8 +932,9 @@ function chem_implements_cnst(name)
end function chem_implements_cnst
-!===============================================================================
-
+ !================================================================================================
+ ! subroutine chem_init
+ !================================================================================================
subroutine chem_init(phys_state, pbuf2d)
!-----------------------------------------------------------------------
!
@@ -952,64 +942,55 @@ subroutine chem_init(phys_state, pbuf2d)
! (and declare history variables)
!
!-----------------------------------------------------------------------
- use physics_buffer, only : physics_buffer_desc, pbuf_get_index
- use chem_mods, only : map2GC_dryDep, drySpc_ndx
-#ifdef SPMD
- use mpishorthand
-#endif
+ ! CAM modules
use cam_abortutils, only : endrun
- use mo_chem_utls, only : get_spc_ndx
-
- use Phys_Grid, only : get_Area_All_p
- use hycoef, only : ps0, hyai, hybi, hyam
-
+ use chem_mods, only : map2GC_dryDep, drySpc_ndx
use gas_wetdep_opts, only : gas_wetdep_method
+ use hycoef, only : ps0, hyai, hybi, hyam
+ use mo_chem_utls, only : get_spc_ndx
+ use mo_ghg_chem, only : ghg_chem_init
+ use mo_mean_mass, only : init_mean_mass
use mo_neu_wetdep, only : neu_wetdep_init
-
+ use mo_setinv, only : setinv_inti
+ use Phys_Grid, only : get_Area_All_p
+ use physics_buffer, only : physics_buffer_desc, pbuf_get_index
+ use spmd_utils, only : mpicom, masterprocid, mpi_real8, mpi_success
+ use tracer_cnst, only : tracer_cnst_init
+ use tracer_srcs, only : tracer_srcs_init
#if defined( MODAL_AERO )
use aero_model, only : aero_model_init
use mo_setsox, only : sox_inti
use mo_drydep, only : drydep_inti
use modal_aero_data, only : ntot_amode, nspec_amode
- use modal_aero_data, only : xname_massptr
#endif
- use Input_Opt_Mod
- use State_Chm_Mod
- use State_Grid_Mod
- use State_Met_Mod
+ ! GEOS-Chem interface modules in CAM
+ use geoschem_diagnostics_mod, only : GC_Diagnostics_Init
+ use geoschem_emissions_mod, only : GC_Emissions_Init
+ use geoschem_history_mod, only : HistoryExports_SetServices
+
+ ! GEOS-Chem modules
+ use Chemistry_Mod, only : Init_Chemistry
use DiagList_Mod, only : Init_DiagList, Print_DiagList
- use TaggedDiagList_Mod, only : Init_TaggedDiagList, Print_TaggedDiagList
+ use Drydep_Mod, only : depName, Ndvzind
+ use Error_Mod, only : Init_Error
+ use GC_Environment_Mod, only : GC_Init_Grid, GC_Init_StateObj
+ use GC_Environment_Mod, only : GC_Init_Extra, GC_Allocate_All
use GC_Grid_Mod, only : SetGridFromCtrEdges
-
- ! Use GEOS-Chem versions of physical constants
- use PhysConstants, only : PI, PI_180, Re
-
- use Time_Mod, only : Accept_External_Date_Time
+ use Input_Mod, only : Read_Input_File, Validate_Directories
+ use Input_Opt_Mod, only : Set_Input_Opt
+ use isorropiaII_Mod, only : Init_IsorropiaII
+ use Linear_Chem_Mod, only : Init_Linear_Chem
use Linoz_Mod, only : Linoz_Read
-
- use CMN_Size_Mod
-
- use Drydep_Mod, only : depName, Ndvzind
+ use PhysConstants, only : PI, PI_180, Re
use Pressure_Mod, only : Accept_External_ApBp
- use Chemistry_Mod, only : Init_Chemistry
+ use State_Chm_Mod, only : Ind_
+ use State_Grid_Mod, only : Init_State_Grid, Cleanup_State_Grid
+ use TaggedDiagList_Mod, only : Init_TaggedDiagList, Print_TaggedDiagList
+ use Time_Mod, only : Accept_External_Date_Time
use Ucx_Mod, only : Init_Ucx
- use Linear_Chem_Mod, only : Init_Linear_Chem
- use isorropiaII_Mod, only : Init_IsorropiaII
- use Input_Mod, only : Read_Input_File
- use Input_Mod, only : Validate_Directories
- use Olson_Landmap_Mod
- use Vdiff_Mod
-
- use mo_setinv, only : setinv_inti
- use mo_mean_mass, only : init_mean_mass
- use mo_ghg_chem, only : ghg_chem_init
- use tracer_cnst, only : tracer_cnst_init
- use tracer_srcs, only : tracer_srcs_init
-
- use GeosChem_Emissions_Mod, only : GC_Emissions_Init
- use GeosChem_Diagnostics_Mod, only : GC_Diagnostics_Init
+ use Vdiff_Mod, only : Max_PblHt_For_Vdiff
TYPE(physics_state), INTENT(IN ) :: phys_state(BEGCHUNK:ENDCHUNK)
TYPE(physics_buffer_desc), POINTER, INTENT(INOUT) :: pbuf2d(:,:)
@@ -1034,8 +1015,9 @@ subroutine chem_init(phys_state, pbuf2d)
LOGICAL :: Found
! Strings
- CHARACTER(LEN=255) :: historyConfigFile
- CHARACTER(LEN=255) :: SpcName
+ CHARACTER(LEN=shr_kind_cl) :: historyConfigFile
+ CHARACTER(LEN=shr_kind_cl) :: SpcName
+ CHARACTER(LEN=*), PARAMETER :: subname = 'chem_init'
! Objects
TYPE(Species), POINTER :: SpcInfo
@@ -1146,32 +1128,31 @@ subroutine chem_init(phys_state, pbuf2d)
Input_Opt%thisCPU = myCPU
Input_Opt%amIRoot = MasterProc
- !IF ( MasterProc ) THEN
- IF ( .True. ) THEN
- CALL Read_Input_File( Input_Opt = Input_Opt, &
- State_Grid = maxGrid, &
- RC = RC )
-
- ! First setup directories
- Input_Opt%Chem_Inputs_Dir = TRIM(gc_cheminputs)
- Input_Opt%SpcDatabaseFile = TRIM(speciesDB)
- Input_Opt%FAST_JX_DIR = TRIM(gc_cheminputs)//'FAST_JX/v2020-02/'
+ CALL Read_Input_File( Input_Opt = Input_Opt, &
+ State_Grid = maxGrid, &
+ RC = RC )
- !==================================================================
- ! CESM-specific input flags
- !==================================================================
+ ! First setup directories
+ Input_Opt%Chem_Inputs_Dir = TRIM(geoschem_cheminputs)
+ Input_Opt%SpcDatabaseFile = TRIM(speciesDB)
+ Input_Opt%FAST_JX_DIR = TRIM(geoschem_cheminputs)//'FAST_JX/v2020-02/'
- ! onlineAlbedo -> True (use CLM albedo)
- ! -> False (read monthly-mean albedo from HEMCO)
- Input_Opt%onlineAlbedo = .true.
+ !----------------------------------------------------------
+ ! CESM-specific input flags
+ !----------------------------------------------------------
- ! applyQtend: apply tendencies of water vapor to specific humidity
- Input_Opt%applyQtend = .False.
+ ! onlineAlbedo -> True (use CLM albedo)
+ ! -> False (read monthly-mean albedo from HEMCO)
+ Input_Opt%onlineAlbedo = .true.
- IF ( .NOT. Input_Opt%LSOA ) THEN
- CALL ENDRUN('CESM2-GC requires the complex SOA option to be on!')
- ENDIF
+ ! applyQtend: apply tendencies of water vapor to specific humidity
+ Input_Opt%applyQtend = .False.
+ ! correctConvUTLS: Apply photolytic correction for convective scavenging of soluble tracers?
+ Input_Opt%correctConvUTLS = .true.
+
+ IF ( .NOT. Input_Opt%LSOA ) THEN
+ CALL ENDRUN('CESM2-GC requires the complex SOA option to be on!')
ENDIF
CALL Validate_Directories( Input_Opt, RC )
@@ -1275,9 +1256,10 @@ subroutine chem_init(phys_state, pbuf2d)
! Copy the data to a temporary array
linozData = REAL(Input_Opt%LINOZ_TPARM, r8)
ENDIF
-#if defined( SPMD )
- CALL MPIBCAST( linozData, nLinoz, MPIR8, 0, MPICOM )
-#endif
+ CALL mpi_bcast(linozData, nLinoz, mpi_real8, masterprocid, mpicom, ierr)
+ IF ( ierr /= mpi_success ) then
+ CALL endrun(subname//': MPI_BCAST ERROR: linozData')
+ ENDIF
IF ( .NOT. MasterProc ) THEN
Input_Opt%LINOZ_TPARM = REAL(linozData,fp)
ENDIF
@@ -1455,13 +1437,13 @@ subroutine chem_init(phys_state, pbuf2d)
ENDIF
IF ( Input_Opt%LDryD ) THEN
- !==============================================================
+ !----------------------------------------------------------
! Get mapping between CESM dry deposited species and the
! indices of State_Chm%DryDepVel. This needs to be done after
! Init_Drydep
! Thibaud M. Fritz - 04 Mar 2020
- !==============================================================
-
+ !----------------------------------------------------------
+
ALLOCATE(map2GC_dryDep(nddvels), STAT=IERR)
IF ( IERR .NE. 0 ) CALL ENDRUN('Failed to allocate map2GC_dryDep')
@@ -1505,7 +1487,7 @@ subroutine chem_init(phys_state, pbuf2d)
CALL aero_model_init( pbuf2d )
! Initialize drydep
- CALL drydep_inti( depvel_lnd_file)
+ CALL drydep_inti( depvel_lnd_file )
#endif
IF ( gas_wetdep_method == 'NEU' ) THEN
@@ -1615,6 +1597,18 @@ subroutine chem_init(phys_state, pbuf2d)
State_Chm = State_Chm(I), &
State_Diag = State_Diag(I), &
State_Grid = State_Grid(I) )
+
+ ! Because not all CPUs in the communicator have the same amount of chunks,
+ ! it is only guaranteed that the first chunk in all CPUs can participate in
+ ! MPI_bcast of the NOXCOEFF array. So only the root CPU & root chunk will
+ ! read the NOXCOEFF array from disk, then broadcast to all other CPU's first
+ ! chunks, then remaining chunks can be copied locally without MPI. (hplin, 10/17/23)
+ IF( I == BEGCHUNK ) THEN
+ CALL mpi_bcast( State_Chm(I)%NOXCOEFF, size(State_Chm(I)%NOXCOEFF), mpi_real8, masterprocid, mpicom, ierr )
+ IF ( ierr /= mpi_success ) CALL endrun('Error in mpi_bcast of NOXCOEFF in first chunk')
+ ELSE
+ State_CHM(I)%NOXCOEFF = State_Chm(BEGCHUNK)%NOXCOEFF
+ ENDIF
ENDDO
ENDIF
@@ -1651,8 +1645,8 @@ subroutine chem_init(phys_state, pbuf2d)
! Free pointer
SpcInfo => NULL()
- l_H2SO4 = get_spc_ndx('H2SO4', compare_uppercase=.true.)
- l_SO4 = get_spc_ndx('SO4', compare_uppercase=.true.)
+ l_H2SO4 = get_spc_ndx('H2SO4', ignore_case=.true.)
+ l_SO4 = get_spc_ndx('SO4', ignore_case=.true.)
! Get indices for physical fields in physics buffer
NDX_PBLH = pbuf_get_index('pblh' )
@@ -1689,25 +1683,27 @@ subroutine chem_init(phys_state, pbuf2d)
State_Met = State_Met(BEGCHUNK) )
! Initialize emissions interface
- CALL GC_Emissions_Init( lght_no_prd_factor = lght_no_prd_factor )
+ CALL GC_Emissions_Init( )
hco_pbuf2d => pbuf2d
! Cleanup
Call Cleanup_State_Grid( maxGrid, RC )
- if (debug .and. masterproc) write(iulog,'(a)') 'chem_init: GEOS-Chem chemistry initialization complete'
+ if (masterproc) write(iulog,'(a)') 'chem_init: GEOS-Chem chemistry initialization complete'
end subroutine chem_init
-!===============================================================================
-
+ !================================================================================================
+ ! chem_timestep_init
+ !================================================================================================
subroutine chem_timestep_init(phys_state, pbuf2d)
- use physics_buffer, only : physics_buffer_desc
+ ! CAM modules
use mo_flbc, only : flbc_chk
use mo_ghg_chem, only : ghg_chem_timestep_init
-
+ use physics_buffer, only : physics_buffer_desc
+
TYPE(physics_state), INTENT(IN):: phys_state(begchunk:endchunk)
TYPE(physics_buffer_desc), POINTER :: pbuf2d(:,:)
@@ -1724,10 +1720,12 @@ subroutine chem_timestep_init(phys_state, pbuf2d)
end subroutine chem_timestep_init
-!===============================================================================
-
- subroutine GC_Update_Timesteps(DT)
+ !================================================================================================
+ ! subroutine gc_update_timesteps
+ !================================================================================================
+ subroutine gc_update_timesteps(DT)
+ ! GEOS-Chem modules
use Time_Mod, only : Set_Timesteps
REAL(r8), INTENT(IN) :: DT
@@ -1755,54 +1753,32 @@ subroutine GC_Update_Timesteps(DT)
DT_MIN_LAST = DT_MIN
ENDIF
- end subroutine
-
-!===============================================================================
-
-!------------------------------------------------------------------------------
-!BOP
-!
-! !IROUTINE: gc_readnl
-!
-! !DESCRIPTION: Reads the namelist from cam/src/control/runtime_opts.
-!\\
-!\\
-! !INTERFACE:
-!
- subroutine gc_readnl(nlfile)
-!
-! !USES:
-!
+ end subroutine gc_update_timesteps
+
+ !================================================================================================
+ ! subroutine geoschem_readnl
+ !================================================================================================
+ subroutine geoschem_readnl(nlfile)
+ ! Purpose: reads the namelist from cam/src/control/runtime_opts
+
+ ! CAM modules
+ use spmd_utils, only : mpicom, masterprocid, mpi_character, mpi_success
use namelist_utils, only: find_group_name
use units, only: getunit, freeunit
- use mpishorthand
-!
-! !INPUT PARAMETERS:
-!
+
character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input
-!
-! !REVISION HISTORY:
-! 21 Jan 2021 - T.M. Fritz - Initial version
-!EOP
-!------------------------------------------------------------------------------
-!BOC
-!
-! !LOCAL VARIABLES:
-!
integer :: unitn, ierr
- character(len=*), parameter :: subname = 'gc_readnl'
+ character(len=*), parameter :: subname = 'geoschem_readnl'
- namelist /gc_nl/ gc_cheminputs
-
- !-----------------------------------------------------------------------------
+ namelist /geoschem_nl/ geoschem_cheminputs
! Read namelist
IF ( MasterProc ) THEN
unitn = getunit()
OPEN( unitn, FILE=TRIM(nlfile), STATUS='old' )
- CALL find_group_name(unitn, 'gc_nl', STATUS=ierr)
+ CALL find_group_name(unitn, 'geoschem_nl', STATUS=ierr)
IF ( ierr == 0 ) THEN
- READ(unitn, gc_nl, IOSTAT=ierr)
+ READ(unitn, geoschem_nl, IOSTAT=ierr)
IF ( ierr /= 0 ) THEN
CALL ENDRUN(subname // ':: ERROR reading namelist')
ENDIF
@@ -1811,40 +1787,46 @@ subroutine gc_readnl(nlfile)
CALL freeunit(unitn)
ENDIF
-#ifdef SPMD
! Broadcast namelist variables
- CALL MPIBCAST(gc_cheminputs, LEN(gc_cheminputs), MPICHAR, 0, MPICOM)
-#endif
-
- end subroutine
-!EOC
+ CALL mpi_bcast(geoschem_cheminputs, LEN(geoschem_cheminputs), mpi_character, masterprocid, mpicom, ierr)
+ IF ( ierr /= mpi_success ) then
+ CALL endrun(subname//': MPI_BCAST ERROR: geoschem_cheminputs')
+ ENDIF
-!===============================================================================
+ end subroutine geoschem_readnl
+ !================================================================================================
+ ! subroutine chem_timestep_tend
+ !================================================================================================
subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o )
- use physics_buffer, only : physics_buffer_desc, pbuf_get_field, pbuf_old_tim_idx
- use physics_buffer, only : pbuf_get_chunk, pbuf_get_index
- use perf_mod, only : t_startf, t_stopf
+ ! CAM modules
use cam_history, only : outfld, hist_fld_active
use camsrfexch, only : cam_in_t, cam_out_t
-
-#ifdef SPMD
- use mpishorthand
-#endif
-
- use phys_grid, only : get_ncols_p, get_rlat_all_p, get_rlon_all_p
-
- use mo_chem_utls, only : get_spc_ndx
use chem_mods, only : drySpc_ndx, map2GC_dryDep
use chem_mods, only : nfs, indexm, gas_pcnst
- use mo_mean_mass, only : set_mean_mass
- use mo_setinv, only : setinv
+ use gas_wetdep_opts, only : gas_wetdep_method
+ use mo_chem_utls, only : get_spc_ndx
use mo_flbc, only : flbc_set
use mo_ghg_chem, only : ghg_chem_set_flbc
+ use mo_mean_mass, only : set_mean_mass
use mo_neu_wetdep, only : neu_wetdep_tend
- use gas_wetdep_opts, only : gas_wetdep_method
+ use mo_setinv, only : setinv
+ use orbit, only : zenith ! For computing SZA
+ use physics_buffer, only : physics_buffer_desc, pbuf_get_field, pbuf_old_tim_idx
+ use physics_buffer, only : pbuf_get_chunk, pbuf_get_index
+ use perf_mod, only : t_startf, t_stopf
+ use phys_grid, only : get_ncols_p, get_rlat_all_p, get_rlon_all_p
+ use phys_grid, only : get_area_all_p, get_lat_all_p, get_lon_all_p
+ use physconst, only : MWDry, Gravit
+ use rad_constituents, only : rad_cnst_get_info
+ use short_lived_species, only : get_short_lived_species_gc, set_short_lived_species_gc
+ use spmd_utils, only : masterproc
+ use time_manager, only : Get_Curr_Calday, Get_Curr_Date ! For computing SZA
+ use tropopause, only : Tropopause_findChemTrop, Tropopause_Find
+ use wv_saturation, only : QSat
#if defined( MODAL_AERO )
+ use aero_model, only : aero_model_gasaerexch ! Aqueous chemistry and aerosol growth
use modal_aero_data, only : ntot_amode, nspec_amode
use modal_aero_data, only : nspec_max, nsoa
use modal_aero_data, only : lmassptr_amode, numptr_amode
@@ -1852,68 +1834,36 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o )
use modal_aero_data, only : lptr2_soa_a_amode, lptr2_soa_g_amode
#endif
- use Diagnostics_Mod, only : Zero_Diagnostics_StartOfTimestep
- use Diagnostics_Mod, only : Set_Diagnostics_EndofTimestep
- use Aerosol_Mod, only : Set_AerMass_Diagnostic
- use Olson_Landmap_Mod, only : Compute_Olson_Landmap
- use Modis_LAI_Mod, only : Compute_XLAI
- use CMN_Size_Mod, only : NSURFTYPE
- use Drydep_Mod, only : Do_Drydep
- use Drydep_Mod, only : DEPNAME, NDVZIND
- use Drydep_Mod, only : Update_DryDepFreq
+ ! GEOS-Chem interface modules in CAM
+ use GeosChem_Emissions_Mod, only : GC_Emissions_Calc
+ use GeosChem_Diagnostics_Mod, only : GC_Diagnostics_Calc, wetdep_name, wtrate_name
+ use GeosChem_History_Mod, only : HistoryExports_SetDataPointers, CopyGCStates2Exports
- use Calc_Met_Mod, only : Set_Dry_Surface_Pressure
- use Calc_Met_Mod, only : AirQnt
- use GC_Grid_Mod, only : SetGridFromCtr
- use Pressure_Mod, only : Set_Floating_Pressures
- use Pressure_Mod, only : Accept_External_Pedge
- use Time_Mod, only : Accept_External_Date_Time
- use Toms_Mod, only : Compute_Overhead_O3
+ ! GEOS-Chem modules
+ use Aerosol_Mod, only : Set_AerMass_Diagnostic
+ use Calc_Met_Mod, only : Set_Dry_Surface_Pressure, AirQnt
use Chemistry_Mod, only : Do_Chemistry
- use Wetscav_Mod, only : Setup_Wetscav
- use CMN_Size_Mod, only : PTop
- use PBL_Mix_Mod, only : Compute_PBL_Height
- use UCX_Mod, only : Set_H2O_Trac
use CMN_FJX_MOD, only : ZPJ
+ use CMN_Size_Mod, only : NSURFTYPE, PTop
+ use Diagnostics_Mod, only : Zero_Diagnostics_StartOfTimestep, Set_Diagnostics_EndofTimestep
+ use Drydep_Mod, only : Do_Drydep, DEPNAME, NDVZIND, Update_DryDepFreq
use FAST_JX_MOD, only : RXN_NO2, RXN_O3_1
- use State_Diag_Mod, only : get_TagInfo
- use Unitconv_Mod, only : Convert_Spc_Units
- use State_Chm_Mod, only : Ind_
-
+ use GC_Grid_Mod, only : SetGridFromCtr
+ use HCO_Interface_GC_Mod,only : Compute_Sflx_For_Vdiff
use Linear_Chem_Mod, only : TrID_GC, GC_Bry_TrID, NSCHEM
use Linear_Chem_Mod, only : BrPtrDay, BrPtrNight, PLVEC, GMI_OH
-
- use GeosChem_Emissions_Mod, only : GC_Emissions_Calc
- use GeosChem_Diagnostics_Mod, only : GC_Diagnostics_Calc
- use GeosChem_Diagnostics_Mod, only : wetdep_name, wtrate_name
-
- use Tropopause, only : Tropopause_findChemTrop, Tropopause_Find
- use HCO_Interface_GC_Mod ! Utility routines for GC-HEMCO interface
-
- ! For calculating SZA
- use Orbit, only : zenith
- use Time_Manager, only : Get_Curr_Calday, Get_Curr_Date
-
- ! Calculating relative humidity
- use WV_Saturation, only : QSat
-
- ! Grid area
- use Phys_Grid, only : get_area_all_p, get_lat_all_p, get_lon_all_p
-
- use short_lived_species, only : get_short_lived_species_gc
- use short_lived_species, only : set_short_lived_species_gc
-
-#if defined( MODAL_AERO )
- ! Aqueous chemistry and aerosol growth
- use aero_model, only : aero_model_gasaerexch
-#endif
-
- use rad_constituents, only : rad_cnst_get_info
-
- ! GEOS-Chem version of physical constants
+ use Olson_Landmap_Mod, only : Compute_Olson_Landmap
+ use Modis_LAI_Mod, only : Compute_XLAI
+ use PBL_Mix_Mod, only : Compute_PBL_Height
use PhysConstants, only : PI, PI_180, g0, AVO, Re, g0_100
- ! CAM version of physical constants
- use PhysConst, only : MWDry, Gravit
+ use Pressure_Mod, only : Set_Floating_Pressures, Accept_External_Pedge
+ use State_Chm_Mod, only : Ind_
+ use State_Diag_Mod, only : get_TagInfo
+ use Time_Mod, only : Accept_External_Date_Time
+ use Toms_Mod, only : Compute_Overhead_O3
+ use UCX_Mod, only : Set_H2O_Trac
+ use Unitconv_Mod, only : Convert_Spc_Units
+ use Wetscav_Mod, only : Setup_Wetscav
REAL(r8), INTENT(IN) :: dT ! Time step
TYPE(physics_state), INTENT(IN) :: state ! Physics State variables
@@ -1996,10 +1946,11 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o )
REAL(r8) :: eflx(pcols,pver,pcnst) ! 3-D emissions in kg/m2/s
! For GEOS-Chem diagnostics
- REAL(r8) :: mmr_tend(state%NCOL,PVER,gas_pcnst)
- REAL(r8) :: wk_out(state%NCOL)
- LOGICAL :: Found
- CHARACTER(LEN=255) :: tagName
+ REAL(r8) :: mmr_tend(state%NCOL,PVER,gas_pcnst)
+ REAL(r8) :: wk_out(state%NCOL)
+ LOGICAL :: Found
+
+ CHARACTER(LEN=shr_kind_cl) :: tagName
REAL(r8), PARAMETER :: zlnd = 0.01_r8 ! Roughness length for soil [m]
REAL(r8), PARAMETER :: zslnd = 0.0024_r8 ! Roughness length for snow [m]
@@ -2031,8 +1982,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o )
! Calculating SZA
REAL(r8) :: Calday
- CHARACTER(LEN=255) :: SpcName
- CHARACTER(LEN=255) :: Prefix, FieldName
+ CHARACTER(LEN=shr_kind_cl) :: SpcName
+ CHARACTER(LEN=shr_kind_cl) :: Prefix, FieldName
+
LOGICAL :: FND
INTEGER :: SpcId
TYPE(Species), POINTER :: SpcInfo
@@ -2245,6 +2197,12 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o )
ENDDO
#if defined( MODAL_AERO )
+ ! NOTE: GEOS-Chem bulk aerosol concentrations (BCPI, BCPO, SO4, ...) are ZEROED OUT
+ ! here in order to be reconstructed from the modal concentrations.
+ !
+ ! This means that any changes to the BULK mass will be ignored between the end
+ ! of the gas_phase_chemdr and the beginning of the next!!
+ !
! First reset State_Chm%Species to zero out MAM-inherited GEOS-Chem aerosols
DO M = 1, ntot_amode
DO SM = 1, nspec_amode(M)
@@ -2290,8 +2248,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o )
! mapCnst(constituent index) constituent index chemical tracer index
! lmassptr_amode(SM, M) SM, M constituent index (modal)
! map2GC(bulk constituent index) constituent index (bulk) GEOS-Chem species index (bulk)
- ! map2MAM4(SM, M) SM, M (modal) constituent index (bulk) this is a N to 1 operation.
- !
+ ! map2MAM4(SM, M) SM, M (modal) constituent index (bulk)
+ ! (map2MAM4 is a N to 1 operation)
! Query functions:
! xname_massptr(SM, M) SM, M NAME of modal aer (bc_a1, bc_a4, ...)
!------------------------------------------------------------------------------------------
@@ -2430,25 +2388,28 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o )
K4 = Ind_(speciesName_4)
DO J = 1, nY
DO L = 1, nZ
+ ! Total SOA aerosol masses from GC are available. Partition according to the ratio given in speciesId_N to totMass summed above.
IF ( totMass(J,L) > 0.0e+00_r8 ) THEN
IF ( K1 > 0 ) State_Chm(LCHNK)%Species(K1)%Conc(1,J,L) = state%q(J,nZ+1-L,speciesId_1) / totMass(J,nZ+1-L) * bulkMass(J,nZ+1-L) * adv_mass(mapCnst(speciesId_1)) / tmpMW_g
- IF ( K2 > 0 ) State_Chm(LCHNK)%Species(K1)%Conc(1,J,L) = state%q(J,nZ+1-L,speciesId_2) / totMass(J,nZ+1-L) * bulkMass(J,nZ+1-L) * adv_mass(mapCnst(speciesId_2)) / tmpMW_g
+ IF ( K2 > 0 ) State_Chm(LCHNK)%Species(K2)%Conc(1,J,L) = state%q(J,nZ+1-L,speciesId_2) / totMass(J,nZ+1-L) * bulkMass(J,nZ+1-L) * adv_mass(mapCnst(speciesId_2)) / tmpMW_g
IF ( K3 > 0 ) State_Chm(LCHNK)%Species(K3)%Conc(1,J,L) = state%q(J,nZ+1-L,speciesId_3) / totMass(J,nZ+1-L) * bulkMass(J,nZ+1-L) * adv_mass(mapCnst(speciesId_3)) / tmpMW_g
IF ( K4 > 0 ) State_Chm(LCHNK)%Species(K4)%Conc(1,J,L) = state%q(J,nZ+1-L,speciesId_4) / totMass(J,nZ+1-L) * bulkMass(J,nZ+1-L) * adv_mass(mapCnst(speciesId_4)) / tmpMW_g
ELSE
+ ! Total SOA aerosol masses from GC are unknown. In this case partition the bulkMass by 1/2 to K1 and K2.
IF ( K1 == K2 ) THEN
+ ! ... go in same bin. This actually does not exist in the partitioning above.
State_Chm(LCHNK)%Species(K1)%Conc(1,J,L) = bulkMass(J,nZ+1-L) * adv_mass(mapCnst(speciesId_1)) / tmpMW_g
ELSE
State_Chm(LCHNK)%Species(K1)%Conc(1,J,L) = bulkMass(J,nZ+1-L) * adv_mass(mapCnst(speciesId_1)) / tmpMW_g / 2.0_r8
- State_Chm(LCHNK)%Species(K1)%Conc(1,J,L) = bulkMass(J,nZ+1-L) * adv_mass(mapCnst(speciesId_1)) / tmpMW_g / 2.0_r8
+ State_Chm(LCHNK)%Species(K2)%Conc(1,J,L) = bulkMass(J,nZ+1-L) * adv_mass(mapCnst(speciesId_2)) / tmpMW_g / 2.0_r8
ENDIF
ENDIF
ENDDO
ENDDO
IF ( K1 > 0 ) MMR_Beg(:nY,:nZ,K1) = State_Chm(LCHNK)%Species(K1)%Conc(1,:nY,:nZ)
IF ( K2 > 0 ) MMR_Beg(:nY,:nZ,K2) = State_Chm(LCHNK)%Species(K2)%Conc(1,:nY,:nZ)
- IF ( K3 > 0 ) MMR_Beg(:nY,:nZ,K4) = State_Chm(LCHNK)%Species(K3)%Conc(1,:nY,:nZ)
- IF ( K4 > 0 ) MMR_Beg(:nY,:nZ,K3) = State_Chm(LCHNK)%Species(K4)%Conc(1,:nY,:nZ)
+ IF ( K3 > 0 ) MMR_Beg(:nY,:nZ,K3) = State_Chm(LCHNK)%Species(K3)%Conc(1,:nY,:nZ)
+ IF ( K4 > 0 ) MMR_Beg(:nY,:nZ,K4) = State_Chm(LCHNK)%Species(K4)%Conc(1,:nY,:nZ)
ENDDO
ENDIF
@@ -2468,15 +2429,18 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o )
ENDIF
#endif
+ ! Convert mass fluxes to VMR as needed for MAM4 aerosols (these operate on vmr0 - initial and vmr1 - end of timestep)
DO N = 1, gas_pcnst
! See definition of map2chm
M = map2chm(N)
IF ( M > 0 ) THEN
+ ! Is a GEOS-Chem species?
vmr0(:nY,:nZ,N) = State_Chm(LCHNK)%Species(M)%Conc(1,:nY,nZ:1:-1) * &
MWDry / adv_mass(N)
! We'll substract concentrations after chemistry later
mmr_tend(:nY,:nZ,N) = REAL(State_Chm(LCHNK)%Species(M)%Conc(1,:nY,nZ:1:-1),r8)
ELSEIF ( M < 0 ) THEN
+ ! Is a MAM4 species? Get VMR from state%q directly.
vmr0(:nY,:nZ,N) = state%q(:nY,:nZ,-M) * &
MWDry / adv_mass(N)
mmr_tend(:nY,:nZ,N) = state%q(:nY,:nZ,-M)
@@ -2782,12 +2746,18 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o )
! Dimensions : nX, nY
State_Met(LCHNK)%SLP (1,:nY) = state%ps(:nY)*0.01e+0_fp
- ! Field : TS, TSKIN
- ! Description: Surface temperature, surface skin temperature
+ ! Field : TS
+ ! Description: Surface temperature
! Unit : K
! Dimensions : nX, nY
State_Met(LCHNK)%TS (1,:nY) = cam_in%TS(:nY)
- State_Met(LCHNK)%TSKIN (1,:nY) = cam_in%TS(:nY)
+
+ ! Field : TSKIN
+ ! Description: Surface skin temperature
+ ! Remarks : NOT to be confused with TS (T at 2m) (hplin, 3/20/23)
+ ! Unit : K
+ ! Dimensions : nX, nY
+ State_Met(LCHNK)%TSKIN (1,:nY) = cam_in%SST(:nY)
! Field : SWGDN
! Description: Incident radiation @ ground
@@ -3922,14 +3892,16 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o )
! Deal with aerosol SOA species
! First deal with lowest two volatility bins
+ ! Only map TOSA0 (K1) and ASOAN (K2) to soa1_ and soa2_, according to Fritz et al.
+ ! SOAIE (K3) and SOAGX (K4) were mapped in the code but are inconsistent with the model description paper.
speciesName_1 = 'TSOA0'
speciesName_2 = 'ASOAN'
- speciesName_2 = 'SOAIE'
- speciesName_2 = 'SOAGX'
- K1 = get_spc_ndx(TRIM(speciesName_1), compare_uppercase=.true.)
- K2 = get_spc_ndx(TRIM(speciesName_2), compare_uppercase=.true.)
- K3 = get_spc_ndx(TRIM(speciesName_3), compare_uppercase=.true.)
- K4 = get_spc_ndx(TRIM(speciesName_4), compare_uppercase=.true.)
+ speciesName_3 = 'SOAIE'
+ speciesName_4 = 'SOAGX'
+ K1 = get_spc_ndx(TRIM(speciesName_1), ignore_case=.true.)
+ K2 = get_spc_ndx(TRIM(speciesName_2), ignore_case=.true.)
+ K3 = get_spc_ndx(TRIM(speciesName_3), ignore_case=.true.)
+ K4 = get_spc_ndx(TRIM(speciesName_4), ignore_case=.true.)
bulkMass(:nY,:nZ) = 0.0e+00_r8
DO iBin = 1, 2
DO M = 1, ntot_amode
@@ -3943,10 +3915,9 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o )
N = lptr2_soa_a_amode(M,iBin)
IF ( N <= 0 ) CYCLE
P = mapCnst(N)
- IF ( P > 0 .AND. K1 > 0 .AND. K2 > 0 .AND. K3 > 0 .AND. K4 > 0 ) THEN
+ IF ( P > 0 .AND. K1 > 0 .AND. K2 > 0 ) THEN
vmr1(:nY,:nZ,P) = state%q(:nY,:nZ,N) / bulkMass(:nY,:nZ) &
- * (vmr1(:nY,:nZ,K1) + vmr1(:nY,:nZ,K2) + &
- vmr1(:nY,:nZ,K3) + vmr1(:nY,:nZ,K4))
+ * (vmr1(:nY,:nZ,K1) + vmr1(:nY,:nZ,K2))
ENDIF
ENDDO
ENDDO
@@ -3963,8 +3934,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o )
speciesName_1 = 'TSOA3'
speciesName_2 = 'ASOA3'
ENDIF
- K1 = get_spc_ndx(TRIM(speciesName_1), compare_uppercase=.true. )
- K2 = get_spc_ndx(TRIM(speciesName_2), compare_uppercase=.true. )
+ K1 = get_spc_ndx(TRIM(speciesName_1), ignore_case=.true. )
+ K2 = get_spc_ndx(TRIM(speciesName_2), ignore_case=.true. )
bulkMass(:nY,:nZ) = 0.0e+00_r8
DO M = 1, ntot_amode
N = lptr2_soa_a_amode(M,iBin)
@@ -3983,11 +3954,12 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o )
ENDDO
! Now deal with gaseous SOA species
- ! Deal with lowest two volatility bins
+ ! Deal with lowest two volatility bins - TSOG0 corresponds to SOAG0 and SOAG1
speciesName_1 = 'TSOG0'
- K1 = get_spc_ndx(TRIM(speciesName_1), compare_uppercase=.true.)
+ K1 = get_spc_ndx(TRIM(speciesName_1), ignore_case=.true.)
N = lptr2_soa_g_amode(1)
P = mapCnst(N)
+ ! current mode other modes (this mapping was verified to be correct.)
vmr1(:nY,:nZ,P) = vmr0(:nY,:nZ,P) / (vmr0(:nY,:nZ,P) + vmr0(:nY,:nZ,mapCnst(lptr2_soa_g_amode(2)))) &
* vmr1(:nY,:nZ,K1)
N = lptr2_soa_g_amode(2)
@@ -4009,8 +3981,8 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o )
speciesName_1 = 'TSOG3'
speciesName_2 = 'ASOG3'
ENDIF
- K1 = get_spc_ndx(TRIM(speciesName_1), compare_uppercase=.true.)
- K2 = get_spc_ndx(TRIM(speciesName_2), compare_uppercase=.true.)
+ K1 = get_spc_ndx(TRIM(speciesName_1), ignore_case=.true.)
+ K2 = get_spc_ndx(TRIM(speciesName_2), ignore_case=.true.)
IF ( P > 0 .AND. K1 > 0 .AND. K2 > 0 ) vmr1(:nY,:nZ,P) = vmr1(:nY,:nZ,K1) + vmr1(:nY,:nZ,K2)
ENDDO
@@ -4238,16 +4210,17 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o )
Nullify(NEvapr )
Nullify(cmfdqr )
- IF ( rootChunk ) WRITE(iulog,*) ' GEOS-Chem Chemistry step ', iStep, ' completed'
- IF ( lastChunk ) WRITE(iulog,*) ' Chemistry completed on all chunks completed of MasterProc'
+ IF ( rootChunk ) WRITE(iulog,*) 'GEOS-Chem Chemistry step ', iStep, ' completed'
+ IF ( lastChunk ) WRITE(iulog,*) 'Chemistry completed on all chunks of root CPU'
IF ( FIRST ) THEN
FIRST = .false.
ENDIF
end subroutine chem_timestep_tend
-!===============================================================================
-
+ !================================================================================================
+ ! subroutine chem_init_cnst
+ !================================================================================================
subroutine chem_init_cnst(name, latvals, lonvals, mask, q)
CHARACTER(LEN=*), INTENT(IN) :: name ! constituent name
@@ -4278,36 +4251,35 @@ subroutine chem_init_cnst(name, latvals, lonvals, mask, q)
end subroutine chem_init_cnst
-!===============================================================================
-
+ !================================================================================================
+ ! subroutine chem_final
+ !================================================================================================
subroutine chem_final
+ ! CAM modules
+ use short_lived_species, only : short_lived_species_final
+
+ ! GEOS-Chem interface modules in CAM
+ use geoschem_emissions_mod, only : GC_Emissions_Final
+ use geoschem_history_mod, only : Destroy_HistoryConfig
+
+ ! GEOS-Chem modules
+ use Aerosol_Mod, only : Cleanup_Aerosol
+ use Carbon_Mod, only : Cleanup_Carbon
+ use CMN_FJX_Mod, only : Cleanup_CMN_FJX
+ use Drydep_Mod, only : Cleanup_Drydep
+ use Dust_Mod, only : Cleanup_Dust
+ use Error_Mod, only : Cleanup_Error
+ use Fullchem_Mod, only : Cleanup_FullChem
use Input_Opt_Mod, only : Cleanup_Input_Opt
+ use Linear_Chem_Mod, only : Cleanup_Linear_Chem
+ use Pressure_Mod, only : Cleanup_Pressure
+ use Seasalt_Mod, only : Cleanup_Seasalt
use State_Chm_Mod, only : Cleanup_State_Chm
use State_Diag_Mod, only : Cleanup_State_Diag
use State_Grid_Mod, only : Cleanup_State_Grid
use State_Met_Mod, only : Cleanup_State_Met
- use Error_Mod, only : Cleanup_Error
- use Fullchem_Mod, only : Cleanup_FullChem
- use Drydep_Mod, only : Cleanup_Drydep
- use Carbon_Mod, only : Cleanup_Carbon
- use Dust_Mod, only : Cleanup_Dust
- use Seasalt_Mod, only : Cleanup_Seasalt
- use Aerosol_Mod, only : Cleanup_Aerosol
use Sulfate_Mod, only : Cleanup_Sulfate
- use Pressure_Mod, only : Cleanup_Pressure
- use Linear_Chem_Mod, only : Cleanup_Linear_Chem
-
- use CMN_FJX_Mod, only : Cleanup_CMN_FJX
-
-#ifdef BPCH_DIAG
- use CMN_O3_Mod, only : Cleanup_CMN_O3
- ! Special: cleans up after NDXX_Setup
- use Diag_Mod, only : Cleanup_Diag
-#endif
-
- use GeosChem_Emissions_Mod, only : GC_Emissions_Final
- use short_lived_species, only : short_lived_species_final
! Local variables
INTEGER :: I, RC
@@ -4342,17 +4314,6 @@ subroutine chem_final
CALL Error_Stop( ErrMsg, ThisLoc )
ENDIF
-#ifdef BPCH_DIAG
- CALL Cleanup_Diag
-
- ! Call extra cleanup routines, from modules in Headers/
- CALL Cleanup_CMN_O3( RC )
- IF ( RC /= GC_SUCCESS ) THEN
- ErrMsg = 'Error encountered in "Cleanup_CMN_O3"!'
- CALL Error_Stop( ErrMsg, ThisLoc )
- ENDIF
-#endif
-
! Cleanup Input_Opt
CALL Cleanup_Input_Opt( Input_Opt, RC )
@@ -4377,12 +4338,15 @@ subroutine chem_final
end subroutine chem_final
-!===============================================================================
-
+ !================================================================================================
+ ! subroutine chem_init_restart
+ !================================================================================================
subroutine chem_init_restart(File)
- use tracer_cnst, only: init_tracer_cnst_restart
- use tracer_srcs, only: init_tracer_srcs_restart
- use pio, only : file_desc_t
+
+ ! CAM modules
+ use pio, only : file_desc_t
+ use tracer_cnst, only : init_tracer_cnst_restart
+ use tracer_srcs, only : init_tracer_srcs_restart
IMPLICIT NONE
@@ -4399,74 +4363,71 @@ subroutine chem_init_restart(File)
end subroutine chem_init_restart
-!===============================================================================
-
+ !================================================================================================
+ ! subroutine chem_write_restart
+ !================================================================================================
subroutine chem_write_restart( File )
- use tracer_cnst, only: write_tracer_cnst_restart
- use tracer_srcs, only: write_tracer_srcs_restart
- !use linoz_data, only: write_linoz_data_restart
- use pio, only : file_desc_t
+
+ ! CAM modules
+ use pio, only : file_desc_t
+ use tracer_cnst, only : write_tracer_cnst_restart
+ use tracer_srcs, only : write_tracer_srcs_restart
IMPLICIT NONE
TYPE(file_desc_t) :: File
WRITE(iulog,'(a)') 'chem_write_restart: writing restarts for tracer sources and offline fields'
- !
+
! data for offline tracers
- !
call write_tracer_cnst_restart(File)
call write_tracer_srcs_restart(File)
- !call write_linoz_data_restart(File)
- end subroutine chem_write_restart
-!===============================================================================
+ end subroutine chem_write_restart
+ !================================================================================================
+ ! subroutine chem_read_restart
+ !================================================================================================
subroutine chem_read_restart( File )
- use tracer_cnst, only: read_tracer_cnst_restart
- use tracer_srcs, only: read_tracer_srcs_restart
- !use linoz_data, only: read_linoz_data_restart
- use pio, only : file_desc_t
+
+ ! CAM modules
+ use pio, only : file_desc_t
+ use tracer_cnst, only : read_tracer_cnst_restart
+ use tracer_srcs, only : read_tracer_srcs_restart
IMPLICIT NONE
TYPE(file_desc_t) :: File
WRITE(iulog,'(a)') 'GCCALL CHEM_READ_RESTART'
- !
+
! data for offline tracers
- !
call read_tracer_cnst_restart(File)
call read_tracer_srcs_restart(File)
- !call read_linoz_data_restart(File)
- end subroutine chem_read_restart
-!================================================================================
+ end subroutine chem_read_restart
- subroutine chem_emissions( state, cam_in )
+ !================================================================================================
+ ! subroutine chem_emissions
+ !================================================================================================
+ subroutine chem_emissions( state, cam_in, pbuf )
+ ! CAM modules
use camsrfexch, only : cam_in_t
-
- ! Arguments:
+ use physics_buffer, only : physics_buffer_desc
TYPE(physics_state), INTENT(IN) :: state ! Physics state variables
TYPE(cam_in_t), INTENT(INOUT) :: cam_in ! import state
+ TYPE(physics_buffer_desc), pointer :: pbuf(:) ! Physics buffer in chunk, for HEMCO
INTEGER :: M, N
- INTEGER :: LCHNK, nY
+ INTEGER :: nY
LOGICAL :: rootChunk
+ nY = state%NCOL ! number of atmospheric columns on this chunk
+ rootChunk = ( MasterProc .and. (state%LCHNK .eq. BEGCHUNK) )
- ! LCHNK: which chunk we have on this process
- LCHNK = state%LCHNK
- ! NCOL: number of atmospheric columns on this chunk
- nY = state%NCOL
- rootChunk = ( MasterProc.and.(LCHNK.EQ.BEGCHUNK) )
-
- !-----------------------------------------------------------------------
! Reset surface fluxes
- !-----------------------------------------------------------------------
-
DO M = iFirstCnst, pcnst
!N = map2chm(M)
!IF ( N > 0 ) cam_in%cflx(1:nY,N) = 0.0e+0_r8
@@ -4475,6 +4436,4 @@ subroutine chem_emissions( state, cam_in )
end subroutine chem_emissions
-!===============================================================================
-
end module chemistry
diff --git a/src/chemistry/geoschem/geoschem_diagnostics_mod.F90 b/src/chemistry/geoschem/geoschem_diagnostics_mod.F90
index 1b729121f1..447d2c29cd 100644
--- a/src/chemistry/geoschem/geoschem_diagnostics_mod.F90
+++ b/src/chemistry/geoschem/geoschem_diagnostics_mod.F90
@@ -1,44 +1,27 @@
-!------------------------------------------------------------------------------
-! GEOS-Chem chemistry diagnostics interface !
-!------------------------------------------------------------------------------
-!BOP
-!
-! !MODULE: geoschem_diagnostics_mod.F90
-!
-! !DESCRIPTION: Module geoschem\_diagnostics\_mod contains routines which aim to
-! diagnose variables from GEOS-Chem
-!\\
-!\\
-! !INTERFACE:
-!
MODULE GeosChem_Diagnostics_Mod
-!
-! !USES:
-!
- USE SHR_KIND_MOD, ONLY : r8 => shr_kind_r8
- USE SHR_CONST_MOD, ONLY : pi => shr_const_pi
- USE CAM_HISTORY, ONLY : fieldname_len
- USE CONSTITUENTS, ONLY : pcnst
- USE CHEM_MODS, ONLY : gas_pcnst, map2chm
- USE CHEM_MODS, ONLY : iFirstCnst
- USE MO_TRACNAME, ONLY : solsym
- USE SPMD_UTILS, ONLY : MasterProc
- USE PPGRID, ONLY : begchunk, pver
- USE CAM_LOGFILE, ONLY : iulog
- USE STRING_UTILS, ONLY : to_upper
- USE Error_Mod ! For error checking
- USE ErrCode_Mod ! Error codes for success or failure
+
+ ! CAM modules
+ use cam_history, only : fieldname_len
+ use cam_logfile, only : iulog
+ use chem_mods, only : gas_pcnst, map2chm, iFirstCnst
+ use constituents, only : pcnst
+ use mo_tracname, only : solsym
+ use ppgrid, only : begchunk, pver
+ use shr_const_mod, only : pi => shr_const_pi
+ use shr_kind_mod, only : r8 => shr_kind_r8, shr_kind_cl
+ use spmd_utils, only : MasterProc
+ use string_utils, only : to_upper
+
+ ! GEOS-Chem modules
+ use ErrCode_Mod, only : GC_SUCCESS
IMPLICIT NONE
PRIVATE
-!
-! !PUBLIC MEMBER FUNCTIONS:
-!
PUBLIC :: GC_Diagnostics_Init
PUBLIC :: GC_Diagnostics_Calc
- PUBLIC :: wetdep_name, wtrate_name
+ PUBLIC :: wetdep_name, wtrate_name, dtchem_name
CHARACTER(LEN=fieldname_len) :: srcnam(gas_pcnst) ! Names of source/sink tendencies
CHARACTER(LEN=fieldname_len) :: wetdep_name(gas_pcnst) ! Wet deposition tendencies
@@ -124,58 +107,34 @@ MODULE GeosChem_Diagnostics_Mod
integer :: id_o,id_o2,id_h,id_n2o
integer :: id_co2,id_o3,id_oh,id_ho2,id_so4_a1,id_so4_a2,id_so4_a3
integer :: id_num_a2,id_num_a3,id_dst_a3,id_ncl_a3
-!
+
! !REVISION HISTORY:
! 28 Oct 2020 - T. M. Fritz - Initial version
-!EOP
-!------------------------------------------------------------------------------
-!BOC
-!
+
CONTAINS
-!
-!EOC
-!------------------------------------------------------------------------------
-!BOP
-!
-! !IROUTINE: gc_diagnostics_init
-!
-! !DESCRIPTION: Subroutine GC\_Diagnostics\_Init declares the variables to
-! diagnosethe
-!\\
-!\\
-! !INTERFACE:
-!
+
SUBROUTINE GC_Diagnostics_Init( Input_Opt, State_Chm, State_Met )
-!
-! !USES:
-!
- USE Input_Opt_Mod, ONLY : OptInput
- USE State_Chm_Mod, ONLY : ChmState
- USE State_Met_Mod, ONLY : MetState
- USE State_Diag_Mod, ONLY : get_TagInfo
- USE Species_Mod, ONLY : Species
- USE Registry_Mod, ONLY : MetaRegItem, RegItem
- USE State_Chm_Mod, ONLY : Ind_
- USE CONSTITUENTS, ONLY : cnst_name, sflxnam
- USE CONSTITUENTS, ONLY : cnst_get_ind
- USE CAM_HISTORY, ONLY : addfld, add_default, horiz_only
- USE PHYS_CONTROL, ONLY : phys_getopts
- USE DRYDEP_MOD, ONLY : depName
- USE MO_CHEM_UTLS, ONLY : get_spc_ndx
-!
-! !INPUT PARAMETERS:
-!
+
+ ! CAM modules
+ use cam_history, only : addfld, add_default, horiz_only
+ use constituents, only : cnst_name, sflxnam, cnst_get_ind
+ use mo_chem_utls, only : get_spc_ndx
+ use phys_control, only : phys_getopts
+
+ ! GEOS-Chem modules
+ use Input_Opt_Mod, only : OptInput
+ use State_Chm_Mod, only : ChmState
+ use State_Met_Mod, only : MetState
+ use State_Diag_Mod, only : get_TagInfo
+ use Species_Mod, only : Species
+ use Registry_Mod, only : MetaRegItem, RegItem
+ use State_Chm_Mod, only : Ind_
+ use DryDep_Mod, only : depName
+
TYPE(OptInput), INTENT(IN) :: Input_Opt ! Input options
TYPE(ChmState), INTENT(IN) :: State_Chm ! Chemistry State object
TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology State object
-!
-! !REVISION HISTORY:
-! 20 Oct 2020 - T. M. Fritz - Initial version
-!EOP
-!------------------------------------------------------------------------------
-!BOC
-!
- ! Integer
+
INTEGER :: M, N, K, SM
INTEGER :: idx
INTEGER :: RC
@@ -189,9 +148,7 @@ SUBROUTINE GC_Diagnostics_Init( Input_Opt, State_Chm, State_Met )
INTEGER :: history_budget_histfile_num ! output history file number
! for budget fields
- ! Logical
LOGICAL :: Found
- LOGICAL :: compare_uppercase ! Compare upper-case names
LOGICAL :: history_aerosol ! Output the MAM aerosol
! tendencies
LOGICAL :: history_chemistry
@@ -207,12 +164,11 @@ SUBROUTINE GC_Diagnostics_Init( Input_Opt, State_Chm, State_Met )
! cloud ice and cloud
! liquid budgets.
- ! Strings
- CHARACTER(LEN=255) :: SpcName
- CHARACTER(LEN=255) :: tagName
- CHARACTER(LEN=255) :: ThisLoc
- CHARACTER(LEN=255) :: ErrMsg
- CHARACTER(LEN=2) :: unit_basename ! Units 'kg' or '1'
+ CHARACTER(LEN=shr_kind_cl) :: SpcName
+ CHARACTER(LEN=shr_kind_cl) :: tagName
+ CHARACTER(LEN=shr_kind_cl) :: ThisLoc
+ CHARACTER(LEN=shr_kind_cl) :: ErrMsg
+ CHARACTER(LEN=2) :: unit_basename ! Units 'kg' or '1'
! Objects
TYPE(Species), POINTER :: SpcInfo
@@ -240,53 +196,52 @@ SUBROUTINE GC_Diagnostics_Init( Input_Opt, State_Chm, State_Met )
history_scwaccm_forcing_out = history_scwaccm_forcing, &
history_dust_out = history_dust )
- compare_uppercase = .true.
-
- id_no3 = get_spc_ndx( 'NO3', compare_uppercase )
- id_o3 = get_spc_ndx( 'O3', compare_uppercase )
- id_oh = get_spc_ndx( 'OH', compare_uppercase )
- id_ho2 = get_spc_ndx( 'HO2', compare_uppercase )
- id_so4_a1 = get_spc_ndx( 'so4_a1', compare_uppercase )
- id_so4_a2 = get_spc_ndx( 'so4_a2', compare_uppercase )
- id_so4_a3 = get_spc_ndx( 'so4_a3', compare_uppercase )
- id_num_a2 = get_spc_ndx( 'num_a2', compare_uppercase )
- id_num_a3 = get_spc_ndx( 'num_a3', compare_uppercase )
- id_dst_a3 = get_spc_ndx( 'dst_a3', compare_uppercase )
- id_ncl_a3 = get_spc_ndx( 'ncl_a3', compare_uppercase )
- id_co2 = get_spc_ndx( 'CO2', compare_uppercase )
- id_no = get_spc_ndx( 'NO', compare_uppercase )
- id_h = get_spc_ndx( 'H', compare_uppercase )
- id_o = get_spc_ndx( 'O', compare_uppercase )
- id_o2 = get_spc_ndx( 'O2', compare_uppercase )
- id_ch4 = get_spc_ndx( 'CH4', compare_uppercase )
- id_h2o = get_spc_ndx( 'H2O', compare_uppercase )
- id_n2o = get_spc_ndx( 'N2O', compare_uppercase )
- id_cfc11 = get_spc_ndx( 'CFC11', compare_uppercase )
- id_cfc12 = get_spc_ndx( 'CFC12', compare_uppercase )
-
- id_bry = get_spc_ndx( 'BRY', compare_uppercase )
- id_cly = get_spc_ndx( 'CLY', compare_uppercase )
-
- id_dst01 = get_spc_ndx( 'DST01', compare_uppercase )
- id_dst02 = get_spc_ndx( 'DST02', compare_uppercase )
- id_dst03 = get_spc_ndx( 'DST03', compare_uppercase )
- id_dst04 = get_spc_ndx( 'DST04', compare_uppercase )
- id_sslt01 = get_spc_ndx( 'SSLT01', compare_uppercase )
- id_sslt02 = get_spc_ndx( 'SSLT02', compare_uppercase )
- id_sslt03 = get_spc_ndx( 'SSLT03', compare_uppercase )
- id_sslt04 = get_spc_ndx( 'SSLT04', compare_uppercase )
- id_soa = get_spc_ndx( 'SOA', compare_uppercase )
- id_so4 = get_spc_ndx( 'SO4', compare_uppercase ); id_so4 = -1 ! Don't pick up GEOS-Chem's SO4!
- id_oc1 = get_spc_ndx( 'OC1', compare_uppercase )
- id_oc2 = get_spc_ndx( 'OC2', compare_uppercase )
- id_cb1 = get_spc_ndx( 'CB1', compare_uppercase )
- id_cb2 = get_spc_ndx( 'CB2', compare_uppercase )
- id_nh4no3 = get_spc_ndx( 'NH4NO3', compare_uppercase )
- id_soam = get_spc_ndx( 'SOAM', compare_uppercase )
- id_soai = get_spc_ndx( 'SOAI', compare_uppercase )
- id_soat = get_spc_ndx( 'SOAT', compare_uppercase )
- id_soab = get_spc_ndx( 'SOAB', compare_uppercase )
- id_soax = get_spc_ndx( 'SOAX', compare_uppercase )
+ id_no3 = get_spc_ndx( 'NO3', ignore_case=.true. )
+ id_o3 = get_spc_ndx( 'O3', ignore_case=.true. )
+ id_oh = get_spc_ndx( 'OH', ignore_case=.true. )
+ id_ho2 = get_spc_ndx( 'HO2', ignore_case=.true. )
+ id_so4_a1 = get_spc_ndx( 'so4_a1', ignore_case=.true. )
+ id_so4_a2 = get_spc_ndx( 'so4_a2', ignore_case=.true. )
+ id_so4_a3 = get_spc_ndx( 'so4_a3', ignore_case=.true. )
+ id_num_a2 = get_spc_ndx( 'num_a2', ignore_case=.true. )
+ id_num_a3 = get_spc_ndx( 'num_a3', ignore_case=.true. )
+ id_dst_a3 = get_spc_ndx( 'dst_a3', ignore_case=.true. )
+ id_ncl_a3 = get_spc_ndx( 'ncl_a3', ignore_case=.true. )
+ id_co2 = get_spc_ndx( 'CO2', ignore_case=.true. )
+ id_no = get_spc_ndx( 'NO', ignore_case=.true. )
+ id_h = get_spc_ndx( 'H', ignore_case=.true. )
+ id_o = get_spc_ndx( 'O', ignore_case=.true. )
+ id_o2 = get_spc_ndx( 'O2', ignore_case=.true. )
+ id_ch4 = get_spc_ndx( 'CH4', ignore_case=.true. )
+ id_h2o = get_spc_ndx( 'H2O', ignore_case=.true. )
+ id_n2o = get_spc_ndx( 'N2O', ignore_case=.true. )
+ id_cfc11 = get_spc_ndx( 'CFC11', ignore_case=.true. )
+ id_cfc12 = get_spc_ndx( 'CFC12', ignore_case=.true. )
+
+ id_bry = get_spc_ndx( 'BRY', ignore_case=.true. )
+ id_cly = get_spc_ndx( 'CLY', ignore_case=.true. )
+
+ id_dst01 = get_spc_ndx( 'DST01', ignore_case=.true. )
+ id_dst02 = get_spc_ndx( 'DST02', ignore_case=.true. )
+ id_dst03 = get_spc_ndx( 'DST03', ignore_case=.true. )
+ id_dst04 = get_spc_ndx( 'DST04', ignore_case=.true. )
+ id_sslt01 = get_spc_ndx( 'SSLT01', ignore_case=.true. )
+ id_sslt02 = get_spc_ndx( 'SSLT02', ignore_case=.true. )
+ id_sslt03 = get_spc_ndx( 'SSLT03', ignore_case=.true. )
+ id_sslt04 = get_spc_ndx( 'SSLT04', ignore_case=.true. )
+ id_soa = get_spc_ndx( 'SOA', ignore_case=.true. )
+ !id_so4 = get_spc_ndx( 'SO4', ignore_case=.true. )i
+ id_so4 = -1 ! Don't pick up GEOS-Chem's SO4!
+ id_oc1 = get_spc_ndx( 'OC1', ignore_case=.true. )
+ id_oc2 = get_spc_ndx( 'OC2', ignore_case=.true. )
+ id_cb1 = get_spc_ndx( 'CB1', ignore_case=.true. )
+ id_cb2 = get_spc_ndx( 'CB2', ignore_case=.true. )
+ id_nh4no3 = get_spc_ndx( 'NH4NO3', ignore_case=.true. )
+ id_soam = get_spc_ndx( 'SOAM', ignore_case=.true. )
+ id_soai = get_spc_ndx( 'SOAI', ignore_case=.true. )
+ id_soat = get_spc_ndx( 'SOAT', ignore_case=.true. )
+ id_soab = get_spc_ndx( 'SOAB', ignore_case=.true. )
+ id_soax = get_spc_ndx( 'SOAX', ignore_case=.true. )
bulkaero_species(:) = -1
bulkaero_species(1:20) = (/ id_dst01, id_dst02, id_dst03, id_dst04, &
@@ -839,56 +794,39 @@ SUBROUTINE GC_Diagnostics_Init( Input_Opt, State_Chm, State_Met )
CALL Addfld( 'CT_H2O_GHG', (/ 'lev' /), 'A','kg/kg/s', 'ghg-chem h2o source/sink' )
- !=======================================================================
- ! Cleanup and quit
- !=======================================================================
+
+ ! Cleanup
Current => NULL()
Item => NULL()
END SUBROUTINE GC_Diagnostics_Init
-!EOC
-!------------------------------------------------------------------------------
-!BOP
-!
-! !IROUTINE: gc_diagnostics_calc
-!
-! !DESCRIPTION: Subroutine GC\_Diagnostics\_Calc passes the diagnostics variable
-! to the CAM History routines
-!\\
-!\\
-! !INTERFACE:
-!
+
SUBROUTINE GC_Diagnostics_Calc( Input_Opt, State_Chm, State_Diag, &
State_Grid, State_Met, cam_in, state, &
mmr_tend, LCHNK )
-!
-! !USES:
-!
- USE Input_Opt_Mod, ONLY : OptInput
- USE State_Chm_Mod, ONLY : ChmState
- USE State_Met_Mod, ONLY : MetState
- USE State_Diag_Mod, ONLY : DgnState
- USE State_Diag_Mod, ONLY : get_TagInfo
- USE State_Grid_Mod, ONLY : GrdState
- USE Species_Mod, ONLY : Species
- USE Registry_Mod, ONLY : MetaRegItem, RegItem
- USE Registry_Mod, ONLY : Registry_Lookup
- USE Registry_Params_Mod
- USE PRECISION_MOD
- USE CHEM_MODS, ONLY : adv_mass
- USE CAM_HISTORY, ONLY : outfld, hist_fld_active
- USE CONSTITUENTS, ONLY : cnst_name, sflxnam
- USE DRYDEP_MOD, ONLY : depName, Ndvzind
- USE CAMSRFEXCH, ONLY : cam_in_t
- USE PHYSICS_TYPES, ONLY : physics_state
- USE SPMD_UTILS, ONLY : MasterProc
- USE PHYSCONST, ONLY : MWDry
- USE UCX_MOD, ONLY : GET_STRAT_OPT!, AERFRAC
- USE CMN_SIZE_MOD, ONLY : NDUST
- USE CMN_FJX_MOD
-!
-! !INPUT PARAMETERS:
-!
+
+ ! CAM modules
+ use cam_history, only : outfld, hist_fld_active
+ use camsrfexch, only : cam_in_t
+ use chem_mods, only : adv_mass
+ use constituents, only : cnst_name, sflxnam
+ use physconst, only : MWDry
+ use physics_types, only : physics_state
+ use spmd_utils, only : MasterProc
+
+ ! GEOS-Chem modules
+ use CMN_Size_Mod, only : NDUST
+ use DryDep_Mod, only : depName, Ndvzind
+ use Input_Opt_Mod, only : OptInput
+ use Precision_Mod, only : f8
+ use Species_Mod, only : Species
+ use State_Chm_Mod, only : ChmState
+ use State_Diag_Mod, only : DgnState, get_TagInfo
+ use State_Grid_Mod, only : GrdState
+ use State_Met_Mod, only : MetState
+ use Registry_Mod, only : MetaRegItem, RegItem, Registry_Lookup
+ use UCX_Mod, only : GET_STRAT_OPT
+
TYPE(OptInput), INTENT(IN) :: Input_Opt ! Input options
TYPE(ChmState), INTENT(INOUT) :: State_Chm ! Chemistry State object
TYPE(DgnState), INTENT(IN) :: State_Diag ! Diag State object
@@ -899,13 +837,7 @@ SUBROUTINE GC_Diagnostics_Calc( Input_Opt, State_Chm, State_Diag, &
REAL(r8), INTENT(IN) :: mmr_tend(state%ncol,pver,gas_pcnst)
! Net tendency from chemistry in kg/s
INTEGER, INTENT(IN) :: LCHNK ! Chunk number
-!
-! !REVISION HISTORY:
-! 20 Oct 2020 - T. M. Fritz - Initial version
-!EOP
-!------------------------------------------------------------------------------
-!BOC
-!
+
! Integers
INTEGER :: I, J, L, M, N, ND, SM
INTEGER :: idx
@@ -921,10 +853,10 @@ SUBROUTINE GC_Diagnostics_Calc( Input_Opt, State_Chm, State_Diag, &
! on level edges (T/F)
! Strings
- CHARACTER(LEN=255) :: ThisLoc
- CHARACTER(LEN=255) :: ErrMsg
- CHARACTER(LEN=255) :: SpcName
- CHARACTER(LEN=255) :: tagName
+ CHARACTER(LEN=shr_kind_cl) :: ThisLoc
+ CHARACTER(LEN=shr_kind_cl) :: ErrMsg
+ CHARACTER(LEN=shr_kind_cl) :: SpcName
+ CHARACTER(LEN=shr_kind_cl) :: tagName
! Real
REAL(r8) :: wgt
@@ -1428,9 +1360,7 @@ SUBROUTINE GC_Diagnostics_Calc( Input_Opt, State_Chm, State_Diag, &
CALL Outfld( TRIM(SpcName), outTmp(:nY,:) , nY, LCHNK )
ENDIF
- !=======================================================================
- ! Cleanup and quit
- !=======================================================================
+ ! Cleanup
Current => NULL()
Item => NULL()
Ptr0d_8 => NULL()
@@ -1439,7 +1369,6 @@ SUBROUTINE GC_Diagnostics_Calc( Input_Opt, State_Chm, State_Diag, &
Ptr3d_8 => NULL()
END SUBROUTINE GC_Diagnostics_Calc
-!EOC
-!------------------------------------------------------------------------------
+
END MODULE GeosChem_Diagnostics_Mod
diff --git a/src/chemistry/geoschem/geoschem_emissions_mod.F90 b/src/chemistry/geoschem/geoschem_emissions_mod.F90
index 4859aee573..9d9dfc6bd1 100644
--- a/src/chemistry/geoschem/geoschem_emissions_mod.F90
+++ b/src/chemistry/geoschem/geoschem_emissions_mod.F90
@@ -1,35 +1,21 @@
-!------------------------------------------------------------------------------
-! "GEOS-Chem" chemistry emissions interface !
-!------------------------------------------------------------------------------
-!BOP
-!
-! !MODULE: geoschem_emissions_mod.F90
-!
-! !DESCRIPTION: Module geoschem\_emissions\_mod contains routines which retrieve
-! emission fluxes from HEMCO and transfers it back to the CESM-GC interface
-!\\
-!\\
-! !INTERFACE:
-!
+! Module geoschem_emissions_mod contains routines which retrieve
+! emission fluxes from HEMCO and transfers it back to the CESM-GC interface
+! 07 Oct 2020 - T. M. Fritz - Initial version
MODULE GeosChem_Emissions_Mod
-!
-! !USES:
-!
- USE SHR_KIND_MOD, ONLY : r8 => shr_kind_r8
- USE SPMD_UTILS, ONLY : MasterProc
- USE CAM_ABORTUTILS, ONLY : endrun
- USE CHEM_MODS, ONLY : iFirstCnst
- USE CONSTITUENTS, ONLY : pcnst, cnst_name
- USE SHR_MEGAN_MOD, ONLY : shr_megan_mechcomps, shr_megan_mechcomps_n
- USE CAM_LOGFILE, ONLY : iulog
+
+ ! CAM modules
+ use cam_abortutils, only : endrun
+ use cam_logfile, only : iulog
+ use chem_mods, only : iFirstCnst
+ use constituents, only : pcnst, cnst_name
+ use shr_kind_mod, only : r8 => shr_kind_r8, shr_kind_cl
+ use shr_megan_mod, only : shr_megan_mechcomps, shr_megan_mechcomps_n
+ use spmd_utils, only : MasterProc
IMPLICIT NONE
PRIVATE
-!
-! !PUBLIC MEMBER FUNCTIONS:
-!
PUBLIC :: GC_Emissions_Init
PUBLIC :: GC_Emissions_Calc
PUBLIC :: GC_Emissions_Final
@@ -54,52 +40,21 @@ MODULE GeosChem_Emissions_Mod
! Cache for is_extfrc?
LOGICAL, ALLOCATABLE :: pcnst_is_extfrc(:) ! no idea why the indexing is not 1:gas_pcnst or why iFirstCnst can be < 0
-!
-! !REVISION HISTORY:
-! 07 Oct 2020 - T. M. Fritz - Initial version
-! 20 Jan 2023 - H.P. Lin - Update for 2D/3D pbuf switches
-!EOP
-!------------------------------------------------------------------------------
-!BOC
-!
+
CONTAINS
-!
-!EOC
-!------------------------------------------------------------------------------
-!BOP
-!
-! !IROUTINE: gc_emissions_init
-!
-! !DESCRIPTION: Subroutine GC\_Emissions\_Init initializes the emissions
-! routine
-!\\
-!\\
-! !INTERFACE:
-!
- SUBROUTINE GC_Emissions_Init( lght_no_prd_factor )
-!
-! !USES:
-!
- USE PHYSICS_TYPES, ONLY : physics_state
- USE CONSTITUENTS, ONLY : cnst_get_ind
- USE PHYS_CONTROL, ONLY : phys_getopts
- USE MO_CHEM_UTLS, ONLY : get_spc_ndx, get_extfrc_ndx
- USE CAM_HISTORY, ONLY : addfld, add_default, horiz_only
- USE MO_LIGHTNING, ONLY : lightning_inti
- USE FIRE_EMISSIONS, ONLY : fire_emissions_init
- USE CHEM_MODS, ONLY : adv_mass
- USE INFNAN, ONLY : NaN, assignment(=)
-!
-! !INPUT PARAMETERS:
-!
- REAL(r8), INTENT(IN ) :: lght_no_prd_factor ! Lightning scaling factor
-!
-! !REVISION HISTORY:
-! 07 Oct 2020 - T. M. Fritz - Initial version
-!EOP
-!------------------------------------------------------------------------------
-!BOC
-!
+
+ SUBROUTINE GC_Emissions_Init( )
+
+ ! CAM modules
+ use cam_history, only : addfld, add_default, horiz_only
+ use chem_mods, only : adv_mass
+ use constituents, only : cnst_get_ind
+ use fire_emissions, only : fire_emissions_init
+ use infnan, only : NaN, assignment(=)
+ use mo_chem_utls, only : get_spc_ndx, get_extfrc_ndx
+ use phys_control, only : phys_getopts
+ use physics_types, only : physics_state
+
! Integers
INTEGER :: IERR
INTEGER :: N, II
@@ -110,16 +65,12 @@ SUBROUTINE GC_Emissions_Init( lght_no_prd_factor )
LOGICAL :: history_cesm_forcing
! Strings
- CHARACTER(LEN=255) :: SpcName
- CHARACTER(LEN=255) :: Description
+ CHARACTER(LEN=shr_kind_cl) :: SpcName
+ CHARACTER(LEN=shr_kind_cl) :: Description
! Real
REAL(r8) :: MW
- !=================================================================
- ! GC_Emissions_Init begins here!
- !=================================================================
-
CALL phys_getopts( history_aerosol_out = history_aerosol, &
history_chemistry_out = history_chemistry, &
history_cesm_forcing_out = history_cesm_forcing )
@@ -127,11 +78,6 @@ SUBROUTINE GC_Emissions_Init( lght_no_prd_factor )
! Get constituent index for NO
CALL cnst_get_ind('NO', iNO, abort=.True.)
- !-----------------------------------------------------------------------
- ! ... initialize the lightning module
- !-----------------------------------------------------------------------
- CALL lightning_inti(lght_no_prd_factor)
-
!-----------------------------------------------------------------------
! ... MEGAN emissions
!-----------------------------------------------------------------------
@@ -257,72 +203,39 @@ SUBROUTINE GC_Emissions_Init( lght_no_prd_factor )
enddo
END SUBROUTINE GC_Emissions_Init
-!EOC
-!------------------------------------------------------------------------------
-!BOP
-!
-! !IROUTINE: gc_emissions_calc
-!
-! !DESCRIPTION: Subroutine GC\_Emissions\_Calc retrieves emission fluxes
-! from HEMCO and returns a 3-D array of emission flux to the CESM-GC
-! interface. On top of passing data, this routine handles a number of checks.
-!\\
-!\\
-! !INTERFACE:
-!
+
SUBROUTINE GC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iStep )
-!
-! !USES:
-!
- USE State_Met_Mod, ONLY : MetState
- USE CAMSRFEXCH, ONLY : cam_in_t
- USE CONSTITUENTS, ONLY : cnst_get_ind, cnst_mw
- USE PHYSICS_TYPES, ONLY : physics_state
- USE PHYSICS_BUFFER, ONLY : pbuf_get_index, pbuf_get_chunk
- USE PHYSICS_BUFFER, ONLY : physics_buffer_desc, pbuf_get_field
- USE PPGRID, ONLY : pcols, pver, begchunk
- USE CAM_HISTORY, ONLY : outfld
- USE STRING_UTILS, ONLY : to_upper
- USE PHYSCONSTANTS, ONLY : PI
-
- ! Lightning emissions
- USE MO_LIGHTNING, ONLY : prod_NO
-
- ! MEGAN emissions
- USE SRF_FIELD_CHECK, ONLY : active_Fall_flxvoc
-
- ! Fire emissions
- USE FIRE_EMISSIONS, ONLY : fire_emissions_srf
- USE FIRE_EMISSIONS, ONLY : fire_emissions_vrt
-
- ! Aerosol emissions
- USE AERO_MODEL, ONLY : aero_model_emissions
-
- ! GEOS-Chem version of physical constants
- USE PHYSCONSTANTS, ONLY : AVO
- ! CAM version of physical constants
- USE PHYSCONST, ONLY : rga, avogad
-!
-! !INPUT PARAMETERS:
-!
+ ! Subroutine GC_Emissions_Calc retrieves emission fluxes
+ ! from HEMCO and returns a 3-D array of emission flux to the CESM-GC
+ ! interface. On top of passing data, this routine handles a number of checks.
+
+ ! CAM modules
+ use aero_model, only : aero_model_emissions ! Aerosol emissions
+ use cam_history, only : outfld
+ use camsrfexch, only : cam_in_t
+ use constituents, only : cnst_get_ind, cnst_mw
+ use fire_emissions, only : fire_emissions_srf, fire_emissions_vrt ! Fire emissions
+ use mo_lightning, only : prod_NO! Lightning emissions
+ use physconst, only : rga, avogad
+ use physics_buffer, only : pbuf_get_index, pbuf_get_chunk
+ use physics_buffer, only : physics_buffer_desc, pbuf_get_field
+ use physics_types, only : physics_state
+ use ppgrid, only : pcols, pver, begchunk
+ use srf_field_check, only : active_Fall_flxvoc ! MEGAN emissions
+ use string_utils, only : to_upper
+
+ ! GEOS-Chem modules
+ use PhysConstants, only : AVO, PI
+ use State_Met_Mod, only : MetState
+
TYPE(physics_state), INTENT(IN ) :: state ! Physics state variables
TYPE(physics_buffer_desc), POINTER, INTENT(IN ) :: hco_pbuf2d(:,:) ! Pointer to 2-D pbuf
TYPE(MetState), INTENT(IN ) :: State_Met ! Meteorology State object
INTEGER, INTENT(IN ) :: iStep
-!
-! !OUTPUT PARAMETERS:
-!
- TYPE(cam_in_t), INTENT(INOUT) :: cam_in ! import state
+
+ TYPE(cam_in_t), INTENT(INOUT) :: cam_in ! import state
REAL(r8), INTENT( OUT) :: eflx(pcols,pver,pcnst) ! 3-D emissions in kg/m2/s
-!
-! !REVISION HISTORY:
-! 07 Oct 2020 - T. M. Fritz - Initial version
-!EOP
-!------------------------------------------------------------------------------
-!BOC
-!
-! !LOCAL VARIABLES:
-!
+
! Integers
INTEGER :: LCHNK
INTEGER :: nY, nZ
@@ -348,13 +261,10 @@ SUBROUTINE GC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iStep
REAL(r8), PARAMETER :: m2km = 1.e-3_r8
! Strings
- CHARACTER(LEN=255) :: SpcName
- CHARACTER(LEN=255) :: fldname_ns ! field name HCO_*
-
- !=================================================================
- ! GC_Emissions_Calc begins here!
- !=================================================================
+ CHARACTER(LEN=shr_kind_cl) :: SpcName
+ CHARACTER(LEN=shr_kind_cl) :: fldname_ns ! field name HCO_*
+
! Initialize pointers
pbuf_chnk => NULL()
pbuf_ik => NULL()
@@ -429,10 +339,10 @@ SUBROUTINE GC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iStep
! Deposition fluxes from HEMCO
!-----------------------------------------------------------------------
- ! Part 1: Eventually retrieve deposition velocities [1/s] from HEMCO
- ! and convert to negative flux and apply.
- ! TODO hplin 3/24/21
-
+ ! Deposition velocities in HEMCO are now handled within HEMCO_CESM for a
+ ! hardcoded list of species, primarily for the SeaFlux extension.
+ ! This is not to be confused with dry deposition fluxes which are not
+ ! handled by HEMCO.
! Part 2: Handle special deposition fluxes for the ParaNOx extension
! for PAR_O3_DEP and PAR_HNO3_DEP
@@ -601,41 +511,22 @@ SUBROUTINE GC_Emissions_Calc( state, hco_pbuf2d, State_Met, cam_in, eflx, iStep
! TMMF - vertical distribution of fire emissions is not implemented yet
!CALL fire_emissions_vrt( nY, LCHNK, zint, cam_in%fireflx, cam_in%fireztop, extfrc )
- !-----------------------------------------------------------------------
- ! Add near-surface emissions to surface flux boundary condition
- !-----------------------------------------------------------------------
- cam_in%cflx(1:nY,:) = cam_in%cflx(1:nY,:) + eflx(1:nY,nZ,:)
- eflx(1:nY,nZ,:) = 0.0e+00_r8
+ ! Near-surface emissions are now emitted directly to GEOS-Chem Species array
+ ! for consistency with CAM-chem implementation of HEMCO
+ ! (but not with GEOS-Chem standalone, where fluxes are mixed by the turbulence routines)
+ ! Refer to discussion here: https://github.com/ESCOMP/CAM/pull/560#discussion_r1084559191
+ !
+ ! To replicate old behavior, uncomment these two lines below:
+ ! cam_in%cflx(1:nY,:) = cam_in%cflx(1:nY,:) + eflx(1:nY,nZ,:)
+ ! eflx(1:nY,nZ,:) = 0.0e+00_r8
END SUBROUTINE GC_Emissions_Calc
-!EOC
-!------------------------------------------------------------------------------
-!BOP
-!
-! !IROUTINE: gc_emissions_final
-!
-! !DESCRIPTION: Subroutine GC\_Emissions\_Final cleans up the module
-!\\
-!\\
-! !INTERFACE:
-!
+
SUBROUTINE GC_Emissions_Final
-!
-! !REVISION HISTORY:
-! 07 Oct 2020 - T. M. Fritz - Initial version
-!EOP
-!------------------------------------------------------------------------------
-!BOC
-!
- !=================================================================
- ! GC_Emissions_Final begins here!
- !=================================================================
IF ( ALLOCATED( megan_indices_map ) ) DEALLOCATE( megan_indices_map )
IF ( ALLOCATED( megan_wght_factors ) ) DEALLOCATE( megan_wght_factors )
END SUBROUTINE GC_Emissions_Final
-!EOC
-!------------------------------------------------------------------------------
-!EOC
- END MODULE GeosChem_Emissions_Mod
+
+END MODULE GeosChem_Emissions_Mod
diff --git a/src/chemistry/geoschem/geoschem_history_mod.F90 b/src/chemistry/geoschem/geoschem_history_mod.F90
index fb722c44a5..ef4c2044e1 100644
--- a/src/chemistry/geoschem/geoschem_history_mod.F90
+++ b/src/chemistry/geoschem/geoschem_history_mod.F90
@@ -22,13 +22,17 @@ MODULE GeosChem_History_Mod
!
! !USES:
!
- USE DiagList_Mod
- USE TaggedDiagList_Mod
- USE ErrCode_Mod
- USE Precision_Mod
-
- USE cam_abortutils, only : endrun
-
+ ! CAM modules
+ USE cam_abortutils, ONLY : endrun
+
+ ! GEOS-Chem modules
+ USE DiagList_Mod, ONLY : DgnItem, DgnList
+ USE DiagList_Mod, ONLY : Init_DiagList, Print_DiagList
+ USE ErrCode_Mod, ONLY : GC_SUCCESS, GC_FAILURE, GC_ERROR
+ USE Precision_Mod, ONLY : fp, f4, f8
+ USE TaggedDiagList_Mod, ONLY : TaggedDgnList
+ USE TaggedDiagList_Mod, ONLY : Init_TaggedDiagList, Print_TaggedDiagList
+
IMPLICIT NONE
PRIVATE
!
@@ -203,9 +207,10 @@ SUBROUTINE Init_HistoryExportsList ( am_I_Root, HistoryConfig, RC )
!
! !USES:
!
- USE State_Chm_Mod, ONLY: Get_Metadata_State_Chm
- USE State_Diag_Mod, ONLY: Get_Metadata_State_Diag
- USE State_Met_Mod, ONLY: Get_Metadata_State_Met
+ ! GEOS-Chem modules
+ USE State_Chm_Mod, ONLY : Get_Metadata_State_Chm
+ USE State_Diag_Mod, ONLY : Get_Metadata_State_Diag
+ USE State_Met_Mod, ONLY : Get_Metadata_State_Met
!
! !INPUT PARAMETERS:
!
@@ -645,8 +650,11 @@ SUBROUTINE HistoryExports_SetServices( am_I_Root, config_file, &
!
! !USES:
!
- USE cam_history, only: addfld, add_default, horiz_only
- USE Registry_Params_Mod
+ ! CAM modules
+ USE cam_history, ONLY : addfld, add_default, horiz_only
+
+ ! GEOS-Chem modules
+ USE Registry_Params_Mod, ONLY : VLocationCenter, VLocationEdge
!
! !INPUT PARAMETERS:
!
@@ -771,12 +779,14 @@ SUBROUTINE CopyGCStates2Exports( am_I_Root, Input_Opt, State_Grid, HistoryConfig
!
! !USES:
!
- USE HCO_Interface_GC_Mod, ONLY : HCOI_GC_WriteDiagn
- USE Input_Opt_Mod, ONLY : OptInput
- USE State_Grid_Mod, ONLY : GrdState
-
- USE cam_history, ONLY : hist_fld_active, outfld
- USE SHR_KIND_MOD, ONLY : shr_kind_r8
+ ! CAM modules
+ USE cam_history, ONLY : hist_fld_active, outfld
+ USE shr_kind_mod, ONLY : shr_kind_r8
+
+ ! GEOS-Chem modules
+ USE HCO_Interface_GC_Mod, ONLY : HCOI_GC_WriteDiagn
+ USE Input_Opt_Mod, ONLY : OptInput
+ USE State_Grid_Mod, ONLY : GrdState
!
! !INPUT PARAMETERS:
!
@@ -989,14 +999,15 @@ SUBROUTINE HistoryExports_SetDataPointers( am_I_Root, &
!
! !USES:
!
+ ! CAM modules
+ USE cam_history, ONLY : hist_fld_active
+
+ ! GEOS-Chem modules
USE Registry_Mod, ONLY : Registry_Lookup
- USE State_Grid_Mod, ONLY : GrdState
USE State_Chm_Mod, ONLY : ChmState
USE State_Diag_Mod, ONLY : DgnState
+ USE State_Grid_Mod, ONLY : GrdState
USE State_Met_Mod, ONLY : MetState
- USE Registry_Params_Mod
-
- use cam_history, only: hist_fld_active
!
! !INPUT PARAMETERS:
!
diff --git a/src/chemistry/modal_aero/modal_aero_convproc.F90 b/src/chemistry/modal_aero/modal_aero_convproc.F90
index 3d13ed52e3..6c8b7cd441 100644
--- a/src/chemistry/modal_aero/modal_aero_convproc.F90
+++ b/src/chemistry/modal_aero/modal_aero_convproc.F90
@@ -532,7 +532,7 @@ subroutine ma_convproc_dp_intr( &
integer :: i
integer :: itmpveca(pcols)
- integer :: l, lchnk, lun
+ integer :: l, lchnk, lun, ncol
integer :: nstep
real(r8) :: dpdry(pcols,pver) ! layer delta-p-dry (mb)
@@ -565,6 +565,7 @@ subroutine ma_convproc_dp_intr( &
! Initialize
lchnk = state%lchnk
+ ncol = state%ncol
nstep = get_nstep()
lun = iulog
@@ -587,6 +588,7 @@ subroutine ma_convproc_dp_intr( &
call pbuf_get_field(pbuf, zm_ideep_idx, ideep)
lengath = count(ideep > 0)
+ if (lengath > ncol) lengath = ncol ! should not happen, but force it to not be larger than ncol for safety sake
fracice(:,:) = 0.0_r8
diff --git a/src/chemistry/modal_aero/modal_aero_data.F90 b/src/chemistry/modal_aero/modal_aero_data.F90
index 6e1fbd5502..15b247584d 100644
--- a/src/chemistry/modal_aero/modal_aero_data.F90
+++ b/src/chemistry/modal_aero/modal_aero_data.F90
@@ -111,7 +111,7 @@ module modal_aero_data
logical, public, protected :: soa_multi_species = .false.
- character(len=16), public, protected, allocatable :: xname_massptr(:,:) ! names of species in each mode
+ character(len=16), allocatable :: xname_massptr(:,:) ! names of species in each mode
character(len=16), allocatable :: xname_massptrcw(:,:) ! names of cloud-borne species in each mode
complex(r8), allocatable :: &
diff --git a/src/chemistry/mozart/chemistry.F90 b/src/chemistry/mozart/chemistry.F90
index 737ca01883..9c6396e262 100644
--- a/src/chemistry/mozart/chemistry.F90
+++ b/src/chemistry/mozart/chemistry.F90
@@ -23,6 +23,7 @@ module chemistry
use mo_apex, only : mo_apex_readnl
use ref_pres, only : ptop_ref
use phys_control, only : waccmx_is ! WACCM-X switch query function
+ use phys_control, only : use_hemco ! HEMCO switch logical
implicit none
private
@@ -59,10 +60,6 @@ module chemistry
character(len=shr_kind_cl) :: bndtvg = ' ' ! pathname for greenhouse gas loss rate
character(len=shr_kind_cl) :: h2orates = ' ' ! pathname for greenhouse gas (lyman-alpha H2O loss)
- ! lightning
-
- real(r8) :: lght_no_prd_factor = 1._r8
-
! photolysis
character(len=shr_kind_cl) :: rsf_file = 'rsf_file'
@@ -83,11 +80,10 @@ module chemistry
character(len=shr_kind_cl) :: depvel_lnd_file = 'depvel_lnd_file'
! emis
- logical :: use_hemco = .false.
-
+ integer, parameter :: max_num_emis_files = max(100,2*pcnst)
character(len=shr_kind_cl) :: airpl_emis_file = '' ! airplane emissions
- character(len=shr_kind_cl) :: srf_emis_specifier(pcnst) = ''
- character(len=shr_kind_cl) :: ext_frc_specifier(pcnst) = ''
+ character(len=shr_kind_cl) :: srf_emis_specifier(max_num_emis_files) = ''
+ character(len=shr_kind_cl) :: ext_frc_specifier(max_num_emis_files) = ''
character(len=24) :: srf_emis_type = 'CYCLICAL' ! 'CYCLICAL' | 'SERIAL' | 'INTERP_MISSING_MONTHS'
integer :: srf_emis_cycle_yr = 0
@@ -111,7 +107,7 @@ module chemistry
character(len=fieldname_len) :: srcnam(gas_pcnst) ! names of source/sink tendencies
- integer :: ixcldliq, ixcldice ! indicies of liquid and ice cloud water
+ integer :: ixcldliq ! index of liquid cloud water
integer :: ndx_cld
integer :: ndx_cmfdqr
integer :: ndx_nevapr
@@ -136,6 +132,7 @@ module chemistry
logical :: chem_use_chemtrop = .false.
integer :: srf_ozone_pbf_ndx = -1
+ logical :: srf_emis_diag(pcnst) = .false.
!================================================================================================
contains
@@ -378,7 +375,6 @@ subroutine chem_readnl(nlfile)
xs_coef_file, xs_short_file, &
exo_coldens_file, &
xs_long_file, rsf_file, photo_max_zen, &
- lght_no_prd_factor, &
depvel_lnd_file, drydep_srf_file, &
srf_emis_type, srf_emis_cycle_yr, srf_emis_fixed_ymd, srf_emis_fixed_tod, srf_emis_specifier, &
fstrat_file, fstrat_list, &
@@ -455,10 +451,6 @@ subroutine chem_readnl(nlfile)
call mpibcast (bndtvg, len(bndtvg), mpichar, 0, mpicom)
call mpibcast (h2orates, len(h2orates), mpichar, 0, mpicom)
- ! lightning
-
- call mpibcast (lght_no_prd_factor,1, mpir8, 0, mpicom)
-
! photolysis
call mpibcast (rsf_file, len(rsf_file), mpichar, 0, mpicom)
@@ -649,7 +641,8 @@ subroutine chem_init(phys_state, pbuf2d)
use constituents, only : sflxnam
use fire_emissions, only : fire_emissions_init
use short_lived_species, only : short_lived_species_initic
- use ocean_emis, only : ocean_emis_init
+ use ocean_emis, only : ocean_emis_init, ocean_emis_species
+ use mo_srf_emissions, only : has_emis
type(physics_buffer_desc), pointer :: pbuf2d(:,:)
type(physics_state), intent(in):: phys_state(begchunk:endchunk)
@@ -660,7 +653,7 @@ subroutine chem_init(phys_state, pbuf2d)
!-----------------------------------------------------------------------
integer :: m ! tracer indicies
character(len=fieldname_len) :: spc_name
- integer :: n, ii
+ integer :: n, ii, ierr
logical :: history_aerosol
logical :: history_chemistry
logical :: history_cesm_forcing
@@ -671,13 +664,14 @@ subroutine chem_init(phys_state, pbuf2d)
! liquid budgets.
integer :: history_budget_histfile_num ! output history file number for budget fields
+ character(len=*), parameter :: prefix = 'chem_init: '
+
call phys_getopts( cam_chempkg_out=chem_name, &
history_aerosol_out=history_aerosol , &
history_chemistry_out=history_chemistry , &
history_budget_out = history_budget , &
history_budget_histfile_num_out = history_budget_histfile_num, &
- history_cesm_forcing_out = history_cesm_forcing, &
- use_hemco_out = use_hemco )
+ history_cesm_forcing_out = history_cesm_forcing )
! aqueous chem initialization
call sox_inti()
@@ -689,7 +683,6 @@ subroutine chem_init(phys_state, pbuf2d)
! Get liq and ice cloud water indicies
!-----------------------------------------------------------------------
call cnst_get_ind( 'CLDLIQ', ixcldliq )
- call cnst_get_ind( 'CLDICE', ixcldice )
call cnst_get_ind( 'NUMLIQ', ixndrop, abort=.false. )
!-----------------------------------------------------------------------
@@ -706,42 +699,6 @@ subroutine chem_init(phys_state, pbuf2d)
call addfld( 'HEIGHT', (/ 'ilev' /),'A','m', 'geopotential height above surface at interfaces (m)' )
call addfld( 'CT_H2O_GHG', (/ 'lev' /), 'A','kg/kg/s', 'ghg-chem h2o source/sink' )
-!-----------------------------------------------------------------------
-! Set names of chemistry variable tendencies and declare them as history variables
-!-----------------------------------------------------------------------
- do m = 1,gas_pcnst
- spc_name = solsym(m)
- srcnam(m) = 'CT_' // spc_name ! chem tendancy (source/sink)
-
- call addfld( srcnam(m), (/ 'lev' /), 'A', 'kg/kg/s', trim(spc_name)//' source/sink' )
- call cnst_get_ind(solsym(m), n, abort=.false. )
- if ( n > 0 ) then
-
- if (sflxnam(n)(3:5) == 'num') then ! name is in the form of "SF****"
- unit_basename = ' 1'
- else
- unit_basename = 'kg'
- endif
-
- call addfld (sflxnam(n),horiz_only, 'A', unit_basename//'/m2/s',trim(solsym(m))//' surface flux')
- if ( history_aerosol .or. history_chemistry ) then
- call add_default( sflxnam(n), 1, ' ' )
- endif
-
- if ( history_cesm_forcing ) then
- if ( spc_name == 'NO' .or. spc_name == 'NH3' ) then
- call add_default( sflxnam(n), 1, ' ' )
- endif
- endif
-
- endif
- end do
-
- ! Add chemical tendency of water vapor to water budget output
- if ( history_budget ) then
- call add_default ('CT_H2O' , history_budget_histfile_num, ' ')
- endif
-
!-----------------------------------------------------------------------
! Initialize chemistry modules
!-----------------------------------------------------------------------
@@ -769,58 +726,116 @@ subroutine chem_init(phys_state, pbuf2d)
, ext_frc_fixed_ymd &
, ext_frc_fixed_tod &
, exo_coldens_file &
- , lght_no_prd_factor &
, use_hemco &
, pbuf2d &
)
- if ( ghg_chem ) then
- call ghg_chem_init(phys_state, bndtvg, h2orates)
- endif
+ if ( ghg_chem ) then
+ call ghg_chem_init(phys_state, bndtvg, h2orates)
+ endif
- call init_cfc11star(pbuf2d)
+ call init_cfc11star(pbuf2d)
- ! MEGAN emissions initialize
- if (shr_megan_mechcomps_n>0) then
+ ! MEGAN emissions initialize
+ if (shr_megan_mechcomps_n>0) then
- allocate( megan_indices_map(shr_megan_mechcomps_n) )
- allocate( megan_wght_factors(shr_megan_mechcomps_n) )
- megan_wght_factors(:) = nan
+ allocate( megan_indices_map(shr_megan_mechcomps_n), stat=ierr)
+ if( ierr /= 0 ) then
+ call endrun(prefix//'failed to allocate megan_indices_map')
+ end if
+ allocate( megan_wght_factors(shr_megan_mechcomps_n), stat=ierr)
+ if( ierr /= 0 ) then
+ call endrun(prefix//'failed to allocate megan_indices_map')
+ end if
+ megan_wght_factors(:) = nan
- do n=1,shr_megan_mechcomps_n
- call cnst_get_ind (shr_megan_mechcomps(n)%name, megan_indices_map(n), abort=.false.)
- ii = get_spc_ndx(shr_megan_mechcomps(n)%name)
- if (ii>0) then
- megan_wght_factors(n) = adv_mass(ii)*1.e-3_r8 ! kg/moles (to convert moles/m2/sec to kg/m2/sec)
- else
- call endrun( 'gas_phase_chemdr_inti: MEGAN compound not in chemistry mechanism : '&
- //trim(shr_megan_mechcomps(n)%name))
- endif
+ do n=1,shr_megan_mechcomps_n
+ call cnst_get_ind (shr_megan_mechcomps(n)%name, megan_indices_map(n), abort=.false.)
+ ii = get_spc_ndx(shr_megan_mechcomps(n)%name)
+ if (ii>0) then
+ megan_wght_factors(n) = adv_mass(ii)*1.e-3_r8 ! kg/moles (to convert moles/m2/sec to kg/m2/sec)
+ else
+ call endrun( 'gas_phase_chemdr_inti: MEGAN compound not in chemistry mechanism : '&
+ //trim(shr_megan_mechcomps(n)%name))
+ endif
- ! MEGAN history fields
- call addfld( 'MEG_'//trim(shr_megan_mechcomps(n)%name),horiz_only,'A','kg/m2/sec',&
- trim(shr_megan_mechcomps(n)%name)//' MEGAN emissions flux')
- if (history_chemistry) then
- call add_default('MEG_'//trim(shr_megan_mechcomps(n)%name), 1, ' ')
- endif
+ ! MEGAN history fields
+ call addfld( 'MEG_'//trim(shr_megan_mechcomps(n)%name),horiz_only,'A','kg/m2/sec',&
+ trim(shr_megan_mechcomps(n)%name)//' MEGAN emissions flux')
+ if (history_chemistry) then
+ call add_default('MEG_'//trim(shr_megan_mechcomps(n)%name), 1, ' ')
+ endif
- enddo
- endif
+ srf_emis_diag(megan_indices_map(n)) = .true.
+ enddo
+ endif
- ! Galatic Cosmic Rays ...
- call gcr_ionization_init()
+ ! Galatic Cosmic Rays ...
+ call gcr_ionization_init()
- ! Fire emissions ...
- call fire_emissions_init()
+ ! Fire emissions ...
+ call fire_emissions_init()
- call short_lived_species_initic()
+ call short_lived_species_initic()
- call ocean_emis_init()
+ call ocean_emis_init()
+
+ !-----------------------------------------------------------------------
+ ! Set names of chemistry variable tendencies and declare them as history variables
+ !-----------------------------------------------------------------------
+ do m = 1,gas_pcnst
+ spc_name = solsym(m)
+ srcnam(m) = 'CT_' // spc_name ! chem tendancy (source/sink)
- ! initialize srf ozone to zero
- if (is_first_step() .and. srf_ozone_pbf_ndx>0) then
- call pbuf_set_field(pbuf2d, srf_ozone_pbf_ndx, 0._r8)
- end if
+ call addfld( srcnam(m), (/ 'lev' /), 'A', 'kg/kg/s', trim(spc_name)//' source/sink' )
+ call cnst_get_ind(solsym(m), n, abort=.false.)
+
+ if ( n>0 ) then
+ if (has_emis(m) .or. aero_has_emis(solsym(m)) .or. ocean_emis_species(solsym(m)) .or. srf_emis_diag(n)) then
+ srf_emis_diag(n) = .true.
+
+ if (sflxnam(n)(3:5) == 'num') then ! name is in the form of "SF****"
+ unit_basename = ' 1'
+ else
+ unit_basename = 'kg'
+ endif
+
+ call addfld (sflxnam(n),horiz_only, 'A', unit_basename//'/m2/s',trim(solsym(m))//' surface flux')
+ if ( history_aerosol .or. history_chemistry ) then
+ call add_default( sflxnam(n), 1, ' ' )
+ endif
+
+ if ( history_cesm_forcing ) then
+ if ( spc_name == 'NO' .or. spc_name == 'NH3' ) then
+ call add_default( sflxnam(n), 1, ' ' )
+ endif
+ endif
+
+ endif
+ endif
+ end do
+
+ ! Add chemical tendency of water vapor to water budget output
+ if ( history_budget ) then
+ call add_default ('CT_H2O' , history_budget_histfile_num, ' ')
+ endif
+
+ ! initialize srf ozone to zero
+ if (is_first_step() .and. srf_ozone_pbf_ndx>0) then
+ call pbuf_set_field(pbuf2d, srf_ozone_pbf_ndx, 0._r8)
+ end if
+
+ contains
+
+ pure logical function aero_has_emis(spcname)
+ use seasalt_model, only: seasalt_names
+ use dust_model, only: dust_names
+
+ character(len=*),intent(in) :: spcname
+
+ aero_has_emis = any(seasalt_names(:) == spcname).or.any(dust_names(:) == spcname)
+
+ end function aero_has_emis
end subroutine chem_init
@@ -885,7 +900,6 @@ subroutine chem_emissions( state, cam_in, pbuf )
!-----------------------------------------------------------------------
! ... Set surface emissions using HEMCO compatibility API
- ! (hplin, 8/8/22)
!-----------------------------------------------------------------------
call hco_set_srf_emissions( lchnk, ncol, sflx(:,:), pbuf )
else
@@ -901,7 +915,9 @@ subroutine chem_emissions( state, cam_in, pbuf )
n = map2chm(m)
if ( n /= h2o_ndx .and. n > 0 ) then
cam_in%cflx(:ncol,m) = cam_in%cflx(:ncol,m) + sflx(:ncol,n)
- call outfld( sflxnam(m), cam_in%cflx(:ncol,m), ncol,lchnk )
+ if (srf_emis_diag(m)) then
+ call outfld( sflxnam(m), cam_in%cflx(:ncol,m), ncol,lchnk )
+ endif
endif
enddo
@@ -995,6 +1011,10 @@ subroutine chem_init_cnst( name, latvals, lonvals, mask, q)
where(mask)
q(:,ilev) = rmwf12 * chem_surfvals_get('F12VMR')
end where
+ case ('CO2')
+ where(mask)
+ q(:,ilev) = chem_surfvals_get('CO2MMR')
+ end where
end select
end do
end if
@@ -1226,16 +1246,15 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dt, pbuf, fh2o)
!-----------------------------------------------------------------------
call t_startf( 'chemdr' )
do k = 1,pver
- cldw(:ncol,k) = state%q(:ncol,k,ixcldliq) + state%q(:ncol,k,ixcldice)
+ cldw(:ncol,k) = state%q(:ncol,k,ixcldliq)
if (ixndrop>0) &
ncldwtr(:ncol,k) = state%q(:ncol,k,ixndrop)
end do
call gas_phase_chemdr(lchnk, ncol, imozart, state%q, &
state%phis, state%zm, state%zi, calday, &
- state%t, state%pmid, state%pdel, state%pint, &
- cldw, tropLev, tropLevChem, ncldwtr, state%u, state%v, &
- chem_dt, state%ps, &
+ state%t, state%pmid, state%pdel, state%pint, state%rpdel, state%rpdeldry, &
+ cldw, tropLev, tropLevChem, ncldwtr, state%u, state%v, chem_dt, state%ps, &
fsds, cam_in%ts, cam_in%asdir, cam_in%ocnfrac, cam_in%icefrac, &
cam_out%precc, cam_out%precl, cam_in%snowhland, ghg_chem, state%latmapback, &
drydepflx, wetdepflx, cam_in%cflx, cam_in%fireflx, cam_in%fireztop, &
diff --git a/src/chemistry/mozart/hco_cc_emissions.F90 b/src/chemistry/mozart/hco_cc_emissions.F90
index 7f3a651d7c..5cd98c6ba6 100644
--- a/src/chemistry/mozart/hco_cc_emissions.F90
+++ b/src/chemistry/mozart/hco_cc_emissions.F90
@@ -60,7 +60,9 @@ module hco_cc_emissions
!EOP
!------------------------------------------------------------------------------
!BOC
- logical :: pcnst_is_extfrc(gas_pcnst)
+ logical :: pcnst_is_extfrc(gas_pcnst) ! Is external forcing? (3-D data)
+ integer :: pcnst_extfrc_ndx(gas_pcnst) ! External forcing index from get_extfrc_ndx
+ integer :: hco_pbuf_idx(gas_pcnst) ! Physics buffer indices for HCO_* fields from HEMCO
contains
!EOC
!------------------------------------------------------------------------------
@@ -80,7 +82,6 @@ subroutine hco_set_srf_emissions( lchnk, ncol, sflx, pbuf )
!
! !USES:
!
- use mo_chem_utls, only: get_extfrc_ndx
implicit none
!
! !INPUT PARAMETERS:
@@ -105,29 +106,12 @@ subroutine hco_set_srf_emissions( lchnk, ncol, sflx, pbuf )
real(r8), pointer :: pbuf_ptr_3d(:,:) ! ptr to pbuf data (/pcols,pver/)
real(r8), pointer :: pbuf_ptr_2d(:) ! ptr to pbuf data (/pcols/)
integer :: tmpIdx ! pbuf field id
- character(len=255) :: fldname_ns ! field name HCO_NH3
- integer :: RC ! return code (dummy)
-
- logical, save :: FIRST = .true. ! is first run?
! reset sflx here. (same as mo_srf_emissions.F90)
! sflx is defined in chem_emissions (chemistry.F90) but without default values, and is
! later added to cam_in%cflx. it must be initialized in this subroutine.
sflx(:,:) = 0._r8
- ! for first run, cache results of 3-D or 2-D scan within pcnst_is_extfrc
- ! to avoid lengthy lookups in future timesteps. hplin 1/12/23
- if(FIRST) then
- do n = 1, gas_pcnst
- pcnst_is_extfrc(n) = (get_extfrc_ndx(trim(solsym(n))) > 0)
- enddo
-
- write(iulog,*) "hco_set_srf_emissions: first run pcnst_is_extfrc cache"
- write(iulog,*) pcnst_is_extfrc
-
- FIRST = .false.
- endif
-
!--------------------------------------------------------
! ... set HEMCO emissions
! hplin 7/19/20
@@ -149,9 +133,7 @@ subroutine hco_set_srf_emissions( lchnk, ncol, sflx, pbuf )
! we loop over the pbuf to prevent inquiries. tbd hplin 7/19/20
do n = 1, gas_pcnst
- ! species name: solsym(n)
- fldname_ns = 'HCO_' // trim(solsym(n))
- tmpIdx = pbuf_get_index(fldname_ns, RC)
+ tmpIdx = hco_pbuf_idx(n)
if(tmpIdx > 0) then
if(pcnst_is_extfrc(n)) then ! 3-D data
! if species is 3-D data, then all forcings set through 3-D. no longer process
@@ -159,10 +141,6 @@ subroutine hco_set_srf_emissions( lchnk, ncol, sflx, pbuf )
else ! 2-D data
call pbuf_get_field(pbuf, tmpIdx, pbuf_ptr_2d)
- if(.not. associated(pbuf_ptr_2d)) then ! sanity check
- call endrun("mo_srf_emissions hemco: FATAL - tmpIdx > 0 but pbuf_ptr_2d unassoc")
- endif
-
! for each col retrieve data from pbuf_ptr(I, K)
sflx(1:ncol,n) = pbuf_ptr_2d(1:ncol)
@@ -190,7 +168,6 @@ subroutine hco_set_extfrc( lchnk, zint, frcing, ncol, pbuf )
! !USES:
!
use mo_chem_utls, only: get_spc_ndx
- use mo_chem_utls, only: get_extfrc_ndx
! Check list whether this species has external forcing from dataset - this is a CAM-chem flag
! and this is CAM-chem specific.
@@ -233,8 +210,6 @@ subroutine hco_set_extfrc( lchnk, zint, frcing, ncol, pbuf )
real(r8), pointer :: pbuf_ik(:,:) ! ptr to pbuf data (/pcols,pver/)
integer :: tmpIdx ! pbuf field id
- character(len=255) :: fldname_ns ! field name HCO_NH3
- integer :: RC ! return code (dummy)
real(r8) :: kg_to_molec
! for every species index retrieve the species name, compute the pbuf name,
@@ -268,39 +243,28 @@ subroutine hco_set_extfrc( lchnk, zint, frcing, ncol, pbuf )
do n = 1, gas_pcnst
! check if extfrc available?
- m = get_extfrc_ndx(trim(solsym(n)))
-
- if(m > 0) then
- ! confirm extfrc present
- ! has_emis(m) = .true.
-
+ if(pcnst_is_extfrc(n)) then
! add extfrc
- ! "external insitu forcing" (1/cm^3/s) -- NOTE UNITS COMING OUT OF HEMCO are
- ! kg/m2/s, so unit conversion must be done
- !
- ! using species factor...
- ! (kg_to_g is actually kg/g...)
- !
- ! 1 / (kg/molec cm2/m2) = molec/kg m2/cm2
- !
- ! kg/m2/s * molec/kg m2/cm2 = molec/cm2/s
- ! now divide by z-interface height (in CM!) for each height to get the right answer!
- ! (hplin, 11/14/20)
- kg_to_molec = 1/(adv_mass(n) / avogadro * cm2_to_m2 * kg_to_g)
-
- ! species name: solsym(n)
- fldname_ns = 'HCO_' // trim(solsym(n))
- ! if(masterproc) write(iulog,*) "mo_extfrc hemco: Adding extfrc for", fldname_ns
-
- tmpIdx = pbuf_get_index(fldname_ns, RC)
+ ! "external insitu forcing" (1/cm^3/s)
+ m = pcnst_extfrc_ndx(n)
+ tmpIdx = hco_pbuf_idx(n)
if(tmpIdx > 0) then
- ! this is already in chunk, retrieve it
+ ! Note: units coming out of HEMCO are in kg/m2/s, so unit conversion must be done
+ !
+ ! using species factor...
+ ! (kg_to_g is actually kg/g...)
+ !
+ ! 1 / (kg/molec cm2/m2) = molec/kg m2/cm2
+ !
+ ! kg/m2/s * molec/kg m2/cm2 = molec/cm2/s
+ ! now divide by z-interface height (in CM!) for each height to get the right answer!
+ ! (hplin, 11/14/20)
+ kg_to_molec = 1/(adv_mass(n) / avogadro * cm2_to_m2 * kg_to_g)
+
+ ! this is already in chunk, retrieve it.
+ ! if the field does not exist, pbuf_get_field will return an error, so sanity check for pbuf_ik is not needed.
call pbuf_get_field(pbuf, tmpIdx, pbuf_ik)
- if(.not. associated(pbuf_ik)) then ! sanity check
- call endrun("mo_extfrc hemco: FATAL - tmpIdx > 0 but pbuf_ik unassoc")
- endif
-
! for each col retrieve data from pbuf_ik(I, K)
! this includes surface layer.
do k = 1, pver
@@ -324,9 +288,6 @@ subroutine hco_set_extfrc( lchnk, zint, frcing, ncol, pbuf )
call outfld( xfcname, frcing_col(:ncol), ncol, lchnk )
xfcname = trim(extfrc_lst(m))//'_CMXF'
call outfld( xfcname, frcing_col_kg(:ncol), ncol, lchnk )
- if ( masterproc ) then
- ! write(iulog,*) "mo_extfrc hemco: debug added 3D emiss for ", TRIM(solsym(n)), maxval(frcing(:ncol,:,m))
- endif
endif
endif
endif
@@ -353,10 +314,12 @@ subroutine hco_extfrc_inti( )
use chem_mods, only: frc_from_dataset, extcnt, extfrc_lst
use cam_history, only: addfld, add_default, horiz_only
use phys_control, only: phys_getopts
+ use mo_chem_utls, only: get_extfrc_ndx
implicit none
!
! !REVISION HISTORY:
! 04 Nov 2022 - H.P. Lin - Initial version based on extfrc_inti
+! 10 Apr 2023 - H.P. Lin - Now move pcnst_is_extfrc initialization here
!EOP
!------------------------------------------------------------------------------
!BOC
@@ -369,6 +332,28 @@ subroutine hco_extfrc_inti( )
character(len=16) :: spc_name
integer :: n
+ character(len=255) :: fldname_ns ! field name HCO_NH3
+ integer :: RC ! return code (dummy)
+
+ ! for first run, cache results of 3-D or 2-D scan within pcnst_is_extfrc
+ ! to avoid lengthy lookups in future timesteps. hplin 1/12/23
+ do n = 1, gas_pcnst
+ pcnst_extfrc_ndx(n) = get_extfrc_ndx(trim(solsym(n)))
+ pcnst_is_extfrc(n) = (pcnst_extfrc_ndx(n) > 0)
+
+ ! construct information about HCO_* corresponding pbuf location
+ fldname_ns = 'HCO_' // trim(solsym(n))
+ hco_pbuf_idx(n) = pbuf_get_index(fldname_ns, RC)
+ enddo
+
+ if(masterproc) then
+ write(iulog,*) "hco_set_srf_emissions: first run pcnst_is_extfrc cache, extfrc_ndx:"
+ do n = 1, gas_pcnst
+ write(iulog,*) trim(solsym(n)), ' : ', pcnst_is_extfrc(n), pcnst_extfrc_ndx(n)
+ end do
+ endif
+
+ ! Replicate functionality in extfrc_inti to create _XFRC... diagnostics
call phys_getopts( &
history_aerosol_out = history_aerosol, &
history_chemistry_out = history_chemistry, &
@@ -396,4 +381,4 @@ subroutine hco_extfrc_inti( )
end subroutine hco_extfrc_inti
!EOC
-end module hco_cc_emissions
\ No newline at end of file
+end module hco_cc_emissions
diff --git a/src/chemistry/mozart/mo_chem_utls.F90 b/src/chemistry/mozart/mo_chem_utls.F90
index 992e0789e7..dbed06c9e8 100644
--- a/src/chemistry/mozart/mo_chem_utls.F90
+++ b/src/chemistry/mozart/mo_chem_utls.F90
@@ -3,13 +3,12 @@ module mo_chem_utls
private
public :: get_spc_ndx, get_het_ndx, get_extfrc_ndx, get_rxt_ndx, get_inv_ndx
- public :: utls_chem_is
save
contains
- integer function get_spc_ndx( spc_name, compare_uppercase )
+ integer function get_spc_ndx( spc_name, ignore_case )
!-----------------------------------------------------------------------
! ... return overall species index associated with spc_name
!-----------------------------------------------------------------------
@@ -24,7 +23,7 @@ integer function get_spc_ndx( spc_name, compare_uppercase )
! ... dummy arguments
!-----------------------------------------------------------------------
character(len=*), intent(in) :: spc_name
- logical, intent(in), optional :: compare_uppercase
+ logical, intent(in), optional :: ignore_case
!-----------------------------------------------------------------------
! ... local variables
@@ -34,8 +33,8 @@ integer function get_spc_ndx( spc_name, compare_uppercase )
logical :: match
convert_to_upper = .false.
- if ( present( compare_uppercase ) ) then
- convert_to_upper = compare_uppercase
+ if ( present( ignore_case ) ) then
+ convert_to_upper = ignore_case
endif
get_spc_ndx = -1
@@ -174,15 +173,4 @@ integer function get_rxt_ndx( rxt_tag )
end function get_rxt_ndx
- logical function utls_chem_is (name) result(chem_is)
- use string_utils, only : to_lower
-
- character(len=*), intent(in) :: name
- chem_is = .false.
- if ( to_lower(name) == 'mozart' ) then
- chem_is = .true.
- endif
-
- end function utls_chem_is
-
end module mo_chem_utls
diff --git a/src/chemistry/mozart/mo_chemini.F90 b/src/chemistry/mozart/mo_chemini.F90
index abc0df5f70..0f4005be96 100644
--- a/src/chemistry/mozart/mo_chemini.F90
+++ b/src/chemistry/mozart/mo_chemini.F90
@@ -36,7 +36,6 @@ subroutine chemini &
, ext_frc_fixed_ymd &
, ext_frc_fixed_tod &
, exo_coldens_file &
- , lght_no_prd_factor &
, use_hemco &
, pbuf2d &
)
@@ -49,7 +48,6 @@ subroutine chemini &
use mo_srf_emissions, only : srf_emissions_inti
use mo_sulf, only : sulf_inti
use mo_photo, only : photo_inti
- use mo_lightning, only : lightning_inti
use mo_drydep, only : drydep_inti
use mo_imp_sol, only : imp_slv_inti
use mo_exp_sol, only : exp_sol_inti
@@ -96,7 +94,6 @@ subroutine chemini &
character(len=*), dimension(:), intent(in) :: srf_emis_specifier
character(len=*), dimension(:), intent(in) :: ext_frc_specifier
character(len=*), intent(in) :: exo_coldens_file
- real(r8), intent(in) :: lght_no_prd_factor
character(len=*), intent(in) :: ext_frc_type
integer, intent(in) :: ext_frc_cycle_yr
integer, intent(in) :: ext_frc_fixed_ymd
@@ -171,12 +168,6 @@ subroutine chemini &
call sad_inti(pbuf2d)
if (masterproc) write(iulog,*) 'chemini: after sad_inti on node ',iam
- !-----------------------------------------------------------------------
- ! ... initialize the lightning module
- !-----------------------------------------------------------------------
- call lightning_inti(lght_no_prd_factor)
- if (masterproc) write(iulog,*) 'chemini: after lightning_inti on node ',iam
-
!-----------------------------------------------------------------------
! ... initialize the dry deposition module
!-----------------------------------------------------------------------
diff --git a/src/chemistry/mozart/mo_chm_diags.F90 b/src/chemistry/mozart/mo_chm_diags.F90
index 8b004048bb..5650403fee 100644
--- a/src/chemistry/mozart/mo_chm_diags.F90
+++ b/src/chemistry/mozart/mo_chm_diags.F90
@@ -10,6 +10,7 @@ module mo_chm_diags
use cam_history, only : fieldname_len
use mo_jeuv, only : neuv
use gas_wetdep_opts,only : gas_wetdep_method
+ use mo_drydep, only : has_drydep
implicit none
private
@@ -64,13 +65,12 @@ subroutine chm_diags_inti
use cam_history, only : addfld, add_default, horiz_only
use constituents, only : cnst_get_ind, cnst_longname
use phys_control, only : phys_getopts
- use mo_drydep, only : has_drydep
use species_sums_diags, only : species_sums_init
integer :: j, k, m, n
character(len=16) :: jname, spc_name, attr
character(len=2) :: jchar
- character(len=2) :: unit_basename ! Units 'kg' or '1'
+ character(len=2) :: unit_basename ! Units 'kg' or '1'
integer :: id_pan, id_onit, id_mpan, id_isopno3, id_onitr, id_nh4no3
integer :: id_so2, id_so4, id_h2so4
@@ -89,7 +89,7 @@ subroutine chm_diags_inti
integer :: id_dst01, id_dst02, id_dst03, id_dst04, id_sslt01, id_sslt02, id_sslt03, id_sslt04
integer :: id_soa, id_oc1, id_oc2, id_cb1, id_cb2
integer :: id_soam,id_soai,id_soat,id_soab,id_soax
- integer :: id_bry, id_cly
+ integer :: id_bry, id_cly
integer :: id_isopn2b, id_isopn3b, id_isopn1d, id_isopn4d, id_isopnbno3
integer :: id_isopfnp, id_isopnoohb, id_isopnoohd, id_inheb, id_inhed
integer :: id_no3ch2cho, id_macrn, id_mvkn, id_isopfnc, id_terpns
@@ -195,17 +195,17 @@ subroutine chm_diags_inti
id_onitr = get_spc_ndx( 'ONITR' )
id_nh4no3 = get_spc_ndx( 'NH4NO3' )
- id_honitr = get_spc_ndx( 'HONITR' )
- id_alknit = get_spc_ndx( 'ALKNIT' )
- id_isopnita = get_spc_ndx( 'ISOPNITA' )
- id_isopnitb = get_spc_ndx( 'ISOPNITB' )
- id_isopnooh = get_spc_ndx( 'ISOPNOOH' )
- id_nc4ch2oh = get_spc_ndx( 'NC4CH2OH' )
- id_nc4cho = get_spc_ndx( 'NC4CHO' )
- id_noa = get_spc_ndx( 'NOA' )
- id_nterpooh = get_spc_ndx( 'NTERPOOH' )
+ id_honitr = get_spc_ndx( 'HONITR' )
+ id_alknit = get_spc_ndx( 'ALKNIT' )
+ id_isopnita = get_spc_ndx( 'ISOPNITA' )
+ id_isopnitb = get_spc_ndx( 'ISOPNITB' )
+ id_isopnooh = get_spc_ndx( 'ISOPNOOH' )
+ id_nc4ch2oh = get_spc_ndx( 'NC4CH2OH' )
+ id_nc4cho = get_spc_ndx( 'NC4CHO' )
+ id_noa = get_spc_ndx( 'NOA' )
+ id_nterpooh = get_spc_ndx( 'NTERPOOH' )
id_pbznit = get_spc_ndx( 'PBZNIT' )
- id_terpnit = get_spc_ndx( 'TERPNIT' )
+ id_terpnit = get_spc_ndx( 'TERPNIT' )
id_ndep = get_spc_ndx( 'NDEP' )
id_nhdep = get_spc_ndx( 'NHDEP' )
@@ -278,9 +278,9 @@ subroutine chm_diags_inti
noy_species = (/ id_n, id_no, id_no2, id_no3, id_n2o5, id_hno3, id_ho2no2, id_clono2, &
id_brono2, id_pan, id_onit, id_mpan, id_isopno3, id_onitr, id_nh4no3, &
id_honitr, id_alknit, id_isopnita, id_isopnitb, id_isopnooh, id_nc4ch2oh, &
- id_nc4cho, id_noa, id_nterpooh, id_pbznit, id_terpnit, &
+ id_nc4cho, id_noa, id_nterpooh, id_pbznit, id_terpnit, &
id_isopn2b, id_isopn3b, id_isopn1d, id_isopn4d, id_isopnbno3, &
- id_isopfdn, id_isopfdnc, id_terpfdn, &
+ id_isopfdn, id_isopfdnc, id_terpfdn, &
id_isopfnp, id_isopnoohb, id_isopnoohd, id_inheb, id_inhed, &
id_no3ch2cho, id_macrn, id_mvkn, id_isopfnc, id_terpns, &
id_terpnt, id_terpnt1, id_terpns1, id_terpnpt, id_terpnps, &
@@ -402,16 +402,17 @@ subroutine chm_diags_inti
attr = spc_name
endif
- depvel_name(m) = 'DV_'//trim(spc_name)
- depflx_name(m) = 'DF_'//trim(spc_name)
dtchem_name(m) = 'D'//trim(spc_name)//'CHM'
-
- call addfld( depvel_name(m), horiz_only, 'A', 'cm/s', 'deposition velocity ' )
- call addfld( depflx_name(m), horiz_only, 'A', 'kg/m2/s', 'dry deposition flux ' )
call addfld( dtchem_name(m), (/ 'lev' /), 'A', 'kg/s', 'net tendency from chem' )
- if (has_drydep(spc_name).and.history_chemistry) then
- call add_default( depflx_name(m), 1, ' ' )
+ depvel_name(m) = 'DV_'//trim(spc_name)
+ depflx_name(m) = 'DF_'//trim(spc_name)
+ if (has_drydep(spc_name)) then
+ call addfld( depvel_name(m), horiz_only, 'A', 'cm/s', 'deposition velocity ' )
+ call addfld( depflx_name(m), horiz_only, 'A', 'kg/m2/s', 'dry deposition flux ' )
+ if (history_chemistry) then
+ call add_default( depflx_name(m), 1, ' ' )
+ endif
endif
if (gas_wetdep_method=='MOZ') then
@@ -439,7 +440,7 @@ subroutine chm_diags_inti
if ((m /= id_cly) .and. (m /= id_bry)) then
if (history_aerosol.or.history_chemistry) then
call add_default( spc_name, 1, ' ' )
- endif
+ endif
if (history_chemspecies_srf) then
call add_default( trim(spc_name)//'_SRF', 1, ' ' )
endif
@@ -510,7 +511,7 @@ subroutine chm_diags( lchnk, ncol, vmr, mmr, rxt_rates, invariants, depvel, depf
!--------------------------------------------------------------------
! ... utility routine to output chemistry diagnostic variables
!--------------------------------------------------------------------
-
+
use cam_history, only : outfld
use phys_grid, only : get_area_all_p
use species_sums_diags, only : species_sums_output
@@ -546,7 +547,7 @@ subroutine chm_diags( lchnk, ncol, vmr, mmr, rxt_rates, invariants, depvel, depf
! real(r8) :: tmp(ncol,pver)
! real(r8) :: m(ncol,pver)
real(r8) :: un2(ncol)
-
+
real(r8), dimension(ncol,pver) :: vmr_nox, vmr_noy, vmr_clox, vmr_cloy, vmr_tcly, vmr_brox, vmr_broy, vmr_toth
real(r8), dimension(ncol,pver) :: vmr_tbry, vmr_foy, vmr_tfy
real(r8), dimension(ncol,pver) :: mmr_noy, mmr_sox, mmr_nhx, net_chem
@@ -673,7 +674,7 @@ subroutine chm_diags( lchnk, ncol, vmr, mmr, rxt_rates, invariants, depvel, depf
if ( any( hox_species == m ) ) then
vmr_hox(:ncol,:) = vmr_hox(:ncol,:) + wgt * vmr(:ncol,:,m)
endif
-
+
if ( any( aer_species == m ) ) then
call outfld( solsym(m), mmr(:ncol,:,m), ncol ,lchnk )
call outfld( trim(solsym(m))//'_SRF', mmr(:ncol,pver,m), ncol ,lchnk )
@@ -682,8 +683,10 @@ subroutine chm_diags( lchnk, ncol, vmr, mmr, rxt_rates, invariants, depvel, depf
call outfld( trim(solsym(m))//'_SRF', vmr(:ncol,pver,m), ncol ,lchnk )
endif
- call outfld( depvel_name(m), depvel(:ncol,m), ncol ,lchnk )
- call outfld( depflx_name(m), depflx(:ncol,m), ncol ,lchnk )
+ if (has_drydep(solsym(m))) then
+ call outfld( depvel_name(m), depvel(:ncol,m), ncol ,lchnk )
+ call outfld( depflx_name(m), depflx(:ncol,m), ncol ,lchnk )
+ endif
if ( any( noy_species == m ) ) then
df_noy(:ncol) = df_noy(:ncol) + wgt * depflx(:ncol,m)*N_molwgt/adv_mass(m)
@@ -705,15 +708,15 @@ subroutine chm_diags( lchnk, ncol, vmr, mmr, rxt_rates, invariants, depvel, depf
! add contribution from non-conservation tracers
!
if ( id_ndep == m ) then
- wd_noy(:ncol) = wd_noy(:ncol) + wgt * wetdepflx(:ncol,m)*N_molwgt/adv_mass(m)
+ wd_noy(:ncol) = wd_noy(:ncol) + wgt * wetdepflx(:ncol,m)*N_molwgt/adv_mass(m)
end if
if ( id_nhdep == m ) then
- wd_nhx(:ncol) = wd_nhx(:ncol) + wgt * wetdepflx(:ncol,m)*N_molwgt/adv_mass(m)
+ wd_nhx(:ncol) = wd_nhx(:ncol) + wgt * wetdepflx(:ncol,m)*N_molwgt/adv_mass(m)
end if
do k=1,pver
do i=1,ncol
- net_chem(i,k) = mmr_tend(i,k,m) * mass(i,k)
+ net_chem(i,k) = mmr_tend(i,k,m) * mass(i,k)
end do
end do
call outfld( dtchem_name(m), net_chem(:ncol,:), ncol, lchnk )
@@ -769,7 +772,7 @@ subroutine chm_diags( lchnk, ncol, vmr, mmr, rxt_rates, invariants, depvel, depf
call outfld( 'DF_SOX', df_sox(:ncol), ncol ,lchnk )
call outfld( 'dry_deposition_NHx_as_N', df_nhx(:ncol), ncol ,lchnk )
if (gas_wetdep_method=='NEU') then
- wd_noy(:ncol) = -wd_noy(:ncol) ! downward is possitive
+ wd_noy(:ncol) = -wd_noy(:ncol) ! downward is possitive
wd_nhx(:ncol) = -wd_nhx(:ncol)
call outfld( 'wet_deposition_NOy_as_N', wd_noy(:ncol), ncol, lchnk )
call outfld( 'wet_deposition_NHx_as_N', wd_nhx(:ncol), ncol, lchnk )
@@ -903,7 +906,7 @@ subroutine het_diags( het_rates, mmr, pdel, lchnk, ncol )
!
wrk_wd(:ncol) = 0._r8
do k = 1,pver
- wrk_wd(:ncol) = wrk_wd(:ncol) + het_rates(:ncol,k,m) * mmr(:ncol,k,m) * pdel(:ncol,k)
+ wrk_wd(:ncol) = wrk_wd(:ncol) + het_rates(:ncol,k,m) * mmr(:ncol,k,m) * pdel(:ncol,k)
end do
!
wrk_wd(:ncol) = wrk_wd(:ncol) * rgrav * wght(:ncol) * rearth**2
diff --git a/src/chemistry/mozart/mo_extfrc.F90 b/src/chemistry/mozart/mo_extfrc.F90
index 2438f47414..c1ca05aed3 100644
--- a/src/chemistry/mozart/mo_extfrc.F90
+++ b/src/chemistry/mozart/mo_extfrc.F90
@@ -5,7 +5,7 @@ module mo_extfrc
use shr_kind_mod, only : r8 => shr_kind_r8
use ppgrid, only : pver, pverp
- use chem_mods, only : gas_pcnst, extcnt, extfrc_lst, frc_from_dataset, adv_mass
+ use chem_mods, only : extcnt, extfrc_lst, frc_from_dataset, adv_mass
use spmd_utils, only : masterproc
use cam_abortutils,only : endrun
use cam_history, only : addfld, outfld, add_default, horiz_only
@@ -78,11 +78,11 @@ subroutine extfrc_inti( extfrc_specifier, extfrc_type_in, extfrc_cycle_yr, extfr
integer :: astat
integer :: j, l, m, n, i,mm ! Indices
character(len=16) :: spc_name
- character(len=256) :: frc_fnames(gas_pcnst)
- real(r8) :: frc_scalefactor(gas_pcnst)
- character(len=16) :: frc_species(gas_pcnst)
- integer :: frc_indexes(gas_pcnst)
- integer :: indx(gas_pcnst)
+ character(len=256) :: frc_fnames(size(extfrc_specifier))
+ real(r8) :: frc_scalefactor(size(extfrc_specifier))
+ character(len=16) :: frc_species(size(extfrc_specifier))
+ integer :: frc_indexes(size(extfrc_specifier))
+ integer :: indx(size(extfrc_specifier))
integer :: vid, ndims, nvars, isec, ierr, num_dims_xfrc, dimid
logical, allocatable :: is_sector(:)
@@ -105,7 +105,7 @@ subroutine extfrc_inti( extfrc_specifier, extfrc_type_in, extfrc_cycle_yr, extfr
character(len=256) :: locfn
!-----------------------------------------------------------------------
-
+
call phys_getopts( &
history_aerosol_out = history_aerosol, &
history_chemistry_out = history_chemistry, &
@@ -119,7 +119,7 @@ subroutine extfrc_inti( extfrc_specifier, extfrc_type_in, extfrc_cycle_yr, extfr
mm = 0
indx(:) = 0
- count_emis: do n=1,gas_pcnst
+ count_emis: do n=1,size(extfrc_specifier)
if ( len_trim(extfrc_specifier(n) ) == 0 ) then
exit count_emis
@@ -127,7 +127,7 @@ subroutine extfrc_inti( extfrc_specifier, extfrc_type_in, extfrc_cycle_yr, extfr
i = scan(extfrc_specifier(n),'->')
spc_name = trim(adjustl(extfrc_specifier(n)(:i-1)))
-
+
! need to parse out scalefactor ...
tmp_string = adjustl(extfrc_specifier(n)(i+2:))
j = scan( tmp_string, '*' )
@@ -179,7 +179,7 @@ subroutine extfrc_inti( extfrc_specifier, extfrc_type_in, extfrc_cycle_yr, extfr
end if
!-----------------------------------------------------------------------
- ! Sort the input files so that the emissions sources are summed in the
+ ! Sort the input files so that the emissions sources are summed in the
! same order regardless of the order of the input files in the namelist
!-----------------------------------------------------------------------
if (n_frc_files > 0) then
@@ -189,14 +189,14 @@ subroutine extfrc_inti( extfrc_specifier, extfrc_type_in, extfrc_cycle_yr, extfr
!-----------------------------------------------------------------------
! ... setup the forcing type array
!-----------------------------------------------------------------------
- do m=1,n_frc_files
+ do m=1,n_frc_files
forcings(m)%frc_ndx = frc_indexes(indx(m))
forcings(m)%species = frc_species(indx(m))
forcings(m)%filename = frc_fnames(indx(m))
forcings(m)%scalefactor = frc_scalefactor(indx(m))
enddo
-
- do n= 1,extcnt
+
+ do n= 1,extcnt
if (frc_from_dataset(n)) then
spc_name = extfrc_lst(n)
call addfld( trim(spc_name)//'_XFRC', (/ 'lev' /), 'A', 'molec/cm3/s', &
@@ -205,7 +205,7 @@ subroutine extfrc_inti( extfrc_specifier, extfrc_type_in, extfrc_cycle_yr, extfr
'vertically intergrated external forcing for '//trim(spc_name) )
call addfld( trim(spc_name)//'_CMXF', horiz_only, 'A', 'kg/m2/s', &
'vertically intergrated external forcing for '//trim(spc_name) )
- if ( history_aerosol .or. history_chemistry ) then
+ if ( history_aerosol .or. history_chemistry ) then
call add_default( trim(spc_name)//'_CLXF', 1, ' ' )
call add_default( trim(spc_name)//'_CMXF', 1, ' ' )
endif
@@ -250,6 +250,10 @@ subroutine extfrc_inti( extfrc_specifier, extfrc_type_in, extfrc_cycle_yr, extfr
forcings(m)%nsectors = 0
+ if (masterproc) then
+ write(iulog,'(a,i3,a)') 'extfrc_inti m: ',m,' init file : '//trim(forcings(m)%filename)
+ endif
+
call getfil (forcings(m)%filename, locfn, 0)
call cam_pio_openfile ( ncid, trim(locfn), PIO_NOWRITE)
ierr = pio_inquire (ncid, nVariables=nvars)
@@ -261,7 +265,7 @@ subroutine extfrc_inti( extfrc_specifier, extfrc_type_in, extfrc_cycle_yr, extfr
allocate(is_sector(nvars))
is_sector(:) = .false.
-
+
do vid = 1,nvars
ierr = pio_inq_varndims (ncid, vid, ndims)
@@ -282,7 +286,7 @@ subroutine extfrc_inti( extfrc_specifier, extfrc_type_in, extfrc_cycle_yr, extfr
forcings(m)%nsectors = forcings(m)%nsectors+1
is_sector(vid)=.true.
-
+
enddo
allocate( forcings(m)%sectors(forcings(m)%nsectors), stat=astat )
@@ -301,7 +305,7 @@ subroutine extfrc_inti( extfrc_specifier, extfrc_type_in, extfrc_cycle_yr, extfr
deallocate(is_sector)
! Global attribute 'input_method' overrides the ext_frc_type namelist setting on
- ! a file-by-file basis. If the ext_frc file does not contain the 'input_method'
+ ! a file-by-file basis. If the ext_frc file does not contain the 'input_method'
! attribute then the ext_frc_type namelist setting is used.
call pio_seterrorhandling(ncid, PIO_BCAST_ERROR)
ierr = pio_get_att(ncid, PIO_GLOBAL, 'input_method', file_interp_type)
@@ -341,7 +345,7 @@ subroutine extfrc_timestep_init( pbuf2d, state )
implicit none
- type(physics_state), intent(in):: state(begchunk:endchunk)
+ type(physics_state), intent(in):: state(begchunk:endchunk)
type(physics_buffer_desc), pointer :: pbuf2d(:,:)
!-----------------------------------------------------------------------
diff --git a/src/chemistry/mozart/mo_gas_phase_chemdr.F90 b/src/chemistry/mozart/mo_gas_phase_chemdr.F90
index 55d53cf89e..0c5b8bc2f6 100644
--- a/src/chemistry/mozart/mo_gas_phase_chemdr.F90
+++ b/src/chemistry/mozart/mo_gas_phase_chemdr.F90
@@ -372,10 +372,11 @@ subroutine gas_phase_chemdr_inti()
! ... save photo rxn rates for HEMCO ParaNOx, chem_mech rxns:
! jo3_b ( 8) O3 + hv -> O + O2
! jno2 ( 16) NO2 + hv -> NO + O
- ! (hplin, 5/17/21)
!
- ! Note hplin 1/25/22: might have to check if this rxt_idx available for
- ! all sub-mechanisms in CAM-chem
+ ! The reactions jo2 and jo3_b exist in the mechanisms that would use
+ ! the ParaNOx ship plume extension. If they do not exist, then the indices
+ ! would not be found and the HCO_IN_JNO2 and HCO_IN_JOH fields would not
+ ! be zero and the extension would have no effect.
!-----------------------------------------------------------------------
rxt_jno2_idx = get_rxt_ndx( 'jno2' )
rxt_joh_idx = get_rxt_ndx( 'jo3_b' )
@@ -386,7 +387,7 @@ end subroutine gas_phase_chemdr_inti
!-----------------------------------------------------------------------
subroutine gas_phase_chemdr(lchnk, ncol, imozart, q, &
phis, zm, zi, calday, &
- tfld, pmid, pdel, pint, &
+ tfld, pmid, pdel, pint, rpdel, rpdeldry, &
cldw, troplev, troplevchem, &
ncldwtr, ufld, vfld, &
delt, ps, &
@@ -401,8 +402,9 @@ subroutine gas_phase_chemdr(lchnk, ncol, imozart, q, &
! ebi, hov, fully implicit, and/or rodas algorithms.
!-----------------------------------------------------------------------
+ use phys_control, only : cam_physpkg_is
use chem_mods, only : nabscol, nfs, indexm, clscnt4
- use physconst, only : rga
+ use physconst, only : rga, gravit
use mo_photo, only : set_ub_col, setcol, table_photo
use mo_exp_sol, only : exp_sol
use mo_imp_sol, only : imp_sol
@@ -423,7 +425,7 @@ subroutine gas_phase_chemdr(lchnk, ncol, imozart, q, &
use mo_mean_mass, only : set_mean_mass
use cam_history, only : outfld
use wv_saturation, only : qsat
- use constituents, only : cnst_mw
+ use constituents, only : cnst_mw, cnst_type
use mo_ghg_chem, only : ghg_chem_set_rates, ghg_chem_set_flbc
use mo_sad, only : sad_strat_calc
use charge_neutrality, only : charge_balance
@@ -482,6 +484,8 @@ subroutine gas_phase_chemdr(lchnk, ncol, imozart, q, &
real(r8),target,intent(in) :: tfld(pcols,pver) ! midpoint temperature (K)
real(r8), intent(in) :: pmid(pcols,pver) ! midpoint pressures (Pa)
real(r8), intent(in) :: pdel(pcols,pver) ! pressure delta about midpoints (Pa)
+ real(r8), intent(in) :: rpdel(pcols,pver) ! reciprocal pressure delta about midpoints (Pa)
+ real(r8), intent(in) :: rpdeldry(pcols,pver) ! reciprocal dry pressure delta about midpoints (Pa)
real(r8), intent(in) :: ufld(pcols,pver) ! zonal velocity (m/s)
real(r8), intent(in) :: vfld(pcols,pver) ! meridional velocity (m/s)
real(r8), intent(in) :: cldw(pcols,pver) ! cloud water (kg/kg)
@@ -1208,7 +1212,6 @@ subroutine gas_phase_chemdr(lchnk, ncol, imozart, q, &
! ... save photo rxn rates for HEMCO ParaNOx, chem_mech rxns:
! jo3_b ( 8) O3 + hv -> O + O2
! jno2 ( 16) NO2 + hv -> NO + O
- ! (hplin, 5/17/21)
!-----------------------------------------------------------------------
! get the rxn rate [1/s] and write to pbuf
if(rxt_jno2_idx > 0 .and. hco_jno2_idx > 0) then
@@ -1219,7 +1222,7 @@ subroutine gas_phase_chemdr(lchnk, ncol, imozart, q, &
if(rxt_joh_idx > 0 .and. hco_joh_idx > 0) then
call pbuf_get_field(pbuf, hco_joh_idx, hco_j_tmp_fld)
- ! this is already in chunk, write /pcols, pver/
+ ! this is already in chunk, write /pcols/ at surface
hco_j_tmp_fld(:ncol) = reaction_rates(:ncol,pver,rxt_joh_idx)
endif
endif
@@ -1449,7 +1452,17 @@ subroutine gas_phase_chemdr(lchnk, ncol, imozart, q, &
do m = 1,pcnst
n = map2chm( m )
if ( n > 0 ) then
- cflx(:ncol,m) = cflx(:ncol,m) - sflx(:ncol,n)
+ if (cam_physpkg_is("cam_dev")) then
+ ! apply to qtend array
+ if (cnst_type(m).eq.'dry') then
+ qtend(:ncol,pver,m) = qtend(:ncol,pver,m) - sflx(:ncol,n)*rpdeldry(:ncol,pver)*gravit
+ else
+ qtend(:ncol,pver,m) = qtend(:ncol,pver,m) - sflx(:ncol,n)*rpdel(:ncol,pver)*gravit
+ end if
+ else
+ ! apply to emissions array
+ cflx(:ncol,m) = cflx(:ncol,m) - sflx(:ncol,n)
+ end if
drydepflx(:ncol,m) = sflx(:ncol,n)
wetdepflx_diag(:ncol,n) = wetdepflx(:ncol,m)
endif
diff --git a/src/chemistry/mozart/mo_lightning.F90 b/src/chemistry/mozart/mo_lightning.F90
index 7f5860d173..4ef18fbaf6 100644
--- a/src/chemistry/mozart/mo_lightning.F90
+++ b/src/chemistry/mozart/mo_lightning.F90
@@ -10,140 +10,205 @@ module mo_lightning
use cam_logfile, only : iulog
use spmd_utils, only : masterproc, mpicom
+ use physics_buffer, only : pbuf_get_index, physics_buffer_desc, pbuf_get_field, pbuf_get_chunk
+ use physics_buffer, only : pbuf_add_field, pbuf_set_field, dtype_r8
+
implicit none
private
- public :: lightning_inti
+
+ public :: lightning_readnl
+ public :: lightning_register
+ public :: lightning_init
public :: lightning_no_prod
public :: prod_no
- save
+ real(r8),protected, allocatable :: prod_no(:,:,:)
real(r8) :: factor = 0.1_r8 ! user-controlled scaling factor to achieve arbitrary no prod.
- real(r8) :: geo_factor ! grid cell area factor
- real(r8) :: vdist(16,3) ! vertical distribution of lightning
- real(r8), allocatable :: prod_no(:,:,:)
- real(r8), allocatable :: glob_prod_no_col(:,:)
- real(r8), allocatable :: flash_freq(:,:)
- integer :: no_ndx,xno_ndx
- logical :: has_no_lightning_prod = .false.
+ real(r8) :: geo_factor = -huge(1._r8) ! grid cell area factor
+ real(r8), allocatable :: vdist(:,:) ! vertical distribution of lightning
+
+ logical :: calc_nox_prod = .false.
+ logical :: calc_lightning = .false.
+
+ integer :: flsh_frq_ndx = -1
+ integer :: cldtop_ndx = -1, cldbot_ndx = -1
+
+ ! namelist parameter
+ real(r8) :: lght_no_prd_factor = -huge(1._r8)
contains
- subroutine lightning_inti( lght_no_prd_factor )
+ !-------------------------------------------------------------------------
+ ! Read namelist options
+ !-------------------------------------------------------------------------
+ subroutine lightning_readnl(nlfile)
+ use namelist_utils, only : find_group_name
+ use spmd_utils, only : mpicom, masterprocid, mpi_real8, mpi_success
+
+ character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input
+
+ integer :: unitn, ierr
+ character(len=*), parameter :: subname = 'lightning_readnl'
+
+ ! ===================
+ ! Namelist definition
+ ! ===================
+ namelist /lightning_nl/ lght_no_prd_factor
+
+ ! =============
+ ! Read namelist
+ ! =============
+ if (masterproc) then
+ open( newunit=unitn, file=trim(nlfile), status='old' )
+ call find_group_name(unitn, 'lightning_nl', status=ierr)
+ if (ierr == 0) then
+ read(unitn, lightning_nl, iostat=ierr)
+ if (ierr /= 0) then
+ call endrun(subname // ':: ERROR reading namelist')
+ end if
+ end if
+ close(unitn)
+ end if
+
+ ! ============================
+ ! Broadcast namelist variables
+ ! ============================
+ call mpi_bcast(lght_no_prd_factor, 1, mpi_real8, masterprocid, mpicom, ierr)
+ if (ierr/=mpi_success) then
+ call endrun(subname//': MPI_BCAST ERROR: lght_no_prd_factor')
+ end if
+
+ if (masterproc) then
+ write(iulog,*) subname,' lght_no_prd_factor: ',lght_no_prd_factor
+ end if
+
+ if( lght_no_prd_factor /= 1._r8 ) then
+ factor = factor*lght_no_prd_factor
+ end if
+
+ end subroutine lightning_readnl
+
+ !-------------------------------------------------------------------------
+ ! register phys buffer field for cloud to ground lightning flash frequency
+ ! to pass to the mediator for land model
+ !-------------------------------------------------------------------------
+ subroutine lightning_register()
+
+ call pbuf_add_field('LGHT_FLASH_FREQ','global',dtype_r8,(/pcols/),flsh_frq_ndx) ! per minute
+
+ end subroutine lightning_register
+
+ !-------------------------------------------------------------------------
+ !-------------------------------------------------------------------------
+ subroutine lightning_init( pbuf2d )
!----------------------------------------------------------------------
! ... initialize the lightning module
!----------------------------------------------------------------------
use mo_constants, only : pi
- use mo_chem_utls, only : get_spc_ndx
use cam_history, only : addfld, add_default, horiz_only
use phys_control, only : phys_getopts
-
- implicit none
+ use time_manager, only : is_first_step
!----------------------------------------------------------------------
! ... dummy args
!----------------------------------------------------------------------
- real(r8), intent(in) :: lght_no_prd_factor ! lightning no production factor
+ type(physics_buffer_desc), pointer :: pbuf2d(:,:)
!----------------------------------------------------------------------
! ... local variables
!----------------------------------------------------------------------
- integer :: astat
+ integer :: astat, err
logical :: history_cesm_forcing
+ character(len=*),parameter :: prefix = 'lightning_init: '
+
+ cldtop_ndx = pbuf_get_index('CLDTOP',errcode=err)
+ cldbot_ndx = pbuf_get_index('CLDBOT',errcode=err)
+ calc_lightning = cldtop_ndx>0 .and. cldbot_ndx>0
+
+ if (.not.calc_lightning) return
+
+ calc_nox_prod = lght_no_prd_factor>0._r8
+
+ if (calc_nox_prod) then
+
+ if (masterproc) write(iulog,*) prefix,'lightning no production scaling factor = ',factor
+
+ !----------------------------------------------------------------------
+ ! ... vdist(kk,itype) = % of lightning nox between (kk-1) and (kk)
+ ! km for profile itype
+ !----------------------------------------------------------------------
+ allocate(vdist(16,3),stat=astat)
+ if( astat /= 0 ) then
+ write(iulog,*) prefix,'failed to allocate vdist; error = ',astat
+ call endrun(prefix//'failed to allocate vdist')
+ end if
+ vdist(:,1) = (/ 3.0_r8, 3.0_r8, 3.0_r8, 3.0_r8, 3.4_r8, 3.5_r8, 3.6_r8, 4.0_r8, & ! midlat cont
+ 5.0_r8, 7.0_r8, 9.0_r8, 14.0_r8, 16.0_r8, 14.0_r8, 8.0_r8, 0.5_r8 /)
+ vdist(:,2) = (/ 2.5_r8, 2.5_r8, 2.5_r8, 2.5_r8, 2.5_r8, 2.5_r8, 2.5_r8, 6.1_r8, & ! trop marine
+ 17.0_r8, 15.4_r8, 14.5_r8, 13.0_r8, 12.5_r8, 2.8_r8, 0.9_r8, 0.3_r8 /)
+ vdist(:,3) = (/ 2.0_r8, 2.0_r8, 2.0_r8, 1.5_r8, 1.5_r8, 1.5_r8, 3.0_r8, 5.8_r8, & ! trop cont
+ 7.6_r8, 9.6_r8, 11.0_r8, 14.0_r8, 14.0_r8, 14.0_r8, 8.2_r8, 2.3_r8 /)
+
+ allocate( prod_no(pcols,pver,begchunk:endchunk),stat=astat )
+ if( astat /= 0 ) then
+ write(iulog,*) prefix, 'failed to allocate prod_no; error = ',astat
+ call endrun(prefix//'failed to allocate prod_no')
+ end if
+ geo_factor = ngcols_p/(4._r8*pi)
+
+ call addfld( 'LNO_COL_PROD', horiz_only, 'I', 'Tg N yr-1', 'lightning column NO source' )
+ call addfld( 'LNO_PROD', (/ 'lev' /), 'I', 'molecules/cm3/s', 'lightning insitu NO source' )
+ call addfld( 'FLASHENGY', horiz_only, 'I', 'J', 'lightning flash energy' ) ! flash energy
+
+ call phys_getopts( history_cesm_forcing_out = history_cesm_forcing )
+ if ( history_cesm_forcing ) then
+ call add_default('LNO_COL_PROD',1,' ')
+ endif
+
+ if (is_first_step()) then
+ call pbuf_set_field(pbuf2d, flsh_frq_ndx, 0.0_r8)
+ endif
- call phys_getopts( history_cesm_forcing_out = history_cesm_forcing )
-
- no_ndx = get_spc_ndx('NO')
- xno_ndx = get_spc_ndx('XNO')
-
- has_no_lightning_prod = no_ndx>0 .or. xno_ndx>0
- if (.not.has_no_lightning_prod) return
-
-
- if( lght_no_prd_factor /= 1._r8 ) then
- factor = factor*lght_no_prd_factor
- end if
-
-
- if (masterproc) write(iulog,*) 'lght_inti: lightning no production scaling factor = ',factor
-
- !----------------------------------------------------------------------
- ! ... vdist(kk,itype) = % of lightning nox between (kk-1) and (kk)
- ! km for profile itype
- !----------------------------------------------------------------------
- vdist(:,1) = (/ 3.0_r8, 3.0_r8, 3.0_r8, 3.0_r8, 3.4_r8, 3.5_r8, 3.6_r8, 4.0_r8, & ! midlat cont
- 5.0_r8, 7.0_r8, 9.0_r8, 14.0_r8, 16.0_r8, 14.0_r8, 8.0_r8, 0.5_r8 /)
- vdist(:,2) = (/ 2.5_r8, 2.5_r8, 2.5_r8, 2.5_r8, 2.5_r8, 2.5_r8, 2.5_r8, 6.1_r8, & ! trop marine
- 17.0_r8, 15.4_r8, 14.5_r8, 13.0_r8, 12.5_r8, 2.8_r8, 0.9_r8, 0.3_r8 /)
- vdist(:,3) = (/ 2.0_r8, 2.0_r8, 2.0_r8, 1.5_r8, 1.5_r8, 1.5_r8, 3.0_r8, 5.8_r8, & ! trop cont
- 7.6_r8, 9.6_r8, 11.0_r8, 14.0_r8, 14.0_r8, 14.0_r8, 8.2_r8, 2.3_r8 /)
-
- allocate( prod_no(pcols,pver,begchunk:endchunk),stat=astat )
- if( astat /= 0 ) then
- write(iulog,*) 'lght_inti: failed to allocate prod_no; error = ',astat
- call endrun
- end if
- allocate( flash_freq(pcols,begchunk:endchunk),stat=astat )
- if( astat /= 0 ) then
- write(iulog,*) 'lght_inti: failed to allocate flash_freq; error = ',astat
- call endrun
- end if
- allocate( glob_prod_no_col(pcols,begchunk:endchunk),stat=astat )
- if( astat /= 0 ) then
- write(iulog,*) 'lght_inti: failed to allocate glob_prod_no_col; error = ',astat
- call endrun
- end if
- prod_no(:,:,:) = 0._r8
- flash_freq(:,:) = 0._r8
- geo_factor = ngcols_p/(4._r8*pi)
-
-
- call addfld( 'LNO_COL_PROD', horiz_only, 'I', 'TG N/YR', 'lighting column NO source' )
- call addfld( 'LNO_PROD', (/ 'lev' /), 'I', '/cm3/s', 'lighting insitu NO source' )
- call addfld( 'FLASHFRQ', horiz_only, 'I', '1/MIN', 'lighting flash rate' ) ! flash frequency in grid box per minute (PPP)
- call addfld( 'FLASHENGY', horiz_only, 'I', ' ', 'lighting flash rate' ) ! flash frequency in grid box per minute (PPP)
- call addfld( 'CLDHGT', horiz_only, 'I', 'KM', 'cloud top height' ) ! cloud top height
- call addfld( 'DCHGZONE', horiz_only, 'I', 'KM', 'depth of discharge zone' ) ! depth of discharge zone
- call addfld( 'CGIC', horiz_only, 'I', 'RATIO', 'ratio of cloud-ground/intracloud discharges' ) ! ratio of cloud-ground/intracloud discharges
-
- if ( history_cesm_forcing ) then
- call add_default('LNO_COL_PROD',1,' ')
endif
- end subroutine lightning_inti
+ call addfld( 'FLASHFRQ', horiz_only, 'I', 'min-1', 'lightning flash rate' ) ! flash frequency in grid box per minute (PPP)
+ call addfld( 'CLDHGT', horiz_only, 'I', 'km', 'cloud top height' ) ! cloud top height
+ call addfld( 'DCHGZONE', horiz_only, 'I', 'km', 'depth of discharge zone' ) ! depth of discharge zone
+ call addfld( 'CGIC', horiz_only, 'I', '1', 'ratio of cloud-ground/intracloud discharges' ) ! ratio of cloud-ground/intracloud discharges
+ call addfld( 'LGHTNG_CLD2GRND', horiz_only, 'I', 'min-1', 'clound-to-ground lightning flash rate') ! clound to ground flash frequency
+ end subroutine lightning_init
+
+ !-------------------------------------------------------------------------
+ !-------------------------------------------------------------------------
subroutine lightning_no_prod( state, pbuf2d, cam_in )
!----------------------------------------------------------------------
! ... set no production from lightning
!----------------------------------------------------------------------
use physics_types, only : physics_state
-
- use physics_buffer, only : pbuf_get_index, physics_buffer_desc, pbuf_get_field, pbuf_get_chunk
use physconst, only : rga
use phys_grid, only : get_rlat_all_p, get_wght_all_p
use cam_history, only : outfld
use camsrfexch, only : cam_in_t
use shr_reprosum_mod, only : shr_reprosum_calc
- use mo_constants, only : rearth, d2r
- implicit none
+ use mo_constants, only : rearth, d2r
!----------------------------------------------------------------------
! ... dummy args
!----------------------------------------------------------------------
type(physics_state), intent(in) :: state(begchunk:endchunk) ! physics state
-
type(physics_buffer_desc), pointer :: pbuf2d(:,:)
type(cam_in_t), intent(in) :: cam_in(begchunk:endchunk) ! physics state
!----------------------------------------------------------------------
! ... local variables
!----------------------------------------------------------------------
- real(r8), parameter :: land = 1._r8
- real(r8), parameter :: secpyr = 365._r8 * 8.64e4_r8
+ real(r8), parameter :: land = 1._r8
+ real(r8), parameter :: secpyr = 365._r8 * 8.64e4_r8
- integer :: i, c
integer :: cldtind ! level index for cloud top
integer :: cldbind ! level index for cloud base > 273k
integer :: k, kk, zlow_ind, zhigh_ind, itype
@@ -162,16 +227,20 @@ subroutine lightning_no_prod( state, pbuf2d, cam_in )
real(r8) :: flash_energy(pcols,begchunk:endchunk) ! energy of flashes per second
real(r8) :: prod_no_col(pcols,begchunk:endchunk) ! global no production rate for diagnostics
real(r8) :: wrk, wrk1, wrk2(1)
+ integer :: icol ! column index
integer :: ncol ! columns per chunk
- integer :: lchnk ! columns per chunk
+ integer :: lchnk ! chunk index
real(r8),pointer :: cldtop(:) ! cloud top level index
real(r8),pointer :: cldbot(:) ! cloud bottom level index
real(r8) :: zmid(pcols,pver) ! geopot height above surface at midpoints (m)
real(r8) :: zint(pcols,pver+1,begchunk:endchunk) ! geopot height above surface at interfaces (m)
real(r8) :: zsurf(pcols) ! geopot height above surface at interfaces (m)
- real(r8) :: rlats(pcols,begchunk:endchunk) ! column latitudes in chunks
+ real(r8) :: rlats(pcols) ! column latitudes in chunks
real(r8) :: wght(pcols)
+ real(r8) :: glob_prod_no_col(pcols,begchunk:endchunk)
+ real(r8) :: flash_freq(pcols,begchunk:endchunk)
+
!----------------------------------------------------------------------
! ... parameters to determine cg/ic ratio [price and rind, 1993]
!----------------------------------------------------------------------
@@ -184,26 +253,29 @@ subroutine lightning_no_prod( state, pbuf2d, cam_in )
real(r8), parameter :: m2km = 1.e-3_r8
real(r8), parameter :: km2cm = 1.e5_r8
real(r8), parameter :: lat25 = 25._r8*d2r ! 25 degrees latitude in radians
- integer :: cldtop_ndx, cldbot_ndx
+
real(r8) :: flash_freq_land, flash_freq_ocn
+ real(r8), pointer :: cld2grnd_flash_freq(:)
+
+ if (.not.calc_lightning) return
- if (.not.has_no_lightning_prod) return
+ nullify(cld2grnd_flash_freq)
!----------------------------------------------------------------------
! ... initialization
!----------------------------------------------------------------------
flash_freq(:,:) = 0._r8
- prod_no(:,:,:) = 0._r8
- prod_no_col(:,:) = 0._r8
cldhgt(:,:) = 0._r8
dchgzone(:,:) = 0._r8
cgic(:,:) = 0._r8
flash_energy(:,:) = 0._r8
- glob_prod_no_col(:,:) = 0._r8
- cldtop_ndx = pbuf_get_index('CLDTOP')
- cldbot_ndx = pbuf_get_index('CLDBOT')
+ if (calc_nox_prod) then
+ prod_no(:,:,:) = 0._r8
+ prod_no_col(:,:) = 0._r8
+ glob_prod_no_col(:,:) = 0._r8
+ end if
!--------------------------------------------------------------------------------
! ... estimate flash frequency and resulting no emissions
@@ -223,29 +295,30 @@ subroutine lightning_no_prod( state, pbuf2d, cam_in )
! with 1e17 n atoms per j. the total number of n atoms is then distributed
! over the complete column of grid boxes.
!--------------------------------------------------------------------------------
- Chunk_loop : do c = begchunk,endchunk
- ncol = state(c)%ncol
- lchnk = state(c)%lchnk
+ Chunk_loop : do lchnk = begchunk,endchunk
+ ncol = state(lchnk)%ncol
+ call pbuf_get_field(pbuf_get_chunk(pbuf2d,lchnk), flsh_frq_ndx, cld2grnd_flash_freq )
call pbuf_get_field(pbuf_get_chunk(pbuf2d,lchnk), cldtop_ndx, cldtop )
call pbuf_get_field(pbuf_get_chunk(pbuf2d,lchnk), cldbot_ndx, cldbot )
- zsurf(:ncol) = state(c)%phis(:ncol)*rga
- call get_rlat_all_p(c, ncol, rlats(1,c) )
- call get_wght_all_p(c, ncol, wght)
+ zsurf(:ncol) = state(lchnk)%phis(:ncol)*rga
+ call get_wght_all_p(lchnk, pcols, wght)
do k = 1,pver
- zmid(:ncol,k) = state(c)%zm(:ncol,k) + zsurf(:ncol)
- zint(:ncol,k,c) = state(c)%zi(:ncol,k) + zsurf(:ncol)
+ zmid(:ncol,k) = state(lchnk)%zm(:ncol,k) + zsurf(:ncol)
+ zint(:ncol,k,lchnk) = state(lchnk)%zi(:ncol,k) + zsurf(:ncol)
end do
- zint(:ncol,pver+1,c) = state(c)%zi(:ncol,pver+1) + zsurf(:ncol)
+ zint(:ncol,pver+1,lchnk) = state(lchnk)%zi(:ncol,pver+1) + zsurf(:ncol)
+
+ cld2grnd_flash_freq(:) = 0.0_r8
- col_loop : do i = 1,ncol
+ col_loop : do icol = 1,ncol
!--------------------------------------------------------------------------------
! ... find cloud top and bottom level above 273k
!--------------------------------------------------------------------------------
- cldtind = nint( cldtop(i) )
- cldbind = nint( cldbot(i) )
+ cldtind = nint( cldtop(icol) )
+ cldbind = nint( cldbot(icol) )
do
- if( cldbind <= cldtind .or. state(c)%t(i,cldbind) < t0 ) then
+ if( cldbind <= cldtind .or. state(lchnk)%t(icol,cldbind) < t0 ) then
exit
end if
cldbind = cldbind - 1
@@ -254,58 +327,77 @@ subroutine lightning_no_prod( state, pbuf2d, cam_in )
!--------------------------------------------------------------------------------
! ... compute cloud top height and depth of charging zone
!--------------------------------------------------------------------------------
- cldhgt(i,c) = m2km*max( 0._r8,zint(i,cldtind,c) )
- dchgz = cldhgt(i,c) - m2km*zmid(i,cldbind)
- dchgzone(i,c) = dchgz
+ cldhgt(icol,lchnk) = m2km*max( 0._r8,zint(icol,cldtind,lchnk) )
+ dchgz = cldhgt(icol,lchnk) - m2km*zmid(icol,cldbind)
+ dchgzone(icol,lchnk) = dchgz
!--------------------------------------------------------------------------------
! ... compute flash frequency for given cloud top height
! (flashes storm^-1 min^-1)
!--------------------------------------------------------------------------------
- flash_freq_land = 3.44e-5_r8 * cldhgt(i,c)**4.9_r8
- flash_freq_ocn = 6.40e-4_r8 * cldhgt(i,c)**1.7_r8
- flash_freq(i,c) = cam_in(c)%landfrac(i)*flash_freq_land + &
- cam_in(c)%ocnfrac(i) *flash_freq_ocn
+ flash_freq_land = 3.44e-5_r8 * cldhgt(icol,lchnk)**4.9_r8
+ flash_freq_ocn = 6.40e-4_r8 * cldhgt(icol,lchnk)**1.7_r8
+ flash_freq(icol,lchnk) = cam_in(lchnk)%landfrac(icol)*flash_freq_land + &
+ cam_in(lchnk)%ocnfrac(icol) *flash_freq_ocn
!--------------------------------------------------------------------------------
- ! ... compute cg/ic ratio
- ! cgic = proportion of cg flashes (=pg from ppp paper)
+ ! cgic = proportion of cloud-to-ground flashes
+ ! NOx from lightning 1. Global distribution based on lightning physics, C Price et al
+ ! JOURNAL OF GEOPHYSICAL RESEARCH, VOL. 102, NO. D5, PAGES 5929-5941, MARCH 20, 1997
+ ! (https://agupubs.onlinelibrary.wiley.com/doi/epdf/10.1029/96JD03504)
+ ! eq 14
!--------------------------------------------------------------------------------
- cgic(i,c) = 1._r8/((((ca*dchgz + cb)*dchgz + cc) *dchgz + cd)*dchgz + ce)
+ cgic(icol,lchnk) = 1._r8/((((ca*dchgz + cb)*dchgz + cc) *dchgz + cd)*dchgz + ce)
if( dchgz < 5.5_r8 ) then
- cgic(i,c) = 0._r8
+ cgic(icol,lchnk) = 0._r8
else if( dchgz > 14._r8 ) then
- cgic(i,c) = .02_r8
+ cgic(icol,lchnk) = .02_r8
end if
- !--------------------------------------------------------------------------------
- ! ... compute flash energy (cg*6.7e9 + ic*6.7e8)
- ! and convert to total energy per second
- ! set ic = cg
- !--------------------------------------------------------------------------------
- flash_energy(i,c) = 6.7e9_r8 * flash_freq(i,c)/60._r8
- !--------------------------------------------------------------------------------
- ! ... LKE Aug 23, 2005: scale production to account for different grid
- ! box sizes. This requires a reduction in the overall fudge factor
- ! (e.g., from 1.2 to 0.5)
- !--------------------------------------------------------------------------------
- flash_energy(i,c) = flash_energy(i,c) * wght(i) * geo_factor
- !--------------------------------------------------------------------------------
- ! ... compute number of n atoms produced per second
- ! and convert to n atoms per second per cm2 and apply fudge factor
- !--------------------------------------------------------------------------------
- prod_no_col(i,c) = 1.e17_r8*flash_energy(i,c)/(1.e4_r8*rearth*rearth*wght(i)) * factor
-
- !--------------------------------------------------------------------------------
- ! ... compute global no production rate in tgn/yr:
- ! tgn per second: * 14.00674 * 1.65979e-24 * 1.e-12
- ! nb: 1.65979e-24 = 1/avo
- ! tgn per year: * secpyr
- !--------------------------------------------------------------------------------
- glob_prod_no_col(i,c) = 1.e17_r8*flash_energy(i,c) &
- * 14.00674_r8 * 1.65979e-24_r8 * 1.e-12_r8 * secpyr * factor
+ cld2grnd_flash_freq(icol) = cam_in(lchnk)%landfrac(icol)*flash_freq_land*cgic(icol,lchnk) ! cld-to-grnd flash frq (per min)
+
+ if (calc_nox_prod) then
+ !--------------------------------------------------------------------------------
+ ! ... compute flash energy (cg*6.7e9 + ic*6.7e8)
+ ! and convert to total energy per second
+ ! set ic = cg
+ !--------------------------------------------------------------------------------
+ flash_energy(icol,lchnk) = 6.7e9_r8 * flash_freq(icol,lchnk)/60._r8
+ !--------------------------------------------------------------------------------
+ ! ... LKE Aug 23, 2005: scale production to account for different grid
+ ! box sizes. This requires a reduction in the overall fudge factor
+ ! (e.g., from 1.2 to 0.5)
+ !--------------------------------------------------------------------------------
+ flash_energy(icol,lchnk) = flash_energy(icol,lchnk) * wght(icol) * geo_factor
+ !--------------------------------------------------------------------------------
+ ! ... compute number of n atoms produced per second
+ ! and convert to n atoms per second per cm2 and apply fudge factor
+ !--------------------------------------------------------------------------------
+ prod_no_col(icol,lchnk) = 1.e17_r8*flash_energy(icol,lchnk)/(1.e4_r8*rearth*rearth*wght(icol)) * factor
+
+ !--------------------------------------------------------------------------------
+ ! ... compute global no production rate in tgn/yr:
+ ! tgn per second: * 14.00674 * 1.65979e-24 * 1.e-12
+ ! nb: 1.65979e-24 = 1/avo
+ ! tgn per year: * secpyr
+ !--------------------------------------------------------------------------------
+ glob_prod_no_col(icol,lchnk) = 1.e17_r8*flash_energy(icol,lchnk) &
+ * 14.00674_r8 * 1.65979e-24_r8 * 1.e-12_r8 * secpyr * factor
+ end if
end if cloud_layer
end do Col_loop
+
+ call outfld( 'LGHTNG_CLD2GRND', cld2grnd_flash_freq, pcols, lchnk )
end do Chunk_loop
+
+ do lchnk = begchunk,endchunk
+ call outfld( 'FLASHFRQ', flash_freq(:,lchnk), pcols, lchnk )
+ call outfld( 'CGIC', cgic(:,lchnk), pcols, lchnk )
+ call outfld( 'CLDHGT', cldhgt(:,lchnk), pcols, lchnk )
+ call outfld( 'DCHGZONE', dchgzone(:,lchnk), pcols, lchnk )
+ enddo
+
+ if (.not.calc_nox_prod) return
+
!--------------------------------------------------------------------------------
! ... Accumulate global total, convert to flashes per second
! ... Accumulate global NO production rate
@@ -325,29 +417,29 @@ subroutine lightning_no_prod( state, pbuf2d, cam_in )
!--------------------------------------------------------------------------------
! ... Distribute production up to cloud top [Pickering et al., 1998 (JGR)]
!--------------------------------------------------------------------------------
- do c = begchunk,endchunk
- ncol = state(c)%ncol
- lchnk = state(c)%lchnk
+ do lchnk = begchunk,endchunk
+ call get_rlat_all_p(lchnk, pcols, rlats)
+ ncol = state(lchnk)%ncol
call pbuf_get_field(pbuf_get_chunk(pbuf2d,lchnk), cldtop_ndx, cldtop )
- do i = 1,ncol
- cldtind = nint( cldtop(i) )
- if( prod_no_col(i,c) > 0._r8 ) then
- if( cldhgt(i,c) > 0._r8 ) then
- if( abs( rlats(i,c) ) > lat25 ) then
- itype = 1 ! midlatitude continental
- else if( nint( cam_in(c)%landfrac(i) ) == land ) then
- itype = 3 ! tropical continental
+ do icol = 1,ncol
+ cldtind = nint( cldtop(icol) )
+ if( prod_no_col(icol,lchnk) > 0._r8 ) then
+ if( cldhgt(icol,lchnk) > 0._r8 ) then
+ if( abs( rlats(icol) ) > lat25 ) then
+ itype = 1 ! midlatitude continental
+ else if( nint( cam_in(lchnk)%landfrac(icol) ) == land ) then
+ itype = 3 ! tropical continental
else
- itype = 2 ! topical marine
+ itype = 2 ! topical marine
end if
frac_sum = 0._r8
do k = cldtind,pver
- zlow = zint(i,k+1,c) * m2km ! lower interface height (km)
- zlow_scal = zlow * 16._r8/cldhgt(i,c) ! scale to 16 km convection height
- zlow_ind = max( 1,INT(zlow_scal)+1 ) ! lowest vdist index to include in layer
- zhigh = zint(i,k,c) * m2km ! upper interface height (km)
- zhigh_scal = zhigh * 16._r8/cldhgt(i,c) ! height (km) scaled to 16km convection height
- zhigh_ind = max( 1,MIN( 16,INT(zhigh_scal)+1 ) ) ! highest vdist index to include in layer
+ zlow = zint(icol,k+1,lchnk) * m2km ! lower interface height (km)
+ zlow_scal = zlow * 16._r8/cldhgt(icol,lchnk) ! scale to 16 km convection height
+ zlow_ind = max( 1,INT(zlow_scal)+1 ) ! lowest vdist index to include in layer
+ zhigh = zint(icol,k,lchnk) * m2km ! upper interface height (km)
+ zhigh_scal = zhigh * 16._r8/cldhgt(icol,lchnk) ! height (km) scaled to 16km convection height
+ zhigh_ind = max( 1,MIN( 16,INT(zhigh_scal)+1 ) ) ! highest vdist index to include in layer
do kk = zlow_ind,zhigh_ind
wrk = kk
wrk1 = kk - 1
@@ -355,11 +447,11 @@ subroutine lightning_no_prod( state, pbuf2d, cam_in )
- max( zlow_scal,wrk1 )
fraction = max( 0._r8, min( 1._r8,fraction ) )
frac_sum = frac_sum + fraction*vdist(kk,itype)
- prod_no(i,k,c) = prod_no(i,k,c) & ! sum the fraction of column NOx in layer k
+ prod_no(icol,k,lchnk) = prod_no(icol,k,lchnk) & ! sum the fraction of column NOx in layer k
+ fraction*vdist(kk,itype)*.01_r8
end do
- prod_no(i,k,c) = prod_no_col(i,c) * prod_no(i,k,c) & ! multiply fraction by column amount
- / (km2cm*(zhigh - zlow)) ! and convert to atom N cm^-3 s^-1
+ prod_no(icol,k,lchnk) = prod_no_col(icol,lchnk) * prod_no(icol,k,lchnk) & ! multiply fraction by column amount
+ / (km2cm*(zhigh - zlow)) ! and convert to atom N cm^-3 s^-1
end do
end if
end if
@@ -370,15 +462,10 @@ subroutine lightning_no_prod( state, pbuf2d, cam_in )
!--------------------------------------------------------------------------------
! ... output lightning no production to history file
!--------------------------------------------------------------------------------
- do c = begchunk,endchunk
- lchnk = state(c)%lchnk
- call outfld( 'LNO_PROD', prod_no(:,:,c), pcols, lchnk )
- call outfld( 'LNO_COL_PROD', glob_prod_no_col(:,c), pcols, lchnk )
- call outfld( 'FLASHFRQ', flash_freq(:,c), pcols, lchnk )
- call outfld( 'FLASHENGY', flash_energy(:,c), pcols, lchnk )
- call outfld( 'CLDHGT', cldhgt(:,c), pcols, lchnk )
- call outfld( 'DCHGZONE', dchgzone(:,c), pcols, lchnk )
- call outfld( 'CGIC', cgic(:,c), pcols, lchnk )
+ do lchnk = begchunk,endchunk
+ call outfld( 'LNO_PROD', prod_no(:,:,lchnk), pcols, lchnk )
+ call outfld( 'LNO_COL_PROD', glob_prod_no_col(:,lchnk), pcols, lchnk )
+ call outfld( 'FLASHENGY', flash_energy(:,lchnk), pcols, lchnk )
enddo
end subroutine lightning_no_prod
diff --git a/src/chemistry/mozart/mo_neu_wetdep.F90 b/src/chemistry/mozart/mo_neu_wetdep.F90
index ed6a39171b..78b3779fe4 100644
--- a/src/chemistry/mozart/mo_neu_wetdep.F90
+++ b/src/chemistry/mozart/mo_neu_wetdep.F90
@@ -192,7 +192,6 @@ subroutine neu_wetdep_init
call addfld ('WD_'//trim(gas_wetdep_list(m)),horiz_only, 'A','kg/m2/s','vertical integrated wet deposition flux')
call addfld ('HEFF_'//trim(gas_wetdep_list(m)),(/ 'lev' /), 'A','M/atm','Effective Henrys Law coeff.')
if (history_chemistry) then
- call add_default('DTWR_'//trim(gas_wetdep_list(m)), 1, ' ')
call add_default('WD_'//trim(gas_wetdep_list(m)), 1, ' ')
end if
end do
diff --git a/src/chemistry/mozart/mo_setext.F90 b/src/chemistry/mozart/mo_setext.F90
index 4cd564ff06..a2c6ed7095 100644
--- a/src/chemistry/mozart/mo_setext.F90
+++ b/src/chemistry/mozart/mo_setext.F90
@@ -9,8 +9,6 @@ module mo_setext
save
- logical :: use_hemco ! Use Harmonized Emissions Component (HEMCO)
-
integer :: co_ndx, no_ndx, xno_ndx, o_ndx
integer :: op_ndx, o2p_ndx, np_ndx, n2p_ndx, n2d_ndx, n_ndx, e_ndx, oh_ndx
logical :: has_ions = .false.
@@ -29,13 +27,8 @@ subroutine setext_inti
use spmd_utils, only : masterproc
use mee_ionization,only : mee_ion_init
- use phys_control, only : phys_getopts
-
implicit none
- ! Check if HEMCO is enabled in this run
- call phys_getopts(use_hemco_out = use_hemco)
-
co_ndx = get_extfrc_ndx( 'CO' )
no_ndx = get_extfrc_ndx( 'NO' )
xno_ndx = get_extfrc_ndx( 'XNO' )
@@ -126,6 +119,8 @@ subroutine setext( extfrc, zint_abs, zint_rel, cldtop, &
use physics_buffer, only : physics_buffer_desc
+ use phys_control, only : use_hemco ! Use Harmonized Emissions Component (HEMCO)
+
implicit none
!--------------------------------------------------------
diff --git a/src/chemistry/mozart/mo_srf_emissions.F90 b/src/chemistry/mozart/mo_srf_emissions.F90
index e0d80ef1b1..80afe7f474 100644
--- a/src/chemistry/mozart/mo_srf_emissions.F90
+++ b/src/chemistry/mozart/mo_srf_emissions.F90
@@ -28,14 +28,13 @@ module mo_srf_emissions
private
- public :: srf_emissions_inti, set_srf_emissions, set_srf_emissions_time
+ public :: srf_emissions_inti, set_srf_emissions, set_srf_emissions_time
- save
+ logical, public, protected :: has_emis(gas_pcnst) = .false.
real(r8), parameter :: amufac = 1.65979e-23_r8 ! 1.e4* kg / amu
- logical :: has_emis(gas_pcnst)
type(emission), allocatable :: emissions(:)
- integer :: n_emis_files
+ integer :: n_emis_files
integer :: c10h16_ndx, isop_ndx
contains
@@ -47,7 +46,7 @@ subroutine srf_emissions_inti( srf_emis_specifier, emis_type_in, emis_cycle_yr,
!-----------------------------------------------------------------------
use chem_mods, only : adv_mass
- use mo_chem_utls, only : get_spc_ndx
+ use mo_chem_utls, only : get_spc_ndx
use tracer_data, only : trcdata_init
use cam_pio_utils, only : cam_pio_openfile
use pio, only : pio_inquire, pio_nowrite, pio_closefile, pio_inq_varndims
@@ -77,11 +76,11 @@ subroutine srf_emissions_inti( srf_emis_specifier, emis_type_in, emis_cycle_yr,
character(len=16) :: spc_name
character(len=256) :: filename
- character(len=16) :: emis_species(gas_pcnst)
- character(len=256) :: emis_filenam(gas_pcnst)
- integer :: emis_indexes(gas_pcnst)
- integer :: indx(gas_pcnst)
- real(r8) :: emis_scalefactor(gas_pcnst)
+ character(len=16) :: emis_species(size(srf_emis_specifier))
+ character(len=256) :: emis_filenam(size(srf_emis_specifier))
+ integer :: emis_indexes(size(srf_emis_specifier))
+ integer :: indx(size(srf_emis_specifier))
+ real(r8) :: emis_scalefactor(size(srf_emis_specifier))
integer :: vid, nvars, isec, num_dims_emis
integer :: vndims
@@ -101,19 +100,19 @@ subroutine srf_emissions_inti( srf_emis_specifier, emis_type_in, emis_cycle_yr,
real(r8) :: xdbl
integer :: time_dimid, ncol_dimid
integer, allocatable :: dimids(:)
-
+
has_emis(:) = .false.
nn = 0
indx(:) = 0
- count_emis: do n=1,gas_pcnst
+ count_emis: do n=1,size(srf_emis_specifier)
if ( len_trim(srf_emis_specifier(n) ) == 0 ) then
exit count_emis
endif
i = scan(srf_emis_specifier(n),'->')
spc_name = trim(adjustl(srf_emis_specifier(n)(:i-1)))
-
+
! need to parse out scalefactor ...
tmp_string = adjustl(srf_emis_specifier(n)(i+2:))
j = scan( tmp_string, '*' )
@@ -130,7 +129,7 @@ subroutine srf_emissions_inti( srf_emis_specifier, emis_type_in, emis_cycle_yr,
if (m > 0) then
has_emis(m) = .true.
- else
+ else
write(iulog,*) 'srf_emis_inti: spc_name ',spc_name,' is not included in the simulation'
call endrun('srf_emis_inti: invalid surface emission specification')
endif
@@ -161,7 +160,7 @@ subroutine srf_emissions_inti( srf_emis_specifier, emis_type_in, emis_cycle_yr,
end if
!-----------------------------------------------------------------------
- ! Sort the input files so that the emissions sources are summed in the
+ ! Sort the input files so that the emissions sources are summed in the
! same order regardless of the order of the input files in the namelist
!-----------------------------------------------------------------------
if (n_emis_files > 0) then
@@ -171,7 +170,7 @@ subroutine srf_emissions_inti( srf_emis_specifier, emis_type_in, emis_cycle_yr,
!-----------------------------------------------------------------------
! ... setup the emission type array
!-----------------------------------------------------------------------
- do m=1,n_emis_files
+ do m=1,n_emis_files
emissions(m)%spc_ndx = emis_indexes(indx(m))
emissions(m)%units = 'Tg/y'
emissions(m)%species = emis_species(indx(m))
@@ -186,7 +185,11 @@ subroutine srf_emissions_inti( srf_emis_specifier, emis_type_in, emis_cycle_yr,
spc_loop: do m = 1, n_emis_files
emissions(m)%nsectors = 0
-
+
+ if (masterproc) then
+ write(iulog,'(a,i3,a)') 'srf_emissions_inti m: ',m,' init file : '//trim(emissions(m)%filename)
+ endif
+
call getfil (emissions(m)%filename, locfn, 0)
call cam_pio_openfile ( ncid, trim(locfn), PIO_NOWRITE)
ierr = pio_inquire (ncid, nVariables=nvars)
@@ -198,7 +201,7 @@ subroutine srf_emissions_inti( srf_emis_specifier, emis_type_in, emis_cycle_yr,
allocate(is_sector(nvars))
is_sector(:) = .false.
-
+
if (unstructured) then
ierr = pio_inq_dimid( ncid, 'time', time_dimid )
end if
@@ -254,7 +257,7 @@ subroutine srf_emissions_inti( srf_emis_specifier, emis_type_in, emis_cycle_yr,
deallocate(is_sector)
! Global attribute 'input_method' overrides the srf_emis_type namelist setting on
- ! a file-by-file basis. If the emis file does not contain the 'input_method'
+ ! a file-by-file basis. If the emis file does not contain the 'input_method'
! attribute then the srf_emis_type namelist setting is used.
call pio_seterrorhandling(ncid, PIO_BCAST_ERROR)
ierr = pio_get_att(ncid, PIO_GLOBAL, 'input_method', file_interp_type)
@@ -297,7 +300,7 @@ subroutine set_srf_emissions_time( pbuf2d, state )
implicit none
- type(physics_state), intent(in):: state(begchunk:endchunk)
+ type(physics_state), intent(in):: state(begchunk:endchunk)
type(physics_buffer_desc), pointer :: pbuf2d(:,:)
!-----------------------------------------------------------------------
@@ -364,7 +367,7 @@ subroutine set_srf_emissions( lchnk, ncol, sflx )
"kg/m^2/sec " /)
character(len=12) :: units
- real(r8), dimension(ncol) :: rlats, rlons
+ real(r8), dimension(ncol) :: rlats, rlons
sflx(:,:) = 0._r8
diff --git a/src/chemistry/mozart/ocean_emis.F90 b/src/chemistry/mozart/ocean_emis.F90
index 26819fd846..d8179d42b8 100644
--- a/src/chemistry/mozart/ocean_emis.F90
+++ b/src/chemistry/mozart/ocean_emis.F90
@@ -3,23 +3,23 @@
! Ref: Carpenter et al Chem Soc Rev (2012); Johnson, Ocean sci (2010)
! ------------------------------------------------------------------------------------
! Required inputs for the air-sea flux module:
-! - Seawater concentration (nanomoles per liter) and Sea surface salinity
+! - Seawater concentration (nanomoles per liter) and Sea surface salinity
! (parts per thousand) read from namelist (netCDF)
! - Concentration in the gas-phase (pptv), air temperature (K), 10m windspeed (m/s),
! surface pressure (atm), sea surface temperature (K): all from other modules
! ------------------------------------------------------------------------------------
! Key subroutines:
-! ocean_emis_readnl(..): Read salinity from namelist (user_nl_cam).
+! ocean_emis_readnl(..): Read salinity from namelist (user_nl_cam).
! Salinity not time-dependent. Flux depends very weakly on it
-! ocean_emis_init(...): Interpolate salinity, initialize the library for the flux
+! ocean_emis_init(...): Interpolate salinity, initialize the library for the flux
! reading time-dependent seawater conc. from user_nl_cam
! ocean_emis_advance(...): process the seawater concentration
-! ocean_emis_getflux(...): calculate the air-sea flux (upward or downward),
+! ocean_emis_getflux(...): calculate the air-sea flux (upward or downward),
! then add to total surface flux (sflx)
! ------------------------------------------------------------------------------------
! Last built: 9 March 2018.
! Written by: Siyuan Wang (ACOM/NCAR) siyuan@ucar.edu
-! Acknowledgement: Francis Vitt (NCAR). and of course Dr. Peppurr too
+! Acknowledgement: Francis Vitt (NCAR). and of course Dr. Peppurr too
! ====================================================================================
module ocean_emis
@@ -28,12 +28,12 @@ module ocean_emis
use ppgrid, only : pcols, begchunk,endchunk
use spmd_utils, only : masterproc
use cam_abortutils, only : endrun
- use cam_history, only : addfld, horiz_only, outfld
+ use cam_history, only : addfld, add_default, horiz_only, outfld
use constituents, only : cnst_get_ind
use tracer_data, only : trfld,trfile
use chem_mods, only : gas_pcnst
use cam_logfile, only : iulog
- use ioFileMod, only : getfil
+ use ioFileMod, only : getfil
implicit none
@@ -42,6 +42,7 @@ module ocean_emis
public :: ocean_emis_init
public :: ocean_emis_getflux
public :: ocean_emis_advance
+ public :: ocean_emis_species
type :: Csw
integer :: spc_ndx
@@ -57,9 +58,9 @@ module ocean_emis
logical :: switch_bubble
type(Csw), allocatable :: Csw_nM(:)
- integer :: n_Csw_files
+ integer :: n_Csw_files = 0
- real(r8), allocatable :: salinity(:,:)
+ real(r8), allocatable :: salinity(:,:)
! ================
! Air-sea exchange
@@ -69,32 +70,32 @@ module ocean_emis
Integer, Parameter :: HowManySalts = 5 ! Change this number if you wanna add more salts
Integer, Parameter :: HowManySaltProperties = 7 ! Don't touch this (unless you wanna add more fields)
- Type GasLib
+ Type GasLib
Character(16) :: CmpdName
Real(r8), Dimension(HowManyProperties) :: CmpdProperties
End Type GasLib
- Type SaltLib
+ Type SaltLib
Character(16) :: SaltName
- Real(r8), Dimension(HowManySaltProperties) :: SaltProperties
+ Real(r8), Dimension(HowManySaltProperties) :: SaltProperties
End Type SaltLib
Type(GasLib), Dimension(HowManyMolecules) :: GasList ! Library for the trace gas properties
Type(SaltLib), Dimension(HowManySalts) :: SaltList ! Library for the salt properties
- ! ===========================
+ ! ===========================
! seawater concentration:
! ===========================
- character(len=cl) :: csw_specifier(gas_pcnst) = ''
+ character(len=cl) :: csw_specifier(gas_pcnst) = ''
character(len=24) :: csw_time_type = 'CYCLICAL' ! 'CYCLICAL' | 'SERIAL' | 'INTERP_MISSING_MONTHS'
integer :: csw_cycle_yr = 0
- logical :: bubble_mediated_transfer = .false.
+ logical :: bubble_mediated_transfer = .false.
character(len=cl) :: ocean_salinity_file = 'NONE'
contains
-!--------------------------------------------------------------------------------
-!--------------------------------------------------------------------------------
+ !--------------------------------------------------------------------------------
+ !--------------------------------------------------------------------------------
subroutine ocean_emis_readnl(nlfile)
use namelist_utils, only : find_group_name
@@ -105,7 +106,7 @@ subroutine ocean_emis_readnl(nlfile)
integer :: unitn, ierr
character(len=*), parameter :: subname = 'ocean_emis_readnl'
- ! ===================
+ ! ===================
! Namelist definition
! ===================
namelist /ocean_emis_nl/ ocean_salinity_file
@@ -125,7 +126,7 @@ subroutine ocean_emis_readnl(nlfile)
end if
close(unitn)
end if
-
+
! ============================
! Broadcast namelist variables
! ============================
@@ -151,7 +152,7 @@ subroutine ocean_emis_init()
use pio, only : file_desc_t, pio_inq_dimid, pio_inq_dimlen, pio_inq_varid, pio_get_var
use pio, only : PIO_NOWRITE, PIO_NOERR
use pio, only : pio_seterrorhandling, PIO_BCAST_ERROR, pio_closefile
- use phys_grid, only : get_ncols_p, get_rlon_all_p, get_rlat_all_p
+ use phys_grid, only : get_ncols_p, get_rlon_all_p, get_rlat_all_p
use interpolate_data, only : lininterp_init, lininterp, interp_type, lininterp_finish
use mo_constants, only : pi
@@ -162,19 +163,19 @@ subroutine ocean_emis_init()
real(r8), allocatable :: file_lats(:), file_lons(:)
real(r8), allocatable :: wrk2d(:,:)
real(r8) :: to_lats(pcols), to_lons(pcols)
- type(interp_type) :: lon_wgts, lat_wgts
+ type(interp_type) :: lon_wgts, lat_wgts
real(r8), parameter :: zero=0_r8, twopi=2_r8*pi, degs2rads = pi/180._r8
character(len=*), parameter :: subname = 'ocean_emis_init'
-
+
if (trim(ocean_salinity_file) == 'NONE') return
call getfil( ocean_salinity_file, filen, 0 )
call cam_pio_openfile( fid, filen, PIO_NOWRITE)
-
+
call pio_seterrorhandling(fid, PIO_BCAST_ERROR)
-
+
ierr = pio_inq_dimid( fid, 'lon', dimid )
if (ierr /= PIO_NOERR) then
call endrun(subname//': pio_inq_dimid lon FAILED')
@@ -225,6 +226,7 @@ subroutine ocean_emis_init()
endif
allocate(salinity(pcols,begchunk:endchunk))
+ salinity = 0._r8
do c=begchunk,endchunk
@@ -235,17 +237,22 @@ subroutine ocean_emis_init()
call lininterp_init(file_lons, file_nlon, to_lons, ncols, 2, lon_wgts, zero, twopi)
call lininterp_init(file_lats, file_nlat, to_lats, ncols, 1, lat_wgts)
- call lininterp(wrk2d, file_nlon, file_nlat, salinity(1:ncols,c), ncols, lon_wgts, lat_wgts)
+ call lininterp(wrk2d, file_nlon, file_nlat, salinity(1:ncols,c), ncols, lon_wgts, lat_wgts)
call lininterp_finish(lon_wgts)
call lininterp_finish(lat_wgts)
end do
+ ! fill in missing values with climatology for modern-day
+ where(salinity < 0._r8)
+ salinity = 33.0_r8
+ end where
+
deallocate( file_lons, file_lats )
deallocate( wrk2d )
- call addfld('OCN_SALINITY', horiz_only, 'A', 'parts per thousands', 'ocean salinity' )
+ call addfld('OCN_SALINITY', horiz_only, 'A', 'parts per thousands', 'ocean salinity' )
! ======================================================
! initializing the libraries for the air-sea flux module
@@ -253,17 +260,17 @@ subroutine ocean_emis_init()
Call CmpLibInitialization()
Call SaltLibInitialization()
- ! ---------------------------------------------
+ ! ---------------------------------------------
! Read seawater concentration: WSY
! ---------------------------------------------
call cseawater_ini()
call pio_closefile (fid)
-
+
end subroutine ocean_emis_init
-!--------------------------------------------------------------------------------
-!--------------------------------------------------------------------------------
+ !--------------------------------------------------------------------------------
+ !--------------------------------------------------------------------------------
subroutine ocean_emis_advance( pbuf2d, state )
! -------------------------------
! check serial case for time span
@@ -274,7 +281,7 @@ subroutine ocean_emis_advance( pbuf2d, state )
use tracer_data, only : advance_trcdata
use physics_buffer, only : physics_buffer_desc
- type(physics_state), intent(in) :: state(begchunk:endchunk)
+ type(physics_state), intent(in) :: state(begchunk:endchunk)
type(physics_buffer_desc), pointer :: pbuf2d(:,:)
integer :: m
@@ -286,12 +293,12 @@ subroutine ocean_emis_advance( pbuf2d, state )
end subroutine ocean_emis_advance
-!--------------------------------------------------------------------------------
-!--------------------------------------------------------------------------------
+ !--------------------------------------------------------------------------------
+ !--------------------------------------------------------------------------------
subroutine ocean_emis_getflux(lchnk, ncol, state, u10, sst, ocnfrac, icefrac, sflx)
use physics_types, only : physics_state
- use ppgrid, only : pver
+ use ppgrid, only : pver
integer, intent(in) :: lchnk, ncol
type(physics_state), target, intent(in) :: state ! Physics state variables
@@ -301,13 +308,13 @@ subroutine ocean_emis_getflux(lchnk, ncol, state, u10, sst, ocnfrac, icefrac, sf
real(r8), intent(in) :: icefrac(:) ! Ice fraction
real(r8), intent(inout) :: sflx(:,:) ! Surface emissions (kg/m^2/s)
- integer :: m, isec, SpeciesID
- real(r8) :: Csw_col(ncol)
- real(r8) :: MW_species
- real(r8) :: oceanflux_kg_m2_s(ncol)
+ integer :: i, m, isec, SpeciesID
+ real(r8) :: Csw_col(ncol)
+ real(r8) :: MW_species
+ real(r8) :: oceanflux_kg_m2_s(ncol)
if (trim(ocean_salinity_file) == 'NONE') return
-
+
! ==================================================
! Get seawater concentrations and calculate the flux
! ==================================================
@@ -317,28 +324,30 @@ subroutine ocean_emis_getflux(lchnk, ncol, state, u10, sst, ocnfrac, icefrac, sf
isec = 1
Csw_col(:ncol) = Csw_nM(m)%scalefactor*Csw_nM(m)%fields(isec)%data(:ncol,1,lchnk)
- MW_species = MolecularWeight(SpeciesIndex( Csw_nM(m)%species ))
+ MW_species = MolecularWeight(SpeciesIndex( Csw_nM(m)%species ))
call cnst_get_ind( trim(Csw_nM(m)%species), SpeciesID, abort=.true. )
oceanflux_kg_m2_s = 0.0_r8
- where (ocnfrac(:ncol) >= 0.2_r8 .and. Csw_col(:ncol) >= 0._r8) ! calculate flux only for ocean
- oceanflux_kg_m2_s(:ncol) = Flux_kg_m2_s( &
- Csw_nM(m)%species, & ! name of species
- state%q(:ncol,pver,SpeciesID) * (28.97_r8/MW_species) * 1.0e+12_r8, & ! air concentration (ppt)
- Csw_col(:ncol), & ! sea water concentration (nM)
- state%t(:ncol,pver), & ! air temperature (K)
- u10(:ncol), & ! wind speed at 10m (m/s) <- should use this
- state%ps(:ncol) / 101325.0_r8, & ! surface pressure (atm)
- sst(:ncol), & ! sea surface temperautre (K)
- salinity(:ncol,lchnk), & ! ocean salinity (parts per thousands)
- switch_bubble, & ! bubble-mediated transfer: on or off
- ncol )
- end where
+ do i = 1,ncol
+ if (ocnfrac(i) >= 0.2_r8 .and. Csw_col(i) >= 0._r8) then
+ ! calculate flux only for ocean
+ oceanflux_kg_m2_s(i) = Flux_kg_m2_s( &
+ Csw_nM(m)%species, & ! name of species
+ state%q(i,pver,SpeciesID) * (28.97_r8/MW_species) * 1.0e+12_r8, & ! air concentration (ppt)
+ Csw_col(i), & ! sea water concentration (nM)
+ state%t(i,pver), & ! air temperature (K)
+ u10(i), & ! wind speed at 10m (m/s) <- should use this
+ state%ps(i) / 101325.0_r8, & ! surface pressure (atm)
+ sst(i), & ! sea surface temperautre (K)
+ salinity(i,lchnk), & ! ocean salinity (parts per thousands)
+ switch_bubble ) ! bubble-mediated transfer: on or off
+ end if
+ end do
! ===========================================================================
- ! Add the ocean flux to the other fluxes
+ ! Add the ocean flux to the other fluxes
! Make sure this ocean module is called after other surface emissions are set
! ===========================================================================
sflx(:ncol,SpeciesID) = sflx(:ncol,SpeciesID) + oceanflux_kg_m2_s(:ncol) * ocnfrac(:ncol)
@@ -355,10 +364,8 @@ subroutine ocean_emis_getflux(lchnk, ncol, state, u10, sst, ocnfrac, icefrac, sf
end subroutine ocean_emis_getflux
-
-!--------------------------------------------------------------------------------
-!--------------------------------------------------------------------------------
-
+ !--------------------------------------------------------------------------------
+ !--------------------------------------------------------------------------------
Subroutine CmpLibInitialization()
! =====================================================================================
! This is the lookup table for molecular weight, Vb, and Henry's law constant
@@ -377,7 +384,7 @@ Subroutine CmpLibInitialization()
GasList(2) = GasLib('C2H5OH', (/ 46.07_r8, 2.0_r8, 6.0_r8, 0.0_r8, 1.0_r8, 0.0_r8, 0.0_r8, &
0.0_r8, 0.0_r8, 0.0_r8, 0.0_r8, 0.0_r8, 0.0_r8, 0.0_r8, 190.0_r8, 6500.0_r8 /))
GasList(3) = GasLib('CH2O', (/ 30.03_r8, 1.0_r8, 2.0_r8, 0.0_r8, 1.0_r8, 0.0_r8, 0.0_r8, &
- 0.0_r8, 0.0_r8, 0.0_r8, 1.0_r8, 0.0_r8, 0.0_r8, 0.0_r8, 3230.0_r8, 7100.0_r8 /))
+ 0.0_r8, 0.0_r8, 0.0_r8, 1.0_r8, 0.0_r8, 0.0_r8, 0.0_r8, 3230.0_r8, 7100.0_r8 /))
GasList(4) = GasLib('CH3CHO', (/ 44.05_r8, 2.0_r8, 4.0_r8, 0.0_r8, 1.0_r8, 0.0_r8, 0.0_r8, &
0.0_r8, 0.0_r8, 0.0_r8, 1.0_r8, 0.0_r8, 0.0_r8, 0.0_r8, 12.9_r8, 5890.0_r8/))
GasList(5) = GasLib('PROPANAL', (/ 58.08_r8, 3.0_r8, 6.0_r8, 0.0_r8, 1.0_r8, 0.0_r8, 0.0_r8, &
@@ -409,10 +416,12 @@ Subroutine CmpLibInitialization()
! --------------------------------------------------------------------------------
End Subroutine CmpLibInitialization
+ !--------------------------------------------------------------------------------
+ !--------------------------------------------------------------------------------
Subroutine SaltLibInitialization()
! ================================================================================
- ! This is the lookup table for common solutes in seawater and the parameters to
- ! calculate the dynamic viscosity of seawater.
+ ! This is the lookup table for common solutes in seawater and the parameters to
+ ! calculate the dynamic viscosity of seawater.
! You may add other solutes or change the mass fractions.
! --------------------------------------------------------------------------------
! Col 1: mass fraction of solute
@@ -431,6 +440,8 @@ Subroutine SaltLibInitialization()
! ---------------------------------------------
End Subroutine SaltLibInitialization
+ !--------------------------------------------------------------------------------
+ !--------------------------------------------------------------------------------
Function SpeciesIndex(SpeciesName)
! ==============================================
! This function is to look for the species index
@@ -439,7 +450,7 @@ Function SpeciesIndex(SpeciesName)
Character(Len=16) :: SpeciesName
SpeciesIndex = -1 ! return -1 if species is not found
-
+
Do i = 1, HowManyMolecules
If (trim(SpeciesName) == trim(GasList(i)%CmpdName)) Then
SpeciesIndex = i
@@ -448,13 +459,15 @@ Function SpeciesIndex(SpeciesName)
End Do
End Function SpeciesIndex
- Function Flux_kg_m2_s(SpeciesName,Cgas_ppt,Cwater_nM,T_air_K,u10_m_s,P_atm,T_water_K,&
- Salinity_PartsPerThousand,switch_bubble,ncol)
+ !--------------------------------------------------------------------------------
+ !--------------------------------------------------------------------------------
+ Real(r8) Function Flux_kg_m2_s(SpeciesName,Cgas_ppt,Cwater_nM,T_air_K,u10_m_s,P_atm,T_water_K,&
+ Salinity_PartsPerThousand,switch_bubble)
! ===========================================================================
! This is the main module function. Input variables:
! ---------------------------------------------------------------------------
! - SpeciesName: name of species
- ! - Cgas_ppt: mixing ratio (parts per trillion) of trace gas of interest
+ ! - Cgas_ppt: mixing ratio (parts per trillion) of trace gas of interest
! in the gas-phase (lowest modeling layer)
! - Cwater_nM: concentration of trace gas of interest in the surface ocean
! - T_air_K: temperature in the lowest modeling layer
@@ -463,52 +476,51 @@ Function Flux_kg_m2_s(SpeciesName,Cgas_ppt,Cwater_nM,T_air_K,u10_m_s,P_atm,T_wat
! - T_water_K: sea surface temperature
! - Salinity_PartsPerThousand: surface ocean salinity
! - switch_bubble: bubble-mediated transfer switch
- ! All must be 1D arrays with same dimension(ncol, so CESM-compatible)
! ===========================================================================
- Integer :: ncol, SpeciesID
- Character(16) :: SpeciesName
- Real(r8), Dimension(ncol) :: Flux_kg_m2_s
- Real(r8), Dimension(ncol) :: Cgas_ppt, Cwater_nM, T_air_K, u10_m_s, P_atm, T_water_K, Salinity_PartsPerThousand
- Real(r8), Dimension(ncol) :: H_gas_over_liquid_dimless, kt_m_s
- Logical :: switch_bubble
+ Character(16),intent(in) :: SpeciesName
+ Real(r8),intent(in) :: Cgas_ppt, Cwater_nM, T_air_K, u10_m_s, P_atm, T_water_K, Salinity_PartsPerThousand
+ Logical ,intent(in) :: switch_bubble
- where(Salinity_PartsPerThousand .lt. 0.0_r8) Salinity_PartsPerThousand = 33.0_r8
+ Integer :: SpeciesID
+ Real(r8) :: H_gas_over_liquid_dimless, kt_m_s
- SpeciesID = SpeciesIndex(SpeciesName)
- H_gas_over_liquid_dimless = 1.0_r8/(Henry_M_atm(SpeciesID,T_water_K,Salinity_PartsPerThousand,ncol)*&
+ SpeciesID = SpeciesIndex(SpeciesName)
+ H_gas_over_liquid_dimless = 1.0_r8/(Henry_M_atm(SpeciesID,T_water_K,Salinity_PartsPerThousand)*&
0.082_r8*T_water_K)
If (switch_bubble) then
! --------------------------------------------------------
! k_water parameterization with bubble-induced enhancement
! --------------------------------------------------------
kt_m_s = (1.0_r8/k_water_m_s_bubble(SpeciesID, T_water_K, Salinity_PartsPerThousand, &
- u10_m_s, Cgas_ppt, P_atm, T_air_K, ncol) &
- + 1.0_r8/k_air_m_s(SpeciesID, u10_m_s, T_air_K, P_atm, ncol)&
+ u10_m_s, Cgas_ppt, P_atm, T_air_K) &
+ + 1.0_r8/k_air_m_s(SpeciesID, u10_m_s, T_air_K, P_atm)&
/H_gas_over_liquid_dimless)**(-1.0_r8)
else
! ------------------------------------------------
! Original k_water parameterization, scaled to CO2
! ------------------------------------------------
- kt_m_s = (1.0_r8/k_water_m_s(SpeciesID, T_water_K, Salinity_PartsPerThousand, u10_m_s, ncol) &
- + 1.0_r8/k_air_m_s(SpeciesID, u10_m_s, T_air_K, P_atm, ncol)/H_gas_over_liquid_dimless)**(-1.0_r8)
+ kt_m_s = (1.0_r8/k_water_m_s(SpeciesID, T_water_K, Salinity_PartsPerThousand, u10_m_s) &
+ + 1.0_r8/k_air_m_s(SpeciesID, u10_m_s, T_air_K, P_atm)/H_gas_over_liquid_dimless)**(-1.0_r8)
endif
Flux_kg_m2_s = kt_m_s * (Cwater_nM*1E-9_r8*1000.0_r8 &
- Cgas_ppt*1E-12_r8*(101325.0_r8*P_atm)/8.314_r8/T_air_K/H_gas_over_liquid_dimless) & ! g/m2/s
* MolecularWeight(SpeciesIndex(SpeciesName)) / 1000.0_r8 ! convert to kg/m2/s
End Function Flux_kg_m2_s
-
- Function k_air_m_s(SpeciesIndex, u10_m_s, T_air_K, P_atm, ncol)
+ !--------------------------------------------------------------------------------
+ !--------------------------------------------------------------------------------
+ Real(r8) Function k_air_m_s(SpeciesIndex, u10_m_s, T_air_K, P_atm)
use shr_const_mod, only: vonKarman=>SHR_CONST_KARMAN
! =============================================================================
- ! Air-side transfer velocity. Slightly modified NOAA COARE (Fairall et al 2003;
- ! Feffery et al 2010), as recommended by Johnson Ocean Sci. 2010.
+ ! Air-side transfer velocity. Slightly modified NOAA COARE (Fairall et al 2003;
+ ! Feffery et al 2010), as recommended by Johnson Ocean Sci. 2010.
! Dynamic viscosity of air: Tsilingiris 2008
! =============================================================================
- Integer :: ncol, SpeciesIndex
- Real(r8), Dimension(ncol) :: k_air_m_s
- Real(r8), Dimension(ncol) :: u10_m_s, T_air_K, P_atm, ustar_m_s, DragCoeff
- Real(r8), Dimension(ncol) :: DynamicViscosityAir_kg_m_s, DensityAir_kg_m3, DiffusivityInAir, SchmidtNumberInAir
+ Integer ,intent(in) :: SpeciesIndex
+ Real(r8),intent(in) :: u10_m_s, T_air_K, P_atm
+
+ Real(r8) :: ustar_m_s, DragCoeff
+ Real(r8) :: DynamicViscosityAir_kg_m_s, DensityAir_kg_m3, DiffusivityInAir, SchmidtNumberInAir
! WSY: If local friction velocity is available from the model, might as well use that?
ustar_m_s = u10_m_s * sqrt(6.1E-4_r8 + 6.3E-5_r8 * u10_m_s)
@@ -516,53 +528,53 @@ Function k_air_m_s(SpeciesIndex, u10_m_s, T_air_K, P_atm, ncol)
DynamicViscosityAir_kg_m_s = 1.715747771E-5_r8 + 4.722402075E-8_r8 * (T_air_K-273.15_r8) &
- 3.663027156E-10_r8 * ((T_air_K-273.15_r8)**2.0_r8) &
+ 1.873236686E-12_r8 * ((T_air_K-273.15_r8)**3.0_r8) &
- - 8.050218737E-14_r8 * ((T_air_K-273.15_r8)**4.0_r8)
+ - 8.050218737E-14_r8 * ((T_air_K-273.15_r8)**4.0_r8)
DensityAir_kg_m3 = 1.293393662_r8 - 5.538444326e-3_r8 * (T_air_K-273.15_r8) &
+ 3.860201577e-5_r8 * (T_air_K-273.15_r8)**2.0_r8 &
- 5.2536065e-7_r8 * (T_air_K-273.15_r8)**3.0_r8
- DiffusivityInAir = DiffusivityInAir_cm2_s(SpeciesIndex, T_air_K, P_atm, ncol)
- SchmidtNumberInAir = DynamicViscosityAir_kg_m_s / DensityAir_kg_m3 / (DiffusivityInAir/10000.0_r8)
+ DiffusivityInAir = DiffusivityInAir_cm2_s(SpeciesIndex, T_air_K, P_atm)
+ SchmidtNumberInAir = DynamicViscosityAir_kg_m_s / DensityAir_kg_m3 / (DiffusivityInAir/10000.0_r8)
k_air_m_s = 1E-3_r8 + ustar_m_s / (13.3_r8*(SchmidtNumberInAir**0.5_r8)+(DragCoeff**(-0.5_r8))-&
5.0_r8+log(SchmidtNumberInAir)/2.0_r8/vonKarman)
End Function k_air_m_s
-
-
-
- Function k_water_m_s(SpeciesIndex, T_water_K, Salinity_PartsPerThousand, u10_m_s, ncol)
+ !--------------------------------------------------------------------------------
+ !--------------------------------------------------------------------------------
+ Real(r8) Function k_water_m_s(SpeciesIndex, T_water_K, Salinity_PartsPerThousand, u10_m_s)
! ================================================================================
! Water-side transfer velocity. Ref: Nightingale et al (2000). Salinity considered
! ================================================================================
- Integer :: ncol, SpeciesIndex
- Real(r8), Dimension(ncol) :: k_water_m_s
- Real(r8), Dimension(ncol) :: T_water_K, Salinity_PartsPerThousand, u10_m_s
- Real(r8), Dimension(ncol) :: DiffusivityInWater, SchmidtNumberInWater
- Real(r8) :: SchmidtNumberInWater_CO2ref
+ Integer ,intent(in) :: SpeciesIndex
+ Real(r8),intent(in) :: T_water_K, Salinity_PartsPerThousand, u10_m_s
+
+ Real(r8) :: DiffusivityInWater, SchmidtNumberInWater
+ Real(r8) :: SchmidtNumberInWater_CO2ref
+
SchmidtNumberInWater_CO2ref = 660.0_r8 ! this is the Schmidt number of CO2 at 20 degC in fresh water
- DiffusivityInWater = DiffusivityInWater_cm2_s(SpeciesIndex, T_water_K, Salinity_PartsPerThousand, ncol)
- SchmidtNumberInWater = DynamicViscosityWater_g_m_s(T_water_K, Salinity_PartsPerThousand, ncol) / 1000.0_r8 &
- / DensityWater_kg_m3(T_water_K,Salinity_PartsPerThousand,ncol)/(DiffusivityInWater/10000.0_r8)
+ DiffusivityInWater = DiffusivityInWater_cm2_s(SpeciesIndex, T_water_K, Salinity_PartsPerThousand)
+ SchmidtNumberInWater = DynamicViscosityWater_g_m_s(T_water_K, Salinity_PartsPerThousand) / 1000.0_r8 &
+ / DensityWater_kg_m3(T_water_K,Salinity_PartsPerThousand)/(DiffusivityInWater/10000.0_r8)
k_water_m_s = ((0.222_r8*(u10_m_s**2.0_r8)+0.333_r8*u10_m_s)*&
((SchmidtNumberInWater/SchmidtNumberInWater_CO2ref)**(-0.5_r8)))/360000.0_r8
End Function k_water_m_s
-
-
-
- Function k_water_m_s_bubble(SpeciesIndex, T_water_K, Salinity_PartsPerThousand, u10_m_s, Cgas_ppt, P_atm, T_air_K, ncol)
+ !--------------------------------------------------------------------------------
+ !--------------------------------------------------------------------------------
+ Real(r8) Function k_water_m_s_bubble(SpeciesIndex, T_water_K, Salinity_PartsPerThousand, u10_m_s, Cgas_ppt, P_atm, T_air_K)
! ==============================================================
! Water-side transfer velocity. Ref: Asher and Wanninkhof (1998).
! ==============================================================
- Integer :: ncol, SpeciesIndex
- Real(r8), Dimension(ncol) :: k_water_m_s_bubble
- Real(r8), Dimension(ncol) :: T_water_K, Salinity_PartsPerThousand, u10_m_s, Cgas_ppt, P_atm, T_air_K
- Real(r8), Dimension(ncol) :: DiffusivityInWater, SchmidtNumberInWater
- Real(r8), Dimension(ncol) :: FracCoverage_WhiteCaps, OstwaldSolubilityCoefficient
- DiffusivityInWater = DiffusivityInWater_cm2_s(SpeciesIndex, T_water_K, Salinity_PartsPerThousand, ncol)
- SchmidtNumberInWater = DynamicViscosityWater_g_m_s(T_water_K, Salinity_PartsPerThousand, ncol) / 1000.0_r8 &
- / DensityWater_kg_m3(T_water_K,Salinity_PartsPerThousand,ncol)/(DiffusivityInWater/10000.0_r8)
- FracCoverage_WhiteCaps = 2.56e-6_r8 * (u10_m_s - 1.77_r8)**3.0_r8
- OstwaldSolubilityCoefficient = Henry_M_atm(SpeciesIndex,T_water_K,Salinity_PartsPerThousand,ncol) ! just Henry's law (M/atm)
+ Integer, intent(in) :: SpeciesIndex
+ Real(r8),intent(in) :: T_water_K, Salinity_PartsPerThousand, u10_m_s, Cgas_ppt, P_atm, T_air_K
+
+ Real(r8) :: DiffusivityInWater, SchmidtNumberInWater
+ Real(r8) :: FracCoverage_WhiteCaps, OstwaldSolubilityCoefficient
+
+ DiffusivityInWater = DiffusivityInWater_cm2_s(SpeciesIndex, T_water_K, Salinity_PartsPerThousand)
+ SchmidtNumberInWater = DynamicViscosityWater_g_m_s(T_water_K, Salinity_PartsPerThousand) / 1000.0_r8 &
+ / DensityWater_kg_m3(T_water_K,Salinity_PartsPerThousand)/(DiffusivityInWater/10000.0_r8)
+ FracCoverage_WhiteCaps = 2.56e-6_r8 * (u10_m_s - 1.77_r8)**3.0_r8
+ OstwaldSolubilityCoefficient = Henry_M_atm(SpeciesIndex,T_water_K,Salinity_PartsPerThousand) ! just Henry's law (M/atm)
OstwaldSolubilityCoefficient = OstwaldSolubilityCoefficient * (Cgas_ppt*1.0E-12_r8*P_atm) ! mol / L
OstwaldSolubilityCoefficient = OstwaldSolubilityCoefficient * 0.082_r8 * T_air_K / P_atm ! L / L
k_water_m_s_bubble = ((47.0_r8*u10_m_s + FracCoverage_WhiteCaps*(115200.0_r8 - 47.0_r8* u10_m_s)) &
@@ -570,40 +582,46 @@ Function k_water_m_s_bubble(SpeciesIndex, T_water_K, Salinity_PartsPerThousand,
+ FracCoverage_WhiteCaps * (-37.0_r8/OstwaldSolubilityCoefficient &
+ 6120.0_r8*(OstwaldSolubilityCoefficient**(-0.37_r8)) *(SchmidtNumberInWater**(-0.18_r8)))) &
* 2.8e-6_r8
- End Function k_water_m_s_bubble
-
-
+ End Function k_water_m_s_bubble
- Function DiffusivityInAir_cm2_s(SpeciesIndex, T_air_K, P_atm, ncol)
+ !--------------------------------------------------------------------------------
+ !--------------------------------------------------------------------------------
+ Real(r8) Function DiffusivityInAir_cm2_s(SpeciesIndex, T_air_K, P_atm)
! ============================
! Ref: Johnson Ocean Sci. 2010
! ============================
- Integer :: ncol, SpeciesIndex
- Real(r8), Dimension(ncol) :: DiffusivityInAir_cm2_s, T_air_K, P_atm
+ Integer ,intent(in) :: SpeciesIndex
+ Real(r8),intent(in) :: T_air_K, P_atm
+
Real(r8), parameter :: MW_air = 28.97_r8 ! molecular weight for air
Real(r8), parameter :: Va = 20.1_r8 ! molar volume for air
Real(r8) :: Vb, MW_species
+
Vb = LiquidMolarVolume_cm3_mol(SpeciesIndex)
MW_species = MolecularWeight(SpeciesIndex)
DiffusivityInAir_cm2_s = 0.001_r8 * (T_air_K**1.75_r8) & ! oh f* me
* (((MW_air + MW_species)/(MW_air*MW_species))**0.5_r8) &
/ ((P_atm*(Va**(1.0_r8/3.0_r8)+Vb**(1.0_r8/3.0_r8)))**2.0_r8)
- End Function DiffusivityInAir_cm2_s
-
+ End Function DiffusivityInAir_cm2_s
- Function DiffusivityInWater_cm2_s(SpeciesIndex, T_water_K, Salinity_PartsPerThousand, ncol)
+ !--------------------------------------------------------------------------------
+ !--------------------------------------------------------------------------------
+ Real(r8) Function DiffusivityInWater_cm2_s(SpeciesIndex, T_water_K, Salinity_PartsPerThousand)
! =================================================
! Ref: Johnson Ocean Sci. 2010. Salinity considered
! =================================================
- Integer :: ncol, SpeciesIndex
- Real(r8), Dimension(ncol) :: DiffusivityInWater_cm2_s, DynamicViscosityWater, T_water_K, Salinity_PartsPerThousand
+ Integer, intent(in) :: SpeciesIndex
+ Real(r8),intent(in) :: T_water_K, Salinity_PartsPerThousand
+
Real(r8), parameter :: AssociationFactor = 2.6_r8 ! ... for water
- Real(r8) :: Vb, MW_species
+ Real(r8) :: DynamicViscosityWater, Vb, MW_species
+
Vb = LiquidMolarVolume_cm3_mol(SpeciesIndex)
MW_species = MolecularWeight(SpeciesIndex)
- DynamicViscosityWater = DynamicViscosityWater_g_m_s(T_water_K, Salinity_PartsPerThousand, ncol)
+
+ DynamicViscosityWater = DynamicViscosityWater_g_m_s(T_water_K, Salinity_PartsPerThousand)
! -------------------------------------------------
! Wilke and Chang 1955: this seems to be a bit high
! -------------------------------------------------
@@ -617,47 +635,51 @@ Function DiffusivityInWater_cm2_s(SpeciesIndex, T_water_K, Salinity_PartsPerThou
End Function DiffusivityInWater_cm2_s
-
- Function DynamicViscosityWater_g_m_s(T_water_K, Salinity_PartsPerThousand, ncol)
+ !--------------------------------------------------------------------------------
+ !--------------------------------------------------------------------------------
+ Real(r8) Function DynamicViscosityWater_g_m_s(T_water_K, Salinity_PartsPerThousand)
! =================================================
! Ref: Johnson Ocean Sci. 2010. Salinity considered
! =================================================
- Integer :: ncol
- Real(r8), Dimension(ncol) :: DynamicViscosityWater_g_m_s, T_water_K, Salinity_PartsPerThousand
- Real(r8), Dimension(ncol) :: MassFrac_water, DynamicViscosityPureWater_g_m_s, SaltViscosity, sum_w_ln_SaltViscosity
- Integer :: j, n
+ Real(r8),intent(in) :: T_water_K, Salinity_PartsPerThousand
+
+ Real(r8) :: MassFrac_water, DynamicViscosityPureWater_g_m_s, SaltViscosity, sum_w_ln_SaltViscosity
+ Integer :: n
+
sum_w_ln_SaltViscosity = 0.0_r8
MassFrac_water = 1.0_r8 - Salinity_PartsPerThousand / 1000.0_r8
DynamicViscosityPureWater_g_m_s = ((T_water_K-273.15_r8)+246.0_r8) &
- / (0.05594_r8*(T_water_K-273.15_r8)**2.0_r8+5.2842_r8*(T_water_K-273.15_r8)+137.37_r8)
- Do j = 1, ncol
- If (Salinity_PartsPerThousand(j) == 0.0_r8) Then ! pure water
- DynamicViscosityWater_g_m_s(j) = DynamicViscosityPureWater_g_m_s(j)
+ / (0.05594_r8*(T_water_K-273.15_r8)**2.0_r8+5.2842_r8*(T_water_K-273.15_r8)+137.37_r8)
+
+ If (Salinity_PartsPerThousand == 0.0_r8) Then ! pure water
+ DynamicViscosityWater_g_m_s = DynamicViscosityPureWater_g_m_s
Else ! salty water
Do n = 1, HowManySalts
- SaltViscosity(j) = exp((SaltList(n)%SaltProperties(2) * &
- (Salinity_PartsPerThousand(j)/1000.0_r8)**SaltList(n)%SaltProperties(3) &
+ SaltViscosity = exp((SaltList(n)%SaltProperties(2) * &
+ (Salinity_PartsPerThousand/1000.0_r8)**SaltList(n)%SaltProperties(3) &
+ SaltList(n)%SaltProperties(4)) &
- / (SaltList(n)%SaltProperties(5)*(T_water_K(j)-273.15_r8) + 1.0_r8)) &
- / (SaltList(n)%SaltProperties(6) * (Salinity_PartsPerThousand(j) / &
+ / (SaltList(n)%SaltProperties(5)*(T_water_K-273.15_r8) + 1.0_r8)) &
+ / (SaltList(n)%SaltProperties(6) * (Salinity_PartsPerThousand / &
1000.0_r8)**SaltList(n)%SaltProperties(7) + 1.0_r8)
- sum_w_ln_SaltViscosity(j) = sum_w_ln_SaltViscosity(j) + (Salinity_PartsPerThousand(j)/1000.0_r8) &
- * SaltList(n)%SaltProperties(1) * log(SaltViscosity(j))
+ sum_w_ln_SaltViscosity = sum_w_ln_SaltViscosity + (Salinity_PartsPerThousand/1000.0_r8) &
+ * SaltList(n)%SaltProperties(1) * log(SaltViscosity)
End Do
- DynamicViscosityWater_g_m_s(j) = exp(MassFrac_water(j) &
- * log(DynamicViscosityPureWater_g_m_s(j)) + sum_w_ln_SaltViscosity(j))
+ DynamicViscosityWater_g_m_s = exp(MassFrac_water &
+ * log(DynamicViscosityPureWater_g_m_s) + sum_w_ln_SaltViscosity)
Endif
- End Do
- End Function DynamicViscosityWater_g_m_s
+ End Function DynamicViscosityWater_g_m_s
- Function DensityWater_kg_m3(T_water_K, Salinity_PartsPerThousand, ncol)
+ !--------------------------------------------------------------------------------
+ !--------------------------------------------------------------------------------
+ Real(r8) Function DensityWater_kg_m3(T_water_K, Salinity_PartsPerThousand)
! ====================================================
! Ref: Millero and Poisson (1981). Salinity considered
! ====================================================
- Integer :: ncol
- Real(r8), Dimension(ncol) :: DensityWater_kg_m3, T_water_K, Salinity_PartsPerThousand
- Real(r8), Dimension(ncol) :: DensityPureWater_kg_m3, FactorA, FactorB, FactorC
+ Real(r8), intent(in) :: T_water_K, Salinity_PartsPerThousand
+
+ Real(r8) :: DensityPureWater_kg_m3, FactorA, FactorB, FactorC
+
DensityPureWater_kg_m3 = 999.842594_r8 + 0.06793952_r8*(T_water_K-273.15_r8) &
- 0.00909529_r8*((T_water_K-273.15_r8)**2.0_r8) &
+ 0.0001001685_r8*((T_water_K-273.15_r8)**3.0_r8) &
@@ -669,41 +691,46 @@ Function DensityWater_kg_m3(T_water_K, Salinity_PartsPerThousand, ncol)
FactorC = 0.00048314_r8
DensityWater_kg_m3 = DensityPureWater_kg_m3 + FactorA*Salinity_PartsPerThousand &
+ FactorB*(Salinity_PartsPerThousand**(2.0_r8/3.0_r8)) + FactorC*Salinity_PartsPerThousand
- End Function DensityWater_kg_m3
+ End Function DensityWater_kg_m3
- Function Henry_M_atm(SpeciesIndex, T_water_K, Salinity_PartsPerThousand, ncol)
+ !--------------------------------------------------------------------------------
+ !--------------------------------------------------------------------------------
+ Real(r8) Function Henry_M_atm(SpeciesIndex, T_water_K, Salinity_PartsPerThousand)
! =========================================================================================
! Ref: Sander compilation 2015. Salt-in or salt-out estimated based on Setschenow constants
! =========================================================================================
- Integer :: ncol, j
- Integer :: SpeciesIndex
- Real(r8), Dimension(ncol) :: Henry_M_atm, T_water_K, Salinity_PartsPerThousand
- Real(r8), Dimension(ncol) :: Heff_M_atm_PureWater, Setschenow, Heff_M_atm_SaltyWater
+ Integer, intent(in) :: SpeciesIndex
+ Real(r8), intent(in) :: T_water_K, Salinity_PartsPerThousand
+
+ Real(r8) :: Heff_M_atm_PureWater, Setschenow, Heff_M_atm_SaltyWater
+
Heff_M_atm_PureWater = GasList(SpeciesIndex)%CmpdProperties(15) * &
exp(GasList(SpeciesIndex)%CmpdProperties(16) * (1.0_r8/T_water_K - 1.0_r8/298.0_r8))
- Do j = 1, ncol
- If (Salinity_PartsPerThousand(j)==0.0_r8) Then
- Henry_M_atm(j) = Heff_M_atm_PureWater(j)
- Else
- Setschenow(j) = log(LiquidMolarVolume_cm3_mol(SpeciesIndex)) * &
- (7.33532E-4_r8 + 3.39615E-5_r8 * log(Heff_M_atm_PureWater(j)) &
- - 2.40888E-6_r8 * ((log(Heff_M_atm_PureWater(j)))**2.0_r8) &
- + 1.57114E-7_r8 * ((log(Heff_M_atm_PureWater(j)))**3.0_r8))
- Heff_M_atm_SaltyWater(j) = Heff_M_atm_PureWater(j) * 10.0_r8**(Setschenow(j)*Salinity_PartsPerThousand(j))
- Henry_M_atm(j) = Heff_M_atm_SaltyWater(j)
- Endif
- End Do
- End Function Henry_M_atm
+ If (Salinity_PartsPerThousand==0.0_r8) Then
+ Henry_M_atm = Heff_M_atm_PureWater
+ Else
+ Setschenow = log(LiquidMolarVolume_cm3_mol(SpeciesIndex)) * &
+ (7.33532E-4_r8 + 3.39615E-5_r8 * log(Heff_M_atm_PureWater) &
+ - 2.40888E-6_r8 * ((log(Heff_M_atm_PureWater))**2.0_r8) &
+ + 1.57114E-7_r8 * ((log(Heff_M_atm_PureWater))**3.0_r8))
+ Heff_M_atm_SaltyWater = Heff_M_atm_PureWater * 10.0_r8**(Setschenow*Salinity_PartsPerThousand)
+ Henry_M_atm = Heff_M_atm_SaltyWater
+ Endif
+
+ End Function Henry_M_atm
+ !--------------------------------------------------------------------------------
+ !--------------------------------------------------------------------------------
Function MolecularWeight(SpeciesIndex)
Real(r8) :: MolecularWeight
Integer :: SpeciesIndex
MolecularWeight = GasList(SpeciesIndex)%CmpdProperties(1)
End Function MolecularWeight
-
+ !--------------------------------------------------------------------------------
+ !--------------------------------------------------------------------------------
Function LiquidMolarVolume_cm3_mol(SpeciesIndex)
! ===========================================================================
! If no measurements available, i.e. GasList(SpeciesIndex)%CmpdProperties(14)
@@ -712,7 +739,7 @@ Function LiquidMolarVolume_cm3_mol(SpeciesIndex)
Real(r8) :: LiquidMolarVolume_cm3_mol
Integer :: SpeciesIndex
- If (GasList(SpeciesIndex)%CmpdProperties(14)/=0.0_r8) Then
+ If (GasList(SpeciesIndex)%CmpdProperties(14)/=0.0_r8) Then
LiquidMolarVolume_cm3_mol = GasList(SpeciesIndex)%CmpdProperties(14)
Else
LiquidMolarVolume_cm3_mol = 7.0_r8*GasList(SpeciesIndex)%CmpdProperties(2) ! C
@@ -731,18 +758,21 @@ Function LiquidMolarVolume_cm3_mol(SpeciesIndex)
End Function LiquidMolarVolume_cm3_mol
+ !--------------------------------------------------------------------------------
+ !--------------------------------------------------------------------------------
subroutine cseawater_ini()
- use mo_chem_utls, only : get_spc_ndx
- use tracer_data, only : trcdata_init
- use cam_pio_utils, only : cam_pio_openfile
+ use mo_chem_utls, only : get_spc_ndx
+ use tracer_data, only : trcdata_init
+ use cam_pio_utils, only : cam_pio_openfile
use pio, only : pio_inquire, pio_nowrite, pio_closefile, pio_inq_varndims
use pio, only : pio_inq_varname, file_desc_t, pio_get_att, PIO_NOERR, PIO_GLOBAL
- use pio, only : pio_seterrorhandling, PIO_BCAST_ERROR
- use string_utils, only : GLC
+ use pio, only : pio_seterrorhandling, PIO_BCAST_ERROR
+ use string_utils, only : GLC
+ use phys_control, only : phys_getopts
integer :: i, j, l, m, n, nn, astat, vid, ierr, nvars, isec
- integer :: indx(gas_pcnst)
+ integer :: indx(gas_pcnst)
type(file_desc_t) :: ncid
character(len=16) :: csw_species(gas_pcnst)
character(len=256) :: csw_filenam(gas_pcnst)
@@ -766,7 +796,10 @@ subroutine cseawater_ini()
character(len=*), parameter :: subname = 'cseawater_ini'
- ! ========================================================
+ logical :: history_chemistry
+ call phys_getopts(history_chemistry_out=history_chemistry)
+
+ ! ========================================================
! Read sea water concentration specifier from the namelist
! ========================================================
@@ -827,7 +860,7 @@ subroutine cseawater_ini()
! -------------------------------------------
! Setup the seawater concentration type array
! -------------------------------------------
- do m=1,n_Csw_files
+ do m=1,n_Csw_files
Csw_nM(m)%spc_ndx = csw_indexes(indx(m))
Csw_nM(m)%units = 'nM'
Csw_nM(m)%species = csw_species(indx(m))
@@ -898,9 +931,9 @@ subroutine cseawater_ini()
deallocate(vndims)
! Global attribute 'input_method' overrides the srf_emis_type namelist setting on
- ! a file-by-file basis. If the emis file does not contain the 'input_method'
+ ! a file-by-file basis. If the emis file does not contain the 'input_method'
! attribute then the srf_emis_type namelist setting is used.
- ierr = pio_get_att(ncid, PIO_GLOBAL, 'input_method', file_interp_type)
+ ierr = pio_get_att(ncid, PIO_GLOBAL, 'input_method', file_interp_type)
if ( ierr == PIO_NOERR) then
l = GLC(file_interp_type)
csw_time_type(1:l) = file_interp_type(1:l)
@@ -928,9 +961,30 @@ subroutine cseawater_ini()
'ocean flux ' // trim(Csw_nM(m)%species) )
call addfld('Csw_' // trim(Csw_nM(m)%species), horiz_only, 'A', 'nanomole per liter (nM)', &
'seeawater concentration ' // trim(Csw_nM(m)%species) )
+ if (history_chemistry) then
+ call add_default('OCN_FLUX_' // trim(Csw_nM(m)%species), 1, ' ')
+ end if
end do
end subroutine cseawater_ini
+ !--------------------------------------------------------------------------------
+ ! returns TRUE if species has ocean emissions
+ !--------------------------------------------------------------------------------
+ pure logical function ocean_emis_species(name)
+ character(len=*), intent(in) :: name
+
+ integer :: m
+
+ ocean_emis_species = .false.
+
+ spc_loop: do m = 1, n_Csw_files
+ if (trim(name) == trim(Csw_nM(m)%species)) then
+ ocean_emis_species = .true.
+ exit spc_loop
+ end if
+ end do spc_loop
+
+ end function ocean_emis_species
end module ocean_emis
diff --git a/src/chemistry/mozart/short_lived_species.F90 b/src/chemistry/mozart/short_lived_species.F90
index 8807776d98..37a43d90bb 100644
--- a/src/chemistry/mozart/short_lived_species.F90
+++ b/src/chemistry/mozart/short_lived_species.F90
@@ -138,7 +138,7 @@ subroutine initialize_short_lived_species(ncid_ini, pbuf2d)
do m=1,nslvd
if (cam_chempkg_is('geoschem_mam4')) then
- write(fieldname,'(a,a)') trim(slvd_lst(m))
+ fieldname = trim(slvd_lst(m))
else
n = map(m)
fieldname = solsym(n)
diff --git a/src/chemistry/mozart/tracer_cnst.F90 b/src/chemistry/mozart/tracer_cnst.F90
index 803e3e1061..9c51b6cec8 100644
--- a/src/chemistry/mozart/tracer_cnst.F90
+++ b/src/chemistry/mozart/tracer_cnst.F90
@@ -13,7 +13,7 @@ module tracer_cnst
implicit none
private ! all unless made public
- save
+ save
public :: tracer_cnst_init
public :: num_tracer_cnst
@@ -94,7 +94,7 @@ subroutine tracer_cnst_init()
call addfld(trim(fields(i)%fldnam), (/ 'lev' /), &
'I','mol/mol', 'prescribed tracer constituent' )
- enddo
+ enddo
allocate(data_q(pcols,pver,num_tracer_cnst,begchunk:endchunk), stat=istat)
call handle_err(istat, 'tracer_cnst_init: ERROR allocating data_q')
@@ -169,7 +169,7 @@ subroutine tracer_cnst_defaultopts( &
tracer_cnst_cycle_yr_out, &
tracer_cnst_fixed_ymd_out,&
tracer_cnst_fixed_tod_out &
- )
+ )
implicit none
@@ -231,7 +231,7 @@ subroutine tracer_cnst_adv( pbuf2d, state )
implicit none
- type(physics_state), intent(in):: state(begchunk:endchunk)
+ type(physics_state), intent(in):: state(begchunk:endchunk)
type(physics_buffer_desc), pointer :: pbuf2d(:,:)
integer :: i,ind,c,ncol
@@ -311,12 +311,13 @@ subroutine get_cnst_data_ptr(name, state, q, pbuf)
integer :: lchnk
integer :: ncol
integer :: inv_id, idx
+ character(len=80) :: error_str
lchnk = state%lchnk
ncol = state%ncol
! make sure the requested constituent can be provided
- inv_id = get_inv_ndx(name)
+ inv_id = get_inv_ndx(name)
if (.not. inv_id > 0) then
if (masterproc) then
write(iulog,*) 'get_cnst_data_ptr: '//name//' is not a prescribed tracer constituent'
@@ -326,6 +327,13 @@ subroutine get_cnst_data_ptr(name, state, q, pbuf)
call get_fld_ndx( fields, name, idx )
+ if (idx<1) then
+ write(error_str,*) 'get_cnst_data_ptr: ',trim(name),' not found ... idx : ',idx
+ if (masterproc) then
+ write(iulog,*) error_str
+ end if
+ call endrun(error_str)
+ end if
call get_fld_data( fields, name, data_q(:,:,idx,lchnk), ncol, lchnk, pbuf )
data_q(:ncol,:,idx,lchnk) = data_q(:ncol,:,idx,lchnk)*fix_mass(inv_id)/mwdry ! vmr->mmr
diff --git a/src/chemistry/pp_ghg_mam4/chem_mech.doc b/src/chemistry/pp_ghg_mam4/chem_mech.doc
new file mode 100644
index 0000000000..5c976202f5
--- /dev/null
+++ b/src/chemistry/pp_ghg_mam4/chem_mech.doc
@@ -0,0 +1,161 @@
+
+
+ Solution species
+ ( 1) bc_a1 (C)
+ ( 2) bc_a4 (C)
+ ( 3) CFC11 (CFCl3)
+ ( 4) CFC12 (CF2Cl2)
+ ( 5) CH4
+ ( 6) CO2
+ ( 7) DMS (CH3SCH3)
+ ( 8) dst_a1 (AlSiO5)
+ ( 9) dst_a2 (AlSiO5)
+ ( 10) dst_a3 (AlSiO5)
+ ( 11) H2O2
+ ( 12) H2SO4
+ ( 13) N2O
+ ( 14) ncl_a1 (NaCl)
+ ( 15) ncl_a2 (NaCl)
+ ( 16) ncl_a3 (NaCl)
+ ( 17) num_a1 (H)
+ ( 18) num_a2 (H)
+ ( 19) num_a3 (H)
+ ( 20) num_a4 (H)
+ ( 21) pom_a1 (C)
+ ( 22) pom_a4 (C)
+ ( 23) SO2
+ ( 24) so4_a1 (NH4HSO4)
+ ( 25) so4_a2 (NH4HSO4)
+ ( 26) so4_a3 (NH4HSO4)
+ ( 27) soa_a1 (C)
+ ( 28) soa_a2 (C)
+ ( 29) SOAE (C)
+ ( 30) SOAG (C)
+ ( 31) H2O
+
+
+ Invariant species
+ ( 1) M
+ ( 2) O2
+ ( 3) N2
+ ( 4) HO2
+ ( 5) OH
+ ( 6) NO3
+ ( 7) O3
+ ( 8) HALONS
+
+
+ Column integrals
+ ( 1) O3 - 0.000E+00
+ ( 2) O2 - 0.000E+00
+
+Class List
+==========
+ Explicit
+ --------
+ ( 1) CO2
+
+ Implicit
+ --------
+ ( 1) bc_a1
+ ( 2) bc_a4
+ ( 3) CFC11
+ ( 4) CFC12
+ ( 5) CH4
+ ( 6) DMS
+ ( 7) dst_a1
+ ( 8) dst_a2
+ ( 9) dst_a3
+ ( 10) H2O2
+ ( 11) H2SO4
+ ( 12) N2O
+ ( 13) ncl_a1
+ ( 14) ncl_a2
+ ( 15) ncl_a3
+ ( 16) num_a1
+ ( 17) num_a2
+ ( 18) num_a3
+ ( 19) num_a4
+ ( 20) pom_a1
+ ( 21) pom_a4
+ ( 22) SO2
+ ( 23) so4_a1
+ ( 24) so4_a2
+ ( 25) so4_a3
+ ( 26) soa_a1
+ ( 27) soa_a2
+ ( 28) SOAE
+ ( 29) SOAG
+ ( 30) H2O
+
+ Photolysis
+ jh2o2 ( 1) H2O2 + hv -> 2*OH rate = ** User defined ** ( 1)
+ jsoa_a1 ( 2) soa_a1 + hv -> (No products) rate = ** User defined ** ( 2)
+ jsoa_a2 ( 3) soa_a2 + hv -> (No products) rate = ** User defined ** ( 3)
+
+ Reactions
+ lyman_alpha ( 1) H2O -> (No products) rate = ** User defined ** ( 4)
+ OH_H2O2 ( 2) OH + H2O2 -> H2O + HO2 rate = 1.80E-12 ( 5)
+ usr_HO2_HO2 ( 3) HO2 + HO2 -> H2O2 + O2 rate = ** User defined ** ( 6)
+ n2o_loss ( 4) N2O -> (No products) rate = ** User defined ** ( 7)
+ cfc11_loss ( 5) CFC11 -> (No products) rate = ** User defined ** ( 8)
+ cfc12_loss ( 6) CFC12 -> (No products) rate = ** User defined ** ( 9)
+ ch4_loss ( 7) CH4 -> 2*H2O rate = ** User defined ** ( 10)
+ DMS_NO3 ( 8) DMS + NO3 -> SO2 + {HNO3} rate = 1.90E-13*exp( 520./t) ( 11)
+ DMS_OHa ( 9) DMS + OH -> SO2 rate = 1.10E-11*exp( -280./t) ( 12)
+ SO2_OH_M ( 10) SO2 + OH + M -> H2SO4 troe : ko=2.90E-31*(300/t)**4.10 ( 13)
+ ki=1.70E-12*(300/t)**-0.20
+ f=0.60
+ usr_DMS_OH ( 11) DMS + OH -> 0.5*SO2 + 0.5*HO2 rate = ** User defined ** ( 14)
+ SOAE_tau ( 12) SOAE -> SOAG rate = 1.16E-05 ( 15)
+
+Extraneous prod/loss species
+ ( 1) bc_a1 (dataset)
+ ( 2) bc_a4 (dataset)
+ ( 3) H2O (dataset)
+ ( 4) num_a1 (dataset)
+ ( 5) num_a2 (dataset)
+ ( 6) num_a4 (dataset)
+ ( 7) pom_a1 (dataset)
+ ( 8) pom_a4 (dataset)
+ ( 9) SO2 (dataset)
+ (10) so4_a1 (dataset)
+ (11) so4_a2 (dataset)
+
+
+ Equation Report
+
+ d(bc_a1)/dt = 0
+ d(bc_a4)/dt = 0
+ d(CFC11)/dt = - r5*CFC11
+ d(CFC12)/dt = - r6*CFC12
+ d(CH4)/dt = - r7*CH4
+ d(CO2)/dt = 0
+ d(DMS)/dt = - r8*NO3*DMS - r9*OH*DMS - r11*OH*DMS
+ d(dst_a1)/dt = 0
+ d(dst_a2)/dt = 0
+ d(dst_a3)/dt = 0
+ d(H2O2)/dt = r3
+ - j1*H2O2 - r2*OH*H2O2
+ d(H2SO4)/dt = r10*OH*M*SO2
+ d(N2O)/dt = - r4*N2O
+ d(ncl_a1)/dt = 0
+ d(ncl_a2)/dt = 0
+ d(ncl_a3)/dt = 0
+ d(num_a1)/dt = 0
+ d(num_a2)/dt = 0
+ d(num_a3)/dt = 0
+ d(num_a4)/dt = 0
+ d(pom_a1)/dt = 0
+ d(pom_a4)/dt = 0
+ d(SO2)/dt = r8*NO3*DMS + r9*OH*DMS + .5*r11*OH*DMS
+ - r10*OH*M*SO2
+ d(so4_a1)/dt = 0
+ d(so4_a2)/dt = 0
+ d(so4_a3)/dt = 0
+ d(soa_a1)/dt = - j2*soa_a1
+ d(soa_a2)/dt = - j3*soa_a2
+ d(SOAE)/dt = - r12*SOAE
+ d(SOAG)/dt = r12*SOAE
+ d(H2O)/dt = r2*OH*H2O2 + 2*r7*CH4
+ - r1*H2O
diff --git a/src/chemistry/pp_ghg_mam4/chem_mech.in b/src/chemistry/pp_ghg_mam4/chem_mech.in
new file mode 100644
index 0000000000..2d0365a8a5
--- /dev/null
+++ b/src/chemistry/pp_ghg_mam4/chem_mech.in
@@ -0,0 +1,179 @@
+* Comments
+* User-given Tag Description: WACCM_SC_MAM4
+* Tag database identifier : MZ312_WACCM_SC_MAM4_20221214
+* Tag created by : lke
+* Tag created from branch : WACCM_SC_MAM4
+* Tag created on : 2022-12-14 15:17:17.723566-07
+* Comments for this tag follow:
+* lke : 2022-12-14 : Specified chemistry (SC) WACCM mechanism, with updated simple SOA.
+* fvitt : 2023-03-17 : Copied from waccm_sc_mam4 to ghg_mam4 and add CO2 for CAM7 prognostic GHGs
+
+ SPECIES
+
+ Solution
+ bc_a1 -> C,
+ bc_a4 -> C,
+ CFC11 -> CFCl3,
+ CFC12 -> CF2Cl2,
+ CH4,
+ CO2,
+ DMS -> CH3SCH3,
+ dst_a1 -> AlSiO5,
+ dst_a2 -> AlSiO5,
+ dst_a3 -> AlSiO5,
+ H2O2,
+ H2SO4,
+ N2O,
+ ncl_a1 -> NaCl,
+ ncl_a2 -> NaCl,
+ ncl_a3 -> NaCl,
+ num_a1 -> H,
+ num_a2 -> H,
+ num_a3 -> H,
+ num_a4 -> H,
+ pom_a1 -> C,
+ pom_a4 -> C,
+ SO2,
+ so4_a1 -> NH4HSO4,
+ so4_a2 -> NH4HSO4,
+ so4_a3 -> NH4HSO4,
+ soa_a1 -> C,
+ soa_a2 -> C,
+ SOAE -> C,
+ SOAG -> C,
+ H2O
+ End Solution
+
+
+ Fixed
+ M, O2, N2, HO2, OH, NO3, O3, HALONS->CFCl3
+ End Fixed
+
+ Col-int
+ O3 = 0.
+ O2 = 0.
+ End Col-int
+
+ Not-Transported
+
+ End Not-Transported
+
+ END Species
+
+
+ Solution classes
+ Explicit
+ CO2
+ End Explicit
+
+ Implicit
+ bc_a1
+ bc_a4
+ CFC11
+ CFC12
+ CH4
+ DMS
+ dst_a1
+ dst_a2
+ dst_a3
+ H2O2
+ H2SO4
+ N2O
+ ncl_a1
+ ncl_a2
+ ncl_a3
+ num_a1
+ num_a2
+ num_a3
+ num_a4
+ pom_a1
+ pom_a4
+ SO2
+ so4_a1
+ so4_a2
+ so4_a3
+ soa_a1
+ soa_a2
+ SOAE
+ SOAG
+ H2O
+ End Implicit
+
+ End Solution classes
+
+
+ CHEMISTRY
+ Photolysis
+*********************************
+*** odd-oxygen
+*********************************
+[jh2o2] H2O2 + hv -> 2*OH
+*********************************
+*** soa
+*********************************
+[jsoa_a1->,.0004*jno2] soa_a1 + hv ->
+[jsoa_a2->,.0004*jno2] soa_a2 + hv ->
+ End Photolysis
+
+ Reactions
+*********************************
+*** odd-hydrogen
+*********************************
+[lyman_alpha] H2O ->
+[OH_H2O2] OH + H2O2 -> H2O + HO2 ; 1.8e-12
+[usr_HO2_HO2] HO2 + HO2 -> H2O2 + O2
+*********************************
+*** odd-nitrogen
+*********************************
+[n2o_loss] N2O ->
+*********************************
+*** odd-chlorine
+*********************************
+[cfc11_loss] CFC11 ->
+[cfc12_loss] CFC12 ->
+*********************************
+*** C1
+*********************************
+[ch4_loss] CH4 -> 2*H2O
+*********************************
+*** Sulfur
+*********************************
+[DMS_NO3] DMS + NO3 -> SO2 + HNO3 ; 1.9e-13, 520
+[DMS_OHa] DMS + OH -> SO2 ; 1.1e-11, -280
+[SO2_OH_M] SO2 + OH + M -> H2SO4 ; 2.9e-31, 4.1, 1.7e-12, -0.2, 0.6
+[usr_DMS_OH] DMS + OH -> 0.5*SO2 + 0.5*HO2
+*********************************
+*** SOA
+*********************************
+[SOAE_tau] SOAE -> SOAG ; 1.157e-05
+ End Reactions
+
+ Ext Forcing
+ bc_a1 <- dataset
+ bc_a4 <- dataset
+ H2O <- dataset
+ num_a1 <- dataset
+ num_a2 <- dataset
+ num_a4 <- dataset
+ pom_a1 <- dataset
+ pom_a4 <- dataset
+ SO2 <- dataset
+ so4_a1 <- dataset
+ so4_a2 <- dataset
+ End Ext Forcing
+
+ End Chemistry
+
+SIMULATION PARAMETERS
+
+ Version Options
+ model = cam
+ machine = intel
+ architecture = hybrid
+ vec_ftns = on
+ multitask = on
+ namemod = on
+ modules = on
+ End Version Options
+
+End Simulation Parameters
diff --git a/src/chemistry/pp_ghg_mam4/chem_mods.F90 b/src/chemistry/pp_ghg_mam4/chem_mods.F90
new file mode 100644
index 0000000000..a6f3071ca0
--- /dev/null
+++ b/src/chemistry/pp_ghg_mam4/chem_mods.F90
@@ -0,0 +1,50 @@
+ module chem_mods
+!--------------------------------------------------------------
+! ... Basic chemistry parameters and arrays
+!--------------------------------------------------------------
+ use shr_kind_mod, only : r8 => shr_kind_r8
+ implicit none
+ save
+ integer, parameter :: phtcnt = 3, & ! number of photolysis reactions
+ rxntot = 15, & ! number of total reactions
+ gascnt = 12, & ! number of gas phase reactions
+ nabscol = 2, & ! number of absorbing column densities
+ gas_pcnst = 31, & ! number of "gas phase" species
+ nfs = 8, & ! number of "fixed" species
+ relcnt = 0, & ! number of relationship species
+ grpcnt = 0, & ! number of group members
+ nzcnt = 35, & ! number of non-zero matrix entries
+ extcnt = 11, & ! number of species with external forcing
+ clscnt1 = 1, & ! number of species in explicit class
+ clscnt2 = 0, & ! number of species in hov class
+ clscnt3 = 0, & ! number of species in ebi class
+ clscnt4 = 30, & ! number of species in implicit class
+ clscnt5 = 0, & ! number of species in rodas class
+ indexm = 1, & ! index of total atm density in invariant array
+ indexh2o = 0, & ! index of water vapor density
+ clsze = 1, & ! loop length for implicit chemistry
+ rxt_tag_cnt = 15, &
+ enthalpy_cnt = 0, &
+ nslvd = 0
+ integer :: clscnt(5) = 0
+ integer :: cls_rxt_cnt(4,5) = 0
+ integer :: clsmap(gas_pcnst,5) = 0
+ integer :: permute(gas_pcnst,5) = 0
+ integer :: diag_map(clscnt4) = 0
+ real(r8) :: adv_mass(gas_pcnst) = 0._r8
+ real(r8) :: crb_mass(gas_pcnst) = 0._r8
+ real(r8) :: fix_mass(max(1,nfs))
+ real(r8), allocatable :: cph_enthalpy(:)
+ integer, allocatable :: cph_rid(:)
+ integer, allocatable :: num_rnts(:)
+ integer, allocatable :: rxt_tag_map(:)
+ real(r8), allocatable :: pht_alias_mult(:,:)
+ character(len=32), allocatable :: rxt_tag_lst(:)
+ character(len=16), allocatable :: pht_alias_lst(:,:)
+ character(len=16) :: inv_lst(max(1,nfs))
+ character(len=16) :: extfrc_lst(max(1,extcnt))
+ logical :: frc_from_dataset(max(1,extcnt))
+ logical :: is_vector
+ logical :: is_scalar
+ character(len=16) :: slvd_lst(max(1,nslvd))
+ end module chem_mods
diff --git a/src/chemistry/pp_ghg_mam4/m_rxt_id.F90 b/src/chemistry/pp_ghg_mam4/m_rxt_id.F90
new file mode 100644
index 0000000000..2c6a0ed8db
--- /dev/null
+++ b/src/chemistry/pp_ghg_mam4/m_rxt_id.F90
@@ -0,0 +1,18 @@
+ module m_rxt_id
+ implicit none
+ integer, parameter :: rid_jh2o2 = 1
+ integer, parameter :: rid_jsoa_a1 = 2
+ integer, parameter :: rid_jsoa_a2 = 3
+ integer, parameter :: rid_lyman_alpha = 4
+ integer, parameter :: rid_OH_H2O2 = 5
+ integer, parameter :: rid_usr_HO2_HO2 = 6
+ integer, parameter :: rid_n2o_loss = 7
+ integer, parameter :: rid_cfc11_loss = 8
+ integer, parameter :: rid_cfc12_loss = 9
+ integer, parameter :: rid_ch4_loss = 10
+ integer, parameter :: rid_DMS_NO3 = 11
+ integer, parameter :: rid_DMS_OHa = 12
+ integer, parameter :: rid_SO2_OH_M = 13
+ integer, parameter :: rid_usr_DMS_OH = 14
+ integer, parameter :: rid_SOAE_tau = 15
+ end module m_rxt_id
diff --git a/src/chemistry/pp_ghg_mam4/m_spc_id.F90 b/src/chemistry/pp_ghg_mam4/m_spc_id.F90
new file mode 100644
index 0000000000..c4bfbe7ef3
--- /dev/null
+++ b/src/chemistry/pp_ghg_mam4/m_spc_id.F90
@@ -0,0 +1,34 @@
+ module m_spc_id
+ implicit none
+ integer, parameter :: id_bc_a1 = 1
+ integer, parameter :: id_bc_a4 = 2
+ integer, parameter :: id_CFC11 = 3
+ integer, parameter :: id_CFC12 = 4
+ integer, parameter :: id_CH4 = 5
+ integer, parameter :: id_CO2 = 6
+ integer, parameter :: id_DMS = 7
+ integer, parameter :: id_dst_a1 = 8
+ integer, parameter :: id_dst_a2 = 9
+ integer, parameter :: id_dst_a3 = 10
+ integer, parameter :: id_H2O2 = 11
+ integer, parameter :: id_H2SO4 = 12
+ integer, parameter :: id_N2O = 13
+ integer, parameter :: id_ncl_a1 = 14
+ integer, parameter :: id_ncl_a2 = 15
+ integer, parameter :: id_ncl_a3 = 16
+ integer, parameter :: id_num_a1 = 17
+ integer, parameter :: id_num_a2 = 18
+ integer, parameter :: id_num_a3 = 19
+ integer, parameter :: id_num_a4 = 20
+ integer, parameter :: id_pom_a1 = 21
+ integer, parameter :: id_pom_a4 = 22
+ integer, parameter :: id_SO2 = 23
+ integer, parameter :: id_so4_a1 = 24
+ integer, parameter :: id_so4_a2 = 25
+ integer, parameter :: id_so4_a3 = 26
+ integer, parameter :: id_soa_a1 = 27
+ integer, parameter :: id_soa_a2 = 28
+ integer, parameter :: id_SOAE = 29
+ integer, parameter :: id_SOAG = 30
+ integer, parameter :: id_H2O = 31
+ end module m_spc_id
diff --git a/src/chemistry/pp_ghg_mam4/mo_adjrxt.F90 b/src/chemistry/pp_ghg_mam4/mo_adjrxt.F90
new file mode 100644
index 0000000000..09ad314f66
--- /dev/null
+++ b/src/chemistry/pp_ghg_mam4/mo_adjrxt.F90
@@ -0,0 +1,28 @@
+ module mo_adjrxt
+ private
+ public :: adjrxt
+ contains
+ subroutine adjrxt( rate, inv, m, ncol, nlev )
+ use shr_kind_mod, only : r8 => shr_kind_r8
+ use chem_mods, only : nfs, rxntot
+ implicit none
+!--------------------------------------------------------------------
+! ... dummy arguments
+!--------------------------------------------------------------------
+ integer, intent(in) :: ncol, nlev
+ real(r8), intent(in) :: inv(ncol,nlev,nfs)
+ real(r8), intent(in) :: m(ncol,nlev)
+ real(r8), intent(inout) :: rate(ncol,nlev,rxntot)
+!--------------------------------------------------------------------
+! ... local variables
+!--------------------------------------------------------------------
+ real(r8) :: im(ncol,nlev)
+ im(:,:) = 1._r8 / m(:,:)
+ rate(:,:, 5) = rate(:,:, 5) * inv(:,:, 5)
+ rate(:,:, 11) = rate(:,:, 11) * inv(:,:, 6)
+ rate(:,:, 12) = rate(:,:, 12) * inv(:,:, 5)
+ rate(:,:, 14) = rate(:,:, 14) * inv(:,:, 5)
+ rate(:,:, 6) = rate(:,:, 6) * inv(:,:, 4) * inv(:,:, 4) * im(:,:)
+ rate(:,:, 13) = rate(:,:, 13) * inv(:,:, 5) * inv(:,:, 1)
+ end subroutine adjrxt
+ end module mo_adjrxt
diff --git a/src/chemistry/pp_ghg_mam4/mo_exp_sol.F90 b/src/chemistry/pp_ghg_mam4/mo_exp_sol.F90
new file mode 100644
index 0000000000..cfde22391a
--- /dev/null
+++ b/src/chemistry/pp_ghg_mam4/mo_exp_sol.F90
@@ -0,0 +1,79 @@
+module mo_exp_sol
+ private
+ public :: exp_sol
+ public :: exp_sol_inti
+contains
+ subroutine exp_sol_inti
+ use mo_tracname, only : solsym
+ use chem_mods, only : clscnt1, clsmap
+ use ppgrid, only : pver
+ use cam_history, only : addfld
+ implicit none
+ integer :: i,j
+ do i = 1,clscnt1
+ j = clsmap(i,1)
+ call addfld( trim(solsym(j))//'_CHMP', (/ 'lev' /), 'I', '/cm3/s', 'chemical production rate' )
+ call addfld( trim(solsym(j))//'_CHML', (/ 'lev' /), 'I', '/cm3/s', 'chemical loss rate' )
+ enddo
+ end subroutine exp_sol_inti
+ subroutine exp_sol( base_sol, reaction_rates, het_rates, extfrc, delt, xhnm, ncol, lchnk, ltrop )
+ !-----------------------------------------------------------------------
+ ! ... Exp_sol advances the volumetric mixing ratio
+ ! forward one time step via the fully explicit
+ ! Euler scheme
+ !-----------------------------------------------------------------------
+ use chem_mods, only : clscnt1, extcnt, gas_pcnst, clsmap, rxntot
+ use ppgrid, only : pcols, pver
+ use mo_prod_loss, only : exp_prod_loss
+ use mo_indprd, only : indprd
+ use shr_kind_mod, only : r8 => shr_kind_r8
+ use cam_history, only : outfld
+ use mo_tracname, only : solsym
+ implicit none
+ !-----------------------------------------------------------------------
+ ! ... Dummy arguments
+ !-----------------------------------------------------------------------
+ integer, intent(in) :: ncol ! columns in chunck
+ integer, intent(in) :: lchnk ! chunk id
+ real(r8), intent(in) :: delt ! time step (s)
+ real(r8), intent(in) :: het_rates(ncol,pver,max(1,gas_pcnst)) ! het rates (1/cm^3/s)
+ real(r8), intent(in) :: reaction_rates(ncol,pver,rxntot) ! rxt rates (1/cm^3/s)
+ real(r8), intent(in) :: extfrc(ncol,pver,extcnt) ! "external insitu forcing" (1/cm^3/s)
+ real(r8), intent(in) :: xhnm(ncol,pver)
+ integer, intent(in) :: ltrop(pcols) ! chemistry troposphere boundary (index)
+ real(r8), intent(inout) :: base_sol(ncol,pver,gas_pcnst) ! working mixing ratios (vmr)
+ !-----------------------------------------------------------------------
+ ! ... Local variables
+ !-----------------------------------------------------------------------
+ integer :: i, k, l, m
+ real(r8), dimension(ncol,pver,clscnt1) :: &
+ prod, &
+ loss, &
+ ind_prd
+ real(r8), dimension(ncol,pver) :: wrk
+ !-----------------------------------------------------------------------
+ ! ... Put "independent" production in the forcing
+ !-----------------------------------------------------------------------
+ call indprd( 1, ind_prd, clscnt1, base_sol, extfrc, &
+ reaction_rates, ncol )
+ !-----------------------------------------------------------------------
+ ! ... Form F(y)
+ !-----------------------------------------------------------------------
+ call exp_prod_loss( prod, loss, base_sol, reaction_rates, het_rates )
+ !-----------------------------------------------------------------------
+ ! ... Solve for the mixing ratio at t(n+1)
+ !-----------------------------------------------------------------------
+ do m = 1,clscnt1
+ l = clsmap(m,1)
+ do i = 1,ncol
+ do k = ltrop(i)+1,pver
+ base_sol(i,k,l) = base_sol(i,k,l) + delt * (prod(i,k,m) + ind_prd(i,k,m) - loss(i,k,m))
+ end do
+ end do
+ wrk(:,:) = (prod(:,:,m) + ind_prd(:,:,m))*xhnm
+ call outfld( trim(solsym(l))//'_CHMP', wrk(:,:), ncol, lchnk )
+ wrk(:,:) = (loss(:,:,m))*xhnm
+ call outfld( trim(solsym(l))//'_CHML', wrk(:,:), ncol, lchnk )
+ end do
+ end subroutine exp_sol
+end module mo_exp_sol
diff --git a/src/chemistry/pp_ghg_mam4/mo_imp_sol.F90 b/src/chemistry/pp_ghg_mam4/mo_imp_sol.F90
new file mode 100644
index 0000000000..d885728ba4
--- /dev/null
+++ b/src/chemistry/pp_ghg_mam4/mo_imp_sol.F90
@@ -0,0 +1,392 @@
+module mo_imp_sol
+ use shr_kind_mod, only : r8 => shr_kind_r8
+ use chem_mods, only : clscnt4, gas_pcnst, clsmap
+ use cam_logfile, only : iulog
+ implicit none
+ private
+ public :: imp_slv_inti, imp_sol
+ save
+ real(r8), parameter :: rel_err = 1.e-3_r8
+ real(r8), parameter :: high_rel_err = 1.e-4_r8
+ !-----------------------------------------------------------------------
+ ! Newton-Raphson iteration limits
+ !-----------------------------------------------------------------------
+ integer, parameter :: itermax = 11
+ integer, parameter :: cut_limit = 5
+ real(r8), parameter :: small = 1.e-40_r8
+ real(r8) :: epsilon(clscnt4)
+ logical :: factor(itermax)
+contains
+ subroutine imp_slv_inti
+ !-----------------------------------------------------------------------
+ ! ... Initialize the implict solver
+ !-----------------------------------------------------------------------
+ use mo_chem_utls, only : get_spc_ndx
+ implicit none
+ !-----------------------------------------------------------------------
+ ! ... Local variables
+ !-----------------------------------------------------------------------
+ integer :: m, ox_ndx, o3a_ndx
+ real(r8) :: eps(gas_pcnst)
+ factor(:) = .true.
+ eps(:) = rel_err
+ ox_ndx = get_spc_ndx( 'OX' )
+ if( ox_ndx < 1 ) then
+ ox_ndx = get_spc_ndx( 'O3' )
+ end if
+ if( ox_ndx > 0 ) then
+ eps(ox_ndx) = high_rel_err
+ end if
+ m = get_spc_ndx( 'NO' )
+ if( m > 0 ) then
+ eps(m) = high_rel_err
+ end if
+ m = get_spc_ndx( 'NO2' )
+ if( m > 0 ) then
+ eps(m) = high_rel_err
+ end if
+ m = get_spc_ndx( 'NO3' )
+ if( m > 0 ) then
+ eps(m) = high_rel_err
+ end if
+ m = get_spc_ndx( 'HNO3' )
+ if( m > 0 ) then
+ eps(m) = high_rel_err
+ end if
+ m = get_spc_ndx( 'HO2NO2' )
+ if( m > 0 ) then
+ eps(m) = high_rel_err
+ end if
+ m = get_spc_ndx( 'N2O5' )
+ if( m > 0 ) then
+ eps(m) = high_rel_err
+ end if
+ m = get_spc_ndx( 'OH' )
+ if( m > 0 ) then
+ eps(m) = high_rel_err
+ end if
+ m = get_spc_ndx( 'HO2' )
+ if( m > 0 ) then
+ eps(m) = high_rel_err
+ end if
+ o3a_ndx = get_spc_ndx( 'O3A' )
+ if( o3a_ndx > 0 ) then
+ eps(m) = high_rel_err
+ end if
+ m = get_spc_ndx( 'XNO' )
+ if( m > 0 ) then
+ eps(m) = high_rel_err
+ end if
+ m = get_spc_ndx( 'XNO2' )
+ if( m > 0 ) then
+ eps(m) = high_rel_err
+ end if
+ m = get_spc_ndx( 'XNO3' )
+ if( m > 0 ) then
+ eps(m) = high_rel_err
+ end if
+ m = get_spc_ndx( 'XHNO3' )
+ if( m > 0 ) then
+ eps(m) = high_rel_err
+ end if
+ m = get_spc_ndx( 'XHO2NO2' )
+ if( m > 0 ) then
+ eps(m) = high_rel_err
+ end if
+ m = get_spc_ndx( 'XNO2NO3' )
+ if( m > 0 ) then
+ eps(m) = high_rel_err
+ end if
+ m = get_spc_ndx( 'NO2XNO3' )
+ if( m > 0 ) then
+ eps(m) = high_rel_err
+ end if
+ do m = 1,clscnt4
+ epsilon(m) = eps(clsmap(m,4))
+ end do
+ end subroutine imp_slv_inti
+ subroutine imp_sol( base_sol, reaction_rates, het_rates, extfrc, delt, &
+ ncol,nlev, lchnk, prod_out, loss_out )
+ !-----------------------------------------------------------------------
+ ! ... imp_sol advances the volumetric mixing ratio
+ ! forward one time step via the fully implicit euler scheme.
+ ! this source is meant for small l1 cache machines such as
+ ! the intel pentium and itanium cpus
+ !-----------------------------------------------------------------------
+ use chem_mods, only : rxntot, extcnt, nzcnt, permute, cls_rxt_cnt
+ use mo_tracname, only : solsym
+ use mo_lin_matrix, only : linmat
+ use mo_nln_matrix, only : nlnmat
+ use mo_lu_factor, only : lu_fac
+ use mo_lu_solve, only : lu_slv
+ use mo_prod_loss, only : imp_prod_loss
+ use mo_indprd, only : indprd
+ use time_manager, only : get_nstep
+ use perf_mod, only : t_startf, t_stopf
+ implicit none
+ !-----------------------------------------------------------------------
+ ! ... dummy args
+ !-----------------------------------------------------------------------
+ integer, intent(in) :: ncol ! columns in chunck
+ integer, intent(in) :: nlev
+ integer, intent(in) :: lchnk ! chunk id
+ real(r8), intent(in) :: delt ! time step (s)
+ real(r8), intent(in) :: reaction_rates(ncol,nlev,max(1,rxntot)) ! rxt rates (1/cm^3/s)
+ real(r8), intent(in) :: extfrc(ncol,nlev,max(1,extcnt)) ! external in-situ forcing (1/cm^3/s)
+ real(r8), intent(in) :: het_rates(ncol,nlev,max(1,gas_pcnst)) ! washout rates (1/s)
+ real(r8), intent(inout) :: base_sol(ncol,nlev,gas_pcnst) ! species mixing ratios (vmr)
+ real(r8), intent(out) :: prod_out(ncol,nlev,max(1,clscnt4))
+ real(r8), intent(out) :: loss_out(ncol,nlev,max(1,clscnt4))
+ !-----------------------------------------------------------------------
+ ! ... local variables
+ !-----------------------------------------------------------------------
+ integer :: nr_iter, &
+ lev, &
+ i, &
+ j, &
+ k, l, &
+ m
+ integer :: fail_cnt, cut_cnt, stp_con_cnt
+ integer :: nstep
+ real(r8) :: interval_done, dt, dti
+ real(r8) :: max_delta(max(1,clscnt4))
+ real(r8) :: sys_jac(max(1,nzcnt))
+ real(r8) :: lin_jac(max(1,nzcnt))
+ real(r8), dimension(max(1,clscnt4)) :: &
+ solution, &
+ forcing, &
+ iter_invariant, &
+ prod, &
+ loss
+ real(r8) :: lrxt(max(1,rxntot))
+ real(r8) :: lsol(max(1,gas_pcnst))
+ real(r8) :: lhet(max(1,gas_pcnst))
+ real(r8), dimension(ncol,nlev,max(1,clscnt4)) :: &
+ ind_prd
+ logical :: convergence
+ logical :: frc_mask, iter_conv
+ logical :: converged(max(1,clscnt4))
+ solution(:) = 0._r8
+ !-----------------------------------------------------------------------
+ ! ... class independent forcing
+ !-----------------------------------------------------------------------
+ if( cls_rxt_cnt(1,4) > 0 .or. extcnt > 0 ) then
+ call indprd( 4, ind_prd, clscnt4, base_sol, extfrc, &
+ reaction_rates, ncol )
+ else
+ do m = 1,max(1,clscnt4)
+ ind_prd(:,:,m) = 0._r8
+ end do
+ end if
+ level_loop : do lev = 1,nlev
+ column_loop : do i = 1,ncol
+ !-----------------------------------------------------------------------
+ ! ... transfer from base to local work arrays
+ !-----------------------------------------------------------------------
+ do m = 1,rxntot
+ lrxt(m) = reaction_rates(i,lev,m)
+ end do
+ if( gas_pcnst > 0 ) then
+ do m = 1,gas_pcnst
+ lhet(m) = het_rates(i,lev,m)
+ end do
+ end if
+ !-----------------------------------------------------------------------
+ ! ... time step loop
+ !-----------------------------------------------------------------------
+ dt = delt
+ cut_cnt = 0
+ fail_cnt = 0
+ stp_con_cnt = 0
+ interval_done = 0._r8
+ time_step_loop : do
+ dti = 1._r8 / dt
+ !-----------------------------------------------------------------------
+ ! ... transfer from base to local work arrays
+ !-----------------------------------------------------------------------
+ do m = 1,gas_pcnst
+ lsol(m) = base_sol(i,lev,m)
+ end do
+ !-----------------------------------------------------------------------
+ ! ... transfer from base to class array
+ !-----------------------------------------------------------------------
+ do k = 1,clscnt4
+ j = clsmap(k,4)
+ m = permute(k,4)
+ solution(m) = lsol(j)
+ end do
+ !-----------------------------------------------------------------------
+ ! ... set the iteration invariant part of the function f(y)
+ !-----------------------------------------------------------------------
+ if( cls_rxt_cnt(1,4) > 0 .or. extcnt > 0 ) then
+ do m = 1,clscnt4
+ iter_invariant(m) = dti * solution(m) + ind_prd(i,lev,m)
+ end do
+ else
+ do m = 1,clscnt4
+ iter_invariant(m) = dti * solution(m)
+ end do
+ end if
+ !-----------------------------------------------------------------------
+ ! ... the linear component
+ !-----------------------------------------------------------------------
+ if( cls_rxt_cnt(2,4) > 0 ) then
+ call t_startf( 'lin_mat' )
+ call linmat( lin_jac, lsol, lrxt, lhet )
+ call t_stopf( 'lin_mat' )
+ end if
+ !=======================================================================
+ ! the newton-raphson iteration for f(y) = 0
+ !=======================================================================
+ iter_loop : do nr_iter = 1,itermax
+ !-----------------------------------------------------------------------
+ ! ... the non-linear component
+ !-----------------------------------------------------------------------
+ if( factor(nr_iter) ) then
+ call t_startf( 'nln_mat' )
+ call nlnmat( sys_jac, lsol, lrxt, lin_jac, dti )
+ call t_stopf( 'nln_mat' )
+ !-----------------------------------------------------------------------
+ ! ... factor the "system" matrix
+ !-----------------------------------------------------------------------
+ call t_startf( 'lu_fac' )
+ call lu_fac( sys_jac )
+ call t_stopf( 'lu_fac' )
+ end if
+ !-----------------------------------------------------------------------
+ ! ... form f(y)
+ !-----------------------------------------------------------------------
+ call t_startf( 'prod_loss' )
+ call imp_prod_loss( prod, loss, lsol, lrxt, lhet )
+ call t_stopf( 'prod_loss' )
+ do m = 1,clscnt4
+ forcing(m) = solution(m)*dti - (iter_invariant(m) + prod(m) - loss(m))
+ end do
+ !-----------------------------------------------------------------------
+ ! ... solve for the mixing ratio at t(n+1)
+ !-----------------------------------------------------------------------
+ call t_startf( 'lu_slv' )
+ call lu_slv( sys_jac, forcing )
+ call t_stopf( 'lu_slv' )
+ do m = 1,clscnt4
+ solution(m) = solution(m) + forcing(m)
+ end do
+ !-----------------------------------------------------------------------
+ ! ... convergence measures
+ !-----------------------------------------------------------------------
+ if( nr_iter > 1 ) then
+ do k = 1,clscnt4
+ m = permute(k,4)
+ if( abs(solution(m)) > 1.e-20_r8 ) then
+ max_delta(k) = abs( forcing(m)/solution(m) )
+ else
+ max_delta(k) = 0._r8
+ end if
+ end do
+ end if
+ !-----------------------------------------------------------------------
+ ! ... limit iterate
+ !-----------------------------------------------------------------------
+ where( solution(:) < 0._r8 )
+ solution(:) = 0._r8
+ endwhere
+ !-----------------------------------------------------------------------
+ ! ... transfer latest solution back to work array
+ !-----------------------------------------------------------------------
+ do k = 1,clscnt4
+ j = clsmap(k,4)
+ m = permute(k,4)
+ lsol(j) = solution(m)
+ end do
+ !-----------------------------------------------------------------------
+ ! ... check for convergence
+ !-----------------------------------------------------------------------
+ converged(:) = .true.
+ if( nr_iter > 1 ) then
+ do k = 1,clscnt4
+ m = permute(k,4)
+ frc_mask = abs( forcing(m) ) > small
+ if( frc_mask ) then
+ converged(k) = abs(forcing(m)) <= epsilon(k)*abs(solution(m))
+ else
+ converged(k) = .true.
+ end if
+ end do
+ convergence = all( converged(:) )
+ if( convergence ) then
+ exit
+ end if
+ end if
+ end do iter_loop
+ !-----------------------------------------------------------------------
+ ! ... check for newton-raphson convergence
+ !-----------------------------------------------------------------------
+ if( .not. convergence ) then
+ !-----------------------------------------------------------------------
+ ! ... non-convergence
+ !-----------------------------------------------------------------------
+ fail_cnt = fail_cnt + 1
+ nstep = get_nstep()
+ write(iulog,'('' imp_sol: Time step '',1p,e21.13,'' failed to converge @ (lchnk,lev,col,nstep) = '',4i6)') &
+ dt,lchnk,lev,i,nstep
+ stp_con_cnt = 0
+ if( cut_cnt < cut_limit ) then
+ cut_cnt = cut_cnt + 1
+ if( cut_cnt < cut_limit ) then
+ dt = .5_r8 * dt
+ else
+ dt = .1_r8 * dt
+ end if
+ cycle time_step_loop
+ else
+ write(iulog,'('' imp_sol: Failed to converge @ (lchnk,lev,col,nstep,dt,time) = '',4i6,1p,2e21.13)') &
+ lchnk,lev,i,nstep,dt,interval_done+dt
+ do m = 1,clscnt4
+ if( .not. converged(m) ) then
+ write(iulog,'(1x,a8,1x,1pe10.3)') solsym(clsmap(m,4)), max_delta(m)
+ end if
+ end do
+ end if
+ end if
+ !-----------------------------------------------------------------------
+ ! ... check for interval done
+ !-----------------------------------------------------------------------
+ interval_done = interval_done + dt
+ if( abs( delt - interval_done ) <= .0001_r8 ) then
+ if( fail_cnt > 0 ) then
+ write(iulog,*) 'imp_sol : @ (lchnk,lev,col) = ',lchnk,lev,i,' failed ',fail_cnt,' times'
+ end if
+ exit time_step_loop
+ else
+ !-----------------------------------------------------------------------
+ ! ... transfer latest solution back to base array
+ !-----------------------------------------------------------------------
+ if( convergence ) then
+ stp_con_cnt = stp_con_cnt + 1
+ end if
+ do m = 1,gas_pcnst
+ base_sol(i,lev,m) = lsol(m)
+ end do
+ if( stp_con_cnt >= 2 ) then
+ dt = 2._r8*dt
+ stp_con_cnt = 0
+ end if
+ dt = min( dt,delt-interval_done )
+ ! write(iulog,'('' imp_sol: New time step '',1p,e21.13)') dt
+ end if
+ end do time_step_loop
+ !-----------------------------------------------------------------------
+ ! ... Transfer latest solution back to base array
+ !-----------------------------------------------------------------------
+ cls_loop: do k = 1,clscnt4
+ j = clsmap(k,4)
+ m = permute(k,4)
+ base_sol(i,lev,j) = solution(m)
+ ! output diagnostics
+ prod_out(i,lev,k) = prod(k) + ind_prd(i,lev,k)
+ loss_out(i,lev,k) = loss(k)
+ end do cls_loop
+ end do column_loop
+ end do level_loop
+ end subroutine imp_sol
+end module mo_imp_sol
diff --git a/src/chemistry/pp_ghg_mam4/mo_indprd.F90 b/src/chemistry/pp_ghg_mam4/mo_indprd.F90
new file mode 100644
index 0000000000..6906fcf304
--- /dev/null
+++ b/src/chemistry/pp_ghg_mam4/mo_indprd.F90
@@ -0,0 +1,61 @@
+ module mo_indprd
+ use shr_kind_mod, only : r8 => shr_kind_r8
+ private
+ public :: indprd
+ contains
+ subroutine indprd( class, prod, nprod, y, extfrc, rxt, ncol )
+ use chem_mods, only : gas_pcnst, extcnt, rxntot
+ use ppgrid, only : pver
+ implicit none
+!--------------------------------------------------------------------
+! ... dummy arguments
+!--------------------------------------------------------------------
+ integer, intent(in) :: class
+ integer, intent(in) :: ncol
+ integer, intent(in) :: nprod
+ real(r8), intent(in) :: y(ncol,pver,gas_pcnst)
+ real(r8), intent(in) :: rxt(ncol,pver,rxntot)
+ real(r8), intent(in) :: extfrc(ncol,pver,extcnt)
+ real(r8), intent(inout) :: prod(ncol,pver,nprod)
+!--------------------------------------------------------------------
+! ... "independent" production for Explicit species
+!--------------------------------------------------------------------
+ if( class == 1 ) then
+ prod(:,:,1) = 0._r8
+!--------------------------------------------------------------------
+! ... "independent" production for Implicit species
+!--------------------------------------------------------------------
+ else if( class == 4 ) then
+ prod(:,:,1) = + extfrc(:,:,1)
+ prod(:,:,2) = + extfrc(:,:,2)
+ prod(:,:,3) = 0._r8
+ prod(:,:,4) = 0._r8
+ prod(:,:,5) = 0._r8
+ prod(:,:,6) = 0._r8
+ prod(:,:,7) = 0._r8
+ prod(:,:,8) = 0._r8
+ prod(:,:,9) = 0._r8
+ prod(:,:,10) =rxt(:,:,6)
+ prod(:,:,11) = 0._r8
+ prod(:,:,12) = 0._r8
+ prod(:,:,13) = 0._r8
+ prod(:,:,14) = 0._r8
+ prod(:,:,15) = 0._r8
+ prod(:,:,16) = + extfrc(:,:,4)
+ prod(:,:,17) = + extfrc(:,:,5)
+ prod(:,:,18) = 0._r8
+ prod(:,:,19) = + extfrc(:,:,6)
+ prod(:,:,20) = + extfrc(:,:,7)
+ prod(:,:,21) = + extfrc(:,:,8)
+ prod(:,:,22) = + extfrc(:,:,9)
+ prod(:,:,23) = + extfrc(:,:,10)
+ prod(:,:,24) = + extfrc(:,:,11)
+ prod(:,:,25) = 0._r8
+ prod(:,:,26) = 0._r8
+ prod(:,:,27) = 0._r8
+ prod(:,:,28) = 0._r8
+ prod(:,:,29) = 0._r8
+ prod(:,:,30) = + extfrc(:,:,3)
+ end if
+ end subroutine indprd
+ end module mo_indprd
diff --git a/src/chemistry/pp_ghg_mam4/mo_lin_matrix.F90 b/src/chemistry/pp_ghg_mam4/mo_lin_matrix.F90
new file mode 100644
index 0000000000..7b32b664f5
--- /dev/null
+++ b/src/chemistry/pp_ghg_mam4/mo_lin_matrix.F90
@@ -0,0 +1,71 @@
+ module mo_lin_matrix
+ private
+ public :: linmat
+ contains
+ subroutine linmat01( mat, y, rxt, het_rates )
+!----------------------------------------------
+! ... linear matrix entries for implicit species
+!----------------------------------------------
+ use chem_mods, only : gas_pcnst, rxntot, nzcnt
+ use shr_kind_mod, only : r8 => shr_kind_r8
+ implicit none
+!----------------------------------------------
+! ... dummy arguments
+!----------------------------------------------
+ real(r8), intent(in) :: y(gas_pcnst)
+ real(r8), intent(in) :: rxt(rxntot)
+ real(r8), intent(in) :: het_rates(max(1,gas_pcnst))
+ real(r8), intent(inout) :: mat(nzcnt)
+ mat(1) = -( het_rates(1) )
+ mat(2) = -( het_rates(2) )
+ mat(3) = -( rxt(8) + het_rates(3) )
+ mat(4) = -( rxt(9) + het_rates(4) )
+ mat(5) = -( rxt(10) + het_rates(5) )
+ mat(7) = -( rxt(11) + rxt(12) + rxt(14) + het_rates(7) )
+ mat(9) = -( het_rates(8) )
+ mat(10) = -( het_rates(9) )
+ mat(11) = -( het_rates(10) )
+ mat(12) = -( rxt(1) + rxt(5) + het_rates(11) )
+ mat(14) = -( het_rates(12) )
+ mat(25) = rxt(13)
+ mat(15) = -( rxt(7) + het_rates(13) )
+ mat(16) = -( het_rates(14) )
+ mat(17) = -( het_rates(15) )
+ mat(18) = -( het_rates(16) )
+ mat(19) = -( het_rates(17) )
+ mat(20) = -( het_rates(18) )
+ mat(21) = -( het_rates(19) )
+ mat(22) = -( het_rates(20) )
+ mat(23) = -( het_rates(21) )
+ mat(24) = -( het_rates(22) )
+ mat(26) = -( rxt(13) + het_rates(23) )
+ mat(8) = rxt(11) + rxt(12) + .500_r8*rxt(14)
+ mat(27) = -( het_rates(24) )
+ mat(28) = -( het_rates(25) )
+ mat(29) = -( het_rates(26) )
+ mat(30) = -( rxt(2) + het_rates(27) )
+ mat(31) = -( rxt(3) + het_rates(28) )
+ mat(32) = -( rxt(15) + het_rates(29) )
+ mat(34) = -( het_rates(30) )
+ mat(33) = rxt(15)
+ mat(35) = -( rxt(4) + het_rates(31) )
+ mat(13) = rxt(5)
+ mat(6) = 2.000_r8*rxt(10)
+ end subroutine linmat01
+ subroutine linmat( mat, y, rxt, het_rates )
+!----------------------------------------------
+! ... linear matrix entries for implicit species
+!----------------------------------------------
+ use chem_mods, only : gas_pcnst, rxntot, nzcnt
+ use shr_kind_mod, only : r8 => shr_kind_r8
+ implicit none
+!----------------------------------------------
+! ... dummy arguments
+!----------------------------------------------
+ real(r8), intent(in) :: y(gas_pcnst)
+ real(r8), intent(in) :: rxt(rxntot)
+ real(r8), intent(in) :: het_rates(max(1,gas_pcnst))
+ real(r8), intent(inout) :: mat(nzcnt)
+ call linmat01( mat, y, rxt, het_rates )
+ end subroutine linmat
+ end module mo_lin_matrix
diff --git a/src/chemistry/pp_ghg_mam4/mo_lu_factor.F90 b/src/chemistry/pp_ghg_mam4/mo_lu_factor.F90
new file mode 100644
index 0000000000..d981e77137
--- /dev/null
+++ b/src/chemistry/pp_ghg_mam4/mo_lu_factor.F90
@@ -0,0 +1,56 @@
+ module mo_lu_factor
+ private
+ public :: lu_fac
+ contains
+ subroutine lu_fac01( lu )
+ use shr_kind_mod, only : r8 => shr_kind_r8
+ implicit none
+!-----------------------------------------------------------------------
+! ... dummy args
+!-----------------------------------------------------------------------
+ real(r8), intent(inout) :: lu(:)
+ lu(1) = 1._r8 / lu(1)
+ lu(2) = 1._r8 / lu(2)
+ lu(3) = 1._r8 / lu(3)
+ lu(4) = 1._r8 / lu(4)
+ lu(5) = 1._r8 / lu(5)
+ lu(6) = lu(6) * lu(5)
+ lu(7) = 1._r8 / lu(7)
+ lu(8) = lu(8) * lu(7)
+ lu(9) = 1._r8 / lu(9)
+ lu(10) = 1._r8 / lu(10)
+ lu(11) = 1._r8 / lu(11)
+ lu(12) = 1._r8 / lu(12)
+ lu(13) = lu(13) * lu(12)
+ lu(14) = 1._r8 / lu(14)
+ lu(15) = 1._r8 / lu(15)
+ lu(16) = 1._r8 / lu(16)
+ lu(17) = 1._r8 / lu(17)
+ lu(18) = 1._r8 / lu(18)
+ lu(19) = 1._r8 / lu(19)
+ lu(20) = 1._r8 / lu(20)
+ lu(21) = 1._r8 / lu(21)
+ lu(22) = 1._r8 / lu(22)
+ lu(23) = 1._r8 / lu(23)
+ lu(24) = 1._r8 / lu(24)
+ lu(26) = 1._r8 / lu(26)
+ lu(27) = 1._r8 / lu(27)
+ lu(28) = 1._r8 / lu(28)
+ lu(29) = 1._r8 / lu(29)
+ lu(30) = 1._r8 / lu(30)
+ lu(31) = 1._r8 / lu(31)
+ lu(32) = 1._r8 / lu(32)
+ lu(33) = lu(33) * lu(32)
+ lu(34) = 1._r8 / lu(34)
+ lu(35) = 1._r8 / lu(35)
+ end subroutine lu_fac01
+ subroutine lu_fac( lu )
+ use shr_kind_mod, only : r8 => shr_kind_r8
+ implicit none
+!-----------------------------------------------------------------------
+! ... dummy args
+!-----------------------------------------------------------------------
+ real(r8), intent(inout) :: lu(:)
+ call lu_fac01( lu )
+ end subroutine lu_fac
+ end module mo_lu_factor
diff --git a/src/chemistry/pp_ghg_mam4/mo_lu_solve.F90 b/src/chemistry/pp_ghg_mam4/mo_lu_solve.F90
new file mode 100644
index 0000000000..574861e9b1
--- /dev/null
+++ b/src/chemistry/pp_ghg_mam4/mo_lu_solve.F90
@@ -0,0 +1,87 @@
+ module mo_lu_solve
+ private
+ public :: lu_slv
+ contains
+ subroutine lu_slv01( lu, b )
+ use shr_kind_mod, only : r8 => shr_kind_r8
+ use chem_mods, only : clscnt4, nzcnt
+ implicit none
+!-----------------------------------------------------------------------
+! ... Dummy args
+!-----------------------------------------------------------------------
+ real(r8), intent(in) :: lu(:)
+ real(r8), intent(inout) :: b(:)
+!-----------------------------------------------------------------------
+! ... Local variables
+!-----------------------------------------------------------------------
+!-----------------------------------------------------------------------
+! ... solve L * y = b
+!-----------------------------------------------------------------------
+ b(30) = b(30) - lu(6) * b(5)
+ b(22) = b(22) - lu(8) * b(6)
+ b(30) = b(30) - lu(13) * b(10)
+ b(29) = b(29) - lu(33) * b(28)
+ end subroutine lu_slv01
+ subroutine lu_slv02( lu, b )
+ use shr_kind_mod, only : r8 => shr_kind_r8
+ use chem_mods, only : clscnt4, nzcnt
+ implicit none
+!-----------------------------------------------------------------------
+! ... Dummy args
+!-----------------------------------------------------------------------
+ real(r8), intent(in) :: lu(:)
+ real(r8), intent(inout) :: b(:)
+!-----------------------------------------------------------------------
+! ... Local variables
+!-----------------------------------------------------------------------
+!-----------------------------------------------------------------------
+! ... solve L * y = b
+!-----------------------------------------------------------------------
+!-----------------------------------------------------------------------
+! ... Solve U * x = y
+!-----------------------------------------------------------------------
+ b(30) = b(30) * lu(35)
+ b(29) = b(29) * lu(34)
+ b(28) = b(28) * lu(32)
+ b(27) = b(27) * lu(31)
+ b(26) = b(26) * lu(30)
+ b(25) = b(25) * lu(29)
+ b(24) = b(24) * lu(28)
+ b(23) = b(23) * lu(27)
+ b(22) = b(22) * lu(26)
+ b(11) = b(11) - lu(25) * b(22)
+ b(21) = b(21) * lu(24)
+ b(20) = b(20) * lu(23)
+ b(19) = b(19) * lu(22)
+ b(18) = b(18) * lu(21)
+ b(17) = b(17) * lu(20)
+ b(16) = b(16) * lu(19)
+ b(15) = b(15) * lu(18)
+ b(14) = b(14) * lu(17)
+ b(13) = b(13) * lu(16)
+ b(12) = b(12) * lu(15)
+ b(11) = b(11) * lu(14)
+ b(10) = b(10) * lu(12)
+ b(9) = b(9) * lu(11)
+ b(8) = b(8) * lu(10)
+ b(7) = b(7) * lu(9)
+ b(6) = b(6) * lu(7)
+ b(5) = b(5) * lu(5)
+ b(4) = b(4) * lu(4)
+ b(3) = b(3) * lu(3)
+ b(2) = b(2) * lu(2)
+ b(1) = b(1) * lu(1)
+ end subroutine lu_slv02
+ subroutine lu_slv( lu, b )
+ use shr_kind_mod, only : r8 => shr_kind_r8
+ use chem_mods, only : clscnt4, nzcnt
+ implicit none
+!-----------------------------------------------------------------------
+! ... Dummy args
+!-----------------------------------------------------------------------
+ real(r8), intent(in) :: lu(:)
+ real(r8), intent(inout) :: b(:)
+ call lu_slv01( lu, b )
+ call lu_slv02( lu, b )
+ end subroutine lu_slv
+ end module mo_lu_solve
diff --git a/src/chemistry/pp_ghg_mam4/mo_nln_matrix.F90 b/src/chemistry/pp_ghg_mam4/mo_nln_matrix.F90
new file mode 100644
index 0000000000..c48389b422
--- /dev/null
+++ b/src/chemistry/pp_ghg_mam4/mo_nln_matrix.F90
@@ -0,0 +1,100 @@
+ module mo_nln_matrix
+ use shr_kind_mod, only : r8 => shr_kind_r8
+ private
+ public :: nlnmat
+ contains
+ subroutine nlnmat( mat, y, rxt, lmat, dti )
+ use chem_mods, only : gas_pcnst, rxntot, nzcnt
+ implicit none
+!----------------------------------------------
+! ... dummy arguments
+!----------------------------------------------
+ real(r8), intent(in) :: dti
+ real(r8), intent(in) :: lmat(nzcnt)
+ real(r8), intent(in) :: y(gas_pcnst)
+ real(r8), intent(in) :: rxt(rxntot)
+ real(r8), intent(inout) :: mat(nzcnt)
+ call nlnmat_finit( mat, lmat, dti )
+ end subroutine nlnmat
+ subroutine nlnmat_finit( mat, lmat, dti )
+ use chem_mods, only : gas_pcnst, rxntot, nzcnt
+ implicit none
+!----------------------------------------------
+! ... dummy arguments
+!----------------------------------------------
+ real(r8), intent(in) :: dti
+ real(r8), intent(in) :: lmat(nzcnt)
+ real(r8), intent(inout) :: mat(nzcnt)
+!----------------------------------------------
+! ... local variables
+!----------------------------------------------
+!----------------------------------------------
+! ... complete matrix entries implicit species
+!----------------------------------------------
+ mat( 1) = lmat( 1)
+ mat( 2) = lmat( 2)
+ mat( 3) = lmat( 3)
+ mat( 4) = lmat( 4)
+ mat( 5) = lmat( 5)
+ mat( 6) = lmat( 6)
+ mat( 7) = lmat( 7)
+ mat( 8) = lmat( 8)
+ mat( 9) = lmat( 9)
+ mat( 10) = lmat( 10)
+ mat( 11) = lmat( 11)
+ mat( 12) = lmat( 12)
+ mat( 13) = lmat( 13)
+ mat( 14) = lmat( 14)
+ mat( 15) = lmat( 15)
+ mat( 16) = lmat( 16)
+ mat( 17) = lmat( 17)
+ mat( 18) = lmat( 18)
+ mat( 19) = lmat( 19)
+ mat( 20) = lmat( 20)
+ mat( 21) = lmat( 21)
+ mat( 22) = lmat( 22)
+ mat( 23) = lmat( 23)
+ mat( 24) = lmat( 24)
+ mat( 25) = lmat( 25)
+ mat( 26) = lmat( 26)
+ mat( 27) = lmat( 27)
+ mat( 28) = lmat( 28)
+ mat( 29) = lmat( 29)
+ mat( 30) = lmat( 30)
+ mat( 31) = lmat( 31)
+ mat( 32) = lmat( 32)
+ mat( 33) = lmat( 33)
+ mat( 34) = lmat( 34)
+ mat( 35) = lmat( 35)
+ mat( 1) = mat( 1) - dti
+ mat( 2) = mat( 2) - dti
+ mat( 3) = mat( 3) - dti
+ mat( 4) = mat( 4) - dti
+ mat( 5) = mat( 5) - dti
+ mat( 7) = mat( 7) - dti
+ mat( 9) = mat( 9) - dti
+ mat( 10) = mat( 10) - dti
+ mat( 11) = mat( 11) - dti
+ mat( 12) = mat( 12) - dti
+ mat( 14) = mat( 14) - dti
+ mat( 15) = mat( 15) - dti
+ mat( 16) = mat( 16) - dti
+ mat( 17) = mat( 17) - dti
+ mat( 18) = mat( 18) - dti
+ mat( 19) = mat( 19) - dti
+ mat( 20) = mat( 20) - dti
+ mat( 21) = mat( 21) - dti
+ mat( 22) = mat( 22) - dti
+ mat( 23) = mat( 23) - dti
+ mat( 24) = mat( 24) - dti
+ mat( 26) = mat( 26) - dti
+ mat( 27) = mat( 27) - dti
+ mat( 28) = mat( 28) - dti
+ mat( 29) = mat( 29) - dti
+ mat( 30) = mat( 30) - dti
+ mat( 31) = mat( 31) - dti
+ mat( 32) = mat( 32) - dti
+ mat( 34) = mat( 34) - dti
+ mat( 35) = mat( 35) - dti
+ end subroutine nlnmat_finit
+ end module mo_nln_matrix
diff --git a/src/chemistry/pp_ghg_mam4/mo_phtadj.F90 b/src/chemistry/pp_ghg_mam4/mo_phtadj.F90
new file mode 100644
index 0000000000..aaa43829fe
--- /dev/null
+++ b/src/chemistry/pp_ghg_mam4/mo_phtadj.F90
@@ -0,0 +1,24 @@
+ module mo_phtadj
+ private
+ public :: phtadj
+ contains
+ subroutine phtadj( p_rate, inv, m, ncol, nlev )
+ use chem_mods, only : nfs, phtcnt
+ use shr_kind_mod, only : r8 => shr_kind_r8
+ implicit none
+!--------------------------------------------------------------------
+! ... dummy arguments
+!--------------------------------------------------------------------
+ integer, intent(in) :: ncol, nlev
+ real(r8), intent(in) :: inv(ncol,nlev,max(1,nfs))
+ real(r8), intent(in) :: m(ncol,nlev)
+ real(r8), intent(inout) :: p_rate(ncol,nlev,max(1,phtcnt))
+!--------------------------------------------------------------------
+! ... local variables
+!--------------------------------------------------------------------
+ integer :: k
+ real(r8) :: im(ncol,nlev)
+ do k = 1,nlev
+ end do
+ end subroutine phtadj
+ end module mo_phtadj
diff --git a/src/chemistry/pp_ghg_mam4/mo_prod_loss.F90 b/src/chemistry/pp_ghg_mam4/mo_prod_loss.F90
new file mode 100644
index 0000000000..d502e216a3
--- /dev/null
+++ b/src/chemistry/pp_ghg_mam4/mo_prod_loss.F90
@@ -0,0 +1,101 @@
+ module mo_prod_loss
+ use shr_kind_mod, only : r8 => shr_kind_r8
+ private
+ public :: exp_prod_loss
+ public :: imp_prod_loss
+ contains
+ subroutine exp_prod_loss( prod, loss, y, rxt, het_rates )
+ use ppgrid, only : pver
+ implicit none
+!--------------------------------------------------------------------
+! ... dummy args
+!--------------------------------------------------------------------
+ real(r8), dimension(:,:,:), intent(out) :: &
+ prod, &
+ loss
+ real(r8), intent(in) :: y(:,:,:)
+ real(r8), intent(in) :: rxt(:,:,:)
+ real(r8), intent(in) :: het_rates(:,:,:)
+!--------------------------------------------------------------------
+! ... loss and production for Explicit method
+!--------------------------------------------------------------------
+ loss(:,:,1) = ( + het_rates(:,:,6))* y(:,:,6)
+ prod(:,:,1) = 0._r8
+ end subroutine exp_prod_loss
+ subroutine imp_prod_loss( prod, loss, y, rxt, het_rates )
+ use ppgrid, only : pver
+ implicit none
+!--------------------------------------------------------------------
+! ... dummy args
+!--------------------------------------------------------------------
+ real(r8), dimension(:), intent(out) :: &
+ prod, &
+ loss
+ real(r8), intent(in) :: y(:)
+ real(r8), intent(in) :: rxt(:)
+ real(r8), intent(in) :: het_rates(:)
+!--------------------------------------------------------------------
+! ... loss and production for Implicit method
+!--------------------------------------------------------------------
+ loss(1) = ( + het_rates(1))* y(1)
+ prod(1) = 0._r8
+ loss(2) = ( + het_rates(2))* y(2)
+ prod(2) = 0._r8
+ loss(3) = ( + rxt(8) + het_rates(3))* y(3)
+ prod(3) = 0._r8
+ loss(4) = ( + rxt(9) + het_rates(4))* y(4)
+ prod(4) = 0._r8
+ loss(5) = ( + rxt(10) + het_rates(5))* y(5)
+ prod(5) = 0._r8
+ loss(6) = ( + rxt(11) + rxt(12) + rxt(14) + het_rates(7))* y(7)
+ prod(6) = 0._r8
+ loss(7) = ( + het_rates(8))* y(8)
+ prod(7) = 0._r8
+ loss(8) = ( + het_rates(9))* y(9)
+ prod(8) = 0._r8
+ loss(9) = ( + het_rates(10))* y(10)
+ prod(9) = 0._r8
+ loss(10) = ( + rxt(1) + rxt(5) + het_rates(11))* y(11)
+ prod(10) = 0._r8
+ loss(11) = ( + het_rates(12))* y(12)
+ prod(11) =rxt(13)*y(23)
+ loss(12) = ( + rxt(7) + het_rates(13))* y(13)
+ prod(12) = 0._r8
+ loss(13) = ( + het_rates(14))* y(14)
+ prod(13) = 0._r8
+ loss(14) = ( + het_rates(15))* y(15)
+ prod(14) = 0._r8
+ loss(15) = ( + het_rates(16))* y(16)
+ prod(15) = 0._r8
+ loss(16) = ( + het_rates(17))* y(17)
+ prod(16) = 0._r8
+ loss(17) = ( + het_rates(18))* y(18)
+ prod(17) = 0._r8
+ loss(18) = ( + het_rates(19))* y(19)
+ prod(18) = 0._r8
+ loss(19) = ( + het_rates(20))* y(20)
+ prod(19) = 0._r8
+ loss(20) = ( + het_rates(21))* y(21)
+ prod(20) = 0._r8
+ loss(21) = ( + het_rates(22))* y(22)
+ prod(21) = 0._r8
+ loss(22) = ( + rxt(13) + het_rates(23))* y(23)
+ prod(22) = (rxt(11) +rxt(12) +.500_r8*rxt(14))*y(7)
+ loss(23) = ( + het_rates(24))* y(24)
+ prod(23) = 0._r8
+ loss(24) = ( + het_rates(25))* y(25)
+ prod(24) = 0._r8
+ loss(25) = ( + het_rates(26))* y(26)
+ prod(25) = 0._r8
+ loss(26) = ( + rxt(2) + het_rates(27))* y(27)
+ prod(26) = 0._r8
+ loss(27) = ( + rxt(3) + het_rates(28))* y(28)
+ prod(27) = 0._r8
+ loss(28) = ( + rxt(15) + het_rates(29))* y(29)
+ prod(28) = 0._r8
+ loss(29) = ( + het_rates(30))* y(30)
+ prod(29) =rxt(15)*y(29)
+ loss(30) = ( + rxt(4) + het_rates(31))* y(31)
+ prod(30) =2.000_r8*rxt(10)*y(5) +rxt(5)*y(11)
+ end subroutine imp_prod_loss
+ end module mo_prod_loss
diff --git a/src/chemistry/pp_ghg_mam4/mo_rxt_rates_conv.F90 b/src/chemistry/pp_ghg_mam4/mo_rxt_rates_conv.F90
new file mode 100644
index 0000000000..0030b06714
--- /dev/null
+++ b/src/chemistry/pp_ghg_mam4/mo_rxt_rates_conv.F90
@@ -0,0 +1,27 @@
+module mo_rxt_rates_conv
+ use shr_kind_mod, only : r8 => shr_kind_r8
+ implicit none
+ private
+ public :: set_rates
+contains
+ subroutine set_rates( rxt_rates, sol, ncol )
+ real(r8), intent(inout) :: rxt_rates(:,:,:)
+ real(r8), intent(in) :: sol(:,:,:)
+ integer, intent(in) :: ncol
+ rxt_rates(:ncol,:, 1) = rxt_rates(:ncol,:, 1)*sol(:ncol,:, 11) ! rate_const*H2O2
+ rxt_rates(:ncol,:, 2) = rxt_rates(:ncol,:, 2)*sol(:ncol,:, 27) ! rate_const*soa_a1
+ rxt_rates(:ncol,:, 3) = rxt_rates(:ncol,:, 3)*sol(:ncol,:, 28) ! rate_const*soa_a2
+ rxt_rates(:ncol,:, 4) = rxt_rates(:ncol,:, 4)*sol(:ncol,:, 31) ! rate_const*H2O
+ rxt_rates(:ncol,:, 5) = rxt_rates(:ncol,:, 5)*sol(:ncol,:, 11) ! rate_const*OH*H2O2
+ ! rate_const
+ rxt_rates(:ncol,:, 7) = rxt_rates(:ncol,:, 7)*sol(:ncol,:, 13) ! rate_const*N2O
+ rxt_rates(:ncol,:, 8) = rxt_rates(:ncol,:, 8)*sol(:ncol,:, 3) ! rate_const*CFC11
+ rxt_rates(:ncol,:, 9) = rxt_rates(:ncol,:, 9)*sol(:ncol,:, 4) ! rate_const*CFC12
+ rxt_rates(:ncol,:, 10) = rxt_rates(:ncol,:, 10)*sol(:ncol,:, 5) ! rate_const*CH4
+ rxt_rates(:ncol,:, 11) = rxt_rates(:ncol,:, 11)*sol(:ncol,:, 7) ! rate_const*NO3*DMS
+ rxt_rates(:ncol,:, 12) = rxt_rates(:ncol,:, 12)*sol(:ncol,:, 7) ! rate_const*OH*DMS
+ rxt_rates(:ncol,:, 13) = rxt_rates(:ncol,:, 13)*sol(:ncol,:, 23) ! rate_const*OH*M*SO2
+ rxt_rates(:ncol,:, 14) = rxt_rates(:ncol,:, 14)*sol(:ncol,:, 7) ! rate_const*OH*DMS
+ rxt_rates(:ncol,:, 15) = rxt_rates(:ncol,:, 15)*sol(:ncol,:, 29) ! rate_const*SOAE
+ end subroutine set_rates
+end module mo_rxt_rates_conv
diff --git a/src/chemistry/pp_ghg_mam4/mo_setrxt.F90 b/src/chemistry/pp_ghg_mam4/mo_setrxt.F90
new file mode 100644
index 0000000000..6b94705faa
--- /dev/null
+++ b/src/chemistry/pp_ghg_mam4/mo_setrxt.F90
@@ -0,0 +1,85 @@
+
+ module mo_setrxt
+
+ use shr_kind_mod, only : r8 => shr_kind_r8
+
+ private
+ public :: setrxt
+ public :: setrxt_hrates
+
+ contains
+
+ subroutine setrxt( rate, temp, m, ncol )
+
+ use ppgrid, only : pver, pcols
+ use shr_kind_mod, only : r8 => shr_kind_r8
+ use chem_mods, only : rxntot
+ use mo_jpl, only : jpl
+
+ implicit none
+
+!-------------------------------------------------------
+! ... dummy arguments
+!-------------------------------------------------------
+ integer, intent(in) :: ncol
+ real(r8), intent(in) :: temp(pcols,pver)
+ real(r8), intent(in) :: m(ncol,pver)
+ real(r8), intent(inout) :: rate(ncol,pver,rxntot)
+
+!-------------------------------------------------------
+! ... local variables
+!-------------------------------------------------------
+ integer :: n
+ real(r8) :: itemp(ncol,pver)
+ real(r8) :: exp_fac(ncol,pver)
+ real(r8) :: ko(ncol,pver)
+ real(r8) :: kinf(ncol,pver)
+
+ rate(:,:,5) = 1.8e-12_r8
+ rate(:,:,15) = 1.157e-05_r8
+ itemp(:ncol,:) = 1._r8 / temp(:ncol,:)
+ n = ncol*pver
+ rate(:,:,11) = 1.9e-13_r8 * exp( 520._r8 * itemp(:,:) )
+ rate(:,:,12) = 1.1e-11_r8 * exp( -280._r8 * itemp(:,:) )
+
+ itemp(:,:) = 300._r8 * itemp(:,:)
+
+ ko(:,:) = 2.9e-31_r8 * itemp(:,:)**4.1_r8
+ kinf(:,:) = 1.7e-12_r8 * itemp(:,:)**(-0.2_r8)
+ call jpl( rate(1,1,13), m, 0.6_r8, ko, kinf, n )
+
+ end subroutine setrxt
+
+
+ subroutine setrxt_hrates( rate, temp, m, ncol, kbot )
+
+ use ppgrid, only : pver, pcols
+ use shr_kind_mod, only : r8 => shr_kind_r8
+ use chem_mods, only : rxntot
+ use mo_jpl, only : jpl
+
+ implicit none
+
+!-------------------------------------------------------
+! ... dummy arguments
+!-------------------------------------------------------
+ integer, intent(in) :: ncol
+ integer, intent(in) :: kbot
+ real(r8), intent(in) :: temp(pcols,pver)
+ real(r8), intent(in) :: m(ncol,pver)
+ real(r8), intent(inout) :: rate(ncol,pver,rxntot)
+
+!-------------------------------------------------------
+! ... local variables
+!-------------------------------------------------------
+ integer :: n
+ real(r8) :: itemp(ncol,kbot)
+ real(r8) :: exp_fac(ncol,kbot)
+ real(r8) :: ko(ncol,kbot)
+ real(r8) :: kinf(ncol,kbot)
+ real(r8) :: wrk(ncol,kbot)
+
+
+ end subroutine setrxt_hrates
+
+ end module mo_setrxt
diff --git a/src/chemistry/pp_ghg_mam4/mo_sim_dat.F90 b/src/chemistry/pp_ghg_mam4/mo_sim_dat.F90
new file mode 100644
index 0000000000..04177a1f6e
--- /dev/null
+++ b/src/chemistry/pp_ghg_mam4/mo_sim_dat.F90
@@ -0,0 +1,146 @@
+
+ module mo_sim_dat
+
+ private
+ public :: set_sim_dat
+
+ contains
+
+ subroutine set_sim_dat
+
+ use chem_mods, only : clscnt, cls_rxt_cnt, clsmap, permute, adv_mass, fix_mass, crb_mass
+ use chem_mods, only : diag_map
+ use chem_mods, only : phtcnt, rxt_tag_cnt, rxt_tag_lst, rxt_tag_map
+ use chem_mods, only : pht_alias_lst, pht_alias_mult
+ use chem_mods, only : extfrc_lst, inv_lst, slvd_lst
+ use chem_mods, only : enthalpy_cnt, cph_enthalpy, cph_rid, num_rnts, rxntot
+ use cam_abortutils,only : endrun
+ use mo_tracname, only : solsym
+ use chem_mods, only : frc_from_dataset
+ use chem_mods, only : is_scalar, is_vector
+ use shr_kind_mod, only : r8 => shr_kind_r8
+ use cam_logfile, only : iulog
+
+ implicit none
+
+!--------------------------------------------------------------
+! ... local variables
+!--------------------------------------------------------------
+ integer :: ios
+
+ is_scalar = .true.
+ is_vector = .false.
+
+ clscnt(:) = (/ 1, 0, 0, 30, 0 /)
+
+ cls_rxt_cnt(:,1) = (/ 0, 0, 0, 1 /)
+ cls_rxt_cnt(:,4) = (/ 1, 14, 0, 30 /)
+
+ solsym(: 31) = (/ 'bc_a1 ','bc_a4 ','CFC11 ','CFC12 ','CH4 ', &
+ 'CO2 ','DMS ','dst_a1 ','dst_a2 ','dst_a3 ', &
+ 'H2O2 ','H2SO4 ','N2O ','ncl_a1 ','ncl_a2 ', &
+ 'ncl_a3 ','num_a1 ','num_a2 ','num_a3 ','num_a4 ', &
+ 'pom_a1 ','pom_a4 ','SO2 ','so4_a1 ','so4_a2 ', &
+ 'so4_a3 ','soa_a1 ','soa_a2 ','SOAE ','SOAG ', &
+ 'H2O ' /)
+
+ adv_mass(: 31) = (/ 12.011000_r8, 12.011000_r8, 137.367503_r8, 120.913206_r8, 16.040600_r8, &
+ 44.009800_r8, 62.132400_r8, 135.064039_r8, 135.064039_r8, 135.064039_r8, &
+ 34.013600_r8, 98.078400_r8, 44.012880_r8, 58.442468_r8, 58.442468_r8, &
+ 58.442468_r8, 1.007400_r8, 1.007400_r8, 1.007400_r8, 1.007400_r8, &
+ 12.011000_r8, 12.011000_r8, 64.064800_r8, 115.107340_r8, 115.107340_r8, &
+ 115.107340_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, &
+ 18.014200_r8 /)
+
+ crb_mass(: 31) = (/ 12.011000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, &
+ 12.011000_r8, 24.022000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, &
+ 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, &
+ 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, &
+ 12.011000_r8, 12.011000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, &
+ 0.000000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, &
+ 0.000000_r8 /)
+
+ fix_mass(: 8) = (/ 0.00000000_r8, 31.9988000_r8, 28.0134800_r8, 33.0062000_r8, 17.0068000_r8, &
+ 62.0049400_r8, 47.9982000_r8, 137.367503_r8 /)
+
+ clsmap(: 1,1) = (/ 6 /)
+ clsmap(: 30,4) = (/ 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, &
+ 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, &
+ 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 /)
+
+ permute(: 30,4) = (/ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, &
+ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, &
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 /)
+
+ diag_map(: 30) = (/ 1, 2, 3, 4, 5, 7, 9, 10, 11, 12, &
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, &
+ 24, 26, 27, 28, 29, 30, 31, 32, 34, 35 /)
+
+ extfrc_lst(: 11) = (/ 'bc_a1 ','bc_a4 ','H2O ','num_a1 ','num_a2 ', &
+ 'num_a4 ','pom_a1 ','pom_a4 ','SO2 ','so4_a1 ', &
+ 'so4_a2 ' /)
+
+ frc_from_dataset(: 11) = (/ .true., .true., .true., .true., .true., &
+ .true., .true., .true., .true., .true., &
+ .true. /)
+
+ inv_lst(: 8) = (/ 'M ', 'O2 ', 'N2 ', 'HO2 ', 'OH ', &
+ 'NO3 ', 'O3 ', 'HALONS ' /)
+
+ if( allocated( rxt_tag_lst ) ) then
+ deallocate( rxt_tag_lst )
+ end if
+ allocate( rxt_tag_lst(rxt_tag_cnt),stat=ios )
+ if( ios /= 0 ) then
+ write(iulog,*) 'set_sim_dat: failed to allocate rxt_tag_lst; error = ',ios
+ call endrun
+ end if
+ if( allocated( rxt_tag_map ) ) then
+ deallocate( rxt_tag_map )
+ end if
+ allocate( rxt_tag_map(rxt_tag_cnt),stat=ios )
+ if( ios /= 0 ) then
+ write(iulog,*) 'set_sim_dat: failed to allocate rxt_tag_map; error = ',ios
+ call endrun
+ end if
+ rxt_tag_lst( 1: 15) = (/ 'jh2o2 ', 'jsoa_a1 ', &
+ 'jsoa_a2 ', 'lyman_alpha ', &
+ 'OH_H2O2 ', 'usr_HO2_HO2 ', &
+ 'n2o_loss ', 'cfc11_loss ', &
+ 'cfc12_loss ', 'ch4_loss ', &
+ 'DMS_NO3 ', 'DMS_OHa ', &
+ 'SO2_OH_M ', 'usr_DMS_OH ', &
+ 'SOAE_tau ' /)
+ rxt_tag_map(:rxt_tag_cnt) = (/ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, &
+ 11, 12, 13, 14, 15 /)
+ if( allocated( pht_alias_lst ) ) then
+ deallocate( pht_alias_lst )
+ end if
+ allocate( pht_alias_lst(phtcnt,2),stat=ios )
+ if( ios /= 0 ) then
+ write(iulog,*) 'set_sim_dat: failed to allocate pht_alias_lst; error = ',ios
+ call endrun
+ end if
+ if( allocated( pht_alias_mult ) ) then
+ deallocate( pht_alias_mult )
+ end if
+ allocate( pht_alias_mult(phtcnt,2),stat=ios )
+ if( ios /= 0 ) then
+ write(iulog,*) 'set_sim_dat: failed to allocate pht_alias_mult; error = ',ios
+ call endrun
+ end if
+ pht_alias_lst(:,1) = (/ ' ', ' ', ' ' /)
+ pht_alias_lst(:,2) = (/ ' ', 'jno2 ', 'jno2 ' /)
+ pht_alias_mult(:,1) = (/ 1._r8, 1._r8, 1._r8 /)
+ pht_alias_mult(:,2) = (/ 1._r8, .0004_r8, .0004_r8 /)
+ allocate( num_rnts(rxntot-phtcnt),stat=ios )
+ if( ios /= 0 ) then
+ write(iulog,*) 'set_sim_dat: failed to allocate num_rnts; error = ',ios
+ call endrun
+ end if
+ num_rnts(:) = (/ 1, 2, 2, 1, 1, 1, 1, 2, 2, 3, &
+ 2, 1 /)
+
+ end subroutine set_sim_dat
+
+ end module mo_sim_dat
diff --git a/src/chemistry/pp_none/chemistry.F90 b/src/chemistry/pp_none/chemistry.F90
index bdb8c9ae0b..7e67fadb6e 100644
--- a/src/chemistry/pp_none/chemistry.F90
+++ b/src/chemistry/pp_none/chemistry.F90
@@ -222,13 +222,15 @@ subroutine chem_reset_fluxes( fptr, cam_in )
end subroutine chem_reset_fluxes
!================================================================================
- subroutine chem_emissions( state, cam_in )
+ subroutine chem_emissions( state, cam_in, pbuf )
use camsrfexch, only: cam_in_t
+ use physics_buffer, only: physics_buffer_desc
! Arguments:
type(physics_state), intent(in) :: state ! Physics state variables
type(cam_in_t), intent(inout) :: cam_in ! import state
+ type(physics_buffer_desc), pointer :: pbuf(:) ! Physics buffer in chunk, for HEMCO
end subroutine chem_emissions
end module chemistry
diff --git a/src/chemistry/pp_terminator/chemistry.F90 b/src/chemistry/pp_terminator/chemistry.F90
index 20d24047a5..11fbf5e0c9 100644
--- a/src/chemistry/pp_terminator/chemistry.F90
+++ b/src/chemistry/pp_terminator/chemistry.F90
@@ -419,13 +419,15 @@ subroutine chem_reset_fluxes( fptr, cam_in )
end subroutine chem_reset_fluxes
!================================================================================
- subroutine chem_emissions( state, cam_in )
+ subroutine chem_emissions( state, cam_in, pbuf )
use camsrfexch, only: cam_in_t
+ use physics_buffer, only: physics_buffer_desc
! Arguments:
type(physics_state), intent(in) :: state ! Physics state variables
type(cam_in_t), intent(inout) :: cam_in ! import state
+ type(physics_buffer_desc), pointer :: pbuf(:) ! Physics buffer in chunk, for HEMCO
end subroutine chem_emissions
diff --git a/src/chemistry/pp_waccm_ma_mam5/chem_mech.doc b/src/chemistry/pp_waccm_ma_mam5/chem_mech.doc
index 9a7379e5b2..5712d4ca8a 100644
--- a/src/chemistry/pp_waccm_ma_mam5/chem_mech.doc
+++ b/src/chemistry/pp_waccm_ma_mam5/chem_mech.doc
@@ -72,37 +72,38 @@
( 69) O
( 70) O2
( 71) O3
- ( 72) OCLO (OClO)
- ( 73) OCS (OCS)
- ( 74) pom_a1 (C)
- ( 75) pom_a4 (C)
- ( 76) S (S)
- ( 77) SF6
- ( 78) SO (SO)
- ( 79) SO2
- ( 80) SO3 (SO3)
- ( 81) so4_a1 (NH4HSO4)
- ( 82) so4_a2 (NH4HSO4)
- ( 83) so4_a3 (NH4HSO4)
- ( 84) so4_a5 (NH4HSO4)
- ( 85) soa_a1 (C)
- ( 86) soa_a2 (C)
- ( 87) SOAG (C)
- ( 88) e (E)
- ( 89) HO2
- ( 90) N2D (N)
- ( 91) N2p (N2)
- ( 92) NOp (NO)
- ( 93) Np (N)
- ( 94) O1D (O)
- ( 95) O2_1D (O2)
- ( 96) O2_1S (O2)
- ( 97) O2p (O2)
- ( 98) OH
- ( 99) Op (O)
- (100) Op2D (O)
- (101) Op2P (O)
- (102) H2O
+ ( 72) O3S (O3)
+ ( 73) OCLO (OClO)
+ ( 74) OCS (OCS)
+ ( 75) pom_a1 (C)
+ ( 76) pom_a4 (C)
+ ( 77) S (S)
+ ( 78) SF6
+ ( 79) SO (SO)
+ ( 80) SO2
+ ( 81) SO3 (SO3)
+ ( 82) so4_a1 (NH4HSO4)
+ ( 83) so4_a2 (NH4HSO4)
+ ( 84) so4_a3 (NH4HSO4)
+ ( 85) so4_a5 (NH4HSO4)
+ ( 86) soa_a1 (C)
+ ( 87) soa_a2 (C)
+ ( 88) SOAG (C)
+ ( 89) e (E)
+ ( 90) HO2
+ ( 91) N2D (N)
+ ( 92) N2p (N2)
+ ( 93) NOp (NO)
+ ( 94) Np (N)
+ ( 95) O1D (O)
+ ( 96) O2_1D (O2)
+ ( 97) O2_1S (O2)
+ ( 98) O2p (O2)
+ ( 99) OH
+ (100) Op (O)
+ (101) Op2D (O)
+ (102) Op2P (O)
+ (103) H2O
Invariant species
@@ -116,6 +117,9 @@
Class List
==========
+ Explicit
+ --------
+ ( 1) O3S
Implicit
--------
@@ -762,6 +766,7 @@ Extraneous prod/loss species
d(O3)/dt = r19*M*O*O2
- j7*O3 - j8*O3 - r8*O1D*O3 - r17*O*O3 - r27*HO2*O3 - r28*H*O3 - r33*OH*O3 - r46*NO2*O3
- r54*NO*O3 - r70*CL*O3 - r102*BR*O3 - r161*S*O3 - r167*SO*O3
+ d(O3S)/dt = 0
d(OCLO)/dt = r74*CLO*CLO + r104*BRO*CLO
- j59*OCLO - r168*SO*OCLO
d(OCS)/dt = - j88*OCS - r157*O*OCS - r158*OH*OCS
diff --git a/src/chemistry/pp_waccm_ma_mam5/chem_mech.in b/src/chemistry/pp_waccm_ma_mam5/chem_mech.in
index 9d69d3a4f2..8443364166 100644
--- a/src/chemistry/pp_waccm_ma_mam5/chem_mech.in
+++ b/src/chemistry/pp_waccm_ma_mam5/chem_mech.in
@@ -81,6 +81,7 @@
O,
O2,
O3,
+ O3S -> O3,
OCLO -> OClO,
OCS -> OCS,
pom_a1 -> C,
@@ -147,7 +148,7 @@
Solution classes
Explicit
-
+ O3S
End Explicit
Implicit
@@ -263,398 +264,398 @@
*********************************
*** odd-oxygen
*********************************
-[jh2o_b] H2O + hv -> H2 + O1D
-[jh2o_c] H2O + hv -> 2*H + O
-[jh2o_a] H2O + hv -> OH + H
-[jh2o2] H2O2 + hv -> 2*OH
-[jo2_b=userdefined,] O2 + hv -> 2*O
-[jo2_a=userdefined,] O2 + hv -> O + O1D
-[jo3_a] O3 + hv -> O1D + O2_1D
-[jo3_b] O3 + hv -> O + O2
+[jh2o_b] H2O + hv -> H2 + O1D
+[jh2o_c] H2O + hv -> 2*H + O
+[jh2o_a] H2O + hv -> OH + H
+[jh2o2] H2O2 + hv -> 2*OH
+[jo2_b=userdefined,] O2 + hv -> 2*O
+[jo2_a=userdefined,] O2 + hv -> O + O1D
+[jo3_a] O3 + hv -> O1D + O2_1D
+[jo3_b] O3 + hv -> O + O2
*********************************
*** odd-nitrogen
*********************************
-[jhno3] HNO3 + hv -> NO2 + OH
-[jho2no2_a] HO2NO2 + hv -> OH + NO3
-[jho2no2_b] HO2NO2 + hv -> NO2 + HO2
-[jn2o] N2O + hv -> O1D + N2
-[jn2o5_a] N2O5 + hv -> NO2 + NO3
-[jn2o5_b] N2O5 + hv -> NO + O + NO3
-[jno=userdefined,] NO + hv -> N + O
-[jno_i] NO + hv -> NOp + e
-[jno2] NO2 + hv -> NO + O
-[jno3_a] NO3 + hv -> NO2 + O
-[jno3_b] NO3 + hv -> NO + O2
+[jhno3] HNO3 + hv -> NO2 + OH
+[jho2no2_a] HO2NO2 + hv -> OH + NO3
+[jho2no2_b] HO2NO2 + hv -> NO2 + HO2
+[jn2o] N2O + hv -> O1D + N2
+[jn2o5_a] N2O5 + hv -> NO2 + NO3
+[jn2o5_b] N2O5 + hv -> NO + O + NO3
+[jno=userdefined,] NO + hv -> N + O
+[jno_i] NO + hv -> NOp + e
+[jno2] NO2 + hv -> NO + O
+[jno3_a] NO3 + hv -> NO2 + O
+[jno3_b] NO3 + hv -> NO + O2
*********************************
*** organics
*********************************
-[jch2o_a] CH2O + hv -> CO + 2*H
-[jch2o_b] CH2O + hv -> CO + H2
-[jch3ooh] CH3OOH + hv -> CH2O + H + OH
-[jch4_a] CH4 + hv -> H + CH3O2
-[jch4_b] CH4 + hv -> 1.44*H2 + 0.18*CH2O + 0.18*O + 0.33*OH + 0.33*H + 0.44*CO2 + 0.38*CO + 0.05*H2O
-[jco2] CO2 + hv -> CO + O
+[jch2o_a] CH2O + hv -> CO + 2*H
+[jch2o_b] CH2O + hv -> CO + H2
+[jch3ooh] CH3OOH + hv -> CH2O + H + OH
+[jch4_a] CH4 + hv -> H + CH3O2
+[jch4_b] CH4 + hv -> 1.44*H2 + 0.18*CH2O + 0.18*O + 0.33*OH + 0.33*H + 0.44*CO2 + 0.38*CO + 0.05*H2O
+[jco2] CO2 + hv -> CO + O
*********************************
*** halogens
*********************************
-[jbrcl] BRCL + hv -> BR + CL
-[jbro] BRO + hv -> BR + O
-[jbrono2_b] BRONO2 + hv -> BRO + NO2
-[jbrono2_a] BRONO2 + hv -> BR + NO3
-[jccl4] CCL4 + hv -> 4*CL
-[jcf2clbr] CF2CLBR + hv -> BR + CL + COF2
-[jcf3br] CF3BR + hv -> BR + F + COF2
-[jcfcl3] CFC11 + hv -> 2*CL + COFCL
-[jcfc113] CFC113 + hv -> 2*CL + COFCL + COF2
-[jcfc114] CFC114 + hv -> 2*CL + 2*COF2
-[jcfc115] CFC115 + hv -> CL + F + 2*COF2
-[jcf2cl2] CFC12 + hv -> 2*CL + COF2
-[jch2br2] CH2BR2 + hv -> 2*BR
-[jch3br] CH3BR + hv -> BR + CH3O2
-[jch3ccl3] CH3CCL3 + hv -> 3*CL
-[jch3cl] CH3CL + hv -> CL + CH3O2
-[jchbr3] CHBR3 + hv -> 3*BR
-[jcl2] CL2 + hv -> 2*CL
-[jcl2o2] CL2O2 + hv -> 2*CL
-[jclo] CLO + hv -> CL + O
-[jclono2_a] CLONO2 + hv -> CL + NO3
-[jclono2_b] CLONO2 + hv -> CLO + NO2
-[jcof2] COF2 + hv -> 2*F
-[jcofcl] COFCL + hv -> F + CL
-[jh2402] H2402 + hv -> 2*BR + 2*COF2
-[jhbr] HBR + hv -> BR + H
-[jhcfc141b] HCFC141B + hv -> CL + COFCL
-[jhcfc142b] HCFC142B + hv -> CL + COF2
-[jhcfc22] HCFC22 + hv -> CL + COF2
-[jhcl] HCL + hv -> H + CL
-[jhf] HF + hv -> H + F
-[jhobr] HOBR + hv -> BR + OH
-[jhocl] HOCL + hv -> OH + CL
-[joclo] OCLO + hv -> O + CLO
-[jsf6] SF6 + hv -> sink
+[jbrcl] BRCL + hv -> BR + CL
+[jbro] BRO + hv -> BR + O
+[jbrono2_b] BRONO2 + hv -> BRO + NO2
+[jbrono2_a] BRONO2 + hv -> BR + NO3
+[jccl4] CCL4 + hv -> 4*CL
+[jcf2clbr] CF2CLBR + hv -> BR + CL + COF2
+[jcf3br] CF3BR + hv -> BR + F + COF2
+[jcfcl3] CFC11 + hv -> 2*CL + COFCL
+[jcfc113] CFC113 + hv -> 2*CL + COFCL + COF2
+[jcfc114] CFC114 + hv -> 2*CL + 2*COF2
+[jcfc115] CFC115 + hv -> CL + F + 2*COF2
+[jcf2cl2] CFC12 + hv -> 2*CL + COF2
+[jch2br2] CH2BR2 + hv -> 2*BR
+[jch3br] CH3BR + hv -> BR + CH3O2
+[jch3ccl3] CH3CCL3 + hv -> 3*CL
+[jch3cl] CH3CL + hv -> CL + CH3O2
+[jchbr3] CHBR3 + hv -> 3*BR
+[jcl2] CL2 + hv -> 2*CL
+[jcl2o2] CL2O2 + hv -> 2*CL
+[jclo] CLO + hv -> CL + O
+[jclono2_a] CLONO2 + hv -> CL + NO3
+[jclono2_b] CLONO2 + hv -> CLO + NO2
+[jcof2] COF2 + hv -> 2*F
+[jcofcl] COFCL + hv -> F + CL
+[jh2402] H2402 + hv -> 2*BR + 2*COF2
+[jhbr] HBR + hv -> BR + H
+[jhcfc141b] HCFC141B + hv -> CL + COFCL
+[jhcfc142b] HCFC142B + hv -> CL + COF2
+[jhcfc22] HCFC22 + hv -> CL + COF2
+[jhcl] HCL + hv -> H + CL
+[jhf] HF + hv -> H + F
+[jhobr] HOBR + hv -> BR + OH
+[jhocl] HOCL + hv -> OH + CL
+[joclo] OCLO + hv -> O + CLO
+[jsf6] SF6 + hv -> sink
*********************************
*** ions
*********************************
-[jeuv_26=userdefined,userdefined] CO2 + hv -> CO + O
-[jeuv_4=userdefined,userdefined] N + hv -> Np + e
-[jeuv_6=userdefined,userdefined] N2 + hv -> N2p + e
-[jeuv_22=userdefined,userdefined] N2 + hv -> N + Np + e
-[jeuv_23=userdefined,userdefined] N2 + hv -> N2D + Np + e
-[jeuv_25=userdefined,userdefined] N2 + hv -> 1.2*N2D + 0.8*N
-[jeuv_18=userdefined,userdefined] N2 + hv -> N2p + e
-[jeuv_13=userdefined,userdefined] N2 + hv -> 1.2*N2D + 0.8*N
-[jeuv_11=userdefined,userdefined] N2 + hv -> N2D + Np + e
-[jeuv_10=userdefined,userdefined] N2 + hv -> N + Np + e
-[jeuv_3=userdefined,userdefined] O + hv -> Op2P + e
-[jeuv_16=userdefined,userdefined] O + hv -> Op2P + e
-[jeuv_1=userdefined,userdefined] O + hv -> Op + e
-[jeuv_14=userdefined,userdefined] O + hv -> Op + e
-[jeuv_2=userdefined,userdefined] O + hv -> Op2D + e
-[jeuv_15=userdefined,userdefined] O + hv -> Op2D + e
-[jeuv_21=userdefined,userdefined] O2 + hv -> O + Op2P + e
-[jeuv_17=userdefined,userdefined] O2 + hv -> O2p + e
-[jeuv_7=userdefined,userdefined] O2 + hv -> O + Op + e
-[jeuv_5=userdefined,userdefined] O2 + hv -> O2p + e
-[jeuv_19=userdefined,userdefined] O2 + hv -> O + Op + e
-[jeuv_24=userdefined,userdefined] O2 + hv -> 2*O
-[jeuv_12=userdefined,userdefined] O2 + hv -> 2*O
-[jeuv_9=userdefined,userdefined] O2 + hv -> O + Op2P + e
-[jeuv_8=userdefined,userdefined] O2 + hv -> O + Op2D + e
-[jeuv_20=userdefined,userdefined] O2 + hv -> O + Op2D + e
+[jeuv_26=userdefined,userdefined] CO2 + hv -> CO + O
+[jeuv_4=userdefined,userdefined] N + hv -> Np + e
+[jeuv_6=userdefined,userdefined] N2 + hv -> N2p + e
+[jeuv_22=userdefined,userdefined] N2 + hv -> N + Np + e
+[jeuv_23=userdefined,userdefined] N2 + hv -> N2D + Np + e
+[jeuv_25=userdefined,userdefined] N2 + hv -> 1.2*N2D + 0.8*N
+[jeuv_18=userdefined,userdefined] N2 + hv -> N2p + e
+[jeuv_13=userdefined,userdefined] N2 + hv -> 1.2*N2D + 0.8*N
+[jeuv_11=userdefined,userdefined] N2 + hv -> N2D + Np + e
+[jeuv_10=userdefined,userdefined] N2 + hv -> N + Np + e
+[jeuv_3=userdefined,userdefined] O + hv -> Op2P + e
+[jeuv_16=userdefined,userdefined] O + hv -> Op2P + e
+[jeuv_1=userdefined,userdefined] O + hv -> Op + e
+[jeuv_14=userdefined,userdefined] O + hv -> Op + e
+[jeuv_2=userdefined,userdefined] O + hv -> Op2D + e
+[jeuv_15=userdefined,userdefined] O + hv -> Op2D + e
+[jeuv_21=userdefined,userdefined] O2 + hv -> O + Op2P + e
+[jeuv_17=userdefined,userdefined] O2 + hv -> O2p + e
+[jeuv_7=userdefined,userdefined] O2 + hv -> O + Op + e
+[jeuv_5=userdefined,userdefined] O2 + hv -> O2p + e
+[jeuv_19=userdefined,userdefined] O2 + hv -> O + Op + e
+[jeuv_24=userdefined,userdefined] O2 + hv -> 2*O
+[jeuv_12=userdefined,userdefined] O2 + hv -> 2*O
+[jeuv_9=userdefined,userdefined] O2 + hv -> O + Op2P + e
+[jeuv_8=userdefined,userdefined] O2 + hv -> O + Op2D + e
+[jeuv_20=userdefined,userdefined] O2 + hv -> O + Op2D + e
*********************************
*** sulfur
*********************************
-[jh2so4] H2SO4 + hv -> SO3 + H2O
-[jocs] OCS + hv -> S + CO
-[jso] SO + hv -> S + O
-[jso2] SO2 + hv -> SO + O
-[jso3] SO3 + hv -> SO2 + O
+[jh2so4] H2SO4 + hv -> SO3 + H2O
+[jocs] OCS + hv -> S + CO
+[jso] SO + hv -> S + O
+[jso2] SO2 + hv -> SO + O
+[jso3] SO3 + hv -> SO2 + O
End Photolysis
Reactions
*********************************
*** odd-oxygen
*********************************
-[ag1] O2_1D -> O2 ; 0.000258
-[ag2] O2_1S -> O2 ; 0.085
-[O1D_H2] O1D + H2 -> H + OH ; 1.2e-10
-[O1D_H2O] O1D + H2O -> 2*OH ; 1.63e-10, 60
-[O1D_N2,cph=189.81] O1D + N2 -> O + N2 ; 2.15e-11, 110
-[O1D_O2,cph=32.91] O1D + O2 -> O + O2_1S ; 2.64e-11, 55
-[O1D_O2b,cph=189.81] O1D + O2 -> O + O2 ; 6.6e-12, 55
-[O1D_O3] O1D + O3 -> O2 + O2 ; 1.2e-10
-[O2_1D_N2,cph=94.3] O2_1D + N2 -> O2 + N2 ; 1e-20
-[O2_1D_O,cph=94.3] O2_1D + O -> O2 + O ; 1.3e-16
-[O2_1D_O2,cph=94.3] O2_1D + O2 -> 2*O2 ; 3.6e-18, -220
-[O2_1S_CO2] O2_1S + CO2 -> O2_1D + CO2 ; 4.2e-13
-[O2_1S_N2,cph=62.6] O2_1S + N2 -> O2_1D + N2 ; 1.8e-15, 45
-[O2_1S_O,cph=62.6] O2_1S + O -> O2_1D + O ; 8e-14
-[O2_1S_O2,cph=62.6] O2_1S + O2 -> O2_1D + O2 ; 3.9e-17
-[O2_1S_O3,cph=62.6] O2_1S + O3 -> O2_1D + O3 ; 3.5e-11, -135
-[O_O3,cph=392.19] O + O3 -> 2*O2 ; 8e-12, -2060
-[usr_O_O,cph=493.58] O + O + M -> O2 + M
-[usr_O_O2,cph=101.39] O + O2 + M -> O3 + M
+[ag1] O2_1D -> O2 ; 0.000258
+[ag2] O2_1S -> O2 ; 0.085
+[O1D_H2] O1D + H2 -> H + OH ; 1.2e-10
+[O1D_H2O] O1D + H2O -> 2*OH ; 1.63e-10, 60
+[O1D_N2,cph=189.81] O1D + N2 -> O + N2 ; 2.15e-11, 110
+[O1D_O2,cph=32.91] O1D + O2 -> O + O2_1S ; 2.64e-11, 55
+[O1D_O2b,cph=189.81] O1D + O2 -> O + O2 ; 6.6e-12, 55
+[O1D_O3] O1D + O3 -> O2 + O2 ; 1.2e-10
+[O2_1D_N2,cph=94.3] O2_1D + N2 -> O2 + N2 ; 1e-20
+[O2_1D_O,cph=94.3] O2_1D + O -> O2 + O ; 1.3e-16
+[O2_1D_O2,cph=94.3] O2_1D + O2 -> 2*O2 ; 3.6e-18, -220
+[O2_1S_CO2] O2_1S + CO2 -> O2_1D + CO2 ; 4.2e-13
+[O2_1S_N2,cph=62.6] O2_1S + N2 -> O2_1D + N2 ; 1.8e-15, 45
+[O2_1S_O,cph=62.6] O2_1S + O -> O2_1D + O ; 8e-14
+[O2_1S_O2,cph=62.6] O2_1S + O2 -> O2_1D + O2 ; 3.9e-17
+[O2_1S_O3,cph=62.6] O2_1S + O3 -> O2_1D + O3 ; 3.5e-11, -135
+[O_O3,cph=392.19] O + O3 -> 2*O2 ; 8e-12, -2060
+[usr_O_O,cph=493.58] O + O + M -> O2 + M
+[usr_O_O2,cph=101.39] O + O2 + M -> O3 + M
*********************************
*** odd-hydrogen
*********************************
-[H2_O] H2 + O -> OH + H ; 1.6e-11, -4570
-[H2O2_O] H2O2 + O -> OH + HO2 ; 1.4e-12, -2000
-[H_HO2,cph=232.59] H + HO2 -> H2 + O2 ; 6.9e-12
-[H_HO2a] H + HO2 -> 2*OH ; 7.2e-11
-[H_HO2b] H + HO2 -> H2O + O ; 1.6e-12
-[H_O2,cph=203.4] H + O2 + M -> HO2 + M ; 5.3e-32, 1.8, 9.5e-11, -0.4, 0.6
-[HO2_O,cph=226.58] HO2 + O -> OH + O2 ; 3e-11, 200
-[HO2_O3,cph=120.1] HO2 + O3 -> OH + 2*O2 ; 1e-14, -490
-[H_O3,cph=194.71] H + O3 -> OH + O2 ; 1.4e-10, -470
-[OH_H2] OH + H2 -> H2O + H ; 2.8e-12, -1800
-[OH_H2O2] OH + H2O2 -> H2O + HO2 ; 1.8e-12
-[OH_HO2,cph=293.62] OH + HO2 -> H2O + O2 ; 4.8e-11, 250
-[OH_O,cph=67.67] OH + O -> H + O2 ; 1.8e-11, 180
-[OH_O3,cph=165.3] OH + O3 -> HO2 + O2 ; 1.7e-12, -940
-[OH_OH] OH + OH -> H2O + O ; 1.8e-12
-[OH_OH_M] OH + OH + M -> H2O2 + M ; 6.9e-31, 1, 2.6e-11, 0, 0.6
-[usr_HO2_HO2,cph=165.51] HO2 + HO2 -> H2O2 + O2
+[H2_O] H2 + O -> OH + H ; 1.6e-11, -4570
+[H2O2_O] H2O2 + O -> OH + HO2 ; 1.4e-12, -2000
+[H_HO2,cph=232.59] H + HO2 -> H2 + O2 ; 6.9e-12
+[H_HO2a] H + HO2 -> 2*OH ; 7.2e-11
+[H_HO2b] H + HO2 -> H2O + O ; 1.6e-12
+[H_O2,cph=203.4] H + O2 + M -> HO2 + M ; 5.3e-32, 1.8, 9.5e-11, -0.4, 0.6
+[HO2_O,cph=226.58] HO2 + O -> OH + O2 ; 3e-11, 200
+[HO2_O3,cph=120.1] HO2 + O3 -> OH + 2*O2 ; 1e-14, -490
+[H_O3,cph=194.71] H + O3 -> OH + O2 ; 1.4e-10, -470
+[OH_H2] OH + H2 -> H2O + H ; 2.8e-12, -1800
+[OH_H2O2] OH + H2O2 -> H2O + HO2 ; 1.8e-12
+[OH_HO2,cph=293.62] OH + HO2 -> H2O + O2 ; 4.8e-11, 250
+[OH_O,cph=67.67] OH + O -> H + O2 ; 1.8e-11, 180
+[OH_O3,cph=165.3] OH + O3 -> HO2 + O2 ; 1.7e-12, -940
+[OH_OH] OH + OH -> H2O + O ; 1.8e-12
+[OH_OH_M] OH + OH + M -> H2O2 + M ; 6.9e-31, 1, 2.6e-11, 0, 0.6
+[usr_HO2_HO2,cph=165.51] HO2 + HO2 -> H2O2 + O2
*********************************
*** odd-nitrogen
*********************************
-[HO2NO2_OH] HO2NO2 + OH -> H2O + NO2 + O2 ; 4.5e-13, 610
-[N2D_O,cph=229.61] N2D + O -> N + O ; 7e-13
-[N2D_O2,cph=177.51] N2D + O2 -> NO + O1D ; 5e-12
-[N_NO,cph=313.75] N + NO -> N2 + O ; 2.1e-11, 100
-[N_NO2a] N + NO2 -> N2O + O ; 2.9e-12, 220
-[N_NO2b] N + NO2 -> 2*NO ; 1.45e-12, 220
-[N_NO2c] N + NO2 -> N2 + O2 ; 1.45e-12, 220
-[N_O2,cph=133.75] N + O2 -> NO + O ; 3.3e-12, -3150
-[NO2_O,cph=193.02] NO2 + O -> NO + O2 ; 5.1e-12, 210
-[NO2_O3] NO2 + O3 -> NO3 + O2 ; 1.2e-13, -2450
-[NO2_O_M] NO2 + O + M -> NO3 + M ; 2.5e-31, 1.8, 2.2e-11, 0.7, 0.6
-[NO3_HO2] NO3 + HO2 -> OH + NO2 + O2 ; 3.5e-12
-[NO3_NO] NO3 + NO -> 2*NO2 ; 1.7e-11, 125
-[NO3_O] NO3 + O -> NO2 + O2 ; 1.3e-11
-[NO3_OH] NO3 + OH -> HO2 + NO2 ; 2.2e-11
-[N_OH] N + OH -> NO + H ; 5e-11
-[NO_HO2,cph=34.47] NO + HO2 -> NO2 + OH ; 3.44e-12, 260
-[NO_O3,cph=199.17] NO + O3 -> NO2 + O2 ; 3e-12, -1500
-[NO_O_M] NO + O + M -> NO2 + M ; 9e-32, 1.5, 3e-11, 0, 0.6
-[O1D_N2Oa] O1D + N2O -> 2*NO ; 7.26e-11, 20
-[O1D_N2Ob] O1D + N2O -> N2 + O2 ; 4.64e-11, 20
-[tag_NO2_HO2] NO2 + HO2 + M -> HO2NO2 + M ; 1.9e-31, 3.4, 4e-12, 0.3, 0.6
-[tag_NO2_NO3] NO2 + NO3 + M -> N2O5 + M ; 2.4e-30, 3, 1.6e-12, -0.1, 0.6
-[tag_NO2_OH] NO2 + OH + M -> HNO3 + M ; 1.8e-30, 3, 2.8e-11, 0, 0.6
-[usr_HNO3_OH] HNO3 + OH -> NO3 + H2O
-[usr_HO2NO2_M] HO2NO2 + M -> HO2 + NO2 + M
-[usr_N2O5_M] N2O5 + M -> NO2 + NO3 + M
+[HO2NO2_OH] HO2NO2 + OH -> H2O + NO2 + O2 ; 4.5e-13, 610
+[N2D_O,cph=229.61] N2D + O -> N + O ; 7e-13
+[N2D_O2,cph=177.51] N2D + O2 -> NO + O1D ; 5e-12
+[N_NO,cph=313.75] N + NO -> N2 + O ; 2.1e-11, 100
+[N_NO2a] N + NO2 -> N2O + O ; 2.9e-12, 220
+[N_NO2b] N + NO2 -> 2*NO ; 1.45e-12, 220
+[N_NO2c] N + NO2 -> N2 + O2 ; 1.45e-12, 220
+[N_O2,cph=133.75] N + O2 -> NO + O ; 3.3e-12, -3150
+[NO2_O,cph=193.02] NO2 + O -> NO + O2 ; 5.1e-12, 210
+[NO2_O3] NO2 + O3 -> NO3 + O2 ; 1.2e-13, -2450
+[NO2_O_M] NO2 + O + M -> NO3 + M ; 2.5e-31, 1.8, 2.2e-11, 0.7, 0.6
+[NO3_HO2] NO3 + HO2 -> OH + NO2 + O2 ; 3.5e-12
+[NO3_NO] NO3 + NO -> 2*NO2 ; 1.7e-11, 125
+[NO3_O] NO3 + O -> NO2 + O2 ; 1.3e-11
+[NO3_OH] NO3 + OH -> HO2 + NO2 ; 2.2e-11
+[N_OH] N + OH -> NO + H ; 5e-11
+[NO_HO2,cph=34.47] NO + HO2 -> NO2 + OH ; 3.44e-12, 260
+[NO_O3,cph=199.17] NO + O3 -> NO2 + O2 ; 3e-12, -1500
+[NO_O_M] NO + O + M -> NO2 + M ; 9e-32, 1.5, 3e-11, 0, 0.6
+[O1D_N2Oa] O1D + N2O -> 2*NO ; 7.26e-11, 20
+[O1D_N2Ob] O1D + N2O -> N2 + O2 ; 4.64e-11, 20
+[tag_NO2_HO2] NO2 + HO2 + M -> HO2NO2 + M ; 1.9e-31, 3.4, 4e-12, 0.3, 0.6
+[tag_NO2_NO3] NO2 + NO3 + M -> N2O5 + M ; 2.4e-30, 3, 1.6e-12, -0.1, 0.6
+[tag_NO2_OH] NO2 + OH + M -> HNO3 + M ; 1.8e-30, 3, 2.8e-11, 0, 0.6
+[usr_HNO3_OH] HNO3 + OH -> NO3 + H2O
+[usr_HO2NO2_M] HO2NO2 + M -> HO2 + NO2 + M
+[usr_N2O5_M] N2O5 + M -> NO2 + NO3 + M
*********************************
*** odd-chlorine
*********************************
-[CL_CH2O] CL + CH2O -> HCL + HO2 + CO ; 8.1e-11, -30
-[CL_CH4] CL + CH4 -> CH3O2 + HCL ; 7.1e-12, -1270
-[CL_H2] CL + H2 -> HCL + H ; 3.05e-11, -2270
-[CL_H2O2] CL + H2O2 -> HCL + HO2 ; 1.1e-11, -980
-[CL_HO2a] CL + HO2 -> HCL + O2 ; 1.4e-11, 270
-[CL_HO2b] CL + HO2 -> OH + CLO ; 3.6e-11, -375
-[CL_O3] CL + O3 -> CLO + O2 ; 2.3e-11, -200
-[CLO_CH3O2] CLO + CH3O2 -> CL + HO2 + CH2O ; 3.3e-12, -115
-[CLO_CLOa] CLO + CLO -> 2*CL + O2 ; 3e-11, -2450
-[CLO_CLOb] CLO + CLO -> CL2 + O2 ; 1e-12, -1590
-[CLO_CLOc] CLO + CLO -> CL + OCLO ; 3.5e-13, -1370
-[CLO_HO2] CLO + HO2 -> O2 + HOCL ; 2.6e-12, 290
-[CLO_NO] CLO + NO -> NO2 + CL ; 6.4e-12, 290
-[CLONO2_CL] CLONO2 + CL -> CL2 + NO3 ; 6.5e-12, 135
-[CLO_NO2_M] CLO + NO2 + M -> CLONO2 + M ; 1.8e-31, 3.4, 1.5e-11, 1.9, 0.6
-[CLONO2_O] CLONO2 + O -> CLO + NO3 ; 3.6e-12, -840
-[CLONO2_OH] CLONO2 + OH -> HOCL + NO3 ; 1.2e-12, -330
-[CLO_O] CLO + O -> CL + O2 ; 2.8e-11, 85
-[CLO_OHa] CLO + OH -> CL + HO2 ; 7.4e-12, 270
-[CLO_OHb] CLO + OH -> HCL + O2 ; 6e-13, 230
-[HCL_O] HCL + O -> CL + OH ; 1e-11, -3300
-[HCL_OH] HCL + OH -> H2O + CL ; 1.8e-12, -250
-[HOCL_CL] HOCL + CL -> HCL + CLO ; 3.4e-12, -130
-[HOCL_O] HOCL + O -> CLO + OH ; 1.7e-13
-[HOCL_OH] HOCL + OH -> H2O + CLO ; 3e-12, -500
-[O1D_CCL4] O1D + CCL4 -> 4*CL ; 2.607e-10
-[O1D_CF2CLBR] O1D + CF2CLBR -> CL + BR + COF2 ; 9.75e-11
-[O1D_CFC11] O1D + CFC11 -> 2*CL + COFCL ; 2.07e-10
-[O1D_CFC113] O1D + CFC113 -> 2*CL + COFCL + COF2 ; 2.088e-10
-[O1D_CFC114] O1D + CFC114 -> 2*CL + 2*COF2 ; 1.17e-10
-[O1D_CFC115] O1D + CFC115 -> CL + F + 2*COF2 ; 4.644e-11
-[O1D_CFC12] O1D + CFC12 -> 2*CL + COF2 ; 1.204e-10
-[O1D_HCLa] O1D + HCL -> CL + OH ; 9.9e-11
-[O1D_HCLb] O1D + HCL -> CLO + H ; 3.3e-12
-[tag_CLO_CLO_M] CLO + CLO + M -> CL2O2 + M ; 1.9e-32, 3.6, 3.7e-12, 1.6, 0.6
-[usr_CL2O2_M] CL2O2 + M -> CLO + CLO + M
+[CL_CH2O] CL + CH2O -> HCL + HO2 + CO ; 8.1e-11, -30
+[CL_CH4] CL + CH4 -> CH3O2 + HCL ; 7.1e-12, -1270
+[CL_H2] CL + H2 -> HCL + H ; 3.05e-11, -2270
+[CL_H2O2] CL + H2O2 -> HCL + HO2 ; 1.1e-11, -980
+[CL_HO2a] CL + HO2 -> HCL + O2 ; 1.4e-11, 270
+[CL_HO2b] CL + HO2 -> OH + CLO ; 3.6e-11, -375
+[CL_O3] CL + O3 -> CLO + O2 ; 2.3e-11, -200
+[CLO_CH3O2] CLO + CH3O2 -> CL + HO2 + CH2O ; 3.3e-12, -115
+[CLO_CLOa] CLO + CLO -> 2*CL + O2 ; 3e-11, -2450
+[CLO_CLOb] CLO + CLO -> CL2 + O2 ; 1e-12, -1590
+[CLO_CLOc] CLO + CLO -> CL + OCLO ; 3.5e-13, -1370
+[CLO_HO2] CLO + HO2 -> O2 + HOCL ; 2.6e-12, 290
+[CLO_NO] CLO + NO -> NO2 + CL ; 6.4e-12, 290
+[CLONO2_CL] CLONO2 + CL -> CL2 + NO3 ; 6.5e-12, 135
+[CLO_NO2_M] CLO + NO2 + M -> CLONO2 + M ; 1.8e-31, 3.4, 1.5e-11, 1.9, 0.6
+[CLONO2_O] CLONO2 + O -> CLO + NO3 ; 3.6e-12, -840
+[CLONO2_OH] CLONO2 + OH -> HOCL + NO3 ; 1.2e-12, -330
+[CLO_O] CLO + O -> CL + O2 ; 2.8e-11, 85
+[CLO_OHa] CLO + OH -> CL + HO2 ; 7.4e-12, 270
+[CLO_OHb] CLO + OH -> HCL + O2 ; 6e-13, 230
+[HCL_O] HCL + O -> CL + OH ; 1e-11, -3300
+[HCL_OH] HCL + OH -> H2O + CL ; 1.8e-12, -250
+[HOCL_CL] HOCL + CL -> HCL + CLO ; 3.4e-12, -130
+[HOCL_O] HOCL + O -> CLO + OH ; 1.7e-13
+[HOCL_OH] HOCL + OH -> H2O + CLO ; 3e-12, -500
+[O1D_CCL4] O1D + CCL4 -> 4*CL ; 2.607e-10
+[O1D_CF2CLBR] O1D + CF2CLBR -> CL + BR + COF2 ; 9.75e-11
+[O1D_CFC11] O1D + CFC11 -> 2*CL + COFCL ; 2.07e-10
+[O1D_CFC113] O1D + CFC113 -> 2*CL + COFCL + COF2 ; 2.088e-10
+[O1D_CFC114] O1D + CFC114 -> 2*CL + 2*COF2 ; 1.17e-10
+[O1D_CFC115] O1D + CFC115 -> CL + F + 2*COF2 ; 4.644e-11
+[O1D_CFC12] O1D + CFC12 -> 2*CL + COF2 ; 1.204e-10
+[O1D_HCLa] O1D + HCL -> CL + OH ; 9.9e-11
+[O1D_HCLb] O1D + HCL -> CLO + H ; 3.3e-12
+[tag_CLO_CLO_M] CLO + CLO + M -> CL2O2 + M ; 1.9e-32, 3.6, 3.7e-12, 1.6, 0.6
+[usr_CL2O2_M] CL2O2 + M -> CLO + CLO + M
*********************************
*** odd-bromine
*********************************
-[BR_CH2O] BR + CH2O -> HBR + HO2 + CO ; 1.7e-11, -800
-[BR_HO2] BR + HO2 -> HBR + O2 ; 4.8e-12, -310
-[BR_O3] BR + O3 -> BRO + O2 ; 1.6e-11, -780
-[BRO_BRO] BRO + BRO -> 2*BR + O2 ; 1.5e-12, 230
-[BRO_CLOa] BRO + CLO -> BR + OCLO ; 9.5e-13, 550
-[BRO_CLOb] BRO + CLO -> BR + CL + O2 ; 2.3e-12, 260
-[BRO_CLOc] BRO + CLO -> BRCL + O2 ; 4.1e-13, 290
-[BRO_HO2] BRO + HO2 -> HOBR + O2 ; 4.5e-12, 460
-[BRO_NO] BRO + NO -> BR + NO2 ; 8.8e-12, 260
-[BRO_NO2_M] BRO + NO2 + M -> BRONO2 + M ; 5.2e-31, 3.2, 6.9e-12, 2.9, 0.6
-[BRONO2_O] BRONO2 + O -> BRO + NO3 ; 1.9e-11, 215
-[BRO_O] BRO + O -> BR + O2 ; 1.9e-11, 230
-[BRO_OH] BRO + OH -> BR + HO2 ; 1.7e-11, 250
-[HBR_O] HBR + O -> BR + OH ; 5.8e-12, -1500
-[HBR_OH] HBR + OH -> BR + H2O ; 5.5e-12, 200
-[HOBR_O] HOBR + O -> BRO + OH ; 1.2e-10, -430
-[O1D_CF3BR] O1D + CF3BR -> BR + F + COF2 ; 4.5e-11
-[O1D_CHBR3] O1D + CHBR3 -> 3*BR ; 4.62e-10
-[O1D_H2402] O1D + H2402 -> 2*BR + 2*COF2 ; 1.2e-10
-[O1D_HBRa] O1D + HBR -> BR + OH ; 9e-11
-[O1D_HBRb] O1D + HBR -> BRO + H ; 3e-11
+[BR_CH2O] BR + CH2O -> HBR + HO2 + CO ; 1.7e-11, -800
+[BR_HO2] BR + HO2 -> HBR + O2 ; 4.8e-12, -310
+[BR_O3] BR + O3 -> BRO + O2 ; 1.6e-11, -780
+[BRO_BRO] BRO + BRO -> 2*BR + O2 ; 1.5e-12, 230
+[BRO_CLOa] BRO + CLO -> BR + OCLO ; 9.5e-13, 550
+[BRO_CLOb] BRO + CLO -> BR + CL + O2 ; 2.3e-12, 260
+[BRO_CLOc] BRO + CLO -> BRCL + O2 ; 4.1e-13, 290
+[BRO_HO2] BRO + HO2 -> HOBR + O2 ; 4.5e-12, 460
+[BRO_NO] BRO + NO -> BR + NO2 ; 8.8e-12, 260
+[BRO_NO2_M] BRO + NO2 + M -> BRONO2 + M ; 5.2e-31, 3.2, 6.9e-12, 2.9, 0.6
+[BRONO2_O] BRONO2 + O -> BRO + NO3 ; 1.9e-11, 215
+[BRO_O] BRO + O -> BR + O2 ; 1.9e-11, 230
+[BRO_OH] BRO + OH -> BR + HO2 ; 1.7e-11, 250
+[HBR_O] HBR + O -> BR + OH ; 5.8e-12, -1500
+[HBR_OH] HBR + OH -> BR + H2O ; 5.5e-12, 200
+[HOBR_O] HOBR + O -> BRO + OH ; 1.2e-10, -430
+[O1D_CF3BR] O1D + CF3BR -> BR + F + COF2 ; 4.5e-11
+[O1D_CHBR3] O1D + CHBR3 -> 3*BR ; 4.62e-10
+[O1D_H2402] O1D + H2402 -> 2*BR + 2*COF2 ; 1.2e-10
+[O1D_HBRa] O1D + HBR -> BR + OH ; 9e-11
+[O1D_HBRb] O1D + HBR -> BRO + H ; 3e-11
*********************************
*** odd-fluorine
*********************************
-[F_CH4] F + CH4 -> HF + CH3O2 ; 1.6e-10, -260
-[F_H2] F + H2 -> HF + H ; 1.4e-10, -500
-[F_H2O] F + H2O -> HF + OH ; 1.4e-11, 0
-[F_HNO3] F + HNO3 -> HF + NO3 ; 6e-12, 400
-[O1D_COF2] O1D + COF2 -> 2*F ; 2.14e-11
-[O1D_COFCL] O1D + COFCL -> F + CL ; 1.9e-10
+[F_CH4] F + CH4 -> HF + CH3O2 ; 1.6e-10, -260
+[F_H2] F + H2 -> HF + H ; 1.4e-10, -500
+[F_H2O] F + H2O -> HF + OH ; 1.4e-11, 0
+[F_HNO3] F + HNO3 -> HF + NO3 ; 6e-12, 400
+[O1D_COF2] O1D + COF2 -> 2*F ; 2.14e-11
+[O1D_COFCL] O1D + COFCL -> F + CL ; 1.9e-10
*********************************
*** organic-halogens
*********************************
-[CH2BR2_CL] CH2BR2 + CL -> 2*BR + HCL ; 6.3e-12, -800
-[CH2BR2_OH] CH2BR2 + OH -> 2*BR + H2O ; 2e-12, -840
-[CH3BR_CL] CH3BR + CL -> HCL + HO2 + BR ; 1.46e-11, -1040
-[CH3BR_OH] CH3BR + OH -> BR + H2O + HO2 ; 1.42e-12, -1150
-[CH3CCL3_OH] CH3CCL3 + OH -> H2O + 3*CL ; 1.64e-12, -1520
-[CH3CL_CL] CH3CL + CL -> HO2 + CO + 2*HCL ; 2.03e-11, -1110
-[CH3CL_OH] CH3CL + OH -> CL + H2O + HO2 ; 1.96e-12, -1200
-[CHBR3_CL] CHBR3 + CL -> 3*BR + HCL ; 4.85e-12, -850
-[CHBR3_OH] CHBR3 + OH -> 3*BR ; 9e-13, -360
-[HCFC141B_OH] HCFC141B + OH -> CL + COFCL ; 1.25e-12, -1600
-[HCFC142B_OH] HCFC142B + OH -> CL + COF2 ; 1.3e-12, -1770
-[HCFC22_OH] HCFC22 + OH -> H2O + CL + COF2 ; 9.2e-13, -1560
-[O1D_CH2BR2] O1D + CH2BR2 -> 2*BR ; 2.57e-10
-[O1D_CH3BR] O1D + CH3BR -> BR ; 1.8e-10
-[O1D_HCFC141B] O1D + HCFC141B -> CL + COFCL ; 1.794e-10
-[O1D_HCFC142B] O1D + HCFC142B -> CL + COF2 ; 1.3e-10
-[O1D_HCFC22] O1D + HCFC22 -> CL + COF2 ; 7.65e-11
+[CH2BR2_CL] CH2BR2 + CL -> 2*BR + HCL ; 6.3e-12, -800
+[CH2BR2_OH] CH2BR2 + OH -> 2*BR + H2O ; 2e-12, -840
+[CH3BR_CL] CH3BR + CL -> HCL + HO2 + BR ; 1.46e-11, -1040
+[CH3BR_OH] CH3BR + OH -> BR + H2O + HO2 ; 1.42e-12, -1150
+[CH3CCL3_OH] CH3CCL3 + OH -> H2O + 3*CL ; 1.64e-12, -1520
+[CH3CL_CL] CH3CL + CL -> HO2 + CO + 2*HCL ; 2.03e-11, -1110
+[CH3CL_OH] CH3CL + OH -> CL + H2O + HO2 ; 1.96e-12, -1200
+[CHBR3_CL] CHBR3 + CL -> 3*BR + HCL ; 4.85e-12, -850
+[CHBR3_OH] CHBR3 + OH -> 3*BR ; 9e-13, -360
+[HCFC141B_OH] HCFC141B + OH -> CL + COFCL ; 1.25e-12, -1600
+[HCFC142B_OH] HCFC142B + OH -> CL + COF2 ; 1.3e-12, -1770
+[HCFC22_OH] HCFC22 + OH -> H2O + CL + COF2 ; 9.2e-13, -1560
+[O1D_CH2BR2] O1D + CH2BR2 -> 2*BR ; 2.57e-10
+[O1D_CH3BR] O1D + CH3BR -> BR ; 1.8e-10
+[O1D_HCFC141B] O1D + HCFC141B -> CL + COFCL ; 1.794e-10
+[O1D_HCFC142B] O1D + HCFC142B -> CL + COF2 ; 1.3e-10
+[O1D_HCFC22] O1D + HCFC22 -> CL + COF2 ; 7.65e-11
*********************************
*** C1
*********************************
-[CH2O_NO3] CH2O + NO3 -> CO + HO2 + HNO3 ; 6e-13, -2058
-[CH2O_O] CH2O + O -> HO2 + OH + CO ; 3.4e-11, -1600
-[CH2O_OH] CH2O + OH -> CO + H2O + H ; 5.5e-12, 125
-[CH3O2_HO2] CH3O2 + HO2 -> CH3OOH + O2 ; 4.1e-13, 750
-[CH3O2_NO] CH3O2 + NO -> CH2O + NO2 + HO2 ; 2.8e-12, 300
-[CH3OOH_OH] CH3OOH + OH -> 0.7*CH3O2 + 0.3*OH + 0.3*CH2O + H2O ; 3.8e-12, 200
-[CH4_OH] CH4 + OH -> CH3O2 + H2O ; 2.45e-12, -1775
-[O1D_CH4a] O1D + CH4 -> CH3O2 + OH ; 1.31e-10
-[O1D_CH4b] O1D + CH4 -> CH2O + H + HO2 ; 3.5e-11
-[O1D_CH4c] O1D + CH4 -> CH2O + H2 ; 9e-12
-[usr_CO_OH] CO + OH -> CO2 + HO2
+[CH2O_NO3] CH2O + NO3 -> CO + HO2 + HNO3 ; 6e-13, -2058
+[CH2O_O] CH2O + O -> HO2 + OH + CO ; 3.4e-11, -1600
+[CH2O_OH] CH2O + OH -> CO + H2O + H ; 5.5e-12, 125
+[CH3O2_HO2] CH3O2 + HO2 -> CH3OOH + O2 ; 4.1e-13, 750
+[CH3O2_NO] CH3O2 + NO -> CH2O + NO2 + HO2 ; 2.8e-12, 300
+[CH3OOH_OH] CH3OOH + OH -> 0.7*CH3O2 + 0.3*OH + 0.3*CH2O + H2O ; 3.8e-12, 200
+[CH4_OH] CH4 + OH -> CH3O2 + H2O ; 2.45e-12, -1775
+[O1D_CH4a] O1D + CH4 -> CH3O2 + OH ; 1.31e-10
+[O1D_CH4b] O1D + CH4 -> CH2O + H + HO2 ; 3.5e-11
+[O1D_CH4c] O1D + CH4 -> CH2O + H2 ; 9e-12
+[usr_CO_OH] CO + OH -> CO2 + HO2
*********************************
*** Sulfur
*********************************
-[DMS_NO3] DMS + NO3 -> SO2 + HNO3 ; 1.9e-13, 520
-[DMS_OHa] DMS + OH -> SO2 ; 1.1e-11, -280
-[OCS_O] OCS + O -> SO + CO ; 2.1e-11, -2200
-[OCS_OH] OCS + OH -> SO2 + CO + H ; 7.2e-14, -1070
-[S_O2] S + O2 -> SO + O ; 2.3e-12
-[SO2_OH_M] SO2 + OH + M -> SO3 + HO2 ; 2.9e-31, 4.1, 1.7e-12, -0.2, 0.6
-[S_O3] S + O3 -> SO + O2 ; 1.2e-11
-[SO_BRO] SO + BRO -> SO2 + BR ; 5.7e-11
-[SO_CLO] SO + CLO -> SO2 + CL ; 2.8e-11
-[S_OH] S + OH -> SO + H ; 6.6e-11
-[SO_NO2] SO + NO2 -> SO2 + NO ; 1.4e-11
-[SO_O2] SO + O2 -> SO2 + O ; 1.6e-13, -2280
-[SO_O3] SO + O3 -> SO2 + O2 ; 3.4e-12, -1100
-[SO_OCLO] SO + OCLO -> SO2 + CLO ; 1.9e-12
-[SO_OH] SO + OH -> SO2 + H ; 2.6e-11, 330
-[usr_DMS_OH] DMS + OH -> 0.5*SO2 + 0.5*HO2
-[usr_SO3_H2O] SO3 + H2O -> H2SO4
+[DMS_NO3] DMS + NO3 -> SO2 + HNO3 ; 1.9e-13, 520
+[DMS_OHa] DMS + OH -> SO2 ; 1.1e-11, -280
+[OCS_O] OCS + O -> SO + CO ; 2.1e-11, -2200
+[OCS_OH] OCS + OH -> SO2 + CO + H ; 7.2e-14, -1070
+[S_O2] S + O2 -> SO + O ; 2.3e-12
+[SO2_OH_M] SO2 + OH + M -> SO3 + HO2 ; 2.9e-31, 4.1, 1.7e-12, -0.2, 0.6
+[S_O3] S + O3 -> SO + O2 ; 1.2e-11
+[SO_BRO] SO + BRO -> SO2 + BR ; 5.7e-11
+[SO_CLO] SO + CLO -> SO2 + CL ; 2.8e-11
+[S_OH] S + OH -> SO + H ; 6.6e-11
+[SO_NO2] SO + NO2 -> SO2 + NO ; 1.4e-11
+[SO_O2] SO + O2 -> SO2 + O ; 1.6e-13, -2280
+[SO_O3] SO + O3 -> SO2 + O2 ; 3.4e-12, -1100
+[SO_OCLO] SO + OCLO -> SO2 + CLO ; 1.9e-12
+[SO_OH] SO + OH -> SO2 + H ; 2.6e-11, 330
+[usr_DMS_OH] DMS + OH -> 0.5*SO2 + 0.5*HO2
+[usr_SO3_H2O] SO3 + H2O -> H2SO4
*********************************
*** Tropospheric Aerosol
*********************************
-[usr_HO2_aer] HO2 -> 0.5*H2O2
-[usr_N2O5_aer] N2O5 -> 2*HNO3
-[usr_NO2_aer] NO2 -> 0.5*OH + 0.5*NO + 0.5*HNO3
-[usr_NO3_aer] NO3 -> HNO3
+[usr_HO2_aer] HO2 -> 0.5*H2O2
+[usr_N2O5_aer] N2O5 -> 2*HNO3
+[usr_NO2_aer] NO2 -> 0.5*OH + 0.5*NO + 0.5*HNO3
+[usr_NO3_aer] NO3 -> HNO3
*********************************
*** Stratospheric Aerosol
*********************************
-[het1] N2O5 -> 2*HNO3
-[het10] HOCL + HCL -> CL2 + H2O
-[het11] BRONO2 -> HOBR + HNO3
-[het12] N2O5 -> 2*HNO3
-[het13] CLONO2 -> HOCL + HNO3
-[het14] BRONO2 -> HOBR + HNO3
-[het15] CLONO2 + HCL -> CL2 + HNO3
-[het16] HOCL + HCL -> CL2 + H2O
-[het17] HOBR + HCL -> BRCL + H2O
-[het2] CLONO2 -> HOCL + HNO3
-[het3] BRONO2 -> HOBR + HNO3
-[het4] CLONO2 + HCL -> CL2 + HNO3
-[het5] HOCL + HCL -> CL2 + H2O
-[het6] HOBR + HCL -> BRCL + H2O
-[het7] N2O5 -> 2*HNO3
-[het8] CLONO2 -> HOCL + HNO3
-[het9] CLONO2 + HCL -> CL2 + HNO3
+[het1] N2O5 -> 2*HNO3
+[het10] HOCL + HCL -> CL2 + H2O
+[het11] BRONO2 -> HOBR + HNO3
+[het12] N2O5 -> 2*HNO3
+[het13] CLONO2 -> HOCL + HNO3
+[het14] BRONO2 -> HOBR + HNO3
+[het15] CLONO2 + HCL -> CL2 + HNO3
+[het16] HOCL + HCL -> CL2 + H2O
+[het17] HOBR + HCL -> BRCL + H2O
+[het2] CLONO2 -> HOCL + HNO3
+[het3] BRONO2 -> HOBR + HNO3
+[het4] CLONO2 + HCL -> CL2 + HNO3
+[het5] HOCL + HCL -> CL2 + H2O
+[het6] HOBR + HCL -> BRCL + H2O
+[het7] N2O5 -> 2*HNO3
+[het8] CLONO2 -> HOCL + HNO3
+[het9] CLONO2 + HCL -> CL2 + HNO3
*********************************
*** Ions
*********************************
-[ag247nm,cph=483.39] Op2P -> Op ; 0.047
-[ag373nm,cph=321.3] Op2D -> Op ; 7.7e-05
-[ag732nm,cph=163.06] Op2P -> Op2D ; 0.171
-[elec1,cph=82.389] NOp + e -> 0.2*N + 0.8*N2D + O
-[elec2,cph=508.95] O2p + e -> 1.15*O + 0.85*O1D
-[elec3,cph=354.83] N2p + e -> 1.1*N + 0.9*N2D
-[ion_N2p_O2,cph=339.59] N2p + O2 -> O2p + N2 ; 6e-11
-[ion_N2p_Oa,cph=67.53] N2p + O -> NOp + N2D
-[ion_N2p_Ob] N2p + O -> Op + N2
-[ion_Np_O,cph=95.55] Np + O -> Op + N ; 1e-12
-[ion_Np_O2a,cph=239.84] Np + O2 -> O2p + N ; 4e-10
-[ion_Np_O2b,cph=646.28] Np + O2 -> NOp + O ; 2e-10
-[ion_O2p_N,cph=406.16] O2p + N -> NOp + O ; 1e-10
-[ion_O2p_N2] O2p + N2 -> NOp + NO ; 5e-16
-[ion_O2p_NO,cph=271.38] O2p + NO -> NOp + O2 ; 4.4e-10
-[ion_Op_CO2] Op + CO2 -> O2p + CO ; 9e-10
-[ion_Op_N2,cph=105.04] Op + N2 -> NOp + N
-[ion_Op_N2D,cph=139.9] Op + N2D -> Np + O ; 1.3e-10
-[ion_Op_O2,cph=150.11] Op + O2 -> O2p + O
-[Op2D_e,cph=319.37] Op2D + e -> Op + e
-[Op2D_N2,cph=128.32] Op2D + N2 -> N2p + O ; 8e-10
-[Op2D_O,cph=319.36] Op2D + O -> Op + O ; 5e-12
-[Op2D_O2,cph=469.4] Op2D + O2 -> O2p + O ; 7e-10
-[Op2P_ea,cph=163.06] Op2P + e -> Op2D + e
-[Op2P_eb,cph=482.43] Op2P + e -> Op + e
-[Op2P_N2a,cph=291.38] Op2P + N2 -> N2p + O ; 4.8e-10
-[Op2P_N2b,cph=67.54] Op2P + N2 -> Np + NO ; 1e-10
-[Op2P_O,cph=501.72] Op2P + O -> Op + O ; 4e-10
+[ag247nm,cph=483.39] Op2P -> Op ; 0.047
+[ag373nm,cph=321.3] Op2D -> Op ; 7.7e-05
+[ag732nm,cph=163.06] Op2P -> Op2D ; 0.171
+[elec1,cph=82.389] NOp + e -> 0.2*N + 0.8*N2D + O
+[elec2,cph=508.95] O2p + e -> 1.15*O + 0.85*O1D
+[elec3,cph=354.83] N2p + e -> 1.1*N + 0.9*N2D
+[ion_N2p_O2,cph=339.59] N2p + O2 -> O2p + N2 ; 6e-11
+[ion_N2p_Oa,cph=67.53] N2p + O -> NOp + N2D
+[ion_N2p_Ob] N2p + O -> Op + N2
+[ion_Np_O,cph=95.55] Np + O -> Op + N ; 1e-12
+[ion_Np_O2a,cph=239.84] Np + O2 -> O2p + N ; 4e-10
+[ion_Np_O2b,cph=646.28] Np + O2 -> NOp + O ; 2e-10
+[ion_O2p_N,cph=406.16] O2p + N -> NOp + O ; 1e-10
+[ion_O2p_N2] O2p + N2 -> NOp + NO ; 5e-16
+[ion_O2p_NO,cph=271.38] O2p + NO -> NOp + O2 ; 4.4e-10
+[ion_Op_CO2] Op + CO2 -> O2p + CO ; 9e-10
+[ion_Op_N2,cph=105.04] Op + N2 -> NOp + N
+[ion_Op_N2D,cph=139.9] Op + N2D -> Np + O ; 1.3e-10
+[ion_Op_O2,cph=150.11] Op + O2 -> O2p + O
+[Op2D_e,cph=319.37] Op2D + e -> Op + e
+[Op2D_N2,cph=128.32] Op2D + N2 -> N2p + O ; 8e-10
+[Op2D_O,cph=319.36] Op2D + O -> Op + O ; 5e-12
+[Op2D_O2,cph=469.4] Op2D + O2 -> O2p + O ; 7e-10
+[Op2P_ea,cph=163.06] Op2P + e -> Op2D + e
+[Op2P_eb,cph=482.43] Op2P + e -> Op + e
+[Op2P_N2a,cph=291.38] Op2P + N2 -> N2p + O ; 4.8e-10
+[Op2P_N2b,cph=67.54] Op2P + N2 -> Np + NO ; 1e-10
+[Op2P_O,cph=501.72] Op2P + O -> Op + O ; 4e-10
End Reactions
Ext Forcing
- so4_a2 <- dataset
- DMS <- dataset
- bc_a4 <- dataset
- num_a1 <- dataset
- num_a2 <- dataset
- num_a4 <- dataset
+ so4_a2 <- dataset
+ DMS <- dataset
+ bc_a4 <- dataset
+ num_a1 <- dataset
+ num_a2 <- dataset
+ num_a4 <- dataset
num_a5 <- dataset
- pom_a1 <- dataset
- pom_a4 <- dataset
- so4_a1 <- dataset
+ pom_a1 <- dataset
+ pom_a4 <- dataset
+ so4_a1 <- dataset
so4_a5 <- dataset
- CO <- dataset
- NO <- dataset
- NO2 <- dataset
- SO2 <- dataset
- bc_a1 <- dataset
- N
- N2D
- N2p
- Op
- e
- Np
- O2p
- OH
+ CO <- dataset
+ NO <- dataset
+ NO2 <- dataset
+ SO2 <- dataset
+ bc_a1 <- dataset
+ N
+ N2D
+ N2p
+ Op
+ e
+ Np
+ O2p
+ OH
End Ext Forcing
End Chemistry
diff --git a/src/chemistry/pp_waccm_ma_mam5/chem_mods.F90 b/src/chemistry/pp_waccm_ma_mam5/chem_mods.F90
index f579d54563..3c74c4fd26 100644
--- a/src/chemistry/pp_waccm_ma_mam5/chem_mods.F90
+++ b/src/chemistry/pp_waccm_ma_mam5/chem_mods.F90
@@ -9,13 +9,13 @@ module chem_mods
rxntot = 311, & ! number of total reactions
gascnt = 220, & ! number of gas phase reactions
nabscol = 2, & ! number of absorbing column densities
- gas_pcnst = 102, & ! number of "gas phase" species
+ gas_pcnst = 103, & ! number of "gas phase" species
nfs = 2, & ! number of "fixed" species
relcnt = 0, & ! number of relationship species
grpcnt = 0, & ! number of group members
nzcnt = 959, & ! number of non-zero matrix entries
extcnt = 24, & ! number of species with external forcing
- clscnt1 = 0, & ! number of species in explicit class
+ clscnt1 = 1, & ! number of species in explicit class
clscnt2 = 0, & ! number of species in hov class
clscnt3 = 0, & ! number of species in ebi class
clscnt4 = 102, & ! number of species in implicit class
diff --git a/src/chemistry/pp_waccm_ma_mam5/m_spc_id.F90 b/src/chemistry/pp_waccm_ma_mam5/m_spc_id.F90
index d596a4e593..6c5ec22920 100644
--- a/src/chemistry/pp_waccm_ma_mam5/m_spc_id.F90
+++ b/src/chemistry/pp_waccm_ma_mam5/m_spc_id.F90
@@ -71,35 +71,36 @@ module m_spc_id
integer, parameter :: id_O = 69
integer, parameter :: id_O2 = 70
integer, parameter :: id_O3 = 71
- integer, parameter :: id_OCLO = 72
- integer, parameter :: id_OCS = 73
- integer, parameter :: id_pom_a1 = 74
- integer, parameter :: id_pom_a4 = 75
- integer, parameter :: id_S = 76
- integer, parameter :: id_SF6 = 77
- integer, parameter :: id_SO = 78
- integer, parameter :: id_SO2 = 79
- integer, parameter :: id_SO3 = 80
- integer, parameter :: id_so4_a1 = 81
- integer, parameter :: id_so4_a2 = 82
- integer, parameter :: id_so4_a3 = 83
- integer, parameter :: id_so4_a5 = 84
- integer, parameter :: id_soa_a1 = 85
- integer, parameter :: id_soa_a2 = 86
- integer, parameter :: id_SOAG = 87
- integer, parameter :: id_e = 88
- integer, parameter :: id_HO2 = 89
- integer, parameter :: id_N2D = 90
- integer, parameter :: id_N2p = 91
- integer, parameter :: id_NOp = 92
- integer, parameter :: id_Np = 93
- integer, parameter :: id_O1D = 94
- integer, parameter :: id_O2_1D = 95
- integer, parameter :: id_O2_1S = 96
- integer, parameter :: id_O2p = 97
- integer, parameter :: id_OH = 98
- integer, parameter :: id_Op = 99
- integer, parameter :: id_Op2D = 100
- integer, parameter :: id_Op2P = 101
- integer, parameter :: id_H2O = 102
+ integer, parameter :: id_O3S = 72
+ integer, parameter :: id_OCLO = 73
+ integer, parameter :: id_OCS = 74
+ integer, parameter :: id_pom_a1 = 75
+ integer, parameter :: id_pom_a4 = 76
+ integer, parameter :: id_S = 77
+ integer, parameter :: id_SF6 = 78
+ integer, parameter :: id_SO = 79
+ integer, parameter :: id_SO2 = 80
+ integer, parameter :: id_SO3 = 81
+ integer, parameter :: id_so4_a1 = 82
+ integer, parameter :: id_so4_a2 = 83
+ integer, parameter :: id_so4_a3 = 84
+ integer, parameter :: id_so4_a5 = 85
+ integer, parameter :: id_soa_a1 = 86
+ integer, parameter :: id_soa_a2 = 87
+ integer, parameter :: id_SOAG = 88
+ integer, parameter :: id_e = 89
+ integer, parameter :: id_HO2 = 90
+ integer, parameter :: id_N2D = 91
+ integer, parameter :: id_N2p = 92
+ integer, parameter :: id_NOp = 93
+ integer, parameter :: id_Np = 94
+ integer, parameter :: id_O1D = 95
+ integer, parameter :: id_O2_1D = 96
+ integer, parameter :: id_O2_1S = 97
+ integer, parameter :: id_O2p = 98
+ integer, parameter :: id_OH = 99
+ integer, parameter :: id_Op = 100
+ integer, parameter :: id_Op2D = 101
+ integer, parameter :: id_Op2P = 102
+ integer, parameter :: id_H2O = 103
end module m_spc_id
diff --git a/src/chemistry/pp_waccm_ma_mam5/mo_indprd.F90 b/src/chemistry/pp_waccm_ma_mam5/mo_indprd.F90
index 125c4a75b8..59b51ae306 100644
--- a/src/chemistry/pp_waccm_ma_mam5/mo_indprd.F90
+++ b/src/chemistry/pp_waccm_ma_mam5/mo_indprd.F90
@@ -17,9 +17,14 @@ subroutine indprd( class, prod, nprod, y, extfrc, rxt, chnkpnts )
real(r8), intent(in) :: extfrc(chnkpnts,extcnt)
real(r8), intent(inout) :: prod(chnkpnts,nprod)
!--------------------------------------------------------------------
+! ... "independent" production for Explicit species
+!--------------------------------------------------------------------
+ if( class == 1 ) then
+ prod(:,1) = 0._r8
+!--------------------------------------------------------------------
! ... "independent" production for Implicit species
!--------------------------------------------------------------------
- if( class == 4 ) then
+ else if( class == 4 ) then
prod(:,1) = + extfrc(:,16)
prod(:,2) = + extfrc(:,3)
prod(:,97) = 0._r8
diff --git a/src/chemistry/pp_waccm_ma_mam5/mo_lin_matrix.F90 b/src/chemistry/pp_waccm_ma_mam5/mo_lin_matrix.F90
index 8e8cfedba7..14f1d2a1ef 100644
--- a/src/chemistry/pp_waccm_ma_mam5/mo_lin_matrix.F90
+++ b/src/chemistry/pp_waccm_ma_mam5/mo_lin_matrix.F90
@@ -222,8 +222,8 @@ subroutine linmat01( avec_len, mat, y, rxt, het_rates )
mat(k,78) = rxt(k,92) + rxt(k,100)
mat(k,81) = rxt(k,93)
mat(k,529) = -( rxt(k,7) + rxt(k,8) + het_rates(k,71) )
- mat(k,134) = -( rxt(k,59) + het_rates(k,72) )
- mat(k,139) = -( rxt(k,88) + het_rates(k,73) )
+ mat(k,134) = -( rxt(k,59) + het_rates(k,73) )
+ mat(k,139) = -( rxt(k,88) + het_rates(k,74) )
end do
end subroutine linmat01
subroutine linmat02( avec_len, mat, y, rxt, het_rates )
@@ -246,57 +246,57 @@ subroutine linmat02( avec_len, mat, y, rxt, het_rates )
!----------------------------------------------
integer :: k
do k = 1,avec_len
- mat(k,16) = -( het_rates(k,74) )
- mat(k,17) = -( het_rates(k,75) )
- mat(k,235) = -( het_rates(k,76) )
+ mat(k,16) = -( het_rates(k,75) )
+ mat(k,17) = -( het_rates(k,76) )
+ mat(k,235) = -( het_rates(k,77) )
mat(k,140) = rxt(k,88)
mat(k,423) = rxt(k,89)
- mat(k,18) = -( rxt(k,60) + het_rates(k,77) )
- mat(k,425) = -( rxt(k,89) + het_rates(k,78) )
+ mat(k,18) = -( rxt(k,60) + het_rates(k,78) )
+ mat(k,425) = -( rxt(k,89) + het_rates(k,79) )
mat(k,301) = rxt(k,90)
- mat(k,300) = -( rxt(k,90) + het_rates(k,79) )
+ mat(k,300) = -( rxt(k,90) + het_rates(k,80) )
mat(k,109) = rxt(k,91)
- mat(k,108) = -( rxt(k,91) + het_rates(k,80) )
+ mat(k,108) = -( rxt(k,91) + het_rates(k,81) )
mat(k,53) = rxt(k,87)
- mat(k,19) = -( het_rates(k,81) )
- mat(k,20) = -( het_rates(k,82) )
- mat(k,21) = -( het_rates(k,83) )
- mat(k,22) = -( het_rates(k,84) )
- mat(k,23) = -( het_rates(k,85) )
- mat(k,24) = -( het_rates(k,86) )
- mat(k,25) = -( het_rates(k,87) )
- mat(k,323) = -( het_rates(k,88) )
+ mat(k,19) = -( het_rates(k,82) )
+ mat(k,20) = -( het_rates(k,83) )
+ mat(k,21) = -( het_rates(k,84) )
+ mat(k,22) = -( het_rates(k,85) )
+ mat(k,23) = -( het_rates(k,86) )
+ mat(k,24) = -( het_rates(k,87) )
+ mat(k,25) = -( het_rates(k,88) )
+ mat(k,323) = -( het_rates(k,89) )
mat(k,736) = rxt(k,16)
mat(k,345) = rxt(k,62)
mat(k,668) = rxt(k,71) + rxt(k,72) + rxt(k,73) + rxt(k,74) + rxt(k,75) &
+ rxt(k,76)
mat(k,501) = rxt(k,77) + rxt(k,78) + rxt(k,79) + rxt(k,80) + rxt(k,81) &
+ rxt(k,84) + rxt(k,85) + rxt(k,86)
- mat(k,555) = -( rxt(k,263) + het_rates(k,89) )
+ mat(k,555) = -( rxt(k,263) + het_rates(k,90) )
mat(k,169) = rxt(k,11) + rxt(k,153)
- mat(k,334) = -( het_rates(k,90) )
- mat(k,219) = -( het_rates(k,91) )
+ mat(k,334) = -( het_rates(k,91) )
+ mat(k,219) = -( het_rates(k,92) )
mat(k,189) = rxt(k,304)
mat(k,183) = rxt(k,309)
- mat(k,242) = -( het_rates(k,92) )
+ mat(k,242) = -( het_rates(k,93) )
mat(k,735) = rxt(k,16)
mat(k,357) = rxt(k,297)
mat(k,371) = rxt(k,300)
- mat(k,273) = -( het_rates(k,93) )
+ mat(k,273) = -( het_rates(k,94) )
mat(k,344) = rxt(k,62)
mat(k,184) = rxt(k,310)
- mat(k,726) = -( rxt(k,96) + het_rates(k,94) )
+ mat(k,726) = -( rxt(k,96) + het_rates(k,95) )
mat(k,951) = rxt(k,1)
mat(k,514) = rxt(k,6)
mat(k,535) = rxt(k,7)
mat(k,105) = rxt(k,12)
- mat(k,77) = -( rxt(k,92) + rxt(k,100) + het_rates(k,95) )
+ mat(k,77) = -( rxt(k,92) + rxt(k,100) + het_rates(k,96) )
mat(k,522) = rxt(k,7)
mat(k,79) = rxt(k,104)
- mat(k,80) = -( rxt(k,93) + rxt(k,104) + het_rates(k,96) )
- mat(k,361) = -( rxt(k,297) + het_rates(k,97) )
+ mat(k,80) = -( rxt(k,93) + rxt(k,104) + het_rates(k,97) )
+ mat(k,361) = -( rxt(k,297) + het_rates(k,98) )
mat(k,504) = rxt(k,78) + rxt(k,80)
- mat(k,858) = -( het_rates(k,98) )
+ mat(k,858) = -( het_rates(k,99) )
mat(k,955) = rxt(k,3)
mat(k,233) = 2.000_r8*rxt(k,4)
mat(k,904) = rxt(k,9)
@@ -306,20 +306,20 @@ subroutine linmat02( avec_len, mat, y, rxt, het_rates )
mat(k,253) = rxt(k,57)
mat(k,270) = rxt(k,58)
mat(k,646) = .500_r8*rxt(k,265)
- mat(k,378) = -( rxt(k,300) + het_rates(k,99) )
+ mat(k,378) = -( rxt(k,300) + het_rates(k,100) )
mat(k,672) = rxt(k,73) + rxt(k,74)
mat(k,505) = rxt(k,79) + rxt(k,81)
mat(k,185) = rxt(k,284)
mat(k,191) = rxt(k,285)
- mat(k,188) = -( rxt(k,285) + rxt(k,304) + het_rates(k,100) )
+ mat(k,188) = -( rxt(k,285) + rxt(k,304) + het_rates(k,101) )
mat(k,655) = rxt(k,75) + rxt(k,76)
mat(k,495) = rxt(k,85) + rxt(k,86)
mat(k,182) = rxt(k,286)
mat(k,181) = -( rxt(k,284) + rxt(k,286) + rxt(k,309) + rxt(k,310) &
- + het_rates(k,101) )
+ + het_rates(k,102) )
mat(k,654) = rxt(k,71) + rxt(k,72)
mat(k,494) = rxt(k,77) + rxt(k,84)
- mat(k,959) = -( rxt(k,1) + rxt(k,2) + rxt(k,3) + het_rates(k,102) )
+ mat(k,959) = -( rxt(k,1) + rxt(k,2) + rxt(k,3) + het_rates(k,103) )
mat(k,409) = .050_r8*rxt(k,24)
mat(k,54) = rxt(k,87)
end do
diff --git a/src/chemistry/pp_waccm_ma_mam5/mo_nln_matrix.F90 b/src/chemistry/pp_waccm_ma_mam5/mo_nln_matrix.F90
index 60c42e2b51..fcd1810f01 100644
--- a/src/chemistry/pp_waccm_ma_mam5/mo_nln_matrix.F90
+++ b/src/chemistry/pp_waccm_ma_mam5/mo_nln_matrix.F90
@@ -22,25 +22,25 @@ subroutine nlnmat01( avec_len, mat, y, rxt )
! ... complete matrix entries implicit species
!----------------------------------------------
do k = 1,avec_len
- mat(k,808) = -(rxt(k,191)*y(k,17) + rxt(k,192)*y(k,89) + rxt(k,193)*y(k,71))
+ mat(k,808) = -(rxt(k,191)*y(k,17) + rxt(k,192)*y(k,90) + rxt(k,193)*y(k,71))
mat(k,486) = -rxt(k,191)*y(k,3)
mat(k,563) = -rxt(k,192)*y(k,3)
mat(k,538) = -rxt(k,193)*y(k,3)
mat(k,927) = 4.000_r8*rxt(k,194)*y(k,5) + (rxt(k,195)+rxt(k,196))*y(k,28) &
- + rxt(k,199)*y(k,61) + rxt(k,202)*y(k,69) + rxt(k,253)*y(k,78) &
- + rxt(k,203)*y(k,98)
- mat(k,59) = rxt(k,181)*y(k,94)
- mat(k,64) = rxt(k,207)*y(k,94)
- mat(k,178) = 2.000_r8*rxt(k,218)*y(k,25) + 2.000_r8*rxt(k,230)*y(k,94) &
- + 2.000_r8*rxt(k,219)*y(k,98)
- mat(k,216) = rxt(k,220)*y(k,25) + rxt(k,231)*y(k,94) + rxt(k,221)*y(k,98)
- mat(k,165) = 3.000_r8*rxt(k,225)*y(k,25) + 3.000_r8*rxt(k,208)*y(k,94) &
- + 3.000_r8*rxt(k,226)*y(k,98)
+ + rxt(k,199)*y(k,61) + rxt(k,202)*y(k,69) + rxt(k,253)*y(k,79) &
+ + rxt(k,203)*y(k,99)
+ mat(k,59) = rxt(k,181)*y(k,95)
+ mat(k,64) = rxt(k,207)*y(k,95)
+ mat(k,178) = 2.000_r8*rxt(k,218)*y(k,25) + 2.000_r8*rxt(k,230)*y(k,95) &
+ + 2.000_r8*rxt(k,219)*y(k,99)
+ mat(k,216) = rxt(k,220)*y(k,25) + rxt(k,231)*y(k,95) + rxt(k,221)*y(k,99)
+ mat(k,165) = 3.000_r8*rxt(k,225)*y(k,25) + 3.000_r8*rxt(k,208)*y(k,95) &
+ + 3.000_r8*rxt(k,226)*y(k,99)
mat(k,786) = 2.000_r8*rxt(k,218)*y(k,16) + rxt(k,220)*y(k,18) &
+ 3.000_r8*rxt(k,225)*y(k,24)
mat(k,616) = (rxt(k,195)+rxt(k,196))*y(k,5)
- mat(k,35) = 2.000_r8*rxt(k,209)*y(k,94)
- mat(k,260) = rxt(k,204)*y(k,69) + rxt(k,210)*y(k,94) + rxt(k,205)*y(k,98)
+ mat(k,35) = 2.000_r8*rxt(k,209)*y(k,95)
+ mat(k,260) = rxt(k,204)*y(k,69) + rxt(k,210)*y(k,95) + rxt(k,205)*y(k,99)
mat(k,754) = rxt(k,199)*y(k,5)
mat(k,687) = rxt(k,202)*y(k,5) + rxt(k,204)*y(k,45)
mat(k,435) = rxt(k,253)*y(k,5)
@@ -54,9 +54,9 @@ subroutine nlnmat01( avec_len, mat, y, rxt )
mat(k,448) = (rxt(k,275)+rxt(k,280))*y(k,53)
mat(k,247) = (rxt(k,275)+rxt(k,280))*y(k,49)
mat(k,931) = -(4._r8*rxt(k,194)*y(k,5) + (rxt(k,195) + rxt(k,196) + rxt(k,197) &
- ) * y(k,28) + rxt(k,198)*y(k,89) + rxt(k,199)*y(k,61) + rxt(k,200) &
- *y(k,62) + rxt(k,202)*y(k,69) + rxt(k,203)*y(k,98) + rxt(k,253) &
- *y(k,78))
+ ) * y(k,28) + rxt(k,198)*y(k,90) + rxt(k,199)*y(k,61) + rxt(k,200) &
+ *y(k,62) + rxt(k,202)*y(k,69) + rxt(k,203)*y(k,99) + rxt(k,253) &
+ *y(k,79))
mat(k,620) = -(rxt(k,195) + rxt(k,196) + rxt(k,197)) * y(k,5)
mat(k,567) = -rxt(k,198)*y(k,5)
mat(k,758) = -rxt(k,199)*y(k,5)
@@ -66,7 +66,7 @@ subroutine nlnmat01( avec_len, mat, y, rxt )
mat(k,437) = -rxt(k,253)*y(k,5)
mat(k,812) = rxt(k,193)*y(k,71)
mat(k,209) = rxt(k,201)*y(k,69)
- mat(k,262) = rxt(k,211)*y(k,94)
+ mat(k,262) = rxt(k,211)*y(k,95)
mat(k,254) = rxt(k,206)*y(k,69)
mat(k,691) = mat(k,691) + rxt(k,201)*y(k,6) + rxt(k,206)*y(k,53)
mat(k,541) = rxt(k,193)*y(k,3)
@@ -75,76 +75,76 @@ subroutine nlnmat01( avec_len, mat, y, rxt )
mat(k,656) = -rxt(k,201)*y(k,6)
mat(k,911) = rxt(k,200)*y(k,62)
mat(k,625) = rxt(k,200)*y(k,5)
- mat(k,29) = -(rxt(k,180)*y(k,94))
+ mat(k,29) = -(rxt(k,180)*y(k,95))
mat(k,693) = -rxt(k,180)*y(k,8)
- mat(k,55) = -(rxt(k,181)*y(k,94))
+ mat(k,55) = -(rxt(k,181)*y(k,95))
mat(k,698) = -rxt(k,181)*y(k,9)
- mat(k,60) = -(rxt(k,207)*y(k,94))
+ mat(k,60) = -(rxt(k,207)*y(k,95))
mat(k,699) = -rxt(k,207)*y(k,10)
- mat(k,36) = -(rxt(k,182)*y(k,94))
+ mat(k,36) = -(rxt(k,182)*y(k,95))
mat(k,695) = -rxt(k,182)*y(k,11)
- mat(k,65) = -(rxt(k,183)*y(k,94))
+ mat(k,65) = -(rxt(k,183)*y(k,95))
mat(k,700) = -rxt(k,183)*y(k,12)
- mat(k,40) = -(rxt(k,184)*y(k,94))
+ mat(k,40) = -(rxt(k,184)*y(k,95))
mat(k,696) = -rxt(k,184)*y(k,13)
- mat(k,70) = -(rxt(k,185)*y(k,94))
+ mat(k,70) = -(rxt(k,185)*y(k,95))
mat(k,701) = -rxt(k,185)*y(k,14)
- mat(k,44) = -(rxt(k,186)*y(k,94))
+ mat(k,44) = -(rxt(k,186)*y(k,95))
mat(k,697) = -rxt(k,186)*y(k,15)
- mat(k,174) = -(rxt(k,218)*y(k,25) + rxt(k,219)*y(k,98) + rxt(k,230)*y(k,94))
+ mat(k,174) = -(rxt(k,218)*y(k,25) + rxt(k,219)*y(k,99) + rxt(k,230)*y(k,95))
mat(k,763) = -rxt(k,218)*y(k,16)
mat(k,827) = -rxt(k,219)*y(k,16)
mat(k,710) = -rxt(k,230)*y(k,16)
mat(k,475) = -(rxt(k,155)*y(k,25) + rxt(k,191)*y(k,3) + rxt(k,235)*y(k,63) &
- + rxt(k,236)*y(k,69) + rxt(k,237)*y(k,98))
+ + rxt(k,236)*y(k,69) + rxt(k,237)*y(k,99))
mat(k,775) = -rxt(k,155)*y(k,17)
mat(k,797) = -rxt(k,191)*y(k,17)
mat(k,577) = -rxt(k,235)*y(k,17)
mat(k,676) = -rxt(k,236)*y(k,17)
mat(k,846) = -rxt(k,237)*y(k,17)
mat(k,413) = rxt(k,162)*y(k,28) + rxt(k,239)*y(k,61)
- mat(k,158) = .300_r8*rxt(k,240)*y(k,98)
- mat(k,397) = (rxt(k,243)+rxt(k,244))*y(k,94)
+ mat(k,158) = .300_r8*rxt(k,240)*y(k,99)
+ mat(k,397) = (rxt(k,243)+rxt(k,244))*y(k,95)
mat(k,605) = rxt(k,162)*y(k,21)
mat(k,743) = rxt(k,239)*y(k,21)
mat(k,718) = (rxt(k,243)+rxt(k,244))*y(k,23)
mat(k,846) = mat(k,846) + .300_r8*rxt(k,240)*y(k,22)
- mat(k,210) = -(rxt(k,220)*y(k,25) + rxt(k,221)*y(k,98) + rxt(k,231)*y(k,94))
+ mat(k,210) = -(rxt(k,220)*y(k,25) + rxt(k,221)*y(k,99) + rxt(k,231)*y(k,95))
mat(k,764) = -rxt(k,220)*y(k,18)
mat(k,829) = -rxt(k,221)*y(k,18)
mat(k,711) = -rxt(k,231)*y(k,18)
- mat(k,48) = -(rxt(k,222)*y(k,98))
+ mat(k,48) = -(rxt(k,222)*y(k,99))
mat(k,814) = -rxt(k,222)*y(k,19)
- mat(k,147) = -(rxt(k,223)*y(k,25) + rxt(k,224)*y(k,98))
+ mat(k,147) = -(rxt(k,223)*y(k,25) + rxt(k,224)*y(k,99))
mat(k,761) = -rxt(k,223)*y(k,20)
mat(k,823) = -rxt(k,224)*y(k,20)
- mat(k,411) = -(rxt(k,162)*y(k,28) + rxt(k,238)*y(k,89) + rxt(k,239)*y(k,61))
+ mat(k,411) = -(rxt(k,162)*y(k,28) + rxt(k,238)*y(k,90) + rxt(k,239)*y(k,61))
mat(k,601) = -rxt(k,162)*y(k,21)
mat(k,549) = -rxt(k,238)*y(k,21)
mat(k,741) = -rxt(k,239)*y(k,21)
- mat(k,156) = .700_r8*rxt(k,240)*y(k,98)
- mat(k,394) = rxt(k,156)*y(k,25) + rxt(k,212)*y(k,39) + rxt(k,242)*y(k,94) &
- + rxt(k,241)*y(k,98)
+ mat(k,156) = .700_r8*rxt(k,240)*y(k,99)
+ mat(k,394) = rxt(k,156)*y(k,25) + rxt(k,212)*y(k,39) + rxt(k,242)*y(k,95) &
+ + rxt(k,241)*y(k,99)
mat(k,772) = rxt(k,156)*y(k,23)
mat(k,292) = rxt(k,212)*y(k,23)
mat(k,715) = rxt(k,242)*y(k,23)
mat(k,842) = .700_r8*rxt(k,240)*y(k,22) + rxt(k,241)*y(k,23)
- mat(k,155) = -(rxt(k,240)*y(k,98))
+ mat(k,155) = -(rxt(k,240)*y(k,99))
mat(k,824) = -rxt(k,240)*y(k,22)
- mat(k,410) = rxt(k,238)*y(k,89)
+ mat(k,410) = rxt(k,238)*y(k,90)
mat(k,543) = rxt(k,238)*y(k,21)
- mat(k,393) = -(rxt(k,156)*y(k,25) + rxt(k,212)*y(k,39) + rxt(k,241)*y(k,98) &
- + (rxt(k,242) + rxt(k,243) + rxt(k,244)) * y(k,94))
+ mat(k,393) = -(rxt(k,156)*y(k,25) + rxt(k,212)*y(k,39) + rxt(k,241)*y(k,99) &
+ + (rxt(k,242) + rxt(k,243) + rxt(k,244)) * y(k,95))
mat(k,771) = -rxt(k,156)*y(k,23)
mat(k,291) = -rxt(k,212)*y(k,23)
mat(k,841) = -rxt(k,241)*y(k,23)
mat(k,714) = -(rxt(k,242) + rxt(k,243) + rxt(k,244)) * y(k,23)
- mat(k,161) = -(rxt(k,208)*y(k,94) + rxt(k,225)*y(k,25) + rxt(k,226)*y(k,98))
+ mat(k,161) = -(rxt(k,208)*y(k,95) + rxt(k,225)*y(k,25) + rxt(k,226)*y(k,99))
mat(k,709) = -rxt(k,208)*y(k,24)
mat(k,762) = -rxt(k,225)*y(k,24)
mat(k,825) = -rxt(k,226)*y(k,24)
mat(k,785) = -(rxt(k,155)*y(k,17) + rxt(k,156)*y(k,23) + rxt(k,157)*y(k,41) &
- + rxt(k,158)*y(k,43) + (rxt(k,159) + rxt(k,160)) * y(k,89) &
+ + rxt(k,158)*y(k,43) + (rxt(k,159) + rxt(k,160)) * y(k,90) &
+ rxt(k,161)*y(k,71) + rxt(k,168)*y(k,29) + rxt(k,177)*y(k,54) &
+ rxt(k,218)*y(k,16) + rxt(k,220)*y(k,18) + rxt(k,223)*y(k,20) &
+ rxt(k,225)*y(k,24))
@@ -161,24 +161,24 @@ subroutine nlnmat01( avec_len, mat, y, rxt )
mat(k,152) = -rxt(k,223)*y(k,25)
mat(k,164) = -rxt(k,225)*y(k,25)
mat(k,926) = rxt(k,196)*y(k,28)
- mat(k,31) = 4.000_r8*rxt(k,180)*y(k,94)
- mat(k,58) = rxt(k,181)*y(k,94)
- mat(k,39) = 2.000_r8*rxt(k,182)*y(k,94)
- mat(k,69) = 2.000_r8*rxt(k,183)*y(k,94)
- mat(k,43) = 2.000_r8*rxt(k,184)*y(k,94)
- mat(k,74) = rxt(k,185)*y(k,94)
- mat(k,47) = 2.000_r8*rxt(k,186)*y(k,94)
- mat(k,49) = 3.000_r8*rxt(k,222)*y(k,98)
- mat(k,152) = mat(k,152) + rxt(k,224)*y(k,98)
+ mat(k,31) = 4.000_r8*rxt(k,180)*y(k,95)
+ mat(k,58) = rxt(k,181)*y(k,95)
+ mat(k,39) = 2.000_r8*rxt(k,182)*y(k,95)
+ mat(k,69) = 2.000_r8*rxt(k,183)*y(k,95)
+ mat(k,43) = 2.000_r8*rxt(k,184)*y(k,95)
+ mat(k,74) = rxt(k,185)*y(k,95)
+ mat(k,47) = 2.000_r8*rxt(k,186)*y(k,95)
+ mat(k,49) = 3.000_r8*rxt(k,222)*y(k,99)
+ mat(k,152) = mat(k,152) + rxt(k,224)*y(k,99)
mat(k,419) = rxt(k,162)*y(k,28)
mat(k,615) = rxt(k,196)*y(k,5) + rxt(k,162)*y(k,21) + (4.000_r8*rxt(k,163) &
+2.000_r8*rxt(k,165))*y(k,28) + rxt(k,167)*y(k,61) + rxt(k,172) &
- *y(k,69) + rxt(k,254)*y(k,78) + rxt(k,173)*y(k,98)
- mat(k,93) = rxt(k,217)*y(k,94)
- mat(k,88) = rxt(k,232)*y(k,94) + rxt(k,227)*y(k,98)
- mat(k,98) = rxt(k,233)*y(k,94) + rxt(k,228)*y(k,98)
- mat(k,116) = rxt(k,234)*y(k,94) + rxt(k,229)*y(k,98)
- mat(k,462) = rxt(k,175)*y(k,69) + rxt(k,187)*y(k,94) + rxt(k,176)*y(k,98)
+ *y(k,69) + rxt(k,254)*y(k,79) + rxt(k,173)*y(k,99)
+ mat(k,93) = rxt(k,217)*y(k,95)
+ mat(k,88) = rxt(k,232)*y(k,95) + rxt(k,227)*y(k,99)
+ mat(k,98) = rxt(k,233)*y(k,95) + rxt(k,228)*y(k,99)
+ mat(k,116) = rxt(k,234)*y(k,95) + rxt(k,229)*y(k,99)
+ mat(k,462) = rxt(k,175)*y(k,69) + rxt(k,187)*y(k,95) + rxt(k,176)*y(k,99)
mat(k,753) = rxt(k,167)*y(k,28)
mat(k,686) = rxt(k,172)*y(k,28) + rxt(k,175)*y(k,49)
mat(k,434) = rxt(k,254)*y(k,28)
@@ -200,9 +200,9 @@ subroutine nlnmat01( avec_len, mat, y, rxt )
mat(k,594) = 2.000_r8*rxt(k,189)*y(k,28)
mat(k,610) = -(rxt(k,162)*y(k,21) + (4._r8*rxt(k,163) + 4._r8*rxt(k,164) &
+ 4._r8*rxt(k,165) + 4._r8*rxt(k,189)) * y(k,28) + rxt(k,166) &
- *y(k,89) + rxt(k,167)*y(k,61) + rxt(k,169)*y(k,62) + rxt(k,172) &
- *y(k,69) + (rxt(k,173) + rxt(k,174)) * y(k,98) + (rxt(k,195) &
- + rxt(k,196) + rxt(k,197)) * y(k,5) + rxt(k,254)*y(k,78))
+ *y(k,90) + rxt(k,167)*y(k,61) + rxt(k,169)*y(k,62) + rxt(k,172) &
+ *y(k,69) + (rxt(k,173) + rxt(k,174)) * y(k,99) + (rxt(k,195) &
+ + rxt(k,196) + rxt(k,197)) * y(k,5) + rxt(k,254)*y(k,79))
mat(k,416) = -rxt(k,162)*y(k,28)
mat(k,557) = -rxt(k,166)*y(k,28)
mat(k,748) = -rxt(k,167)*y(k,28)
@@ -211,18 +211,18 @@ subroutine nlnmat01( avec_len, mat, y, rxt )
mat(k,851) = -(rxt(k,173) + rxt(k,174)) * y(k,28)
mat(k,921) = -(rxt(k,195) + rxt(k,196) + rxt(k,197)) * y(k,28)
mat(k,430) = -rxt(k,254)*y(k,28)
- mat(k,780) = rxt(k,177)*y(k,54) + rxt(k,161)*y(k,71) + rxt(k,160)*y(k,89)
+ mat(k,780) = rxt(k,177)*y(k,54) + rxt(k,161)*y(k,71) + rxt(k,160)*y(k,90)
mat(k,311) = rxt(k,170)*y(k,69)
- mat(k,458) = rxt(k,188)*y(k,94)
- mat(k,267) = rxt(k,177)*y(k,25) + rxt(k,178)*y(k,69) + rxt(k,179)*y(k,98)
+ mat(k,458) = rxt(k,188)*y(k,95)
+ mat(k,267) = rxt(k,177)*y(k,25) + rxt(k,178)*y(k,69) + rxt(k,179)*y(k,99)
mat(k,681) = mat(k,681) + rxt(k,170)*y(k,29) + rxt(k,178)*y(k,54)
mat(k,532) = rxt(k,161)*y(k,25)
- mat(k,137) = rxt(k,259)*y(k,78)
- mat(k,430) = mat(k,430) + rxt(k,259)*y(k,72)
+ mat(k,137) = rxt(k,259)*y(k,79)
+ mat(k,430) = mat(k,430) + rxt(k,259)*y(k,73)
mat(k,557) = mat(k,557) + rxt(k,160)*y(k,25)
mat(k,723) = rxt(k,188)*y(k,49)
mat(k,851) = mat(k,851) + rxt(k,179)*y(k,54)
- mat(k,308) = -(rxt(k,168)*y(k,25) + rxt(k,170)*y(k,69) + rxt(k,171)*y(k,98) &
+ mat(k,308) = -(rxt(k,168)*y(k,25) + rxt(k,170)*y(k,69) + rxt(k,171)*y(k,99) &
+ (rxt(k,273) + rxt(k,278) + rxt(k,283)) * y(k,49))
mat(k,768) = -rxt(k,168)*y(k,29)
mat(k,667) = -rxt(k,170)*y(k,29)
@@ -250,125 +250,125 @@ subroutine nlnmat02( avec_len, mat, y, rxt )
! ... complete matrix entries implicit species
!----------------------------------------------
do k = 1,avec_len
- mat(k,282) = -(rxt(k,245)*y(k,98))
+ mat(k,282) = -(rxt(k,245)*y(k,99))
mat(k,834) = -rxt(k,245)*y(k,31)
mat(k,793) = rxt(k,191)*y(k,17)
mat(k,470) = rxt(k,191)*y(k,3) + rxt(k,155)*y(k,25) + rxt(k,235)*y(k,63) &
- + rxt(k,236)*y(k,69) + rxt(k,237)*y(k,98)
+ + rxt(k,236)*y(k,69) + rxt(k,237)*y(k,99)
mat(k,148) = rxt(k,223)*y(k,25)
mat(k,767) = rxt(k,155)*y(k,17) + rxt(k,223)*y(k,20)
- mat(k,197) = rxt(k,299)*y(k,99)
+ mat(k,197) = rxt(k,299)*y(k,100)
mat(k,571) = rxt(k,235)*y(k,17)
- mat(k,665) = rxt(k,236)*y(k,17) + rxt(k,248)*y(k,73)
- mat(k,141) = rxt(k,248)*y(k,69) + rxt(k,249)*y(k,98)
- mat(k,834) = mat(k,834) + rxt(k,237)*y(k,17) + rxt(k,249)*y(k,73)
+ mat(k,665) = rxt(k,236)*y(k,17) + rxt(k,248)*y(k,74)
+ mat(k,141) = rxt(k,248)*y(k,69) + rxt(k,249)*y(k,99)
+ mat(k,834) = mat(k,834) + rxt(k,237)*y(k,17) + rxt(k,249)*y(k,74)
mat(k,373) = rxt(k,299)*y(k,32)
- mat(k,196) = -(rxt(k,299)*y(k,99))
+ mat(k,196) = -(rxt(k,299)*y(k,100))
mat(k,370) = -rxt(k,299)*y(k,32)
- mat(k,281) = rxt(k,245)*y(k,98)
+ mat(k,281) = rxt(k,245)*y(k,99)
mat(k,828) = rxt(k,245)*y(k,31)
- mat(k,82) = -(rxt(k,216)*y(k,94))
+ mat(k,82) = -(rxt(k,216)*y(k,95))
mat(k,703) = -rxt(k,216)*y(k,33)
- mat(k,56) = rxt(k,181)*y(k,94)
- mat(k,61) = rxt(k,207)*y(k,94)
- mat(k,66) = rxt(k,183)*y(k,94)
- mat(k,41) = 2.000_r8*rxt(k,184)*y(k,94)
- mat(k,71) = 2.000_r8*rxt(k,185)*y(k,94)
- mat(k,45) = rxt(k,186)*y(k,94)
- mat(k,33) = 2.000_r8*rxt(k,209)*y(k,94)
- mat(k,94) = rxt(k,233)*y(k,94) + rxt(k,228)*y(k,98)
- mat(k,112) = rxt(k,234)*y(k,94) + rxt(k,229)*y(k,98)
+ mat(k,56) = rxt(k,181)*y(k,95)
+ mat(k,61) = rxt(k,207)*y(k,95)
+ mat(k,66) = rxt(k,183)*y(k,95)
+ mat(k,41) = 2.000_r8*rxt(k,184)*y(k,95)
+ mat(k,71) = 2.000_r8*rxt(k,185)*y(k,95)
+ mat(k,45) = rxt(k,186)*y(k,95)
+ mat(k,33) = 2.000_r8*rxt(k,209)*y(k,95)
+ mat(k,94) = rxt(k,233)*y(k,95) + rxt(k,228)*y(k,99)
+ mat(k,112) = rxt(k,234)*y(k,95) + rxt(k,229)*y(k,99)
mat(k,703) = mat(k,703) + rxt(k,181)*y(k,9) + rxt(k,207)*y(k,10) + rxt(k,183) &
*y(k,12) + 2.000_r8*rxt(k,184)*y(k,13) + 2.000_r8*rxt(k,185) &
*y(k,14) + rxt(k,186)*y(k,15) + 2.000_r8*rxt(k,209)*y(k,42) &
+ rxt(k,233)*y(k,47) + rxt(k,234)*y(k,48)
mat(k,815) = rxt(k,228)*y(k,47) + rxt(k,229)*y(k,48)
- mat(k,90) = -(rxt(k,217)*y(k,94))
+ mat(k,90) = -(rxt(k,217)*y(k,95))
mat(k,705) = -rxt(k,217)*y(k,34)
- mat(k,37) = rxt(k,182)*y(k,94)
- mat(k,67) = rxt(k,183)*y(k,94)
- mat(k,86) = rxt(k,232)*y(k,94) + rxt(k,227)*y(k,98)
+ mat(k,37) = rxt(k,182)*y(k,95)
+ mat(k,67) = rxt(k,183)*y(k,95)
+ mat(k,86) = rxt(k,232)*y(k,95) + rxt(k,227)*y(k,99)
mat(k,705) = mat(k,705) + rxt(k,182)*y(k,11) + rxt(k,183)*y(k,12) &
+ rxt(k,232)*y(k,46)
mat(k,817) = rxt(k,227)*y(k,46)
- mat(k,128) = -(rxt(k,246)*y(k,63) + (rxt(k,247) + rxt(k,261)) * y(k,98))
+ mat(k,128) = -(rxt(k,246)*y(k,63) + (rxt(k,247) + rxt(k,261)) * y(k,99))
mat(k,570) = -rxt(k,246)*y(k,35)
mat(k,821) = -(rxt(k,247) + rxt(k,261)) * y(k,35)
- mat(k,290) = -(rxt(k,212)*y(k,23) + rxt(k,213)*y(k,41) + rxt(k,214)*y(k,102) &
+ mat(k,290) = -(rxt(k,212)*y(k,23) + rxt(k,213)*y(k,41) + rxt(k,214)*y(k,103) &
+ rxt(k,215)*y(k,51))
mat(k,390) = -rxt(k,212)*y(k,39)
mat(k,864) = -rxt(k,213)*y(k,39)
mat(k,936) = -rxt(k,214)*y(k,39)
mat(k,887) = -rxt(k,215)*y(k,39)
- mat(k,62) = rxt(k,207)*y(k,94)
- mat(k,72) = rxt(k,185)*y(k,94)
- mat(k,83) = 2.000_r8*rxt(k,216)*y(k,94)
- mat(k,91) = rxt(k,217)*y(k,94)
+ mat(k,62) = rxt(k,207)*y(k,95)
+ mat(k,72) = rxt(k,185)*y(k,95)
+ mat(k,83) = 2.000_r8*rxt(k,216)*y(k,95)
+ mat(k,91) = rxt(k,217)*y(k,95)
mat(k,713) = rxt(k,207)*y(k,10) + rxt(k,185)*y(k,14) + 2.000_r8*rxt(k,216) &
*y(k,33) + rxt(k,217)*y(k,34)
- mat(k,439) = -((rxt(k,113) + rxt(k,114) + rxt(k,115)) * y(k,89) + rxt(k,116) &
+ mat(k,439) = -((rxt(k,113) + rxt(k,114) + rxt(k,115)) * y(k,90) + rxt(k,116) &
*y(k,70) + rxt(k,119)*y(k,71))
mat(k,550) = -(rxt(k,113) + rxt(k,114) + rxt(k,115)) * y(k,40)
mat(k,507) = -rxt(k,116)*y(k,40)
mat(k,527) = -rxt(k,119)*y(k,40)
- mat(k,473) = rxt(k,237)*y(k,98)
- mat(k,395) = rxt(k,243)*y(k,94)
+ mat(k,473) = rxt(k,237)*y(k,99)
+ mat(k,395) = rxt(k,243)*y(k,95)
mat(k,773) = rxt(k,157)*y(k,41)
mat(k,293) = rxt(k,213)*y(k,41)
mat(k,867) = rxt(k,157)*y(k,25) + rxt(k,213)*y(k,39) + rxt(k,111)*y(k,69) &
- + rxt(k,94)*y(k,94) + rxt(k,120)*y(k,98)
- mat(k,257) = rxt(k,211)*y(k,94)
- mat(k,452) = rxt(k,188)*y(k,94)
- mat(k,350) = rxt(k,143)*y(k,98)
- mat(k,674) = rxt(k,111)*y(k,41) + rxt(k,123)*y(k,98)
- mat(k,144) = rxt(k,249)*y(k,98)
- mat(k,237) = rxt(k,255)*y(k,98)
- mat(k,426) = rxt(k,260)*y(k,98)
+ + rxt(k,94)*y(k,95) + rxt(k,120)*y(k,99)
+ mat(k,257) = rxt(k,211)*y(k,95)
+ mat(k,452) = rxt(k,188)*y(k,95)
+ mat(k,350) = rxt(k,143)*y(k,99)
+ mat(k,674) = rxt(k,111)*y(k,41) + rxt(k,123)*y(k,99)
+ mat(k,144) = rxt(k,249)*y(k,99)
+ mat(k,237) = rxt(k,255)*y(k,99)
+ mat(k,426) = rxt(k,260)*y(k,99)
mat(k,716) = rxt(k,243)*y(k,23) + rxt(k,94)*y(k,41) + rxt(k,211)*y(k,45) &
+ rxt(k,188)*y(k,49)
mat(k,844) = rxt(k,237)*y(k,17) + rxt(k,120)*y(k,41) + rxt(k,143)*y(k,55) &
- + rxt(k,123)*y(k,69) + rxt(k,249)*y(k,73) + rxt(k,255)*y(k,76) &
- + rxt(k,260)*y(k,78)
- mat(k,882) = -(rxt(k,94)*y(k,94) + rxt(k,111)*y(k,69) + rxt(k,120)*y(k,98) &
+ + rxt(k,123)*y(k,69) + rxt(k,249)*y(k,74) + rxt(k,255)*y(k,77) &
+ + rxt(k,260)*y(k,79)
+ mat(k,882) = -(rxt(k,94)*y(k,95) + rxt(k,111)*y(k,69) + rxt(k,120)*y(k,99) &
+ rxt(k,157)*y(k,25) + rxt(k,213)*y(k,39))
mat(k,731) = -rxt(k,94)*y(k,41)
mat(k,689) = -rxt(k,111)*y(k,41)
mat(k,859) = -rxt(k,120)*y(k,41)
mat(k,788) = -rxt(k,157)*y(k,41)
mat(k,296) = -rxt(k,213)*y(k,41)
- mat(k,407) = rxt(k,244)*y(k,94)
- mat(k,445) = rxt(k,113)*y(k,89)
+ mat(k,407) = rxt(k,244)*y(k,95)
+ mat(k,445) = rxt(k,113)*y(k,90)
mat(k,565) = rxt(k,113)*y(k,40)
mat(k,731) = mat(k,731) + rxt(k,244)*y(k,23)
- mat(k,32) = -(rxt(k,209)*y(k,94))
+ mat(k,32) = -(rxt(k,209)*y(k,95))
mat(k,694) = -rxt(k,209)*y(k,42)
- mat(k,228) = -(rxt(k,112)*y(k,69) + rxt(k,121)*y(k,98) + rxt(k,158)*y(k,25))
+ mat(k,228) = -(rxt(k,112)*y(k,69) + rxt(k,121)*y(k,99) + rxt(k,158)*y(k,25))
mat(k,658) = -rxt(k,112)*y(k,43)
mat(k,830) = -rxt(k,121)*y(k,43)
mat(k,765) = -rxt(k,158)*y(k,43)
- mat(k,545) = 2.000_r8*rxt(k,127)*y(k,89)
- mat(k,830) = mat(k,830) + 2.000_r8*rxt(k,126)*y(k,98)
- mat(k,107) = rxt(k,262)*y(k,102)
- mat(k,933) = rxt(k,262)*y(k,80)
- mat(k,256) = -(rxt(k,204)*y(k,69) + rxt(k,205)*y(k,98) + (rxt(k,210) &
- + rxt(k,211)) * y(k,94))
+ mat(k,545) = 2.000_r8*rxt(k,127)*y(k,90)
+ mat(k,830) = mat(k,830) + 2.000_r8*rxt(k,126)*y(k,99)
+ mat(k,107) = rxt(k,262)*y(k,103)
+ mat(k,933) = rxt(k,262)*y(k,81)
+ mat(k,256) = -(rxt(k,204)*y(k,69) + rxt(k,205)*y(k,99) + (rxt(k,210) &
+ + rxt(k,211)) * y(k,95))
mat(k,662) = -rxt(k,204)*y(k,45)
mat(k,832) = -rxt(k,205)*y(k,45)
mat(k,712) = -(rxt(k,210) + rxt(k,211)) * y(k,45)
- mat(k,792) = rxt(k,191)*y(k,17) + rxt(k,192)*y(k,89)
+ mat(k,792) = rxt(k,191)*y(k,17) + rxt(k,192)*y(k,90)
mat(k,469) = rxt(k,191)*y(k,3)
mat(k,547) = rxt(k,192)*y(k,3)
- mat(k,85) = -(rxt(k,227)*y(k,98) + rxt(k,232)*y(k,94))
+ mat(k,85) = -(rxt(k,227)*y(k,99) + rxt(k,232)*y(k,95))
mat(k,816) = -rxt(k,227)*y(k,46)
mat(k,704) = -rxt(k,232)*y(k,46)
- mat(k,95) = -(rxt(k,228)*y(k,98) + rxt(k,233)*y(k,94))
+ mat(k,95) = -(rxt(k,228)*y(k,99) + rxt(k,233)*y(k,95))
mat(k,818) = -rxt(k,228)*y(k,47)
mat(k,706) = -rxt(k,233)*y(k,47)
- mat(k,113) = -(rxt(k,229)*y(k,98) + rxt(k,234)*y(k,94))
+ mat(k,113) = -(rxt(k,229)*y(k,99) + rxt(k,234)*y(k,95))
mat(k,820) = -rxt(k,229)*y(k,48)
mat(k,708) = -rxt(k,234)*y(k,48)
- mat(k,453) = -(rxt(k,175)*y(k,69) + rxt(k,176)*y(k,98) + (rxt(k,187) &
- + rxt(k,188)) * y(k,94) + (rxt(k,268) + rxt(k,274) + rxt(k,279) &
+ mat(k,453) = -(rxt(k,175)*y(k,69) + rxt(k,176)*y(k,99) + (rxt(k,187) &
+ + rxt(k,188)) * y(k,95) + (rxt(k,268) + rxt(k,274) + rxt(k,279) &
) * y(k,54) + (rxt(k,273) + rxt(k,278) + rxt(k,283)) * y(k,29) &
+ (rxt(k,275) + rxt(k,280)) * y(k,53))
mat(k,675) = -rxt(k,175)*y(k,49)
@@ -386,8 +386,8 @@ subroutine nlnmat02( avec_len, mat, y, rxt )
mat(k,774) = rxt(k,218)*y(k,16) + rxt(k,155)*y(k,17) + rxt(k,220)*y(k,18) &
+ 2.000_r8*rxt(k,223)*y(k,20) + rxt(k,156)*y(k,23) + rxt(k,225) &
*y(k,24) + rxt(k,157)*y(k,41) + rxt(k,158)*y(k,43) + rxt(k,177) &
- *y(k,54) + rxt(k,159)*y(k,89)
- mat(k,604) = rxt(k,174)*y(k,98)
+ *y(k,54) + rxt(k,159)*y(k,90)
+ mat(k,604) = rxt(k,174)*y(k,99)
mat(k,868) = rxt(k,157)*y(k,25)
mat(k,229) = rxt(k,158)*y(k,25)
mat(k,266) = mat(k,266) + rxt(k,177)*y(k,25)
@@ -395,63 +395,63 @@ subroutine nlnmat02( avec_len, mat, y, rxt )
mat(k,845) = mat(k,845) + rxt(k,174)*y(k,28)
mat(k,387) = rxt(k,212)*y(k,39)
mat(k,289) = rxt(k,212)*y(k,23) + rxt(k,213)*y(k,41) + rxt(k,215)*y(k,51) &
- + rxt(k,214)*y(k,102)
+ + rxt(k,214)*y(k,103)
mat(k,863) = rxt(k,213)*y(k,39)
mat(k,886) = rxt(k,215)*y(k,39)
mat(k,935) = rxt(k,214)*y(k,39)
- mat(k,906) = -(rxt(k,152)*y(k,98) + rxt(k,215)*y(k,39))
+ mat(k,906) = -(rxt(k,152)*y(k,99) + rxt(k,215)*y(k,39))
mat(k,860) = -rxt(k,152)*y(k,51)
mat(k,297) = -rxt(k,215)*y(k,51)
mat(k,489) = rxt(k,235)*y(k,63)
mat(k,316) = (rxt(k,273)+rxt(k,278)+rxt(k,283))*y(k,49)
mat(k,133) = rxt(k,246)*y(k,63)
mat(k,466) = (rxt(k,273)+rxt(k,278)+rxt(k,283))*y(k,29)
- mat(k,648) = rxt(k,151)*y(k,98)
+ mat(k,648) = rxt(k,151)*y(k,99)
mat(k,591) = rxt(k,235)*y(k,17) + rxt(k,246)*y(k,35)
mat(k,860) = mat(k,860) + rxt(k,151)*y(k,62)
- mat(k,167) = -(rxt(k,128)*y(k,98))
+ mat(k,167) = -(rxt(k,128)*y(k,99))
mat(k,826) = -rxt(k,128)*y(k,52)
- mat(k,624) = rxt(k,149)*y(k,89)
+ mat(k,624) = rxt(k,149)*y(k,90)
mat(k,544) = rxt(k,149)*y(k,62)
mat(k,248) = -(rxt(k,206)*y(k,69) + (rxt(k,275) + rxt(k,280)) * y(k,49))
mat(k,661) = -rxt(k,206)*y(k,53)
mat(k,449) = -(rxt(k,275) + rxt(k,280)) * y(k,53)
- mat(k,912) = rxt(k,198)*y(k,89)
+ mat(k,912) = rxt(k,198)*y(k,90)
mat(k,546) = rxt(k,198)*y(k,5)
- mat(k,265) = -(rxt(k,177)*y(k,25) + rxt(k,178)*y(k,69) + rxt(k,179)*y(k,98) &
+ mat(k,265) = -(rxt(k,177)*y(k,25) + rxt(k,178)*y(k,69) + rxt(k,179)*y(k,99) &
+ (rxt(k,268) + rxt(k,274) + rxt(k,279)) * y(k,49))
mat(k,766) = -rxt(k,177)*y(k,54)
mat(k,663) = -rxt(k,178)*y(k,54)
mat(k,833) = -rxt(k,179)*y(k,54)
mat(k,450) = -(rxt(k,268) + rxt(k,274) + rxt(k,279)) * y(k,54)
- mat(k,598) = rxt(k,166)*y(k,89)
- mat(k,307) = rxt(k,171)*y(k,98)
+ mat(k,598) = rxt(k,166)*y(k,90)
+ mat(k,307) = rxt(k,171)*y(k,99)
mat(k,548) = rxt(k,166)*y(k,28)
mat(k,833) = mat(k,833) + rxt(k,171)*y(k,29)
mat(k,347) = -(rxt(k,131)*y(k,61) + (rxt(k,132) + rxt(k,133) + rxt(k,134) &
- ) * y(k,62) + rxt(k,135)*y(k,70) + rxt(k,143)*y(k,98) + rxt(k,296) &
- *y(k,97))
+ ) * y(k,62) + rxt(k,135)*y(k,70) + rxt(k,143)*y(k,99) + rxt(k,296) &
+ *y(k,98))
mat(k,738) = -rxt(k,131)*y(k,55)
mat(k,629) = -(rxt(k,132) + rxt(k,133) + rxt(k,134)) * y(k,55)
mat(k,503) = -rxt(k,135)*y(k,55)
mat(k,838) = -rxt(k,143)*y(k,55)
mat(k,360) = -rxt(k,296)*y(k,55)
- mat(k,670) = rxt(k,129)*y(k,90) + rxt(k,293)*y(k,93)
- mat(k,503) = mat(k,503) + rxt(k,294)*y(k,93)
- mat(k,325) = 1.100_r8*rxt(k,289)*y(k,91) + .200_r8*rxt(k,287)*y(k,92)
+ mat(k,670) = rxt(k,129)*y(k,91) + rxt(k,293)*y(k,94)
+ mat(k,503) = mat(k,503) + rxt(k,294)*y(k,94)
+ mat(k,325) = 1.100_r8*rxt(k,289)*y(k,92) + .200_r8*rxt(k,287)*y(k,93)
mat(k,335) = rxt(k,129)*y(k,69)
- mat(k,223) = 1.100_r8*rxt(k,289)*y(k,88)
- mat(k,245) = .200_r8*rxt(k,287)*y(k,88)
+ mat(k,223) = 1.100_r8*rxt(k,289)*y(k,89)
+ mat(k,245) = .200_r8*rxt(k,287)*y(k,89)
mat(k,276) = rxt(k,293)*y(k,69) + rxt(k,294)*y(k,70)
- mat(k,103) = -((rxt(k,147) + rxt(k,148)) * y(k,94))
+ mat(k,103) = -((rxt(k,147) + rxt(k,148)) * y(k,95))
mat(k,707) = -(rxt(k,147) + rxt(k,148)) * y(k,56)
mat(k,342) = rxt(k,132)*y(k,62)
mat(k,622) = rxt(k,132)*y(k,55)
mat(k,623) = rxt(k,150)*y(k,63)
mat(k,569) = rxt(k,150)*y(k,62)
- mat(k,752) = -(rxt(k,131)*y(k,55) + rxt(k,140)*y(k,63) + rxt(k,144)*y(k,89) &
+ mat(k,752) = -(rxt(k,131)*y(k,55) + rxt(k,140)*y(k,63) + rxt(k,144)*y(k,90) &
+ rxt(k,145)*y(k,71) + rxt(k,146)*y(k,69) + rxt(k,167)*y(k,28) &
- + rxt(k,199)*y(k,5) + rxt(k,239)*y(k,21) + rxt(k,298)*y(k,97))
+ + rxt(k,199)*y(k,5) + rxt(k,239)*y(k,21) + rxt(k,298)*y(k,98))
mat(k,355) = -rxt(k,131)*y(k,61)
mat(k,586) = -rxt(k,140)*y(k,61)
mat(k,561) = -rxt(k,144)*y(k,61)
@@ -462,12 +462,12 @@ subroutine nlnmat02( avec_len, mat, y, rxt )
mat(k,418) = -rxt(k,239)*y(k,61)
mat(k,368) = -rxt(k,298)*y(k,61)
mat(k,355) = mat(k,355) + 2.000_r8*rxt(k,133)*y(k,62) + rxt(k,135)*y(k,70) &
- + rxt(k,143)*y(k,98)
- mat(k,106) = 2.000_r8*rxt(k,147)*y(k,94)
+ + rxt(k,143)*y(k,99)
+ mat(k,106) = 2.000_r8*rxt(k,147)*y(k,95)
mat(k,643) = 2.000_r8*rxt(k,133)*y(k,55) + rxt(k,136)*y(k,69) + rxt(k,256) &
- *y(k,78)
+ *y(k,79)
mat(k,685) = mat(k,685) + rxt(k,136)*y(k,62)
- mat(k,515) = rxt(k,135)*y(k,55) + rxt(k,130)*y(k,90)
+ mat(k,515) = rxt(k,135)*y(k,55) + rxt(k,130)*y(k,91)
mat(k,433) = rxt(k,256)*y(k,62)
mat(k,341) = rxt(k,130)*y(k,70)
mat(k,727) = 2.000_r8*rxt(k,147)*y(k,56)
@@ -494,8 +494,8 @@ subroutine nlnmat03( avec_len, mat, y, rxt )
do k = 1,avec_len
mat(k,640) = -((rxt(k,132) + rxt(k,133) + rxt(k,134)) * y(k,55) + (rxt(k,136) &
+ rxt(k,138)) * y(k,69) + rxt(k,137)*y(k,71) + rxt(k,149) &
- *y(k,89) + rxt(k,150)*y(k,63) + rxt(k,151)*y(k,98) + rxt(k,169) &
- *y(k,28) + rxt(k,200)*y(k,5) + rxt(k,256)*y(k,78))
+ *y(k,90) + rxt(k,150)*y(k,63) + rxt(k,151)*y(k,99) + rxt(k,169) &
+ *y(k,28) + rxt(k,200)*y(k,5) + rxt(k,256)*y(k,79))
mat(k,352) = -(rxt(k,132) + rxt(k,133) + rxt(k,134)) * y(k,62)
mat(k,682) = -(rxt(k,136) + rxt(k,138)) * y(k,62)
mat(k,533) = -rxt(k,137)*y(k,62)
@@ -508,18 +508,18 @@ subroutine nlnmat03( avec_len, mat, y, rxt )
mat(k,922) = mat(k,922) + rxt(k,199)*y(k,61)
mat(k,417) = rxt(k,239)*y(k,61)
mat(k,611) = mat(k,611) + rxt(k,167)*y(k,61)
- mat(k,171) = rxt(k,128)*y(k,98)
+ mat(k,171) = rxt(k,128)*y(k,99)
mat(k,749) = rxt(k,199)*y(k,5) + rxt(k,239)*y(k,21) + rxt(k,167)*y(k,28) &
+ 2.000_r8*rxt(k,140)*y(k,63) + rxt(k,146)*y(k,69) + rxt(k,145) &
- *y(k,71) + rxt(k,144)*y(k,89)
+ *y(k,71) + rxt(k,144)*y(k,90)
mat(k,583) = mat(k,583) + 2.000_r8*rxt(k,140)*y(k,61) + rxt(k,141)*y(k,69) &
- + rxt(k,139)*y(k,89) + rxt(k,142)*y(k,98)
+ + rxt(k,139)*y(k,90) + rxt(k,142)*y(k,99)
mat(k,682) = mat(k,682) + rxt(k,146)*y(k,61) + rxt(k,141)*y(k,63)
mat(k,533) = mat(k,533) + rxt(k,145)*y(k,61)
mat(k,558) = mat(k,558) + rxt(k,144)*y(k,61) + rxt(k,139)*y(k,63)
mat(k,852) = mat(k,852) + rxt(k,128)*y(k,52) + rxt(k,142)*y(k,63)
- mat(k,581) = -(rxt(k,139)*y(k,89) + rxt(k,140)*y(k,61) + rxt(k,141)*y(k,69) &
- + rxt(k,142)*y(k,98) + rxt(k,150)*y(k,62) + rxt(k,235)*y(k,17) &
+ mat(k,581) = -(rxt(k,139)*y(k,90) + rxt(k,140)*y(k,61) + rxt(k,141)*y(k,69) &
+ + rxt(k,142)*y(k,99) + rxt(k,150)*y(k,62) + rxt(k,235)*y(k,17) &
+ rxt(k,246)*y(k,35))
mat(k,556) = -rxt(k,139)*y(k,63)
mat(k,747) = -rxt(k,140)*y(k,63)
@@ -530,9 +530,9 @@ subroutine nlnmat03( avec_len, mat, y, rxt )
mat(k,131) = -rxt(k,246)*y(k,63)
mat(k,204) = rxt(k,201)*y(k,69)
mat(k,779) = rxt(k,168)*y(k,29)
- mat(k,310) = rxt(k,168)*y(k,25) + rxt(k,170)*y(k,69) + rxt(k,171)*y(k,98)
+ mat(k,310) = rxt(k,168)*y(k,25) + rxt(k,170)*y(k,69) + rxt(k,171)*y(k,99)
mat(k,294) = rxt(k,215)*y(k,51)
- mat(k,896) = rxt(k,215)*y(k,39) + rxt(k,152)*y(k,98)
+ mat(k,896) = rxt(k,215)*y(k,39) + rxt(k,152)*y(k,99)
mat(k,638) = mat(k,638) + rxt(k,138)*y(k,69) + rxt(k,137)*y(k,71)
mat(k,680) = mat(k,680) + rxt(k,201)*y(k,6) + rxt(k,170)*y(k,29) + rxt(k,138) &
*y(k,62)
@@ -540,13 +540,13 @@ subroutine nlnmat03( avec_len, mat, y, rxt )
mat(k,850) = mat(k,850) + rxt(k,171)*y(k,29) + rxt(k,152)*y(k,51)
mat(k,683) = -(rxt(k,108)*y(k,71) + 4._r8*rxt(k,109)*y(k,69) + rxt(k,110) &
*y(k,70) + rxt(k,111)*y(k,41) + rxt(k,112)*y(k,43) + rxt(k,117) &
- *y(k,89) + rxt(k,123)*y(k,98) + (rxt(k,136) + rxt(k,138) &
+ *y(k,90) + rxt(k,123)*y(k,99) + (rxt(k,136) + rxt(k,138) &
) * y(k,62) + rxt(k,141)*y(k,63) + rxt(k,146)*y(k,61) + rxt(k,170) &
*y(k,29) + rxt(k,172)*y(k,28) + rxt(k,175)*y(k,49) + rxt(k,178) &
*y(k,54) + rxt(k,201)*y(k,6) + rxt(k,202)*y(k,5) + rxt(k,204) &
*y(k,45) + rxt(k,206)*y(k,53) + rxt(k,236)*y(k,17) + rxt(k,248) &
- *y(k,73) + (rxt(k,291) + rxt(k,292)) * y(k,91) + rxt(k,293) &
- *y(k,93))
+ *y(k,74) + (rxt(k,291) + rxt(k,292)) * y(k,92) + rxt(k,293) &
+ *y(k,94))
mat(k,534) = -rxt(k,108)*y(k,69)
mat(k,513) = -rxt(k,110)*y(k,69)
mat(k,876) = -rxt(k,111)*y(k,69)
@@ -568,31 +568,31 @@ subroutine nlnmat03( avec_len, mat, y, rxt )
mat(k,145) = -rxt(k,248)*y(k,69)
mat(k,227) = -(rxt(k,291) + rxt(k,292)) * y(k,69)
mat(k,280) = -rxt(k,293)*y(k,69)
- mat(k,443) = rxt(k,115)*y(k,89)
+ mat(k,443) = rxt(k,115)*y(k,90)
mat(k,353) = rxt(k,131)*y(k,61) + rxt(k,132)*y(k,62) + rxt(k,135)*y(k,70) &
- + rxt(k,296)*y(k,97)
+ + rxt(k,296)*y(k,98)
mat(k,750) = mat(k,750) + rxt(k,131)*y(k,55)
mat(k,641) = mat(k,641) + rxt(k,132)*y(k,55)
- mat(k,513) = mat(k,513) + rxt(k,135)*y(k,55) + rxt(k,250)*y(k,76) &
- + rxt(k,257)*y(k,78) + rxt(k,295)*y(k,93) + (rxt(k,97)+rxt(k,98)) &
- *y(k,94) + rxt(k,302)*y(k,99) + rxt(k,306)*y(k,100)
+ mat(k,513) = mat(k,513) + rxt(k,135)*y(k,55) + rxt(k,250)*y(k,77) &
+ + rxt(k,257)*y(k,79) + rxt(k,295)*y(k,94) + (rxt(k,97)+rxt(k,98)) &
+ *y(k,95) + rxt(k,302)*y(k,100) + rxt(k,306)*y(k,101)
mat(k,240) = rxt(k,250)*y(k,70)
mat(k,432) = rxt(k,257)*y(k,70)
- mat(k,329) = rxt(k,287)*y(k,92) + 1.150_r8*rxt(k,288)*y(k,97)
+ mat(k,329) = rxt(k,287)*y(k,93) + 1.150_r8*rxt(k,288)*y(k,98)
mat(k,559) = mat(k,559) + rxt(k,115)*y(k,40)
- mat(k,339) = rxt(k,301)*y(k,99)
- mat(k,246) = rxt(k,287)*y(k,88)
+ mat(k,339) = rxt(k,301)*y(k,100)
+ mat(k,246) = rxt(k,287)*y(k,89)
mat(k,280) = mat(k,280) + rxt(k,295)*y(k,70)
mat(k,725) = (rxt(k,97)+rxt(k,98))*y(k,70)
- mat(k,366) = rxt(k,296)*y(k,55) + 1.150_r8*rxt(k,288)*y(k,88)
- mat(k,853) = mat(k,853) + 2.000_r8*rxt(k,125)*y(k,98)
- mat(k,383) = rxt(k,302)*y(k,70) + rxt(k,301)*y(k,90)
+ mat(k,366) = rxt(k,296)*y(k,55) + 1.150_r8*rxt(k,288)*y(k,89)
+ mat(k,853) = mat(k,853) + 2.000_r8*rxt(k,125)*y(k,99)
+ mat(k,383) = rxt(k,302)*y(k,70) + rxt(k,301)*y(k,91)
mat(k,193) = rxt(k,306)*y(k,70)
- mat(k,508) = -(rxt(k,97)*y(k,94) + rxt(k,102)*y(k,95) + rxt(k,110)*y(k,69) &
- + rxt(k,116)*y(k,40) + rxt(k,130)*y(k,90) + rxt(k,135)*y(k,55) &
- + rxt(k,250)*y(k,76) + rxt(k,257)*y(k,78) + rxt(k,290)*y(k,91) &
- + (rxt(k,294) + rxt(k,295)) * y(k,93) + rxt(k,302)*y(k,99) &
- + rxt(k,306)*y(k,100))
+ mat(k,508) = -(rxt(k,97)*y(k,95) + rxt(k,102)*y(k,96) + rxt(k,110)*y(k,69) &
+ + rxt(k,116)*y(k,40) + rxt(k,130)*y(k,91) + rxt(k,135)*y(k,55) &
+ + rxt(k,250)*y(k,77) + rxt(k,257)*y(k,79) + rxt(k,290)*y(k,92) &
+ + (rxt(k,294) + rxt(k,295)) * y(k,94) + rxt(k,302)*y(k,100) &
+ + rxt(k,306)*y(k,101))
mat(k,719) = -rxt(k,97)*y(k,70)
mat(k,78) = -rxt(k,102)*y(k,70)
mat(k,677) = -rxt(k,110)*y(k,70)
@@ -605,46 +605,46 @@ subroutine nlnmat03( avec_len, mat, y, rxt )
mat(k,279) = -(rxt(k,294) + rxt(k,295)) * y(k,70)
mat(k,380) = -rxt(k,302)*y(k,70)
mat(k,192) = -rxt(k,306)*y(k,70)
- mat(k,798) = rxt(k,193)*y(k,71) + rxt(k,192)*y(k,89)
+ mat(k,798) = rxt(k,193)*y(k,71) + rxt(k,192)*y(k,90)
mat(k,917) = 2.000_r8*rxt(k,194)*y(k,5) + (rxt(k,196)+rxt(k,197))*y(k,28) &
- + rxt(k,202)*y(k,69) + rxt(k,198)*y(k,89)
- mat(k,414) = rxt(k,238)*y(k,89)
- mat(k,776) = rxt(k,161)*y(k,71) + rxt(k,159)*y(k,89)
+ + rxt(k,202)*y(k,69) + rxt(k,198)*y(k,90)
+ mat(k,414) = rxt(k,238)*y(k,90)
+ mat(k,776) = rxt(k,161)*y(k,71) + rxt(k,159)*y(k,90)
mat(k,606) = (rxt(k,196)+rxt(k,197))*y(k,5) + (2.000_r8*rxt(k,163) &
+2.000_r8*rxt(k,164))*y(k,28) + rxt(k,172)*y(k,69) + rxt(k,166) &
- *y(k,89) + rxt(k,174)*y(k,98)
- mat(k,440) = mat(k,440) + rxt(k,119)*y(k,71) + rxt(k,113)*y(k,89)
- mat(k,168) = rxt(k,128)*y(k,98)
+ *y(k,90) + rxt(k,174)*y(k,99)
+ mat(k,440) = mat(k,440) + rxt(k,119)*y(k,71) + rxt(k,113)*y(k,90)
+ mat(k,168) = rxt(k,128)*y(k,99)
mat(k,351) = mat(k,351) + rxt(k,134)*y(k,62)
- mat(k,104) = rxt(k,148)*y(k,94)
- mat(k,744) = rxt(k,145)*y(k,71) + rxt(k,298)*y(k,97)
+ mat(k,104) = rxt(k,148)*y(k,95)
+ mat(k,744) = rxt(k,145)*y(k,71) + rxt(k,298)*y(k,98)
mat(k,635) = rxt(k,134)*y(k,55) + rxt(k,136)*y(k,69) + rxt(k,137)*y(k,71)
- mat(k,578) = rxt(k,141)*y(k,69) + rxt(k,139)*y(k,89)
+ mat(k,578) = rxt(k,141)*y(k,69) + rxt(k,139)*y(k,90)
mat(k,677) = mat(k,677) + rxt(k,202)*y(k,5) + rxt(k,172)*y(k,28) + rxt(k,136) &
*y(k,62) + rxt(k,141)*y(k,63) + 2.000_r8*rxt(k,109)*y(k,69) &
- + 2.000_r8*rxt(k,108)*y(k,71) + rxt(k,117)*y(k,89) + rxt(k,101) &
- *y(k,95) + rxt(k,123)*y(k,98)
- mat(k,508) = mat(k,508) + 2.000_r8*rxt(k,102)*y(k,95)
+ + 2.000_r8*rxt(k,108)*y(k,71) + rxt(k,117)*y(k,90) + rxt(k,101) &
+ *y(k,96) + rxt(k,123)*y(k,99)
+ mat(k,508) = mat(k,508) + 2.000_r8*rxt(k,102)*y(k,96)
mat(k,528) = rxt(k,193)*y(k,3) + rxt(k,161)*y(k,25) + rxt(k,119)*y(k,40) &
+ rxt(k,145)*y(k,61) + rxt(k,137)*y(k,62) + 2.000_r8*rxt(k,108) &
- *y(k,69) + rxt(k,252)*y(k,76) + rxt(k,258)*y(k,78) &
- + 2.000_r8*rxt(k,118)*y(k,89) + 2.000_r8*rxt(k,99)*y(k,94) &
- + rxt(k,124)*y(k,98)
+ *y(k,69) + rxt(k,252)*y(k,77) + rxt(k,258)*y(k,79) &
+ + 2.000_r8*rxt(k,118)*y(k,90) + 2.000_r8*rxt(k,99)*y(k,95) &
+ + rxt(k,124)*y(k,99)
mat(k,238) = mat(k,238) + rxt(k,252)*y(k,71)
mat(k,427) = mat(k,427) + rxt(k,258)*y(k,71)
mat(k,553) = rxt(k,192)*y(k,3) + rxt(k,198)*y(k,5) + rxt(k,238)*y(k,21) &
+ rxt(k,159)*y(k,25) + rxt(k,166)*y(k,28) + rxt(k,113)*y(k,40) &
+ rxt(k,139)*y(k,63) + rxt(k,117)*y(k,69) + 2.000_r8*rxt(k,118) &
- *y(k,71) + 2.000_r8*rxt(k,127)*y(k,89) + rxt(k,122)*y(k,98)
+ *y(k,71) + 2.000_r8*rxt(k,127)*y(k,90) + rxt(k,122)*y(k,99)
mat(k,719) = mat(k,719) + rxt(k,148)*y(k,56) + 2.000_r8*rxt(k,99)*y(k,71)
mat(k,78) = mat(k,78) + rxt(k,101)*y(k,69) + 2.000_r8*rxt(k,102)*y(k,70)
mat(k,364) = rxt(k,298)*y(k,61)
mat(k,847) = rxt(k,174)*y(k,28) + rxt(k,128)*y(k,52) + rxt(k,123)*y(k,69) &
- + rxt(k,124)*y(k,71) + rxt(k,122)*y(k,89)
- mat(k,529) = -(rxt(k,99)*y(k,94) + rxt(k,108)*y(k,69) + rxt(k,118)*y(k,89) &
- + rxt(k,119)*y(k,40) + rxt(k,124)*y(k,98) + rxt(k,137)*y(k,62) &
+ + rxt(k,124)*y(k,71) + rxt(k,122)*y(k,90)
+ mat(k,529) = -(rxt(k,99)*y(k,95) + rxt(k,108)*y(k,69) + rxt(k,118)*y(k,90) &
+ + rxt(k,119)*y(k,40) + rxt(k,124)*y(k,99) + rxt(k,137)*y(k,62) &
+ rxt(k,145)*y(k,61) + rxt(k,161)*y(k,25) + rxt(k,193)*y(k,3) &
- + rxt(k,252)*y(k,76) + rxt(k,258)*y(k,78))
+ + rxt(k,252)*y(k,77) + rxt(k,258)*y(k,79))
mat(k,720) = -rxt(k,99)*y(k,71)
mat(k,678) = -rxt(k,108)*y(k,71)
mat(k,554) = -rxt(k,118)*y(k,71)
@@ -658,49 +658,49 @@ subroutine nlnmat03( avec_len, mat, y, rxt )
mat(k,428) = -rxt(k,258)*y(k,71)
mat(k,678) = mat(k,678) + rxt(k,110)*y(k,70)
mat(k,509) = rxt(k,110)*y(k,69)
- mat(k,134) = -(rxt(k,259)*y(k,78))
- mat(k,422) = -rxt(k,259)*y(k,72)
+ mat(k,134) = -(rxt(k,259)*y(k,79))
+ mat(k,422) = -rxt(k,259)*y(k,73)
mat(k,910) = rxt(k,195)*y(k,28)
mat(k,597) = rxt(k,195)*y(k,5) + 2.000_r8*rxt(k,165)*y(k,28)
- mat(k,139) = -(rxt(k,248)*y(k,69) + rxt(k,249)*y(k,98))
- mat(k,653) = -rxt(k,248)*y(k,73)
- mat(k,822) = -rxt(k,249)*y(k,73)
- mat(k,235) = -(rxt(k,250)*y(k,70) + rxt(k,252)*y(k,71) + rxt(k,255)*y(k,98))
- mat(k,497) = -rxt(k,250)*y(k,76)
- mat(k,524) = -rxt(k,252)*y(k,76)
- mat(k,831) = -rxt(k,255)*y(k,76)
+ mat(k,139) = -(rxt(k,248)*y(k,69) + rxt(k,249)*y(k,99))
+ mat(k,653) = -rxt(k,248)*y(k,74)
+ mat(k,822) = -rxt(k,249)*y(k,74)
+ mat(k,235) = -(rxt(k,250)*y(k,70) + rxt(k,252)*y(k,71) + rxt(k,255)*y(k,99))
+ mat(k,497) = -rxt(k,250)*y(k,77)
+ mat(k,524) = -rxt(k,252)*y(k,77)
+ mat(k,831) = -rxt(k,255)*y(k,77)
mat(k,425) = -(rxt(k,253)*y(k,5) + rxt(k,254)*y(k,28) + rxt(k,256)*y(k,62) &
- + rxt(k,257)*y(k,70) + rxt(k,258)*y(k,71) + rxt(k,259)*y(k,72) &
- + rxt(k,260)*y(k,98))
- mat(k,914) = -rxt(k,253)*y(k,78)
- mat(k,602) = -rxt(k,254)*y(k,78)
- mat(k,632) = -rxt(k,256)*y(k,78)
- mat(k,506) = -rxt(k,257)*y(k,78)
- mat(k,526) = -rxt(k,258)*y(k,78)
- mat(k,136) = -rxt(k,259)*y(k,78)
- mat(k,843) = -rxt(k,260)*y(k,78)
- mat(k,673) = rxt(k,248)*y(k,73)
- mat(k,506) = mat(k,506) + rxt(k,250)*y(k,76)
- mat(k,526) = mat(k,526) + rxt(k,252)*y(k,76)
+ + rxt(k,257)*y(k,70) + rxt(k,258)*y(k,71) + rxt(k,259)*y(k,73) &
+ + rxt(k,260)*y(k,99))
+ mat(k,914) = -rxt(k,253)*y(k,79)
+ mat(k,602) = -rxt(k,254)*y(k,79)
+ mat(k,632) = -rxt(k,256)*y(k,79)
+ mat(k,506) = -rxt(k,257)*y(k,79)
+ mat(k,526) = -rxt(k,258)*y(k,79)
+ mat(k,136) = -rxt(k,259)*y(k,79)
+ mat(k,843) = -rxt(k,260)*y(k,79)
+ mat(k,673) = rxt(k,248)*y(k,74)
+ mat(k,506) = mat(k,506) + rxt(k,250)*y(k,77)
+ mat(k,526) = mat(k,526) + rxt(k,252)*y(k,77)
mat(k,143) = rxt(k,248)*y(k,69)
- mat(k,236) = rxt(k,250)*y(k,70) + rxt(k,252)*y(k,71) + rxt(k,255)*y(k,98)
- mat(k,843) = mat(k,843) + rxt(k,255)*y(k,76)
- mat(k,300) = -(rxt(k,251)*y(k,98))
- mat(k,836) = -rxt(k,251)*y(k,79)
- mat(k,913) = rxt(k,253)*y(k,78)
- mat(k,599) = rxt(k,254)*y(k,78)
- mat(k,129) = rxt(k,246)*y(k,63) + (rxt(k,247)+.500_r8*rxt(k,261))*y(k,98)
- mat(k,627) = rxt(k,256)*y(k,78)
+ mat(k,236) = rxt(k,250)*y(k,70) + rxt(k,252)*y(k,71) + rxt(k,255)*y(k,99)
+ mat(k,843) = mat(k,843) + rxt(k,255)*y(k,77)
+ mat(k,300) = -(rxt(k,251)*y(k,99))
+ mat(k,836) = -rxt(k,251)*y(k,80)
+ mat(k,913) = rxt(k,253)*y(k,79)
+ mat(k,599) = rxt(k,254)*y(k,79)
+ mat(k,129) = rxt(k,246)*y(k,63) + (rxt(k,247)+.500_r8*rxt(k,261))*y(k,99)
+ mat(k,627) = rxt(k,256)*y(k,79)
mat(k,572) = rxt(k,246)*y(k,35)
- mat(k,500) = rxt(k,257)*y(k,78)
- mat(k,525) = rxt(k,258)*y(k,78)
- mat(k,135) = rxt(k,259)*y(k,78)
- mat(k,142) = rxt(k,249)*y(k,98)
+ mat(k,500) = rxt(k,257)*y(k,79)
+ mat(k,525) = rxt(k,258)*y(k,79)
+ mat(k,135) = rxt(k,259)*y(k,79)
+ mat(k,142) = rxt(k,249)*y(k,99)
mat(k,424) = rxt(k,253)*y(k,5) + rxt(k,254)*y(k,28) + rxt(k,256)*y(k,62) &
- + rxt(k,257)*y(k,70) + rxt(k,258)*y(k,71) + rxt(k,259)*y(k,72) &
- + rxt(k,260)*y(k,98)
+ + rxt(k,257)*y(k,70) + rxt(k,258)*y(k,71) + rxt(k,259)*y(k,73) &
+ + rxt(k,260)*y(k,99)
mat(k,836) = mat(k,836) + (rxt(k,247)+.500_r8*rxt(k,261))*y(k,35) &
- + rxt(k,249)*y(k,73) + rxt(k,260)*y(k,78)
+ + rxt(k,249)*y(k,74) + rxt(k,260)*y(k,79)
end do
end subroutine nlnmat03
subroutine nlnmat04( avec_len, mat, y, rxt )
@@ -721,86 +721,86 @@ subroutine nlnmat04( avec_len, mat, y, rxt )
! ... complete matrix entries implicit species
!----------------------------------------------
do k = 1,avec_len
- mat(k,108) = -(rxt(k,262)*y(k,102))
- mat(k,934) = -rxt(k,262)*y(k,80)
- mat(k,299) = rxt(k,251)*y(k,98)
- mat(k,819) = rxt(k,251)*y(k,79)
- mat(k,323) = -(rxt(k,287)*y(k,92) + rxt(k,288)*y(k,97) + rxt(k,289)*y(k,91))
- mat(k,243) = -rxt(k,287)*y(k,88)
- mat(k,358) = -rxt(k,288)*y(k,88)
- mat(k,221) = -rxt(k,289)*y(k,88)
+ mat(k,108) = -(rxt(k,262)*y(k,103))
+ mat(k,934) = -rxt(k,262)*y(k,81)
+ mat(k,299) = rxt(k,251)*y(k,99)
+ mat(k,819) = rxt(k,251)*y(k,80)
+ mat(k,323) = -(rxt(k,287)*y(k,93) + rxt(k,288)*y(k,98) + rxt(k,289)*y(k,92))
+ mat(k,243) = -rxt(k,287)*y(k,89)
+ mat(k,358) = -rxt(k,288)*y(k,89)
+ mat(k,221) = -rxt(k,289)*y(k,89)
mat(k,555) = -((rxt(k,113) + rxt(k,114) + rxt(k,115)) * y(k,40) + rxt(k,117) &
- *y(k,69) + rxt(k,118)*y(k,71) + rxt(k,122)*y(k,98) &
- + 4._r8*rxt(k,127)*y(k,89) + rxt(k,139)*y(k,63) + rxt(k,144) &
+ *y(k,69) + rxt(k,118)*y(k,71) + rxt(k,122)*y(k,99) &
+ + 4._r8*rxt(k,127)*y(k,90) + rxt(k,139)*y(k,63) + rxt(k,144) &
*y(k,61) + rxt(k,149)*y(k,62) + (rxt(k,159) + rxt(k,160) &
) * y(k,25) + rxt(k,166)*y(k,28) + rxt(k,192)*y(k,3) + rxt(k,198) &
*y(k,5) + rxt(k,238)*y(k,21))
- mat(k,442) = -(rxt(k,113) + rxt(k,114) + rxt(k,115)) * y(k,89)
- mat(k,679) = -rxt(k,117)*y(k,89)
- mat(k,530) = -rxt(k,118)*y(k,89)
- mat(k,849) = -rxt(k,122)*y(k,89)
- mat(k,580) = -rxt(k,139)*y(k,89)
- mat(k,746) = -rxt(k,144)*y(k,89)
- mat(k,637) = -rxt(k,149)*y(k,89)
- mat(k,778) = -(rxt(k,159) + rxt(k,160)) * y(k,89)
- mat(k,608) = -rxt(k,166)*y(k,89)
- mat(k,800) = -rxt(k,192)*y(k,89)
- mat(k,919) = -rxt(k,198)*y(k,89)
- mat(k,415) = -rxt(k,238)*y(k,89)
+ mat(k,442) = -(rxt(k,113) + rxt(k,114) + rxt(k,115)) * y(k,90)
+ mat(k,679) = -rxt(k,117)*y(k,90)
+ mat(k,530) = -rxt(k,118)*y(k,90)
+ mat(k,849) = -rxt(k,122)*y(k,90)
+ mat(k,580) = -rxt(k,139)*y(k,90)
+ mat(k,746) = -rxt(k,144)*y(k,90)
+ mat(k,637) = -rxt(k,149)*y(k,90)
+ mat(k,778) = -(rxt(k,159) + rxt(k,160)) * y(k,90)
+ mat(k,608) = -rxt(k,166)*y(k,90)
+ mat(k,800) = -rxt(k,192)*y(k,90)
+ mat(k,919) = -rxt(k,198)*y(k,90)
+ mat(k,415) = -rxt(k,238)*y(k,90)
mat(k,800) = mat(k,800) + rxt(k,191)*y(k,17)
- mat(k,919) = mat(k,919) + rxt(k,203)*y(k,98)
+ mat(k,919) = mat(k,919) + rxt(k,203)*y(k,99)
mat(k,478) = rxt(k,191)*y(k,3) + rxt(k,155)*y(k,25) + rxt(k,235)*y(k,63) &
+ rxt(k,236)*y(k,69)
- mat(k,213) = rxt(k,220)*y(k,25) + rxt(k,221)*y(k,98)
- mat(k,151) = rxt(k,223)*y(k,25) + rxt(k,224)*y(k,98)
+ mat(k,213) = rxt(k,220)*y(k,25) + rxt(k,221)*y(k,99)
+ mat(k,151) = rxt(k,223)*y(k,25) + rxt(k,224)*y(k,99)
mat(k,415) = mat(k,415) + rxt(k,162)*y(k,28) + rxt(k,239)*y(k,61)
- mat(k,399) = rxt(k,243)*y(k,94)
+ mat(k,399) = rxt(k,243)*y(k,95)
mat(k,778) = mat(k,778) + rxt(k,155)*y(k,17) + rxt(k,220)*y(k,18) &
+ rxt(k,223)*y(k,20) + rxt(k,158)*y(k,43)
- mat(k,608) = mat(k,608) + rxt(k,162)*y(k,21) + rxt(k,173)*y(k,98)
- mat(k,286) = rxt(k,245)*y(k,98)
- mat(k,130) = .500_r8*rxt(k,261)*y(k,98)
+ mat(k,608) = mat(k,608) + rxt(k,162)*y(k,21) + rxt(k,173)*y(k,99)
+ mat(k,286) = rxt(k,245)*y(k,99)
+ mat(k,130) = .500_r8*rxt(k,261)*y(k,99)
mat(k,442) = mat(k,442) + rxt(k,116)*y(k,70)
- mat(k,230) = rxt(k,158)*y(k,25) + rxt(k,112)*y(k,69) + rxt(k,121)*y(k,98)
+ mat(k,230) = rxt(k,158)*y(k,25) + rxt(k,112)*y(k,69) + rxt(k,121)*y(k,99)
mat(k,746) = mat(k,746) + rxt(k,239)*y(k,21)
- mat(k,580) = mat(k,580) + rxt(k,235)*y(k,17) + rxt(k,142)*y(k,98)
+ mat(k,580) = mat(k,580) + rxt(k,235)*y(k,17) + rxt(k,142)*y(k,99)
mat(k,679) = mat(k,679) + rxt(k,236)*y(k,17) + rxt(k,112)*y(k,43)
mat(k,510) = rxt(k,116)*y(k,40)
- mat(k,530) = mat(k,530) + rxt(k,124)*y(k,98)
- mat(k,302) = rxt(k,251)*y(k,98)
+ mat(k,530) = mat(k,530) + rxt(k,124)*y(k,99)
+ mat(k,302) = rxt(k,251)*y(k,99)
mat(k,721) = rxt(k,243)*y(k,23)
mat(k,849) = mat(k,849) + rxt(k,203)*y(k,5) + rxt(k,221)*y(k,18) + rxt(k,224) &
*y(k,20) + rxt(k,173)*y(k,28) + rxt(k,245)*y(k,31) &
+ .500_r8*rxt(k,261)*y(k,35) + rxt(k,121)*y(k,43) + rxt(k,142) &
- *y(k,63) + rxt(k,124)*y(k,71) + rxt(k,251)*y(k,79)
- mat(k,334) = -(rxt(k,129)*y(k,69) + rxt(k,130)*y(k,70) + rxt(k,301)*y(k,99))
- mat(k,669) = -rxt(k,129)*y(k,90)
- mat(k,502) = -rxt(k,130)*y(k,90)
- mat(k,375) = -rxt(k,301)*y(k,90)
- mat(k,669) = mat(k,669) + rxt(k,291)*y(k,91)
- mat(k,324) = .900_r8*rxt(k,289)*y(k,91) + .800_r8*rxt(k,287)*y(k,92)
- mat(k,222) = rxt(k,291)*y(k,69) + .900_r8*rxt(k,289)*y(k,88)
- mat(k,244) = .800_r8*rxt(k,287)*y(k,88)
- mat(k,219) = -(rxt(k,289)*y(k,88) + rxt(k,290)*y(k,70) + (rxt(k,291) &
+ *y(k,63) + rxt(k,124)*y(k,71) + rxt(k,251)*y(k,80)
+ mat(k,334) = -(rxt(k,129)*y(k,69) + rxt(k,130)*y(k,70) + rxt(k,301)*y(k,100))
+ mat(k,669) = -rxt(k,129)*y(k,91)
+ mat(k,502) = -rxt(k,130)*y(k,91)
+ mat(k,375) = -rxt(k,301)*y(k,91)
+ mat(k,669) = mat(k,669) + rxt(k,291)*y(k,92)
+ mat(k,324) = .900_r8*rxt(k,289)*y(k,92) + .800_r8*rxt(k,287)*y(k,93)
+ mat(k,222) = rxt(k,291)*y(k,69) + .900_r8*rxt(k,289)*y(k,89)
+ mat(k,244) = .800_r8*rxt(k,287)*y(k,89)
+ mat(k,219) = -(rxt(k,289)*y(k,89) + rxt(k,290)*y(k,70) + (rxt(k,291) &
+ rxt(k,292)) * y(k,69))
- mat(k,320) = -rxt(k,289)*y(k,91)
- mat(k,496) = -rxt(k,290)*y(k,91)
- mat(k,657) = -(rxt(k,291) + rxt(k,292)) * y(k,91)
- mat(k,242) = -(rxt(k,287)*y(k,88))
- mat(k,321) = -rxt(k,287)*y(k,92)
- mat(k,343) = rxt(k,296)*y(k,97)
- mat(k,735) = rxt(k,298)*y(k,97)
- mat(k,660) = rxt(k,291)*y(k,91)
- mat(k,498) = rxt(k,295)*y(k,93)
+ mat(k,320) = -rxt(k,289)*y(k,92)
+ mat(k,496) = -rxt(k,290)*y(k,92)
+ mat(k,657) = -(rxt(k,291) + rxt(k,292)) * y(k,92)
+ mat(k,242) = -(rxt(k,287)*y(k,89))
+ mat(k,321) = -rxt(k,287)*y(k,93)
+ mat(k,343) = rxt(k,296)*y(k,98)
+ mat(k,735) = rxt(k,298)*y(k,98)
+ mat(k,660) = rxt(k,291)*y(k,92)
+ mat(k,498) = rxt(k,295)*y(k,94)
mat(k,220) = rxt(k,291)*y(k,69)
mat(k,272) = rxt(k,295)*y(k,70)
mat(k,357) = rxt(k,296)*y(k,55) + rxt(k,298)*y(k,61)
mat(k,273) = -(rxt(k,293)*y(k,69) + (rxt(k,294) + rxt(k,295)) * y(k,70))
- mat(k,664) = -rxt(k,293)*y(k,93)
- mat(k,499) = -(rxt(k,294) + rxt(k,295)) * y(k,93)
- mat(k,332) = rxt(k,301)*y(k,99)
- mat(k,372) = rxt(k,301)*y(k,90)
- mat(k,726) = -(rxt(k,94)*y(k,41) + rxt(k,95)*y(k,102) + (rxt(k,97) + rxt(k,98) &
+ mat(k,664) = -rxt(k,293)*y(k,94)
+ mat(k,499) = -(rxt(k,294) + rxt(k,295)) * y(k,94)
+ mat(k,332) = rxt(k,301)*y(k,100)
+ mat(k,372) = rxt(k,301)*y(k,91)
+ mat(k,726) = -(rxt(k,94)*y(k,41) + rxt(k,95)*y(k,103) + (rxt(k,97) + rxt(k,98) &
) * y(k,70) + rxt(k,99)*y(k,71) + (rxt(k,147) + rxt(k,148) &
) * y(k,56) + rxt(k,180)*y(k,8) + rxt(k,181)*y(k,9) + rxt(k,182) &
*y(k,11) + rxt(k,183)*y(k,12) + rxt(k,184)*y(k,13) + rxt(k,185) &
@@ -810,66 +810,66 @@ subroutine nlnmat04( avec_len, mat, y, rxt )
*y(k,33) + rxt(k,217)*y(k,34) + rxt(k,230)*y(k,16) + rxt(k,231) &
*y(k,18) + rxt(k,232)*y(k,46) + rxt(k,233)*y(k,47) + rxt(k,234) &
*y(k,48) + (rxt(k,242) + rxt(k,243) + rxt(k,244)) * y(k,23))
- mat(k,877) = -rxt(k,94)*y(k,94)
- mat(k,951) = -rxt(k,95)*y(k,94)
- mat(k,514) = -(rxt(k,97) + rxt(k,98)) * y(k,94)
- mat(k,535) = -rxt(k,99)*y(k,94)
- mat(k,105) = -(rxt(k,147) + rxt(k,148)) * y(k,94)
- mat(k,30) = -rxt(k,180)*y(k,94)
- mat(k,57) = -rxt(k,181)*y(k,94)
- mat(k,38) = -rxt(k,182)*y(k,94)
- mat(k,68) = -rxt(k,183)*y(k,94)
- mat(k,42) = -rxt(k,184)*y(k,94)
- mat(k,73) = -rxt(k,185)*y(k,94)
- mat(k,46) = -rxt(k,186)*y(k,94)
- mat(k,461) = -(rxt(k,187) + rxt(k,188)) * y(k,94)
- mat(k,63) = -rxt(k,207)*y(k,94)
- mat(k,163) = -rxt(k,208)*y(k,94)
- mat(k,34) = -rxt(k,209)*y(k,94)
- mat(k,259) = -(rxt(k,210) + rxt(k,211)) * y(k,94)
- mat(k,84) = -rxt(k,216)*y(k,94)
- mat(k,92) = -rxt(k,217)*y(k,94)
- mat(k,176) = -rxt(k,230)*y(k,94)
- mat(k,214) = -rxt(k,231)*y(k,94)
- mat(k,87) = -rxt(k,232)*y(k,94)
- mat(k,97) = -rxt(k,233)*y(k,94)
- mat(k,115) = -rxt(k,234)*y(k,94)
- mat(k,403) = -(rxt(k,242) + rxt(k,243) + rxt(k,244)) * y(k,94)
- mat(k,514) = mat(k,514) + rxt(k,130)*y(k,90)
- mat(k,330) = .850_r8*rxt(k,288)*y(k,97)
+ mat(k,877) = -rxt(k,94)*y(k,95)
+ mat(k,951) = -rxt(k,95)*y(k,95)
+ mat(k,514) = -(rxt(k,97) + rxt(k,98)) * y(k,95)
+ mat(k,535) = -rxt(k,99)*y(k,95)
+ mat(k,105) = -(rxt(k,147) + rxt(k,148)) * y(k,95)
+ mat(k,30) = -rxt(k,180)*y(k,95)
+ mat(k,57) = -rxt(k,181)*y(k,95)
+ mat(k,38) = -rxt(k,182)*y(k,95)
+ mat(k,68) = -rxt(k,183)*y(k,95)
+ mat(k,42) = -rxt(k,184)*y(k,95)
+ mat(k,73) = -rxt(k,185)*y(k,95)
+ mat(k,46) = -rxt(k,186)*y(k,95)
+ mat(k,461) = -(rxt(k,187) + rxt(k,188)) * y(k,95)
+ mat(k,63) = -rxt(k,207)*y(k,95)
+ mat(k,163) = -rxt(k,208)*y(k,95)
+ mat(k,34) = -rxt(k,209)*y(k,95)
+ mat(k,259) = -(rxt(k,210) + rxt(k,211)) * y(k,95)
+ mat(k,84) = -rxt(k,216)*y(k,95)
+ mat(k,92) = -rxt(k,217)*y(k,95)
+ mat(k,176) = -rxt(k,230)*y(k,95)
+ mat(k,214) = -rxt(k,231)*y(k,95)
+ mat(k,87) = -rxt(k,232)*y(k,95)
+ mat(k,97) = -rxt(k,233)*y(k,95)
+ mat(k,115) = -rxt(k,234)*y(k,95)
+ mat(k,403) = -(rxt(k,242) + rxt(k,243) + rxt(k,244)) * y(k,95)
+ mat(k,514) = mat(k,514) + rxt(k,130)*y(k,91)
+ mat(k,330) = .850_r8*rxt(k,288)*y(k,98)
mat(k,340) = rxt(k,130)*y(k,70)
- mat(k,367) = .850_r8*rxt(k,288)*y(k,88)
+ mat(k,367) = .850_r8*rxt(k,288)*y(k,89)
mat(k,77) = -(rxt(k,101)*y(k,69) + rxt(k,102)*y(k,70))
- mat(k,651) = -rxt(k,101)*y(k,95)
- mat(k,492) = -rxt(k,102)*y(k,95)
- mat(k,194) = rxt(k,103)*y(k,96)
- mat(k,651) = mat(k,651) + rxt(k,105)*y(k,96)
- mat(k,492) = mat(k,492) + rxt(k,106)*y(k,96)
- mat(k,522) = rxt(k,107)*y(k,96)
+ mat(k,651) = -rxt(k,101)*y(k,96)
+ mat(k,492) = -rxt(k,102)*y(k,96)
+ mat(k,194) = rxt(k,103)*y(k,97)
+ mat(k,651) = mat(k,651) + rxt(k,105)*y(k,97)
+ mat(k,492) = mat(k,492) + rxt(k,106)*y(k,97)
+ mat(k,522) = rxt(k,107)*y(k,97)
mat(k,79) = rxt(k,103)*y(k,32) + rxt(k,105)*y(k,69) + rxt(k,106)*y(k,70) &
+ rxt(k,107)*y(k,71)
mat(k,80) = -(rxt(k,103)*y(k,32) + rxt(k,105)*y(k,69) + rxt(k,106)*y(k,70) &
+ rxt(k,107)*y(k,71))
- mat(k,195) = -rxt(k,103)*y(k,96)
- mat(k,652) = -rxt(k,105)*y(k,96)
- mat(k,493) = -rxt(k,106)*y(k,96)
- mat(k,523) = -rxt(k,107)*y(k,96)
- mat(k,493) = mat(k,493) + rxt(k,97)*y(k,94)
+ mat(k,195) = -rxt(k,103)*y(k,97)
+ mat(k,652) = -rxt(k,105)*y(k,97)
+ mat(k,493) = -rxt(k,106)*y(k,97)
+ mat(k,523) = -rxt(k,107)*y(k,97)
+ mat(k,493) = mat(k,493) + rxt(k,97)*y(k,95)
mat(k,702) = rxt(k,97)*y(k,70)
- mat(k,361) = -(rxt(k,288)*y(k,88) + rxt(k,296)*y(k,55) + rxt(k,298)*y(k,61))
- mat(k,326) = -rxt(k,288)*y(k,97)
- mat(k,348) = -rxt(k,296)*y(k,97)
- mat(k,739) = -rxt(k,298)*y(k,97)
- mat(k,198) = rxt(k,299)*y(k,99)
- mat(k,504) = rxt(k,290)*y(k,91) + rxt(k,294)*y(k,93) + rxt(k,302)*y(k,99) &
- + rxt(k,306)*y(k,100)
+ mat(k,361) = -(rxt(k,288)*y(k,89) + rxt(k,296)*y(k,55) + rxt(k,298)*y(k,61))
+ mat(k,326) = -rxt(k,288)*y(k,98)
+ mat(k,348) = -rxt(k,296)*y(k,98)
+ mat(k,739) = -rxt(k,298)*y(k,98)
+ mat(k,198) = rxt(k,299)*y(k,100)
+ mat(k,504) = rxt(k,290)*y(k,92) + rxt(k,294)*y(k,94) + rxt(k,302)*y(k,100) &
+ + rxt(k,306)*y(k,101)
mat(k,224) = rxt(k,290)*y(k,70)
mat(k,277) = rxt(k,294)*y(k,70)
mat(k,377) = rxt(k,299)*y(k,32) + rxt(k,302)*y(k,70)
mat(k,190) = rxt(k,306)*y(k,70)
- mat(k,858) = -(rxt(k,120)*y(k,41) + rxt(k,121)*y(k,43) + rxt(k,122)*y(k,89) &
+ mat(k,858) = -(rxt(k,120)*y(k,41) + rxt(k,121)*y(k,43) + rxt(k,122)*y(k,90) &
+ rxt(k,123)*y(k,69) + rxt(k,124)*y(k,71) + (4._r8*rxt(k,125) &
- + 4._r8*rxt(k,126)) * y(k,98) + rxt(k,128)*y(k,52) + rxt(k,142) &
+ + 4._r8*rxt(k,126)) * y(k,99) + rxt(k,128)*y(k,52) + rxt(k,142) &
*y(k,63) + rxt(k,143)*y(k,55) + rxt(k,151)*y(k,62) + rxt(k,152) &
*y(k,51) + rxt(k,171)*y(k,29) + (rxt(k,173) + rxt(k,174) &
) * y(k,28) + rxt(k,176)*y(k,49) + rxt(k,179)*y(k,54) + rxt(k,203) &
@@ -878,66 +878,66 @@ subroutine nlnmat04( avec_len, mat, y, rxt )
*y(k,24) + rxt(k,227)*y(k,46) + rxt(k,228)*y(k,47) + rxt(k,229) &
*y(k,48) + rxt(k,237)*y(k,17) + rxt(k,240)*y(k,22) + rxt(k,241) &
*y(k,23) + rxt(k,245)*y(k,31) + (rxt(k,247) + rxt(k,261) &
- ) * y(k,35) + rxt(k,249)*y(k,73) + rxt(k,251)*y(k,79) + rxt(k,255) &
- *y(k,76) + rxt(k,260)*y(k,78))
- mat(k,881) = -rxt(k,120)*y(k,98)
- mat(k,233) = -rxt(k,121)*y(k,98)
- mat(k,564) = -rxt(k,122)*y(k,98)
- mat(k,688) = -rxt(k,123)*y(k,98)
- mat(k,539) = -rxt(k,124)*y(k,98)
- mat(k,172) = -rxt(k,128)*y(k,98)
- mat(k,589) = -rxt(k,142)*y(k,98)
- mat(k,356) = -rxt(k,143)*y(k,98)
- mat(k,646) = -rxt(k,151)*y(k,98)
- mat(k,904) = -rxt(k,152)*y(k,98)
- mat(k,315) = -rxt(k,171)*y(k,98)
- mat(k,617) = -(rxt(k,173) + rxt(k,174)) * y(k,98)
- mat(k,464) = -rxt(k,176)*y(k,98)
- mat(k,270) = -rxt(k,179)*y(k,98)
- mat(k,928) = -rxt(k,203)*y(k,98)
- mat(k,261) = -rxt(k,205)*y(k,98)
- mat(k,179) = -rxt(k,219)*y(k,98)
- mat(k,217) = -rxt(k,221)*y(k,98)
- mat(k,50) = -rxt(k,222)*y(k,98)
- mat(k,153) = -rxt(k,224)*y(k,98)
- mat(k,166) = -rxt(k,226)*y(k,98)
- mat(k,89) = -rxt(k,227)*y(k,98)
- mat(k,99) = -rxt(k,228)*y(k,98)
- mat(k,117) = -rxt(k,229)*y(k,98)
- mat(k,487) = -rxt(k,237)*y(k,98)
- mat(k,159) = -rxt(k,240)*y(k,98)
- mat(k,406) = -rxt(k,241)*y(k,98)
- mat(k,288) = -rxt(k,245)*y(k,98)
- mat(k,132) = -(rxt(k,247) + rxt(k,261)) * y(k,98)
- mat(k,146) = -rxt(k,249)*y(k,98)
- mat(k,304) = -rxt(k,251)*y(k,98)
- mat(k,241) = -rxt(k,255)*y(k,98)
- mat(k,436) = -rxt(k,260)*y(k,98)
+ ) * y(k,35) + rxt(k,249)*y(k,74) + rxt(k,251)*y(k,80) + rxt(k,255) &
+ *y(k,77) + rxt(k,260)*y(k,79))
+ mat(k,881) = -rxt(k,120)*y(k,99)
+ mat(k,233) = -rxt(k,121)*y(k,99)
+ mat(k,564) = -rxt(k,122)*y(k,99)
+ mat(k,688) = -rxt(k,123)*y(k,99)
+ mat(k,539) = -rxt(k,124)*y(k,99)
+ mat(k,172) = -rxt(k,128)*y(k,99)
+ mat(k,589) = -rxt(k,142)*y(k,99)
+ mat(k,356) = -rxt(k,143)*y(k,99)
+ mat(k,646) = -rxt(k,151)*y(k,99)
+ mat(k,904) = -rxt(k,152)*y(k,99)
+ mat(k,315) = -rxt(k,171)*y(k,99)
+ mat(k,617) = -(rxt(k,173) + rxt(k,174)) * y(k,99)
+ mat(k,464) = -rxt(k,176)*y(k,99)
+ mat(k,270) = -rxt(k,179)*y(k,99)
+ mat(k,928) = -rxt(k,203)*y(k,99)
+ mat(k,261) = -rxt(k,205)*y(k,99)
+ mat(k,179) = -rxt(k,219)*y(k,99)
+ mat(k,217) = -rxt(k,221)*y(k,99)
+ mat(k,50) = -rxt(k,222)*y(k,99)
+ mat(k,153) = -rxt(k,224)*y(k,99)
+ mat(k,166) = -rxt(k,226)*y(k,99)
+ mat(k,89) = -rxt(k,227)*y(k,99)
+ mat(k,99) = -rxt(k,228)*y(k,99)
+ mat(k,117) = -rxt(k,229)*y(k,99)
+ mat(k,487) = -rxt(k,237)*y(k,99)
+ mat(k,159) = -rxt(k,240)*y(k,99)
+ mat(k,406) = -rxt(k,241)*y(k,99)
+ mat(k,288) = -rxt(k,245)*y(k,99)
+ mat(k,132) = -(rxt(k,247) + rxt(k,261)) * y(k,99)
+ mat(k,146) = -rxt(k,249)*y(k,99)
+ mat(k,304) = -rxt(k,251)*y(k,99)
+ mat(k,241) = -rxt(k,255)*y(k,99)
+ mat(k,436) = -rxt(k,260)*y(k,99)
mat(k,487) = mat(k,487) + rxt(k,236)*y(k,69)
- mat(k,159) = mat(k,159) + .300_r8*rxt(k,240)*y(k,98)
- mat(k,406) = mat(k,406) + rxt(k,242)*y(k,94)
- mat(k,787) = rxt(k,160)*y(k,89)
- mat(k,295) = rxt(k,214)*y(k,102)
- mat(k,444) = rxt(k,119)*y(k,71) + 2.000_r8*rxt(k,114)*y(k,89)
- mat(k,881) = mat(k,881) + rxt(k,111)*y(k,69) + rxt(k,94)*y(k,94)
+ mat(k,159) = mat(k,159) + .300_r8*rxt(k,240)*y(k,99)
+ mat(k,406) = mat(k,406) + rxt(k,242)*y(k,95)
+ mat(k,787) = rxt(k,160)*y(k,90)
+ mat(k,295) = rxt(k,214)*y(k,103)
+ mat(k,444) = rxt(k,119)*y(k,71) + 2.000_r8*rxt(k,114)*y(k,90)
+ mat(k,881) = mat(k,881) + rxt(k,111)*y(k,69) + rxt(k,94)*y(k,95)
mat(k,233) = mat(k,233) + rxt(k,112)*y(k,69)
- mat(k,261) = mat(k,261) + rxt(k,204)*y(k,69) + rxt(k,210)*y(k,94)
- mat(k,464) = mat(k,464) + rxt(k,175)*y(k,69) + rxt(k,187)*y(k,94)
+ mat(k,261) = mat(k,261) + rxt(k,204)*y(k,69) + rxt(k,210)*y(k,95)
+ mat(k,464) = mat(k,464) + rxt(k,175)*y(k,69) + rxt(k,187)*y(k,95)
mat(k,253) = rxt(k,206)*y(k,69)
mat(k,270) = mat(k,270) + rxt(k,178)*y(k,69)
- mat(k,755) = rxt(k,144)*y(k,89)
- mat(k,589) = mat(k,589) + rxt(k,139)*y(k,89)
+ mat(k,755) = rxt(k,144)*y(k,90)
+ mat(k,589) = mat(k,589) + rxt(k,139)*y(k,90)
mat(k,688) = mat(k,688) + rxt(k,236)*y(k,17) + rxt(k,111)*y(k,41) &
+ rxt(k,112)*y(k,43) + rxt(k,204)*y(k,45) + rxt(k,175)*y(k,49) &
- + rxt(k,206)*y(k,53) + rxt(k,178)*y(k,54) + rxt(k,117)*y(k,89)
- mat(k,539) = mat(k,539) + rxt(k,119)*y(k,40) + rxt(k,118)*y(k,89)
+ + rxt(k,206)*y(k,53) + rxt(k,178)*y(k,54) + rxt(k,117)*y(k,90)
+ mat(k,539) = mat(k,539) + rxt(k,119)*y(k,40) + rxt(k,118)*y(k,90)
mat(k,564) = mat(k,564) + rxt(k,160)*y(k,25) + 2.000_r8*rxt(k,114)*y(k,40) &
+ rxt(k,144)*y(k,61) + rxt(k,139)*y(k,63) + rxt(k,117)*y(k,69) &
+ rxt(k,118)*y(k,71)
mat(k,730) = rxt(k,242)*y(k,23) + rxt(k,94)*y(k,41) + rxt(k,210)*y(k,45) &
- + rxt(k,187)*y(k,49) + 2.000_r8*rxt(k,95)*y(k,102)
+ + rxt(k,187)*y(k,49) + 2.000_r8*rxt(k,95)*y(k,103)
mat(k,858) = mat(k,858) + .300_r8*rxt(k,240)*y(k,22)
- mat(k,955) = rxt(k,214)*y(k,39) + 2.000_r8*rxt(k,95)*y(k,94)
+ mat(k,955) = rxt(k,214)*y(k,39) + 2.000_r8*rxt(k,95)*y(k,95)
end do
end subroutine nlnmat04
subroutine nlnmat05( avec_len, mat, y, rxt )
@@ -958,55 +958,55 @@ subroutine nlnmat05( avec_len, mat, y, rxt )
! ... complete matrix entries implicit species
!----------------------------------------------
do k = 1,avec_len
- mat(k,378) = -(rxt(k,299)*y(k,32) + rxt(k,301)*y(k,90) + rxt(k,302)*y(k,70))
- mat(k,199) = -rxt(k,299)*y(k,99)
- mat(k,337) = -rxt(k,301)*y(k,99)
- mat(k,505) = -rxt(k,302)*y(k,99)
- mat(k,672) = rxt(k,292)*y(k,91) + rxt(k,293)*y(k,93) + rxt(k,305)*y(k,100) &
- + rxt(k,311)*y(k,101)
- mat(k,327) = rxt(k,303)*y(k,100) + rxt(k,308)*y(k,101)
+ mat(k,378) = -(rxt(k,299)*y(k,32) + rxt(k,301)*y(k,91) + rxt(k,302)*y(k,70))
+ mat(k,199) = -rxt(k,299)*y(k,100)
+ mat(k,337) = -rxt(k,301)*y(k,100)
+ mat(k,505) = -rxt(k,302)*y(k,100)
+ mat(k,672) = rxt(k,292)*y(k,92) + rxt(k,293)*y(k,94) + rxt(k,305)*y(k,101) &
+ + rxt(k,311)*y(k,102)
+ mat(k,327) = rxt(k,303)*y(k,101) + rxt(k,308)*y(k,102)
mat(k,225) = rxt(k,292)*y(k,69)
mat(k,278) = rxt(k,293)*y(k,69)
- mat(k,191) = rxt(k,305)*y(k,69) + rxt(k,303)*y(k,88)
- mat(k,185) = rxt(k,311)*y(k,69) + rxt(k,308)*y(k,88)
- mat(k,188) = -(rxt(k,303)*y(k,88) + rxt(k,305)*y(k,69) + rxt(k,306)*y(k,70))
- mat(k,319) = -rxt(k,303)*y(k,100)
- mat(k,655) = -rxt(k,305)*y(k,100)
- mat(k,495) = -rxt(k,306)*y(k,100)
- mat(k,319) = mat(k,319) + rxt(k,307)*y(k,101)
- mat(k,182) = rxt(k,307)*y(k,88)
- mat(k,181) = -((rxt(k,307) + rxt(k,308)) * y(k,88) + rxt(k,311)*y(k,69))
- mat(k,318) = -(rxt(k,307) + rxt(k,308)) * y(k,101)
- mat(k,654) = -rxt(k,311)*y(k,101)
- mat(k,959) = -(rxt(k,95)*y(k,94) + rxt(k,214)*y(k,39) + rxt(k,262)*y(k,80))
- mat(k,734) = -rxt(k,95)*y(k,102)
- mat(k,298) = -rxt(k,214)*y(k,102)
- mat(k,111) = -rxt(k,262)*y(k,102)
- mat(k,180) = rxt(k,219)*y(k,98)
- mat(k,491) = rxt(k,237)*y(k,98)
- mat(k,218) = rxt(k,221)*y(k,98)
- mat(k,51) = rxt(k,222)*y(k,98)
- mat(k,154) = rxt(k,224)*y(k,98)
- mat(k,160) = rxt(k,240)*y(k,98)
- mat(k,409) = rxt(k,241)*y(k,98)
- mat(k,446) = rxt(k,115)*y(k,89)
- mat(k,885) = rxt(k,120)*y(k,98)
- mat(k,234) = rxt(k,121)*y(k,98)
- mat(k,263) = rxt(k,205)*y(k,98)
- mat(k,118) = rxt(k,229)*y(k,98)
+ mat(k,191) = rxt(k,305)*y(k,69) + rxt(k,303)*y(k,89)
+ mat(k,185) = rxt(k,311)*y(k,69) + rxt(k,308)*y(k,89)
+ mat(k,188) = -(rxt(k,303)*y(k,89) + rxt(k,305)*y(k,69) + rxt(k,306)*y(k,70))
+ mat(k,319) = -rxt(k,303)*y(k,101)
+ mat(k,655) = -rxt(k,305)*y(k,101)
+ mat(k,495) = -rxt(k,306)*y(k,101)
+ mat(k,319) = mat(k,319) + rxt(k,307)*y(k,102)
+ mat(k,182) = rxt(k,307)*y(k,89)
+ mat(k,181) = -((rxt(k,307) + rxt(k,308)) * y(k,89) + rxt(k,311)*y(k,69))
+ mat(k,318) = -(rxt(k,307) + rxt(k,308)) * y(k,102)
+ mat(k,654) = -rxt(k,311)*y(k,102)
+ mat(k,959) = -(rxt(k,95)*y(k,95) + rxt(k,214)*y(k,39) + rxt(k,262)*y(k,81))
+ mat(k,734) = -rxt(k,95)*y(k,103)
+ mat(k,298) = -rxt(k,214)*y(k,103)
+ mat(k,111) = -rxt(k,262)*y(k,103)
+ mat(k,180) = rxt(k,219)*y(k,99)
+ mat(k,491) = rxt(k,237)*y(k,99)
+ mat(k,218) = rxt(k,221)*y(k,99)
+ mat(k,51) = rxt(k,222)*y(k,99)
+ mat(k,154) = rxt(k,224)*y(k,99)
+ mat(k,160) = rxt(k,240)*y(k,99)
+ mat(k,409) = rxt(k,241)*y(k,99)
+ mat(k,446) = rxt(k,115)*y(k,90)
+ mat(k,885) = rxt(k,120)*y(k,99)
+ mat(k,234) = rxt(k,121)*y(k,99)
+ mat(k,263) = rxt(k,205)*y(k,99)
+ mat(k,118) = rxt(k,229)*y(k,99)
mat(k,468) = (rxt(k,275)+rxt(k,280))*y(k,53) + (rxt(k,268)+rxt(k,274) &
- +rxt(k,279))*y(k,54) + rxt(k,176)*y(k,98)
- mat(k,908) = rxt(k,152)*y(k,98)
- mat(k,173) = rxt(k,128)*y(k,98)
+ +rxt(k,279))*y(k,54) + rxt(k,176)*y(k,99)
+ mat(k,908) = rxt(k,152)*y(k,99)
+ mat(k,173) = rxt(k,128)*y(k,99)
mat(k,255) = (rxt(k,275)+rxt(k,280))*y(k,49)
- mat(k,271) = (rxt(k,268)+rxt(k,274)+rxt(k,279))*y(k,49) + rxt(k,179)*y(k,98)
- mat(k,568) = rxt(k,115)*y(k,40) + rxt(k,122)*y(k,98)
+ mat(k,271) = (rxt(k,268)+rxt(k,274)+rxt(k,279))*y(k,49) + rxt(k,179)*y(k,99)
+ mat(k,568) = rxt(k,115)*y(k,40) + rxt(k,122)*y(k,99)
mat(k,862) = rxt(k,219)*y(k,16) + rxt(k,237)*y(k,17) + rxt(k,221)*y(k,18) &
+ rxt(k,222)*y(k,19) + rxt(k,224)*y(k,20) + rxt(k,240)*y(k,22) &
+ rxt(k,241)*y(k,23) + rxt(k,120)*y(k,41) + rxt(k,121)*y(k,43) &
+ rxt(k,205)*y(k,45) + rxt(k,229)*y(k,48) + rxt(k,176)*y(k,49) &
+ rxt(k,152)*y(k,51) + rxt(k,128)*y(k,52) + rxt(k,179)*y(k,54) &
- + rxt(k,122)*y(k,89) + 2.000_r8*rxt(k,125)*y(k,98)
+ + rxt(k,122)*y(k,90) + 2.000_r8*rxt(k,125)*y(k,99)
end do
end subroutine nlnmat05
subroutine nlnmat_finit( avec_len, mat, lmat, dti )
diff --git a/src/chemistry/pp_waccm_ma_mam5/mo_prod_loss.F90 b/src/chemistry/pp_waccm_ma_mam5/mo_prod_loss.F90
index 10c37c4a5d..4b90d14e1f 100644
--- a/src/chemistry/pp_waccm_ma_mam5/mo_prod_loss.F90
+++ b/src/chemistry/pp_waccm_ma_mam5/mo_prod_loss.F90
@@ -19,6 +19,17 @@ subroutine exp_prod_loss( ofl, ofu, prod, loss, y, &
real(r8), intent(in) :: y(chnkpnts,gas_pcnst)
real(r8), intent(in) :: rxt(chnkpnts,rxntot)
real(r8), intent(in) :: het_rates(chnkpnts,gas_pcnst)
+!--------------------------------------------------------------------
+! ... local variables
+!--------------------------------------------------------------------
+ integer :: k
+!--------------------------------------------------------------------
+! ... loss and production for Explicit method
+!--------------------------------------------------------------------
+ do k = ofl,ofu
+ loss(k,1) = ( + het_rates(k,72))* y(k,72)
+ prod(k,1) = 0._r8
+ end do
end subroutine exp_prod_loss
subroutine imp_prod_loss( avec_len, prod, loss, y, &
rxt, het_rates )
@@ -46,16 +57,16 @@ subroutine imp_prod_loss( avec_len, prod, loss, y, &
prod(k,1) = 0._r8
loss(k,2) = ( + het_rates(k,2))* y(k,2)
prod(k,2) = 0._r8
- loss(k,97) = (rxt(k,191)* y(k,17) +rxt(k,193)* y(k,71) +rxt(k,192)* y(k,89) &
+ loss(k,97) = (rxt(k,191)* y(k,17) +rxt(k,193)* y(k,71) +rxt(k,192)* y(k,90) &
+ het_rates(k,3))* y(k,3)
prod(k,97) = (rxt(k,27) +2.000_r8*rxt(k,194)*y(k,5) +rxt(k,195)*y(k,28) + &
rxt(k,196)*y(k,28) +rxt(k,199)*y(k,61) +rxt(k,202)*y(k,69) + &
- rxt(k,203)*y(k,98) +rxt(k,253)*y(k,78))*y(k,5) + (rxt(k,181)*y(k,9) + &
+ rxt(k,203)*y(k,99) +rxt(k,253)*y(k,79))*y(k,5) + (rxt(k,181)*y(k,9) + &
rxt(k,207)*y(k,10) +3.000_r8*rxt(k,208)*y(k,24) + &
2.000_r8*rxt(k,209)*y(k,42) +rxt(k,210)*y(k,45) + &
- 2.000_r8*rxt(k,230)*y(k,16) +rxt(k,231)*y(k,18))*y(k,94) &
+ 2.000_r8*rxt(k,230)*y(k,16) +rxt(k,231)*y(k,18))*y(k,95) &
+ (rxt(k,205)*y(k,45) +2.000_r8*rxt(k,219)*y(k,16) + &
- rxt(k,221)*y(k,18) +3.000_r8*rxt(k,226)*y(k,24))*y(k,98) &
+ rxt(k,221)*y(k,18) +3.000_r8*rxt(k,226)*y(k,24))*y(k,99) &
+ (2.000_r8*rxt(k,218)*y(k,16) +rxt(k,220)*y(k,18) + &
3.000_r8*rxt(k,225)*y(k,24))*y(k,25) + (rxt(k,51) + &
rxt(k,204)*y(k,69))*y(k,45) +rxt(k,26)*y(k,4) +rxt(k,29)*y(k,6) &
@@ -67,78 +78,78 @@ subroutine imp_prod_loss( avec_len, prod, loss, y, &
+rxt(k,197)*y(k,28)*y(k,5)
loss(k,101) = (2._r8*rxt(k,194)* y(k,5) + (rxt(k,195) +rxt(k,196) + &
rxt(k,197))* y(k,28) +rxt(k,199)* y(k,61) +rxt(k,200)* y(k,62) &
- +rxt(k,202)* y(k,69) +rxt(k,253)* y(k,78) +rxt(k,198)* y(k,89) &
- +rxt(k,203)* y(k,98) + rxt(k,27) + het_rates(k,5))* y(k,5)
+ +rxt(k,202)* y(k,69) +rxt(k,253)* y(k,79) +rxt(k,198)* y(k,90) &
+ +rxt(k,203)* y(k,99) + rxt(k,27) + het_rates(k,5))* y(k,5)
prod(k,101) = (rxt(k,28) +rxt(k,201)*y(k,69))*y(k,6) +rxt(k,193)*y(k,71) &
- *y(k,3) +rxt(k,211)*y(k,94)*y(k,45) +rxt(k,206)*y(k,69)*y(k,53)
+ *y(k,3) +rxt(k,211)*y(k,95)*y(k,45) +rxt(k,206)*y(k,69)*y(k,53)
loss(k,62) = (rxt(k,201)* y(k,69) + rxt(k,28) + rxt(k,29) + rxt(k,269) &
+ rxt(k,272) + rxt(k,277) + het_rates(k,6))* y(k,6)
prod(k,62) =rxt(k,200)*y(k,62)*y(k,5)
loss(k,3) = ( + het_rates(k,7))* y(k,7)
prod(k,3) = 0._r8
- loss(k,27) = (rxt(k,180)* y(k,94) + rxt(k,30) + het_rates(k,8))* y(k,8)
+ loss(k,27) = (rxt(k,180)* y(k,95) + rxt(k,30) + het_rates(k,8))* y(k,8)
prod(k,27) = 0._r8
- loss(k,34) = (rxt(k,181)* y(k,94) + rxt(k,31) + het_rates(k,9))* y(k,9)
+ loss(k,34) = (rxt(k,181)* y(k,95) + rxt(k,31) + het_rates(k,9))* y(k,9)
prod(k,34) = 0._r8
- loss(k,35) = (rxt(k,207)* y(k,94) + rxt(k,32) + het_rates(k,10))* y(k,10)
+ loss(k,35) = (rxt(k,207)* y(k,95) + rxt(k,32) + het_rates(k,10))* y(k,10)
prod(k,35) = 0._r8
- loss(k,29) = (rxt(k,182)* y(k,94) + rxt(k,33) + het_rates(k,11))* y(k,11)
+ loss(k,29) = (rxt(k,182)* y(k,95) + rxt(k,33) + het_rates(k,11))* y(k,11)
prod(k,29) = 0._r8
- loss(k,36) = (rxt(k,183)* y(k,94) + rxt(k,34) + het_rates(k,12))* y(k,12)
+ loss(k,36) = (rxt(k,183)* y(k,95) + rxt(k,34) + het_rates(k,12))* y(k,12)
prod(k,36) = 0._r8
- loss(k,30) = (rxt(k,184)* y(k,94) + rxt(k,35) + het_rates(k,13))* y(k,13)
+ loss(k,30) = (rxt(k,184)* y(k,95) + rxt(k,35) + het_rates(k,13))* y(k,13)
prod(k,30) = 0._r8
- loss(k,37) = (rxt(k,185)* y(k,94) + rxt(k,36) + het_rates(k,14))* y(k,14)
+ loss(k,37) = (rxt(k,185)* y(k,95) + rxt(k,36) + het_rates(k,14))* y(k,14)
prod(k,37) = 0._r8
- loss(k,31) = (rxt(k,186)* y(k,94) + rxt(k,37) + het_rates(k,15))* y(k,15)
+ loss(k,31) = (rxt(k,186)* y(k,95) + rxt(k,37) + het_rates(k,15))* y(k,15)
prod(k,31) = 0._r8
- loss(k,58) = (rxt(k,218)* y(k,25) +rxt(k,230)* y(k,94) +rxt(k,219)* y(k,98) &
+ loss(k,58) = (rxt(k,218)* y(k,25) +rxt(k,230)* y(k,95) +rxt(k,219)* y(k,99) &
+ rxt(k,38) + het_rates(k,16))* y(k,16)
prod(k,58) = 0._r8
loss(k,86) = (rxt(k,191)* y(k,3) +rxt(k,155)* y(k,25) +rxt(k,235)* y(k,63) &
- +rxt(k,236)* y(k,69) +rxt(k,237)* y(k,98) + rxt(k,20) + rxt(k,21) &
+ +rxt(k,236)* y(k,69) +rxt(k,237)* y(k,99) + rxt(k,20) + rxt(k,21) &
+ het_rates(k,17))* y(k,17)
- prod(k,86) = (.180_r8*rxt(k,24) +rxt(k,243)*y(k,94) +rxt(k,244)*y(k,94)) &
+ prod(k,86) = (.180_r8*rxt(k,24) +rxt(k,243)*y(k,95) +rxt(k,244)*y(k,95)) &
*y(k,23) + (rxt(k,162)*y(k,28) +rxt(k,239)*y(k,61))*y(k,21) &
- + (rxt(k,22) +.300_r8*rxt(k,240)*y(k,98))*y(k,22)
- loss(k,63) = (rxt(k,220)* y(k,25) +rxt(k,231)* y(k,94) +rxt(k,221)* y(k,98) &
+ + (rxt(k,22) +.300_r8*rxt(k,240)*y(k,99))*y(k,22)
+ loss(k,63) = (rxt(k,220)* y(k,25) +rxt(k,231)* y(k,95) +rxt(k,221)* y(k,99) &
+ rxt(k,39) + het_rates(k,18))* y(k,18)
prod(k,63) = 0._r8
- loss(k,32) = (rxt(k,222)* y(k,98) + rxt(k,40) + het_rates(k,19))* y(k,19)
+ loss(k,32) = (rxt(k,222)* y(k,99) + rxt(k,40) + het_rates(k,19))* y(k,19)
prod(k,32) = 0._r8
- loss(k,54) = (rxt(k,223)* y(k,25) +rxt(k,224)* y(k,98) + rxt(k,41) &
+ loss(k,54) = (rxt(k,223)* y(k,25) +rxt(k,224)* y(k,99) + rxt(k,41) &
+ het_rates(k,20))* y(k,20)
prod(k,54) = 0._r8
- loss(k,82) = (rxt(k,162)* y(k,28) +rxt(k,239)* y(k,61) +rxt(k,238)* y(k,89) &
+ loss(k,82) = (rxt(k,162)* y(k,28) +rxt(k,239)* y(k,61) +rxt(k,238)* y(k,90) &
+ het_rates(k,21))* y(k,21)
prod(k,82) = (rxt(k,23) +rxt(k,156)*y(k,25) +rxt(k,212)*y(k,39) + &
- rxt(k,241)*y(k,98) +rxt(k,242)*y(k,94))*y(k,23) +rxt(k,39)*y(k,18) &
- +rxt(k,41)*y(k,20) +.700_r8*rxt(k,240)*y(k,98)*y(k,22)
- loss(k,55) = (rxt(k,240)* y(k,98) + rxt(k,22) + het_rates(k,22))* y(k,22)
- prod(k,55) =rxt(k,238)*y(k,89)*y(k,21)
+ rxt(k,241)*y(k,99) +rxt(k,242)*y(k,95))*y(k,23) +rxt(k,39)*y(k,18) &
+ +rxt(k,41)*y(k,20) +.700_r8*rxt(k,240)*y(k,99)*y(k,22)
+ loss(k,55) = (rxt(k,240)* y(k,99) + rxt(k,22) + het_rates(k,22))* y(k,22)
+ prod(k,55) =rxt(k,238)*y(k,90)*y(k,21)
loss(k,81) = (rxt(k,156)* y(k,25) +rxt(k,212)* y(k,39) + (rxt(k,242) + &
- rxt(k,243) +rxt(k,244))* y(k,94) +rxt(k,241)* y(k,98) + rxt(k,23) &
+ rxt(k,243) +rxt(k,244))* y(k,95) +rxt(k,241)* y(k,99) + rxt(k,23) &
+ rxt(k,24) + het_rates(k,23))* y(k,23)
prod(k,81) = 0._r8
- loss(k,56) = (rxt(k,225)* y(k,25) +rxt(k,208)* y(k,94) +rxt(k,226)* y(k,98) &
+ loss(k,56) = (rxt(k,225)* y(k,25) +rxt(k,208)* y(k,95) +rxt(k,226)* y(k,99) &
+ rxt(k,42) + het_rates(k,24))* y(k,24)
prod(k,56) = 0._r8
loss(k,96) = (rxt(k,218)* y(k,16) +rxt(k,155)* y(k,17) +rxt(k,220)* y(k,18) &
+rxt(k,223)* y(k,20) +rxt(k,156)* y(k,23) +rxt(k,225)* y(k,24) &
+rxt(k,168)* y(k,29) +rxt(k,157)* y(k,41) +rxt(k,158)* y(k,43) &
+rxt(k,177)* y(k,54) +rxt(k,161)* y(k,71) + (rxt(k,159) +rxt(k,160)) &
- * y(k,89) + het_rates(k,25))* y(k,25)
+ * y(k,90) + het_rates(k,25))* y(k,25)
prod(k,96) = (4.000_r8*rxt(k,180)*y(k,8) +rxt(k,181)*y(k,9) + &
2.000_r8*rxt(k,182)*y(k,11) +2.000_r8*rxt(k,183)*y(k,12) + &
2.000_r8*rxt(k,184)*y(k,13) +rxt(k,185)*y(k,14) + &
2.000_r8*rxt(k,186)*y(k,15) +rxt(k,187)*y(k,49) +rxt(k,217)*y(k,34) + &
- rxt(k,232)*y(k,46) +rxt(k,233)*y(k,47) +rxt(k,234)*y(k,48))*y(k,94) &
+ rxt(k,232)*y(k,46) +rxt(k,233)*y(k,47) +rxt(k,234)*y(k,48))*y(k,95) &
+ (rxt(k,45) +rxt(k,162)*y(k,21) +2.000_r8*rxt(k,163)*y(k,28) + &
rxt(k,165)*y(k,28) +rxt(k,167)*y(k,61) +rxt(k,172)*y(k,69) + &
- rxt(k,173)*y(k,98) +rxt(k,196)*y(k,5) +rxt(k,254)*y(k,78))*y(k,28) &
+ rxt(k,173)*y(k,99) +rxt(k,196)*y(k,5) +rxt(k,254)*y(k,79))*y(k,28) &
+ (rxt(k,176)*y(k,49) +3.000_r8*rxt(k,222)*y(k,19) + &
rxt(k,224)*y(k,20) +rxt(k,227)*y(k,46) +rxt(k,228)*y(k,47) + &
- rxt(k,229)*y(k,48))*y(k,98) + (rxt(k,55) +rxt(k,175)*y(k,69))*y(k,49) &
+ rxt(k,229)*y(k,48))*y(k,99) + (rxt(k,55) +rxt(k,175)*y(k,69))*y(k,49) &
+rxt(k,26)*y(k,4) +4.000_r8*rxt(k,30)*y(k,8) +rxt(k,31)*y(k,9) &
+2.000_r8*rxt(k,33)*y(k,11) +2.000_r8*rxt(k,34)*y(k,12) &
+2.000_r8*rxt(k,35)*y(k,13) +rxt(k,36)*y(k,14) +2.000_r8*rxt(k,37) &
@@ -155,43 +166,43 @@ subroutine imp_prod_loss( avec_len, prod, loss, y, &
loss(k,91) = ((rxt(k,195) +rxt(k,196) +rxt(k,197))* y(k,5) +rxt(k,162) &
* y(k,21) + 2._r8*(rxt(k,163) +rxt(k,164) +rxt(k,165) +rxt(k,189)) &
* y(k,28) +rxt(k,167)* y(k,61) +rxt(k,169)* y(k,62) +rxt(k,172) &
- * y(k,69) +rxt(k,254)* y(k,78) +rxt(k,166)* y(k,89) + (rxt(k,173) + &
- rxt(k,174))* y(k,98) + rxt(k,45) + het_rates(k,28))* y(k,28)
- prod(k,91) = (rxt(k,160)*y(k,89) +rxt(k,161)*y(k,71) +rxt(k,177)*y(k,54)) &
+ * y(k,69) +rxt(k,254)* y(k,79) +rxt(k,166)* y(k,90) + (rxt(k,173) + &
+ rxt(k,174))* y(k,99) + rxt(k,45) + het_rates(k,28))* y(k,28)
+ prod(k,91) = (rxt(k,160)*y(k,90) +rxt(k,161)*y(k,71) +rxt(k,177)*y(k,54)) &
*y(k,25) + (rxt(k,47) +rxt(k,170)*y(k,69))*y(k,29) &
- + (rxt(k,178)*y(k,69) +rxt(k,179)*y(k,98))*y(k,54) + (rxt(k,59) + &
- rxt(k,259)*y(k,78))*y(k,72) +2.000_r8*rxt(k,190)*y(k,27) &
- +rxt(k,188)*y(k,94)*y(k,49)
+ + (rxt(k,178)*y(k,69) +rxt(k,179)*y(k,99))*y(k,54) + (rxt(k,59) + &
+ rxt(k,259)*y(k,79))*y(k,73) +2.000_r8*rxt(k,190)*y(k,27) &
+ +rxt(k,188)*y(k,95)*y(k,49)
loss(k,75) = (rxt(k,168)* y(k,25) + (rxt(k,273) +rxt(k,278) +rxt(k,283)) &
- * y(k,49) +rxt(k,170)* y(k,69) +rxt(k,171)* y(k,98) + rxt(k,46) &
+ * y(k,49) +rxt(k,170)* y(k,69) +rxt(k,171)* y(k,99) + rxt(k,46) &
+ rxt(k,47) + rxt(k,271) + rxt(k,276) + rxt(k,282) &
+ het_rates(k,29))* y(k,29)
prod(k,75) =rxt(k,169)*y(k,62)*y(k,28)
loss(k,4) = ( + het_rates(k,30))* y(k,30)
prod(k,4) = 0._r8
- loss(k,72) = (rxt(k,245)* y(k,98) + het_rates(k,31))* y(k,31)
+ loss(k,72) = (rxt(k,245)* y(k,99) + het_rates(k,31))* y(k,31)
prod(k,72) = (rxt(k,20) +rxt(k,21) +rxt(k,155)*y(k,25) +rxt(k,191)*y(k,3) + &
- rxt(k,235)*y(k,63) +rxt(k,236)*y(k,69) +rxt(k,237)*y(k,98))*y(k,17) &
- + (rxt(k,25) +rxt(k,61) +rxt(k,299)*y(k,99))*y(k,32) + (rxt(k,88) + &
- rxt(k,248)*y(k,69) +rxt(k,249)*y(k,98))*y(k,73) +rxt(k,223)*y(k,25) &
+ rxt(k,235)*y(k,63) +rxt(k,236)*y(k,69) +rxt(k,237)*y(k,99))*y(k,17) &
+ + (rxt(k,25) +rxt(k,61) +rxt(k,299)*y(k,100))*y(k,32) + (rxt(k,88) + &
+ rxt(k,248)*y(k,69) +rxt(k,249)*y(k,99))*y(k,74) +rxt(k,223)*y(k,25) &
*y(k,20) +.380_r8*rxt(k,24)*y(k,23)
- loss(k,61) = (rxt(k,299)* y(k,99) + rxt(k,25) + rxt(k,61) + het_rates(k,32)) &
+ loss(k,61) = (rxt(k,299)* y(k,100) + rxt(k,25) + rxt(k,61) + het_rates(k,32)) &
* y(k,32)
- prod(k,61) =.440_r8*rxt(k,24)*y(k,23) +rxt(k,245)*y(k,98)*y(k,31)
- loss(k,41) = (rxt(k,216)* y(k,94) + rxt(k,48) + het_rates(k,33))* y(k,33)
+ prod(k,61) =.440_r8*rxt(k,24)*y(k,23) +rxt(k,245)*y(k,99)*y(k,31)
+ loss(k,41) = (rxt(k,216)* y(k,95) + rxt(k,48) + het_rates(k,33))* y(k,33)
prod(k,41) = (rxt(k,181)*y(k,9) +rxt(k,183)*y(k,12) + &
2.000_r8*rxt(k,184)*y(k,13) +2.000_r8*rxt(k,185)*y(k,14) + &
rxt(k,186)*y(k,15) +rxt(k,207)*y(k,10) +2.000_r8*rxt(k,209)*y(k,42) + &
- rxt(k,233)*y(k,47) +rxt(k,234)*y(k,48))*y(k,94) + (rxt(k,53) + &
- rxt(k,228)*y(k,98))*y(k,47) + (rxt(k,54) +rxt(k,229)*y(k,98))*y(k,48) &
+ rxt(k,233)*y(k,47) +rxt(k,234)*y(k,48))*y(k,95) + (rxt(k,53) + &
+ rxt(k,228)*y(k,99))*y(k,47) + (rxt(k,54) +rxt(k,229)*y(k,99))*y(k,48) &
+rxt(k,31)*y(k,9) +rxt(k,32)*y(k,10) +rxt(k,34)*y(k,12) &
+2.000_r8*rxt(k,35)*y(k,13) +2.000_r8*rxt(k,36)*y(k,14) +rxt(k,37) &
*y(k,15) +2.000_r8*rxt(k,50)*y(k,42)
- loss(k,43) = (rxt(k,217)* y(k,94) + rxt(k,49) + het_rates(k,34))* y(k,34)
- prod(k,43) = (rxt(k,52) +rxt(k,227)*y(k,98) +rxt(k,232)*y(k,94))*y(k,46) &
- + (rxt(k,33) +rxt(k,182)*y(k,94))*y(k,11) + (rxt(k,34) + &
- rxt(k,183)*y(k,94))*y(k,12)
- loss(k,51) = (rxt(k,246)* y(k,63) + (rxt(k,247) +rxt(k,261))* y(k,98) &
+ loss(k,43) = (rxt(k,217)* y(k,95) + rxt(k,49) + het_rates(k,34))* y(k,34)
+ prod(k,43) = (rxt(k,52) +rxt(k,227)*y(k,99) +rxt(k,232)*y(k,95))*y(k,46) &
+ + (rxt(k,33) +rxt(k,182)*y(k,95))*y(k,11) + (rxt(k,34) + &
+ rxt(k,183)*y(k,95))*y(k,12)
+ loss(k,51) = (rxt(k,246)* y(k,63) + (rxt(k,247) +rxt(k,261))* y(k,99) &
+ het_rates(k,35))* y(k,35)
prod(k,51) = 0._r8
loss(k,5) = ( + het_rates(k,36))* y(k,36)
@@ -201,83 +212,83 @@ subroutine imp_prod_loss( avec_len, prod, loss, y, &
loss(k,7) = ( + het_rates(k,38))* y(k,38)
prod(k,7) = 0._r8
loss(k,73) = (rxt(k,212)* y(k,23) +rxt(k,213)* y(k,41) +rxt(k,215)* y(k,51) &
- +rxt(k,214)* y(k,102) + het_rates(k,39))* y(k,39)
+ +rxt(k,214)* y(k,103) + het_rates(k,39))* y(k,39)
prod(k,73) = (rxt(k,185)*y(k,14) +rxt(k,207)*y(k,10) + &
- 2.000_r8*rxt(k,216)*y(k,33) +rxt(k,217)*y(k,34))*y(k,94) +rxt(k,32) &
+ 2.000_r8*rxt(k,216)*y(k,33) +rxt(k,217)*y(k,34))*y(k,95) +rxt(k,32) &
*y(k,10) +rxt(k,36)*y(k,14) +2.000_r8*rxt(k,48)*y(k,33) +rxt(k,49) &
*y(k,34) +rxt(k,56)*y(k,50)
loss(k,84) = (rxt(k,116)* y(k,70) +rxt(k,119)* y(k,71) + (rxt(k,113) + &
- rxt(k,114) +rxt(k,115))* y(k,89) + het_rates(k,40))* y(k,40)
+ rxt(k,114) +rxt(k,115))* y(k,90) + het_rates(k,40))* y(k,40)
prod(k,84) = (rxt(k,120)*y(k,41) +rxt(k,123)*y(k,69) +rxt(k,143)*y(k,55) + &
- rxt(k,237)*y(k,17) +rxt(k,249)*y(k,73) +rxt(k,255)*y(k,76) + &
- rxt(k,260)*y(k,78))*y(k,98) + (rxt(k,94)*y(k,94) + &
+ rxt(k,237)*y(k,17) +rxt(k,249)*y(k,74) +rxt(k,255)*y(k,77) + &
+ rxt(k,260)*y(k,79))*y(k,99) + (rxt(k,94)*y(k,95) + &
rxt(k,111)*y(k,69) +rxt(k,157)*y(k,25) +rxt(k,213)*y(k,39))*y(k,41) &
- + (rxt(k,23) +.330_r8*rxt(k,24) +rxt(k,243)*y(k,94))*y(k,23) &
- + (rxt(k,51) +rxt(k,211)*y(k,94))*y(k,45) + (rxt(k,55) + &
- rxt(k,188)*y(k,94))*y(k,49) + (2.000_r8*rxt(k,2) +rxt(k,3))*y(k,102) &
+ + (rxt(k,23) +.330_r8*rxt(k,24) +rxt(k,243)*y(k,95))*y(k,23) &
+ + (rxt(k,51) +rxt(k,211)*y(k,95))*y(k,45) + (rxt(k,55) + &
+ rxt(k,188)*y(k,95))*y(k,49) + (2.000_r8*rxt(k,2) +rxt(k,3))*y(k,103) &
+2.000_r8*rxt(k,20)*y(k,17) +rxt(k,22)*y(k,22) +rxt(k,56)*y(k,50)
loss(k,99) = (rxt(k,157)* y(k,25) +rxt(k,213)* y(k,39) +rxt(k,111)* y(k,69) &
- +rxt(k,94)* y(k,94) +rxt(k,120)* y(k,98) + het_rates(k,41))* y(k,41)
- prod(k,99) = (1.440_r8*rxt(k,24) +rxt(k,244)*y(k,94))*y(k,23) +rxt(k,21) &
- *y(k,17) +rxt(k,113)*y(k,89)*y(k,40) +rxt(k,1)*y(k,102)
- loss(k,28) = (rxt(k,209)* y(k,94) + rxt(k,50) + het_rates(k,42))* y(k,42)
+ +rxt(k,94)* y(k,95) +rxt(k,120)* y(k,99) + het_rates(k,41))* y(k,41)
+ prod(k,99) = (1.440_r8*rxt(k,24) +rxt(k,244)*y(k,95))*y(k,23) +rxt(k,21) &
+ *y(k,17) +rxt(k,113)*y(k,90)*y(k,40) +rxt(k,1)*y(k,103)
+ loss(k,28) = (rxt(k,209)* y(k,95) + rxt(k,50) + het_rates(k,42))* y(k,42)
prod(k,28) = 0._r8
- loss(k,65) = (rxt(k,158)* y(k,25) +rxt(k,112)* y(k,69) +rxt(k,121)* y(k,98) &
+ loss(k,65) = (rxt(k,158)* y(k,25) +rxt(k,112)* y(k,69) +rxt(k,121)* y(k,99) &
+ rxt(k,4) + het_rates(k,43))* y(k,43)
- prod(k,65) = (.500_r8*rxt(k,263) +rxt(k,127)*y(k,89))*y(k,89) &
- +rxt(k,126)*y(k,98)*y(k,98)
+ prod(k,65) = (.500_r8*rxt(k,263) +rxt(k,127)*y(k,90))*y(k,90) &
+ +rxt(k,126)*y(k,99)*y(k,99)
loss(k,33) = ( + rxt(k,87) + het_rates(k,44))* y(k,44)
- prod(k,33) =rxt(k,262)*y(k,102)*y(k,80)
- loss(k,69) = (rxt(k,204)* y(k,69) + (rxt(k,210) +rxt(k,211))* y(k,94) &
- +rxt(k,205)* y(k,98) + rxt(k,51) + het_rates(k,45))* y(k,45)
- prod(k,69) = (rxt(k,191)*y(k,17) +rxt(k,192)*y(k,89))*y(k,3)
- loss(k,42) = (rxt(k,232)* y(k,94) +rxt(k,227)* y(k,98) + rxt(k,52) &
+ prod(k,33) =rxt(k,262)*y(k,103)*y(k,81)
+ loss(k,69) = (rxt(k,204)* y(k,69) + (rxt(k,210) +rxt(k,211))* y(k,95) &
+ +rxt(k,205)* y(k,99) + rxt(k,51) + het_rates(k,45))* y(k,45)
+ prod(k,69) = (rxt(k,191)*y(k,17) +rxt(k,192)*y(k,90))*y(k,3)
+ loss(k,42) = (rxt(k,232)* y(k,95) +rxt(k,227)* y(k,99) + rxt(k,52) &
+ het_rates(k,46))* y(k,46)
prod(k,42) = 0._r8
- loss(k,44) = (rxt(k,233)* y(k,94) +rxt(k,228)* y(k,98) + rxt(k,53) &
+ loss(k,44) = (rxt(k,233)* y(k,95) +rxt(k,228)* y(k,99) + rxt(k,53) &
+ het_rates(k,47))* y(k,47)
prod(k,44) = 0._r8
- loss(k,48) = (rxt(k,234)* y(k,94) +rxt(k,229)* y(k,98) + rxt(k,54) &
+ loss(k,48) = (rxt(k,234)* y(k,95) +rxt(k,229)* y(k,99) + rxt(k,54) &
+ het_rates(k,48))* y(k,48)
prod(k,48) = 0._r8
loss(k,85) = ((rxt(k,273) +rxt(k,278) +rxt(k,283))* y(k,29) + (rxt(k,275) + &
rxt(k,280))* y(k,53) + (rxt(k,268) +rxt(k,274) +rxt(k,279))* y(k,54) &
- +rxt(k,175)* y(k,69) + (rxt(k,187) +rxt(k,188))* y(k,94) +rxt(k,176) &
- * y(k,98) + rxt(k,55) + het_rates(k,49))* y(k,49)
+ +rxt(k,175)* y(k,69) + (rxt(k,187) +rxt(k,188))* y(k,95) +rxt(k,176) &
+ * y(k,99) + rxt(k,55) + het_rates(k,49))* y(k,49)
prod(k,85) = (rxt(k,155)*y(k,17) +rxt(k,156)*y(k,23) +rxt(k,157)*y(k,41) + &
- rxt(k,158)*y(k,43) +rxt(k,159)*y(k,89) +rxt(k,177)*y(k,54) + &
+ rxt(k,158)*y(k,43) +rxt(k,159)*y(k,90) +rxt(k,177)*y(k,54) + &
rxt(k,218)*y(k,16) +rxt(k,220)*y(k,18) +2.000_r8*rxt(k,223)*y(k,20) + &
- rxt(k,225)*y(k,24))*y(k,25) +rxt(k,174)*y(k,98)*y(k,28)
+ rxt(k,225)*y(k,24))*y(k,25) +rxt(k,174)*y(k,99)*y(k,28)
loss(k,49) = ( + rxt(k,56) + het_rates(k,50))* y(k,50)
- prod(k,49) = (rxt(k,212)*y(k,23) +rxt(k,213)*y(k,41) +rxt(k,214)*y(k,102) + &
+ prod(k,49) = (rxt(k,212)*y(k,23) +rxt(k,213)*y(k,41) +rxt(k,214)*y(k,103) + &
rxt(k,215)*y(k,51))*y(k,39)
- loss(k,100) = (rxt(k,215)* y(k,39) +rxt(k,152)* y(k,98) + rxt(k,9) &
+ loss(k,100) = (rxt(k,215)* y(k,39) +rxt(k,152)* y(k,99) + rxt(k,9) &
+ het_rates(k,51))* y(k,51)
prod(k,100) = (rxt(k,271) +rxt(k,276) +rxt(k,282) +rxt(k,273)*y(k,49) + &
rxt(k,278)*y(k,49) +rxt(k,283)*y(k,49))*y(k,29) &
+ (2.000_r8*rxt(k,264) +2.000_r8*rxt(k,267) +2.000_r8*rxt(k,270) + &
2.000_r8*rxt(k,281))*y(k,57) + (rxt(k,269) +rxt(k,272) +rxt(k,277)) &
*y(k,6) + (rxt(k,266) +rxt(k,235)*y(k,17) +rxt(k,246)*y(k,35)) &
- *y(k,63) + (.500_r8*rxt(k,265) +rxt(k,151)*y(k,98))*y(k,62)
- loss(k,57) = (rxt(k,128)* y(k,98) + rxt(k,10) + rxt(k,11) + rxt(k,153) &
+ *y(k,63) + (.500_r8*rxt(k,265) +rxt(k,151)*y(k,99))*y(k,62)
+ loss(k,57) = (rxt(k,128)* y(k,99) + rxt(k,10) + rxt(k,11) + rxt(k,153) &
+ het_rates(k,52))* y(k,52)
- prod(k,57) =rxt(k,149)*y(k,89)*y(k,62)
+ prod(k,57) =rxt(k,149)*y(k,90)*y(k,62)
loss(k,68) = ((rxt(k,275) +rxt(k,280))* y(k,49) +rxt(k,206)* y(k,69) &
+ rxt(k,57) + het_rates(k,53))* y(k,53)
- prod(k,68) = (rxt(k,269) +rxt(k,272) +rxt(k,277))*y(k,6) +rxt(k,198)*y(k,89) &
+ prod(k,68) = (rxt(k,269) +rxt(k,272) +rxt(k,277))*y(k,6) +rxt(k,198)*y(k,90) &
*y(k,5)
loss(k,70) = (rxt(k,177)* y(k,25) + (rxt(k,268) +rxt(k,274) +rxt(k,279)) &
- * y(k,49) +rxt(k,178)* y(k,69) +rxt(k,179)* y(k,98) + rxt(k,58) &
+ * y(k,49) +rxt(k,178)* y(k,69) +rxt(k,179)* y(k,99) + rxt(k,58) &
+ het_rates(k,54))* y(k,54)
- prod(k,70) = (rxt(k,271) +rxt(k,276) +rxt(k,282) +rxt(k,171)*y(k,98))*y(k,29) &
- +rxt(k,166)*y(k,89)*y(k,28)
+ prod(k,70) = (rxt(k,271) +rxt(k,276) +rxt(k,282) +rxt(k,171)*y(k,99))*y(k,29) &
+ +rxt(k,166)*y(k,90)*y(k,28)
loss(k,78) = (rxt(k,131)* y(k,61) + (rxt(k,132) +rxt(k,133) +rxt(k,134)) &
- * y(k,62) +rxt(k,135)* y(k,70) +rxt(k,296)* y(k,97) +rxt(k,143) &
- * y(k,98) + rxt(k,62) + het_rates(k,55))* y(k,55)
- prod(k,78) = (rxt(k,129)*y(k,90) +rxt(k,293)*y(k,93))*y(k,69) &
- + (.200_r8*rxt(k,287)*y(k,92) +1.100_r8*rxt(k,289)*y(k,91))*y(k,88) &
- +rxt(k,15)*y(k,61) +rxt(k,294)*y(k,93)*y(k,70) +rxt(k,300)*y(k,99)
- loss(k,46) = ((rxt(k,147) +rxt(k,148))* y(k,94) + rxt(k,12) &
+ * y(k,62) +rxt(k,135)* y(k,70) +rxt(k,296)* y(k,98) +rxt(k,143) &
+ * y(k,99) + rxt(k,62) + het_rates(k,55))* y(k,55)
+ prod(k,78) = (rxt(k,129)*y(k,91) +rxt(k,293)*y(k,94))*y(k,69) &
+ + (.200_r8*rxt(k,287)*y(k,93) +1.100_r8*rxt(k,289)*y(k,92))*y(k,89) &
+ +rxt(k,15)*y(k,61) +rxt(k,294)*y(k,94)*y(k,70) +rxt(k,300)*y(k,100)
+ loss(k,46) = ((rxt(k,147) +rxt(k,148))* y(k,95) + rxt(k,12) &
+ het_rates(k,56))* y(k,56)
prod(k,46) =rxt(k,132)*y(k,62)*y(k,55)
loss(k,50) = ( + rxt(k,13) + rxt(k,14) + rxt(k,154) + rxt(k,264) + rxt(k,267) &
@@ -291,34 +302,34 @@ subroutine imp_prod_loss( avec_len, prod, loss, y, &
prod(k,10) = 0._r8
loss(k,95) = (rxt(k,199)* y(k,5) +rxt(k,239)* y(k,21) +rxt(k,167)* y(k,28) &
+rxt(k,131)* y(k,55) +rxt(k,140)* y(k,63) +rxt(k,146)* y(k,69) &
- +rxt(k,145)* y(k,71) +rxt(k,144)* y(k,89) +rxt(k,298)* y(k,97) &
+ +rxt(k,145)* y(k,71) +rxt(k,144)* y(k,90) +rxt(k,298)* y(k,98) &
+ rxt(k,15) + rxt(k,16) + het_rates(k,61))* y(k,61)
prod(k,95) = (rxt(k,17) +.500_r8*rxt(k,265) +2.000_r8*rxt(k,133)*y(k,55) + &
- rxt(k,136)*y(k,69) +rxt(k,256)*y(k,78))*y(k,62) &
- + (rxt(k,135)*y(k,70) +rxt(k,143)*y(k,98))*y(k,55) &
- +2.000_r8*rxt(k,147)*y(k,94)*y(k,56) +rxt(k,14)*y(k,57) +rxt(k,19) &
- *y(k,63) +rxt(k,130)*y(k,90)*y(k,70) +rxt(k,297)*y(k,97) +rxt(k,310) &
- *y(k,101)
+ rxt(k,136)*y(k,69) +rxt(k,256)*y(k,79))*y(k,62) &
+ + (rxt(k,135)*y(k,70) +rxt(k,143)*y(k,99))*y(k,55) &
+ +2.000_r8*rxt(k,147)*y(k,95)*y(k,56) +rxt(k,14)*y(k,57) +rxt(k,19) &
+ *y(k,63) +rxt(k,130)*y(k,91)*y(k,70) +rxt(k,297)*y(k,98) +rxt(k,310) &
+ *y(k,102)
loss(k,92) = (rxt(k,200)* y(k,5) +rxt(k,169)* y(k,28) + (rxt(k,132) + &
rxt(k,133) +rxt(k,134))* y(k,55) +rxt(k,150)* y(k,63) + (rxt(k,136) + &
- rxt(k,138))* y(k,69) +rxt(k,137)* y(k,71) +rxt(k,256)* y(k,78) &
- +rxt(k,149)* y(k,89) +rxt(k,151)* y(k,98) + rxt(k,17) + rxt(k,265) &
+ rxt(k,138))* y(k,69) +rxt(k,137)* y(k,71) +rxt(k,256)* y(k,79) &
+ +rxt(k,149)* y(k,90) +rxt(k,151)* y(k,99) + rxt(k,17) + rxt(k,265) &
+ het_rates(k,62))* y(k,62)
- prod(k,92) = (2.000_r8*rxt(k,140)*y(k,63) +rxt(k,144)*y(k,89) + &
+ prod(k,92) = (2.000_r8*rxt(k,140)*y(k,63) +rxt(k,144)*y(k,90) + &
rxt(k,145)*y(k,71) +rxt(k,146)*y(k,69) +rxt(k,167)*y(k,28) + &
rxt(k,199)*y(k,5) +rxt(k,239)*y(k,21))*y(k,61) + (rxt(k,18) + &
- rxt(k,139)*y(k,89) +rxt(k,141)*y(k,69) +rxt(k,142)*y(k,98))*y(k,63) &
- + (rxt(k,11) +rxt(k,153) +rxt(k,128)*y(k,98))*y(k,52) + (rxt(k,13) + &
+ rxt(k,139)*y(k,90) +rxt(k,141)*y(k,69) +rxt(k,142)*y(k,99))*y(k,63) &
+ + (rxt(k,11) +rxt(k,153) +rxt(k,128)*y(k,99))*y(k,52) + (rxt(k,13) + &
rxt(k,154))*y(k,57) +rxt(k,28)*y(k,6) +rxt(k,47)*y(k,29) +rxt(k,9) &
*y(k,51)
loss(k,90) = (rxt(k,235)* y(k,17) +rxt(k,246)* y(k,35) +rxt(k,140)* y(k,61) &
- +rxt(k,150)* y(k,62) +rxt(k,141)* y(k,69) +rxt(k,139)* y(k,89) &
- +rxt(k,142)* y(k,98) + rxt(k,18) + rxt(k,19) + rxt(k,266) &
+ +rxt(k,150)* y(k,62) +rxt(k,141)* y(k,69) +rxt(k,139)* y(k,90) &
+ +rxt(k,142)* y(k,99) + rxt(k,18) + rxt(k,19) + rxt(k,266) &
+ het_rates(k,63))* y(k,63)
prod(k,90) = (rxt(k,46) +rxt(k,168)*y(k,25) +rxt(k,170)*y(k,69) + &
- rxt(k,171)*y(k,98))*y(k,29) + (rxt(k,13) +rxt(k,14) +rxt(k,154)) &
+ rxt(k,171)*y(k,99))*y(k,29) + (rxt(k,13) +rxt(k,14) +rxt(k,154)) &
*y(k,57) + (rxt(k,29) +rxt(k,201)*y(k,69))*y(k,6) &
- + (rxt(k,152)*y(k,98) +rxt(k,215)*y(k,39))*y(k,51) &
+ + (rxt(k,152)*y(k,99) +rxt(k,215)*y(k,39))*y(k,51) &
+ (rxt(k,137)*y(k,71) +rxt(k,138)*y(k,69))*y(k,62) +rxt(k,10) &
*y(k,52)
loss(k,11) = ( + het_rates(k,64))* y(k,64)
@@ -337,97 +348,97 @@ subroutine imp_prod_loss( avec_len, prod, loss, y, &
+rxt(k,206)* y(k,53) +rxt(k,178)* y(k,54) +rxt(k,146)* y(k,61) &
+ (rxt(k,136) +rxt(k,138))* y(k,62) +rxt(k,141)* y(k,63) &
+ 2._r8*rxt(k,109)* y(k,69) +rxt(k,110)* y(k,70) +rxt(k,108) &
- * y(k,71) +rxt(k,248)* y(k,73) +rxt(k,117)* y(k,89) + (rxt(k,291) + &
- rxt(k,292))* y(k,91) +rxt(k,293)* y(k,93) +rxt(k,123)* y(k,98) &
+ * y(k,71) +rxt(k,248)* y(k,74) +rxt(k,117)* y(k,90) + (rxt(k,291) + &
+ rxt(k,292))* y(k,92) +rxt(k,293)* y(k,94) +rxt(k,123)* y(k,99) &
+ rxt(k,71) + rxt(k,72) + rxt(k,73) + rxt(k,74) + rxt(k,75) &
+ rxt(k,76) + het_rates(k,69))* y(k,69)
prod(k,93) = (2.000_r8*rxt(k,5) +rxt(k,6) +rxt(k,77) +rxt(k,79) +rxt(k,81) + &
2.000_r8*rxt(k,82) +2.000_r8*rxt(k,83) +rxt(k,84) +rxt(k,85) + &
- rxt(k,86) +rxt(k,97)*y(k,94) +rxt(k,98)*y(k,94) +rxt(k,135)*y(k,55) + &
- rxt(k,250)*y(k,76) +rxt(k,257)*y(k,78) +rxt(k,295)*y(k,93) + &
- rxt(k,302)*y(k,99) +rxt(k,306)*y(k,100))*y(k,70) &
- + (rxt(k,131)*y(k,61) +rxt(k,132)*y(k,62) +rxt(k,296)*y(k,97)) &
- *y(k,55) + (rxt(k,25) +rxt(k,61))*y(k,32) + (rxt(k,287)*y(k,92) + &
- 1.150_r8*rxt(k,288)*y(k,97))*y(k,88) +rxt(k,27)*y(k,5) &
- +.180_r8*rxt(k,24)*y(k,23) +rxt(k,45)*y(k,28) +rxt(k,115)*y(k,89) &
+ rxt(k,86) +rxt(k,97)*y(k,95) +rxt(k,98)*y(k,95) +rxt(k,135)*y(k,55) + &
+ rxt(k,250)*y(k,77) +rxt(k,257)*y(k,79) +rxt(k,295)*y(k,94) + &
+ rxt(k,302)*y(k,100) +rxt(k,306)*y(k,101))*y(k,70) &
+ + (rxt(k,131)*y(k,61) +rxt(k,132)*y(k,62) +rxt(k,296)*y(k,98)) &
+ *y(k,55) + (rxt(k,25) +rxt(k,61))*y(k,32) + (rxt(k,287)*y(k,93) + &
+ 1.150_r8*rxt(k,288)*y(k,98))*y(k,89) +rxt(k,27)*y(k,5) &
+ +.180_r8*rxt(k,24)*y(k,23) +rxt(k,45)*y(k,28) +rxt(k,115)*y(k,90) &
*y(k,40) +rxt(k,14)*y(k,57) +rxt(k,15)*y(k,61) +rxt(k,17)*y(k,62) &
- +rxt(k,18)*y(k,63) +rxt(k,8)*y(k,71) +rxt(k,59)*y(k,72) +rxt(k,89) &
- *y(k,78) +rxt(k,90)*y(k,79) +rxt(k,91)*y(k,80) +rxt(k,301)*y(k,99) &
- *y(k,90) +rxt(k,96)*y(k,94) +rxt(k,125)*y(k,98)*y(k,98) +rxt(k,304) &
- *y(k,100) +rxt(k,309)*y(k,101) +rxt(k,2)*y(k,102)
+ +rxt(k,18)*y(k,63) +rxt(k,8)*y(k,71) +rxt(k,59)*y(k,73) +rxt(k,89) &
+ *y(k,79) +rxt(k,90)*y(k,80) +rxt(k,91)*y(k,81) +rxt(k,301)*y(k,100) &
+ *y(k,91) +rxt(k,96)*y(k,95) +rxt(k,125)*y(k,99)*y(k,99) +rxt(k,304) &
+ *y(k,101) +rxt(k,309)*y(k,102) +rxt(k,2)*y(k,103)
loss(k,87) = (rxt(k,116)* y(k,40) +rxt(k,135)* y(k,55) +rxt(k,110)* y(k,69) &
- +rxt(k,250)* y(k,76) +rxt(k,257)* y(k,78) +rxt(k,130)* y(k,90) &
- +rxt(k,290)* y(k,91) + (rxt(k,294) +rxt(k,295))* y(k,93) +rxt(k,97) &
- * y(k,94) +rxt(k,102)* y(k,95) +rxt(k,302)* y(k,99) +rxt(k,306) &
- * y(k,100) + rxt(k,5) + rxt(k,6) + rxt(k,77) + rxt(k,78) + rxt(k,79) &
+ +rxt(k,250)* y(k,77) +rxt(k,257)* y(k,79) +rxt(k,130)* y(k,91) &
+ +rxt(k,290)* y(k,92) + (rxt(k,294) +rxt(k,295))* y(k,94) +rxt(k,97) &
+ * y(k,95) +rxt(k,102)* y(k,96) +rxt(k,302)* y(k,100) +rxt(k,306) &
+ * y(k,101) + rxt(k,5) + rxt(k,6) + rxt(k,77) + rxt(k,78) + rxt(k,79) &
+ rxt(k,80) + rxt(k,81) + rxt(k,82) + rxt(k,83) + rxt(k,84) &
+ rxt(k,85) + rxt(k,86) + het_rates(k,70))* y(k,70)
- prod(k,87) = (rxt(k,8) +2.000_r8*rxt(k,99)*y(k,94) + &
- 2.000_r8*rxt(k,108)*y(k,69) +2.000_r8*rxt(k,118)*y(k,89) + &
- rxt(k,119)*y(k,40) +rxt(k,124)*y(k,98) +rxt(k,137)*y(k,62) + &
+ prod(k,87) = (rxt(k,8) +2.000_r8*rxt(k,99)*y(k,95) + &
+ 2.000_r8*rxt(k,108)*y(k,69) +2.000_r8*rxt(k,118)*y(k,90) + &
+ rxt(k,119)*y(k,40) +rxt(k,124)*y(k,99) +rxt(k,137)*y(k,62) + &
rxt(k,145)*y(k,61) +rxt(k,161)*y(k,25) +rxt(k,193)*y(k,3) + &
- rxt(k,252)*y(k,76) +rxt(k,258)*y(k,78))*y(k,71) &
- + (rxt(k,113)*y(k,40) +rxt(k,117)*y(k,69) +rxt(k,122)*y(k,98) + &
- rxt(k,127)*y(k,89) +rxt(k,139)*y(k,63) +rxt(k,159)*y(k,25) + &
+ rxt(k,252)*y(k,77) +rxt(k,258)*y(k,79))*y(k,71) &
+ + (rxt(k,113)*y(k,40) +rxt(k,117)*y(k,69) +rxt(k,122)*y(k,99) + &
+ rxt(k,127)*y(k,90) +rxt(k,139)*y(k,63) +rxt(k,159)*y(k,25) + &
rxt(k,166)*y(k,28) +rxt(k,192)*y(k,3) +rxt(k,198)*y(k,5) + &
- rxt(k,238)*y(k,21))*y(k,89) + (rxt(k,101)*y(k,95) + &
- rxt(k,109)*y(k,69) +rxt(k,123)*y(k,98) +rxt(k,136)*y(k,62) + &
+ rxt(k,238)*y(k,21))*y(k,90) + (rxt(k,101)*y(k,96) + &
+ rxt(k,109)*y(k,69) +rxt(k,123)*y(k,99) +rxt(k,136)*y(k,62) + &
rxt(k,141)*y(k,63) +rxt(k,172)*y(k,28) +rxt(k,202)*y(k,5))*y(k,69) &
- + (rxt(k,163)*y(k,28) +rxt(k,164)*y(k,28) +rxt(k,174)*y(k,98) + &
+ + (rxt(k,163)*y(k,28) +rxt(k,164)*y(k,28) +rxt(k,174)*y(k,99) + &
rxt(k,196)*y(k,5) +rxt(k,197)*y(k,5))*y(k,28) + (rxt(k,92) + &
- rxt(k,100) +2.000_r8*rxt(k,102)*y(k,70))*y(k,95) +rxt(k,194)*y(k,5) &
- *y(k,5) +rxt(k,128)*y(k,98)*y(k,52) +rxt(k,134)*y(k,62)*y(k,55) &
- +rxt(k,148)*y(k,94)*y(k,56) +rxt(k,298)*y(k,97)*y(k,61) +rxt(k,19) &
- *y(k,63) +rxt(k,93)*y(k,96)
+ rxt(k,100) +2.000_r8*rxt(k,102)*y(k,70))*y(k,96) +rxt(k,194)*y(k,5) &
+ *y(k,5) +rxt(k,128)*y(k,99)*y(k,52) +rxt(k,134)*y(k,62)*y(k,55) &
+ +rxt(k,148)*y(k,95)*y(k,56) +rxt(k,298)*y(k,98)*y(k,61) +rxt(k,19) &
+ *y(k,63) +rxt(k,93)*y(k,97)
loss(k,88) = (rxt(k,193)* y(k,3) +rxt(k,161)* y(k,25) +rxt(k,119)* y(k,40) &
+rxt(k,145)* y(k,61) +rxt(k,137)* y(k,62) +rxt(k,108)* y(k,69) &
- +rxt(k,252)* y(k,76) +rxt(k,258)* y(k,78) +rxt(k,118)* y(k,89) &
- +rxt(k,99)* y(k,94) +rxt(k,124)* y(k,98) + rxt(k,7) + rxt(k,8) &
+ +rxt(k,252)* y(k,77) +rxt(k,258)* y(k,79) +rxt(k,118)* y(k,90) &
+ +rxt(k,99)* y(k,95) +rxt(k,124)* y(k,99) + rxt(k,7) + rxt(k,8) &
+ het_rates(k,71))* y(k,71)
prod(k,88) =rxt(k,110)*y(k,70)*y(k,69)
- loss(k,52) = (rxt(k,259)* y(k,78) + rxt(k,59) + het_rates(k,72))* y(k,72)
+ loss(k,52) = (rxt(k,259)* y(k,79) + rxt(k,59) + het_rates(k,73))* y(k,73)
prod(k,52) = (rxt(k,165)*y(k,28) +rxt(k,195)*y(k,5))*y(k,28)
- loss(k,53) = (rxt(k,248)* y(k,69) +rxt(k,249)* y(k,98) + rxt(k,88) &
- + het_rates(k,73))* y(k,73)
+ loss(k,53) = (rxt(k,248)* y(k,69) +rxt(k,249)* y(k,99) + rxt(k,88) &
+ + het_rates(k,74))* y(k,74)
prod(k,53) = 0._r8
- loss(k,16) = ( + het_rates(k,74))* y(k,74)
+ loss(k,16) = ( + het_rates(k,75))* y(k,75)
prod(k,16) = 0._r8
- loss(k,17) = ( + het_rates(k,75))* y(k,75)
+ loss(k,17) = ( + het_rates(k,76))* y(k,76)
prod(k,17) = 0._r8
- loss(k,66) = (rxt(k,250)* y(k,70) +rxt(k,252)* y(k,71) +rxt(k,255)* y(k,98) &
- + het_rates(k,76))* y(k,76)
- prod(k,66) =rxt(k,88)*y(k,73) +rxt(k,89)*y(k,78)
- loss(k,18) = ( + rxt(k,60) + het_rates(k,77))* y(k,77)
+ loss(k,66) = (rxt(k,250)* y(k,70) +rxt(k,252)* y(k,71) +rxt(k,255)* y(k,99) &
+ + het_rates(k,77))* y(k,77)
+ prod(k,66) =rxt(k,88)*y(k,74) +rxt(k,89)*y(k,79)
+ loss(k,18) = ( + rxt(k,60) + het_rates(k,78))* y(k,78)
prod(k,18) = 0._r8
loss(k,83) = (rxt(k,253)* y(k,5) +rxt(k,254)* y(k,28) +rxt(k,256)* y(k,62) &
- +rxt(k,257)* y(k,70) +rxt(k,258)* y(k,71) +rxt(k,259)* y(k,72) &
- +rxt(k,260)* y(k,98) + rxt(k,89) + het_rates(k,78))* y(k,78)
- prod(k,83) = (rxt(k,250)*y(k,70) +rxt(k,252)*y(k,71) +rxt(k,255)*y(k,98)) &
- *y(k,76) +rxt(k,248)*y(k,73)*y(k,69) +rxt(k,90)*y(k,79)
- loss(k,74) = (rxt(k,251)* y(k,98) + rxt(k,90) + het_rates(k,79))* y(k,79)
+ +rxt(k,257)* y(k,70) +rxt(k,258)* y(k,71) +rxt(k,259)* y(k,73) &
+ +rxt(k,260)* y(k,99) + rxt(k,89) + het_rates(k,79))* y(k,79)
+ prod(k,83) = (rxt(k,250)*y(k,70) +rxt(k,252)*y(k,71) +rxt(k,255)*y(k,99)) &
+ *y(k,77) +rxt(k,248)*y(k,74)*y(k,69) +rxt(k,90)*y(k,80)
+ loss(k,74) = (rxt(k,251)* y(k,99) + rxt(k,90) + het_rates(k,80))* y(k,80)
prod(k,74) = (rxt(k,253)*y(k,5) +rxt(k,254)*y(k,28) +rxt(k,256)*y(k,62) + &
- rxt(k,257)*y(k,70) +rxt(k,258)*y(k,71) +rxt(k,259)*y(k,72) + &
- rxt(k,260)*y(k,98))*y(k,78) + (rxt(k,246)*y(k,63) + &
- rxt(k,247)*y(k,98) +.500_r8*rxt(k,261)*y(k,98))*y(k,35) &
- +rxt(k,249)*y(k,98)*y(k,73) +rxt(k,91)*y(k,80)
- loss(k,47) = (rxt(k,262)* y(k,102) + rxt(k,91) + het_rates(k,80))* y(k,80)
- prod(k,47) =rxt(k,87)*y(k,44) +rxt(k,251)*y(k,98)*y(k,79)
- loss(k,19) = ( + het_rates(k,81))* y(k,81)
+ rxt(k,257)*y(k,70) +rxt(k,258)*y(k,71) +rxt(k,259)*y(k,73) + &
+ rxt(k,260)*y(k,99))*y(k,79) + (rxt(k,246)*y(k,63) + &
+ rxt(k,247)*y(k,99) +.500_r8*rxt(k,261)*y(k,99))*y(k,35) &
+ +rxt(k,249)*y(k,99)*y(k,74) +rxt(k,91)*y(k,81)
+ loss(k,47) = (rxt(k,262)* y(k,103) + rxt(k,91) + het_rates(k,81))* y(k,81)
+ prod(k,47) =rxt(k,87)*y(k,44) +rxt(k,251)*y(k,99)*y(k,80)
+ loss(k,19) = ( + het_rates(k,82))* y(k,82)
prod(k,19) = 0._r8
- loss(k,20) = ( + het_rates(k,82))* y(k,82)
+ loss(k,20) = ( + het_rates(k,83))* y(k,83)
prod(k,20) = 0._r8
- loss(k,21) = ( + het_rates(k,83))* y(k,83)
+ loss(k,21) = ( + het_rates(k,84))* y(k,84)
prod(k,21) = 0._r8
- loss(k,22) = ( + het_rates(k,84))* y(k,84)
+ loss(k,22) = ( + het_rates(k,85))* y(k,85)
prod(k,22) = 0._r8
- loss(k,23) = ( + het_rates(k,85))* y(k,85)
+ loss(k,23) = ( + het_rates(k,86))* y(k,86)
prod(k,23) = 0._r8
- loss(k,24) = ( + het_rates(k,86))* y(k,86)
+ loss(k,24) = ( + het_rates(k,87))* y(k,87)
prod(k,24) = 0._r8
- loss(k,25) = ( + het_rates(k,87))* y(k,87)
+ loss(k,25) = ( + het_rates(k,88))* y(k,88)
prod(k,25) = 0._r8
- loss(k,76) = (rxt(k,289)* y(k,91) +rxt(k,287)* y(k,92) +rxt(k,288)* y(k,97) &
- + het_rates(k,88))* y(k,88)
+ loss(k,76) = (rxt(k,289)* y(k,92) +rxt(k,287)* y(k,93) +rxt(k,288)* y(k,98) &
+ + het_rates(k,89))* y(k,89)
prod(k,76) = (rxt(k,77) +rxt(k,78) +rxt(k,79) +rxt(k,80) +rxt(k,81) + &
rxt(k,84) +rxt(k,85) +rxt(k,86))*y(k,70) + (rxt(k,71) +rxt(k,72) + &
rxt(k,73) +rxt(k,74) +rxt(k,75) +rxt(k,76))*y(k,69) +rxt(k,62) &
@@ -436,32 +447,32 @@ subroutine imp_prod_loss( avec_len, prod, loss, y, &
+ (rxt(k,159) +rxt(k,160))* y(k,25) +rxt(k,166)* y(k,28) &
+ (rxt(k,113) +rxt(k,114) +rxt(k,115))* y(k,40) +rxt(k,144)* y(k,61) &
+rxt(k,149)* y(k,62) +rxt(k,139)* y(k,63) +rxt(k,117)* y(k,69) &
- +rxt(k,118)* y(k,71) + 2._r8*rxt(k,127)* y(k,89) +rxt(k,122) &
- * y(k,98) + rxt(k,263) + het_rates(k,89))* y(k,89)
+ +rxt(k,118)* y(k,71) + 2._r8*rxt(k,127)* y(k,90) +rxt(k,122) &
+ * y(k,99) + rxt(k,263) + het_rates(k,90))* y(k,90)
prod(k,89) = (rxt(k,121)*y(k,43) +rxt(k,124)*y(k,71) +rxt(k,142)*y(k,63) + &
rxt(k,173)*y(k,28) +rxt(k,203)*y(k,5) +rxt(k,221)*y(k,18) + &
- rxt(k,224)*y(k,20) +rxt(k,245)*y(k,31) +rxt(k,251)*y(k,79) + &
- .500_r8*rxt(k,261)*y(k,35))*y(k,98) + (rxt(k,155)*y(k,25) + &
+ rxt(k,224)*y(k,20) +rxt(k,245)*y(k,31) +rxt(k,251)*y(k,80) + &
+ .500_r8*rxt(k,261)*y(k,35))*y(k,99) + (rxt(k,155)*y(k,25) + &
rxt(k,191)*y(k,3) +rxt(k,235)*y(k,63) +rxt(k,236)*y(k,69))*y(k,17) &
+ (rxt(k,158)*y(k,43) +rxt(k,220)*y(k,18) +rxt(k,223)*y(k,20)) &
*y(k,25) + (rxt(k,162)*y(k,28) +rxt(k,239)*y(k,61))*y(k,21) &
- + (rxt(k,11) +rxt(k,153))*y(k,52) +rxt(k,243)*y(k,94)*y(k,23) &
+ + (rxt(k,11) +rxt(k,153))*y(k,52) +rxt(k,243)*y(k,95)*y(k,23) &
+rxt(k,116)*y(k,70)*y(k,40) +rxt(k,112)*y(k,69)*y(k,43)
- loss(k,77) = (rxt(k,129)* y(k,69) +rxt(k,130)* y(k,70) +rxt(k,301)* y(k,99) &
- + het_rates(k,90))* y(k,90)
- prod(k,77) = (.800_r8*rxt(k,287)*y(k,92) +.900_r8*rxt(k,289)*y(k,91))*y(k,88) &
- +rxt(k,291)*y(k,91)*y(k,69)
+ loss(k,77) = (rxt(k,129)* y(k,69) +rxt(k,130)* y(k,70) +rxt(k,301)* y(k,100) &
+ + het_rates(k,91))* y(k,91)
+ prod(k,77) = (.800_r8*rxt(k,287)*y(k,93) +.900_r8*rxt(k,289)*y(k,92))*y(k,89) &
+ +rxt(k,291)*y(k,92)*y(k,69)
loss(k,64) = ((rxt(k,291) +rxt(k,292))* y(k,69) +rxt(k,290)* y(k,70) &
- +rxt(k,289)* y(k,88) + het_rates(k,91))* y(k,91)
- prod(k,64) =rxt(k,304)*y(k,100) +rxt(k,309)*y(k,101)
- loss(k,67) = (rxt(k,287)* y(k,88) + het_rates(k,92))* y(k,92)
- prod(k,67) = (rxt(k,297) +rxt(k,296)*y(k,55) +rxt(k,298)*y(k,61))*y(k,97) &
- +rxt(k,16)*y(k,61) +rxt(k,291)*y(k,91)*y(k,69) +rxt(k,295)*y(k,93) &
- *y(k,70) +rxt(k,300)*y(k,99)
+ +rxt(k,289)* y(k,89) + het_rates(k,92))* y(k,92)
+ prod(k,64) =rxt(k,304)*y(k,101) +rxt(k,309)*y(k,102)
+ loss(k,67) = (rxt(k,287)* y(k,89) + het_rates(k,93))* y(k,93)
+ prod(k,67) = (rxt(k,297) +rxt(k,296)*y(k,55) +rxt(k,298)*y(k,61))*y(k,98) &
+ +rxt(k,16)*y(k,61) +rxt(k,291)*y(k,92)*y(k,69) +rxt(k,295)*y(k,94) &
+ *y(k,70) +rxt(k,300)*y(k,100)
loss(k,71) = (rxt(k,293)* y(k,69) + (rxt(k,294) +rxt(k,295))* y(k,70) &
- + het_rates(k,93))* y(k,93)
- prod(k,71) =rxt(k,62)*y(k,55) +rxt(k,301)*y(k,99)*y(k,90) +rxt(k,310) &
- *y(k,101)
+ + het_rates(k,94))* y(k,94)
+ prod(k,71) =rxt(k,62)*y(k,55) +rxt(k,301)*y(k,100)*y(k,91) +rxt(k,310) &
+ *y(k,102)
loss(k,94) = (rxt(k,180)* y(k,8) +rxt(k,181)* y(k,9) +rxt(k,207)* y(k,10) &
+rxt(k,182)* y(k,11) +rxt(k,183)* y(k,12) +rxt(k,184)* y(k,13) &
+rxt(k,185)* y(k,14) +rxt(k,186)* y(k,15) +rxt(k,230)* y(k,16) &
@@ -471,24 +482,24 @@ subroutine imp_prod_loss( avec_len, prod, loss, y, &
* y(k,45) +rxt(k,232)* y(k,46) +rxt(k,233)* y(k,47) +rxt(k,234) &
* y(k,48) + (rxt(k,187) +rxt(k,188))* y(k,49) + (rxt(k,147) + &
rxt(k,148))* y(k,56) + (rxt(k,97) +rxt(k,98))* y(k,70) +rxt(k,99) &
- * y(k,71) +rxt(k,95)* y(k,102) + rxt(k,96) + het_rates(k,94)) &
- * y(k,94)
- prod(k,94) = (rxt(k,6) +rxt(k,130)*y(k,90))*y(k,70) +rxt(k,12)*y(k,56) &
- +rxt(k,7)*y(k,71) +.850_r8*rxt(k,288)*y(k,97)*y(k,88) +rxt(k,1) &
- *y(k,102)
+ * y(k,71) +rxt(k,95)* y(k,103) + rxt(k,96) + het_rates(k,95)) &
+ * y(k,95)
+ prod(k,94) = (rxt(k,6) +rxt(k,130)*y(k,91))*y(k,70) +rxt(k,12)*y(k,56) &
+ +rxt(k,7)*y(k,71) +.850_r8*rxt(k,288)*y(k,98)*y(k,89) +rxt(k,1) &
+ *y(k,103)
loss(k,39) = (rxt(k,101)* y(k,69) +rxt(k,102)* y(k,70) + rxt(k,92) &
- + rxt(k,100) + het_rates(k,95))* y(k,95)
+ + rxt(k,100) + het_rates(k,96))* y(k,96)
prod(k,39) = (rxt(k,104) +rxt(k,103)*y(k,32) +rxt(k,105)*y(k,69) + &
- rxt(k,106)*y(k,70) +rxt(k,107)*y(k,71))*y(k,96) +rxt(k,7)*y(k,71)
+ rxt(k,106)*y(k,70) +rxt(k,107)*y(k,71))*y(k,97) +rxt(k,7)*y(k,71)
loss(k,40) = (rxt(k,103)* y(k,32) +rxt(k,105)* y(k,69) +rxt(k,106)* y(k,70) &
- +rxt(k,107)* y(k,71) + rxt(k,93) + rxt(k,104) + het_rates(k,96)) &
- * y(k,96)
- prod(k,40) =rxt(k,97)*y(k,94)*y(k,70)
- loss(k,79) = (rxt(k,296)* y(k,55) +rxt(k,298)* y(k,61) +rxt(k,288)* y(k,88) &
- + rxt(k,297) + het_rates(k,97))* y(k,97)
- prod(k,79) = (rxt(k,78) +rxt(k,80) +rxt(k,290)*y(k,91) +rxt(k,294)*y(k,93) + &
- rxt(k,302)*y(k,99) +rxt(k,306)*y(k,100))*y(k,70) +rxt(k,299)*y(k,99) &
- *y(k,32)
+ +rxt(k,107)* y(k,71) + rxt(k,93) + rxt(k,104) + het_rates(k,97)) &
+ * y(k,97)
+ prod(k,40) =rxt(k,97)*y(k,95)*y(k,70)
+ loss(k,79) = (rxt(k,296)* y(k,55) +rxt(k,298)* y(k,61) +rxt(k,288)* y(k,89) &
+ + rxt(k,297) + het_rates(k,98))* y(k,98)
+ prod(k,79) = (rxt(k,78) +rxt(k,80) +rxt(k,290)*y(k,92) +rxt(k,294)*y(k,94) + &
+ rxt(k,302)*y(k,100) +rxt(k,306)*y(k,101))*y(k,70) &
+ +rxt(k,299)*y(k,100)*y(k,32)
loss(k,98) = (rxt(k,203)* y(k,5) +rxt(k,219)* y(k,16) +rxt(k,237)* y(k,17) &
+rxt(k,221)* y(k,18) +rxt(k,222)* y(k,19) +rxt(k,224)* y(k,20) &
+rxt(k,240)* y(k,22) +rxt(k,241)* y(k,23) +rxt(k,226)* y(k,24) &
@@ -498,47 +509,47 @@ subroutine imp_prod_loss( avec_len, prod, loss, y, &
+rxt(k,228)* y(k,47) +rxt(k,229)* y(k,48) +rxt(k,176)* y(k,49) &
+rxt(k,152)* y(k,51) +rxt(k,128)* y(k,52) +rxt(k,179)* y(k,54) &
+rxt(k,143)* y(k,55) +rxt(k,151)* y(k,62) +rxt(k,142)* y(k,63) &
- +rxt(k,123)* y(k,69) +rxt(k,124)* y(k,71) +rxt(k,249)* y(k,73) &
- +rxt(k,255)* y(k,76) +rxt(k,260)* y(k,78) +rxt(k,251)* y(k,79) &
- +rxt(k,122)* y(k,89) + 2._r8*(rxt(k,125) +rxt(k,126))* y(k,98) &
- + het_rates(k,98))* y(k,98)
- prod(k,98) = (rxt(k,111)*y(k,41) +rxt(k,112)*y(k,43) +rxt(k,117)*y(k,89) + &
+ +rxt(k,123)* y(k,69) +rxt(k,124)* y(k,71) +rxt(k,249)* y(k,74) &
+ +rxt(k,255)* y(k,77) +rxt(k,260)* y(k,79) +rxt(k,251)* y(k,80) &
+ +rxt(k,122)* y(k,90) + 2._r8*(rxt(k,125) +rxt(k,126))* y(k,99) &
+ + het_rates(k,99))* y(k,99)
+ prod(k,98) = (rxt(k,111)*y(k,41) +rxt(k,112)*y(k,43) +rxt(k,117)*y(k,90) + &
rxt(k,175)*y(k,49) +rxt(k,178)*y(k,54) +rxt(k,204)*y(k,45) + &
rxt(k,206)*y(k,53) +rxt(k,236)*y(k,17))*y(k,69) &
+ (2.000_r8*rxt(k,114)*y(k,40) +rxt(k,118)*y(k,71) + &
- rxt(k,139)*y(k,63) +rxt(k,144)*y(k,61) +rxt(k,160)*y(k,25))*y(k,89) &
- + (rxt(k,94)*y(k,41) +2.000_r8*rxt(k,95)*y(k,102) + &
- rxt(k,187)*y(k,49) +rxt(k,210)*y(k,45) +rxt(k,242)*y(k,23))*y(k,94) &
- + (rxt(k,22) +.300_r8*rxt(k,240)*y(k,98))*y(k,22) + (rxt(k,3) + &
- rxt(k,214)*y(k,39))*y(k,102) +.330_r8*rxt(k,24)*y(k,23) &
+ rxt(k,139)*y(k,63) +rxt(k,144)*y(k,61) +rxt(k,160)*y(k,25))*y(k,90) &
+ + (rxt(k,94)*y(k,41) +2.000_r8*rxt(k,95)*y(k,103) + &
+ rxt(k,187)*y(k,49) +rxt(k,210)*y(k,45) +rxt(k,242)*y(k,23))*y(k,95) &
+ + (rxt(k,22) +.300_r8*rxt(k,240)*y(k,99))*y(k,22) + (rxt(k,3) + &
+ rxt(k,214)*y(k,39))*y(k,103) +.330_r8*rxt(k,24)*y(k,23) &
+rxt(k,119)*y(k,71)*y(k,40) +2.000_r8*rxt(k,4)*y(k,43) +rxt(k,9) &
*y(k,51) +rxt(k,10)*y(k,52) +rxt(k,57)*y(k,53) +rxt(k,58)*y(k,54) &
+.500_r8*rxt(k,265)*y(k,62)
- loss(k,80) = (rxt(k,299)* y(k,32) +rxt(k,302)* y(k,70) +rxt(k,301)* y(k,90) &
- + rxt(k,300) + het_rates(k,99))* y(k,99)
- prod(k,80) = (rxt(k,73) +rxt(k,74) +rxt(k,292)*y(k,91) +rxt(k,293)*y(k,93) + &
- rxt(k,305)*y(k,100) +rxt(k,311)*y(k,101))*y(k,69) + (rxt(k,79) + &
- rxt(k,81))*y(k,70) + (rxt(k,303)*y(k,100) +rxt(k,308)*y(k,101)) &
- *y(k,88) +rxt(k,285)*y(k,100) +rxt(k,284)*y(k,101)
- loss(k,60) = (rxt(k,305)* y(k,69) +rxt(k,306)* y(k,70) +rxt(k,303)* y(k,88) &
- + rxt(k,285) + rxt(k,304) + het_rates(k,100))* y(k,100)
+ loss(k,80) = (rxt(k,299)* y(k,32) +rxt(k,302)* y(k,70) +rxt(k,301)* y(k,91) &
+ + rxt(k,300) + het_rates(k,100))* y(k,100)
+ prod(k,80) = (rxt(k,73) +rxt(k,74) +rxt(k,292)*y(k,92) +rxt(k,293)*y(k,94) + &
+ rxt(k,305)*y(k,101) +rxt(k,311)*y(k,102))*y(k,69) + (rxt(k,79) + &
+ rxt(k,81))*y(k,70) + (rxt(k,303)*y(k,101) +rxt(k,308)*y(k,102)) &
+ *y(k,89) +rxt(k,285)*y(k,101) +rxt(k,284)*y(k,102)
+ loss(k,60) = (rxt(k,305)* y(k,69) +rxt(k,306)* y(k,70) +rxt(k,303)* y(k,89) &
+ + rxt(k,285) + rxt(k,304) + het_rates(k,101))* y(k,101)
prod(k,60) = (rxt(k,75) +rxt(k,76))*y(k,69) + (rxt(k,85) +rxt(k,86))*y(k,70) &
- + (rxt(k,286) +rxt(k,307)*y(k,88))*y(k,101)
- loss(k,59) = (rxt(k,311)* y(k,69) + (rxt(k,307) +rxt(k,308))* y(k,88) &
+ + (rxt(k,286) +rxt(k,307)*y(k,89))*y(k,102)
+ loss(k,59) = (rxt(k,311)* y(k,69) + (rxt(k,307) +rxt(k,308))* y(k,89) &
+ rxt(k,284) + rxt(k,286) + rxt(k,309) + rxt(k,310) &
- + het_rates(k,101))* y(k,101)
+ + het_rates(k,102))* y(k,102)
prod(k,59) = (rxt(k,71) +rxt(k,72))*y(k,69) + (rxt(k,77) +rxt(k,84))*y(k,70)
- loss(k,102) = (rxt(k,214)* y(k,39) +rxt(k,262)* y(k,80) +rxt(k,95)* y(k,94) &
- + rxt(k,1) + rxt(k,2) + rxt(k,3) + het_rates(k,102))* y(k,102)
- prod(k,102) = (rxt(k,120)*y(k,41) +rxt(k,121)*y(k,43) +rxt(k,122)*y(k,89) + &
- rxt(k,125)*y(k,98) +rxt(k,128)*y(k,52) +rxt(k,152)*y(k,51) + &
+ loss(k,102) = (rxt(k,214)* y(k,39) +rxt(k,262)* y(k,81) +rxt(k,95)* y(k,95) &
+ + rxt(k,1) + rxt(k,2) + rxt(k,3) + het_rates(k,103))* y(k,103)
+ prod(k,102) = (rxt(k,120)*y(k,41) +rxt(k,121)*y(k,43) +rxt(k,122)*y(k,90) + &
+ rxt(k,125)*y(k,99) +rxt(k,128)*y(k,52) +rxt(k,152)*y(k,51) + &
rxt(k,176)*y(k,49) +rxt(k,179)*y(k,54) +rxt(k,205)*y(k,45) + &
rxt(k,219)*y(k,16) +rxt(k,221)*y(k,18) +rxt(k,222)*y(k,19) + &
rxt(k,224)*y(k,20) +rxt(k,229)*y(k,48) +rxt(k,237)*y(k,17) + &
- rxt(k,240)*y(k,22) +rxt(k,241)*y(k,23))*y(k,98) &
+ rxt(k,240)*y(k,22) +rxt(k,241)*y(k,23))*y(k,99) &
+ (rxt(k,268)*y(k,54) +rxt(k,274)*y(k,54) +rxt(k,275)*y(k,53) + &
rxt(k,279)*y(k,54) +rxt(k,280)*y(k,53))*y(k,49) +.050_r8*rxt(k,24) &
- *y(k,23) +rxt(k,115)*y(k,89)*y(k,40) +rxt(k,87)*y(k,44)
+ *y(k,23) +rxt(k,115)*y(k,90)*y(k,40) +rxt(k,87)*y(k,44)
end do
end subroutine imp_prod_loss
end module mo_prod_loss
diff --git a/src/chemistry/pp_waccm_ma_mam5/mo_rxt_rates_conv.F90 b/src/chemistry/pp_waccm_ma_mam5/mo_rxt_rates_conv.F90
index d8f52c4676..bbe9d4d986 100644
--- a/src/chemistry/pp_waccm_ma_mam5/mo_rxt_rates_conv.F90
+++ b/src/chemistry/pp_waccm_ma_mam5/mo_rxt_rates_conv.F90
@@ -8,9 +8,9 @@ subroutine set_rates( rxt_rates, sol, ncol )
real(r8), intent(inout) :: rxt_rates(:,:,:)
real(r8), intent(in) :: sol(:,:,:)
integer, intent(in) :: ncol
- rxt_rates(:ncol,:, 1) = rxt_rates(:ncol,:, 1)*sol(:ncol,:, 102) ! rate_const*H2O
- rxt_rates(:ncol,:, 2) = rxt_rates(:ncol,:, 2)*sol(:ncol,:, 102) ! rate_const*H2O
- rxt_rates(:ncol,:, 3) = rxt_rates(:ncol,:, 3)*sol(:ncol,:, 102) ! rate_const*H2O
+ rxt_rates(:ncol,:, 1) = rxt_rates(:ncol,:, 1)*sol(:ncol,:, 103) ! rate_const*H2O
+ rxt_rates(:ncol,:, 2) = rxt_rates(:ncol,:, 2)*sol(:ncol,:, 103) ! rate_const*H2O
+ rxt_rates(:ncol,:, 3) = rxt_rates(:ncol,:, 3)*sol(:ncol,:, 103) ! rate_const*H2O
rxt_rates(:ncol,:, 4) = rxt_rates(:ncol,:, 4)*sol(:ncol,:, 43) ! rate_const*H2O2
rxt_rates(:ncol,:, 5) = rxt_rates(:ncol,:, 5)*sol(:ncol,:, 70) ! rate_const*O2
rxt_rates(:ncol,:, 6) = rxt_rates(:ncol,:, 6)*sol(:ncol,:, 70) ! rate_const*O2
@@ -66,8 +66,8 @@ subroutine set_rates( rxt_rates, sol, ncol )
rxt_rates(:ncol,:, 56) = rxt_rates(:ncol,:, 56)*sol(:ncol,:, 50) ! rate_const*HF
rxt_rates(:ncol,:, 57) = rxt_rates(:ncol,:, 57)*sol(:ncol,:, 53) ! rate_const*HOBR
rxt_rates(:ncol,:, 58) = rxt_rates(:ncol,:, 58)*sol(:ncol,:, 54) ! rate_const*HOCL
- rxt_rates(:ncol,:, 59) = rxt_rates(:ncol,:, 59)*sol(:ncol,:, 72) ! rate_const*OCLO
- rxt_rates(:ncol,:, 60) = rxt_rates(:ncol,:, 60)*sol(:ncol,:, 77) ! rate_const*SF6
+ rxt_rates(:ncol,:, 59) = rxt_rates(:ncol,:, 59)*sol(:ncol,:, 73) ! rate_const*OCLO
+ rxt_rates(:ncol,:, 60) = rxt_rates(:ncol,:, 60)*sol(:ncol,:, 78) ! rate_const*SF6
rxt_rates(:ncol,:, 61) = rxt_rates(:ncol,:, 61)*sol(:ncol,:, 32) ! rate_const*CO2
rxt_rates(:ncol,:, 62) = rxt_rates(:ncol,:, 62)*sol(:ncol,:, 55) ! rate_const*N
! rate_const*N2
@@ -95,49 +95,49 @@ subroutine set_rates( rxt_rates, sol, ncol )
rxt_rates(:ncol,:, 85) = rxt_rates(:ncol,:, 85)*sol(:ncol,:, 70) ! rate_const*O2
rxt_rates(:ncol,:, 86) = rxt_rates(:ncol,:, 86)*sol(:ncol,:, 70) ! rate_const*O2
rxt_rates(:ncol,:, 87) = rxt_rates(:ncol,:, 87)*sol(:ncol,:, 44) ! rate_const*H2SO4
- rxt_rates(:ncol,:, 88) = rxt_rates(:ncol,:, 88)*sol(:ncol,:, 73) ! rate_const*OCS
- rxt_rates(:ncol,:, 89) = rxt_rates(:ncol,:, 89)*sol(:ncol,:, 78) ! rate_const*SO
- rxt_rates(:ncol,:, 90) = rxt_rates(:ncol,:, 90)*sol(:ncol,:, 79) ! rate_const*SO2
- rxt_rates(:ncol,:, 91) = rxt_rates(:ncol,:, 91)*sol(:ncol,:, 80) ! rate_const*SO3
- rxt_rates(:ncol,:, 92) = rxt_rates(:ncol,:, 92)*sol(:ncol,:, 95) ! rate_const*O2_1D
- rxt_rates(:ncol,:, 93) = rxt_rates(:ncol,:, 93)*sol(:ncol,:, 96) ! rate_const*O2_1S
- rxt_rates(:ncol,:, 94) = rxt_rates(:ncol,:, 94)*sol(:ncol,:, 94)*sol(:ncol,:, 41) ! rate_const*O1D*H2
- rxt_rates(:ncol,:, 95) = rxt_rates(:ncol,:, 95)*sol(:ncol,:, 94)*sol(:ncol,:, 102) ! rate_const*O1D*H2O
- rxt_rates(:ncol,:, 96) = rxt_rates(:ncol,:, 96)*sol(:ncol,:, 94) ! rate_const*N2*O1D
- rxt_rates(:ncol,:, 97) = rxt_rates(:ncol,:, 97)*sol(:ncol,:, 94)*sol(:ncol,:, 70) ! rate_const*O1D*O2
- rxt_rates(:ncol,:, 98) = rxt_rates(:ncol,:, 98)*sol(:ncol,:, 94)*sol(:ncol,:, 70) ! rate_const*O1D*O2
- rxt_rates(:ncol,:, 99) = rxt_rates(:ncol,:, 99)*sol(:ncol,:, 94)*sol(:ncol,:, 71) ! rate_const*O1D*O3
- rxt_rates(:ncol,:, 100) = rxt_rates(:ncol,:, 100)*sol(:ncol,:, 95) ! rate_const*N2*O2_1D
- rxt_rates(:ncol,:, 101) = rxt_rates(:ncol,:, 101)*sol(:ncol,:, 95)*sol(:ncol,:, 69) ! rate_const*O2_1D*O
- rxt_rates(:ncol,:, 102) = rxt_rates(:ncol,:, 102)*sol(:ncol,:, 95)*sol(:ncol,:, 70) ! rate_const*O2_1D*O2
- rxt_rates(:ncol,:, 103) = rxt_rates(:ncol,:, 103)*sol(:ncol,:, 96)*sol(:ncol,:, 32) ! rate_const*O2_1S*CO2
- rxt_rates(:ncol,:, 104) = rxt_rates(:ncol,:, 104)*sol(:ncol,:, 96) ! rate_const*N2*O2_1S
- rxt_rates(:ncol,:, 105) = rxt_rates(:ncol,:, 105)*sol(:ncol,:, 96)*sol(:ncol,:, 69) ! rate_const*O2_1S*O
- rxt_rates(:ncol,:, 106) = rxt_rates(:ncol,:, 106)*sol(:ncol,:, 96)*sol(:ncol,:, 70) ! rate_const*O2_1S*O2
- rxt_rates(:ncol,:, 107) = rxt_rates(:ncol,:, 107)*sol(:ncol,:, 96)*sol(:ncol,:, 71) ! rate_const*O2_1S*O3
+ rxt_rates(:ncol,:, 88) = rxt_rates(:ncol,:, 88)*sol(:ncol,:, 74) ! rate_const*OCS
+ rxt_rates(:ncol,:, 89) = rxt_rates(:ncol,:, 89)*sol(:ncol,:, 79) ! rate_const*SO
+ rxt_rates(:ncol,:, 90) = rxt_rates(:ncol,:, 90)*sol(:ncol,:, 80) ! rate_const*SO2
+ rxt_rates(:ncol,:, 91) = rxt_rates(:ncol,:, 91)*sol(:ncol,:, 81) ! rate_const*SO3
+ rxt_rates(:ncol,:, 92) = rxt_rates(:ncol,:, 92)*sol(:ncol,:, 96) ! rate_const*O2_1D
+ rxt_rates(:ncol,:, 93) = rxt_rates(:ncol,:, 93)*sol(:ncol,:, 97) ! rate_const*O2_1S
+ rxt_rates(:ncol,:, 94) = rxt_rates(:ncol,:, 94)*sol(:ncol,:, 95)*sol(:ncol,:, 41) ! rate_const*O1D*H2
+ rxt_rates(:ncol,:, 95) = rxt_rates(:ncol,:, 95)*sol(:ncol,:, 95)*sol(:ncol,:, 103) ! rate_const*O1D*H2O
+ rxt_rates(:ncol,:, 96) = rxt_rates(:ncol,:, 96)*sol(:ncol,:, 95) ! rate_const*N2*O1D
+ rxt_rates(:ncol,:, 97) = rxt_rates(:ncol,:, 97)*sol(:ncol,:, 95)*sol(:ncol,:, 70) ! rate_const*O1D*O2
+ rxt_rates(:ncol,:, 98) = rxt_rates(:ncol,:, 98)*sol(:ncol,:, 95)*sol(:ncol,:, 70) ! rate_const*O1D*O2
+ rxt_rates(:ncol,:, 99) = rxt_rates(:ncol,:, 99)*sol(:ncol,:, 95)*sol(:ncol,:, 71) ! rate_const*O1D*O3
+ rxt_rates(:ncol,:, 100) = rxt_rates(:ncol,:, 100)*sol(:ncol,:, 96) ! rate_const*N2*O2_1D
+ rxt_rates(:ncol,:, 101) = rxt_rates(:ncol,:, 101)*sol(:ncol,:, 96)*sol(:ncol,:, 69) ! rate_const*O2_1D*O
+ rxt_rates(:ncol,:, 102) = rxt_rates(:ncol,:, 102)*sol(:ncol,:, 96)*sol(:ncol,:, 70) ! rate_const*O2_1D*O2
+ rxt_rates(:ncol,:, 103) = rxt_rates(:ncol,:, 103)*sol(:ncol,:, 97)*sol(:ncol,:, 32) ! rate_const*O2_1S*CO2
+ rxt_rates(:ncol,:, 104) = rxt_rates(:ncol,:, 104)*sol(:ncol,:, 97) ! rate_const*N2*O2_1S
+ rxt_rates(:ncol,:, 105) = rxt_rates(:ncol,:, 105)*sol(:ncol,:, 97)*sol(:ncol,:, 69) ! rate_const*O2_1S*O
+ rxt_rates(:ncol,:, 106) = rxt_rates(:ncol,:, 106)*sol(:ncol,:, 97)*sol(:ncol,:, 70) ! rate_const*O2_1S*O2
+ rxt_rates(:ncol,:, 107) = rxt_rates(:ncol,:, 107)*sol(:ncol,:, 97)*sol(:ncol,:, 71) ! rate_const*O2_1S*O3
rxt_rates(:ncol,:, 108) = rxt_rates(:ncol,:, 108)*sol(:ncol,:, 69)*sol(:ncol,:, 71) ! rate_const*O*O3
rxt_rates(:ncol,:, 109) = rxt_rates(:ncol,:, 109)*sol(:ncol,:, 69)*sol(:ncol,:, 69) ! rate_const*M*O*O
rxt_rates(:ncol,:, 110) = rxt_rates(:ncol,:, 110)*sol(:ncol,:, 69)*sol(:ncol,:, 70) ! rate_const*M*O*O2
rxt_rates(:ncol,:, 111) = rxt_rates(:ncol,:, 111)*sol(:ncol,:, 41)*sol(:ncol,:, 69) ! rate_const*H2*O
rxt_rates(:ncol,:, 112) = rxt_rates(:ncol,:, 112)*sol(:ncol,:, 43)*sol(:ncol,:, 69) ! rate_const*H2O2*O
- rxt_rates(:ncol,:, 113) = rxt_rates(:ncol,:, 113)*sol(:ncol,:, 40)*sol(:ncol,:, 89) ! rate_const*H*HO2
- rxt_rates(:ncol,:, 114) = rxt_rates(:ncol,:, 114)*sol(:ncol,:, 40)*sol(:ncol,:, 89) ! rate_const*H*HO2
- rxt_rates(:ncol,:, 115) = rxt_rates(:ncol,:, 115)*sol(:ncol,:, 40)*sol(:ncol,:, 89) ! rate_const*H*HO2
+ rxt_rates(:ncol,:, 113) = rxt_rates(:ncol,:, 113)*sol(:ncol,:, 40)*sol(:ncol,:, 90) ! rate_const*H*HO2
+ rxt_rates(:ncol,:, 114) = rxt_rates(:ncol,:, 114)*sol(:ncol,:, 40)*sol(:ncol,:, 90) ! rate_const*H*HO2
+ rxt_rates(:ncol,:, 115) = rxt_rates(:ncol,:, 115)*sol(:ncol,:, 40)*sol(:ncol,:, 90) ! rate_const*H*HO2
rxt_rates(:ncol,:, 116) = rxt_rates(:ncol,:, 116)*sol(:ncol,:, 40)*sol(:ncol,:, 70) ! rate_const*M*H*O2
- rxt_rates(:ncol,:, 117) = rxt_rates(:ncol,:, 117)*sol(:ncol,:, 89)*sol(:ncol,:, 69) ! rate_const*HO2*O
- rxt_rates(:ncol,:, 118) = rxt_rates(:ncol,:, 118)*sol(:ncol,:, 89)*sol(:ncol,:, 71) ! rate_const*HO2*O3
+ rxt_rates(:ncol,:, 117) = rxt_rates(:ncol,:, 117)*sol(:ncol,:, 90)*sol(:ncol,:, 69) ! rate_const*HO2*O
+ rxt_rates(:ncol,:, 118) = rxt_rates(:ncol,:, 118)*sol(:ncol,:, 90)*sol(:ncol,:, 71) ! rate_const*HO2*O3
rxt_rates(:ncol,:, 119) = rxt_rates(:ncol,:, 119)*sol(:ncol,:, 40)*sol(:ncol,:, 71) ! rate_const*H*O3
- rxt_rates(:ncol,:, 120) = rxt_rates(:ncol,:, 120)*sol(:ncol,:, 98)*sol(:ncol,:, 41) ! rate_const*OH*H2
- rxt_rates(:ncol,:, 121) = rxt_rates(:ncol,:, 121)*sol(:ncol,:, 98)*sol(:ncol,:, 43) ! rate_const*OH*H2O2
- rxt_rates(:ncol,:, 122) = rxt_rates(:ncol,:, 122)*sol(:ncol,:, 98)*sol(:ncol,:, 89) ! rate_const*OH*HO2
- rxt_rates(:ncol,:, 123) = rxt_rates(:ncol,:, 123)*sol(:ncol,:, 98)*sol(:ncol,:, 69) ! rate_const*OH*O
- rxt_rates(:ncol,:, 124) = rxt_rates(:ncol,:, 124)*sol(:ncol,:, 98)*sol(:ncol,:, 71) ! rate_const*OH*O3
- rxt_rates(:ncol,:, 125) = rxt_rates(:ncol,:, 125)*sol(:ncol,:, 98)*sol(:ncol,:, 98) ! rate_const*OH*OH
- rxt_rates(:ncol,:, 126) = rxt_rates(:ncol,:, 126)*sol(:ncol,:, 98)*sol(:ncol,:, 98) ! rate_const*M*OH*OH
- rxt_rates(:ncol,:, 127) = rxt_rates(:ncol,:, 127)*sol(:ncol,:, 89)*sol(:ncol,:, 89) ! rate_const*HO2*HO2
- rxt_rates(:ncol,:, 128) = rxt_rates(:ncol,:, 128)*sol(:ncol,:, 52)*sol(:ncol,:, 98) ! rate_const*HO2NO2*OH
- rxt_rates(:ncol,:, 129) = rxt_rates(:ncol,:, 129)*sol(:ncol,:, 90)*sol(:ncol,:, 69) ! rate_const*N2D*O
- rxt_rates(:ncol,:, 130) = rxt_rates(:ncol,:, 130)*sol(:ncol,:, 90)*sol(:ncol,:, 70) ! rate_const*N2D*O2
+ rxt_rates(:ncol,:, 120) = rxt_rates(:ncol,:, 120)*sol(:ncol,:, 99)*sol(:ncol,:, 41) ! rate_const*OH*H2
+ rxt_rates(:ncol,:, 121) = rxt_rates(:ncol,:, 121)*sol(:ncol,:, 99)*sol(:ncol,:, 43) ! rate_const*OH*H2O2
+ rxt_rates(:ncol,:, 122) = rxt_rates(:ncol,:, 122)*sol(:ncol,:, 99)*sol(:ncol,:, 90) ! rate_const*OH*HO2
+ rxt_rates(:ncol,:, 123) = rxt_rates(:ncol,:, 123)*sol(:ncol,:, 99)*sol(:ncol,:, 69) ! rate_const*OH*O
+ rxt_rates(:ncol,:, 124) = rxt_rates(:ncol,:, 124)*sol(:ncol,:, 99)*sol(:ncol,:, 71) ! rate_const*OH*O3
+ rxt_rates(:ncol,:, 125) = rxt_rates(:ncol,:, 125)*sol(:ncol,:, 99)*sol(:ncol,:, 99) ! rate_const*OH*OH
+ rxt_rates(:ncol,:, 126) = rxt_rates(:ncol,:, 126)*sol(:ncol,:, 99)*sol(:ncol,:, 99) ! rate_const*M*OH*OH
+ rxt_rates(:ncol,:, 127) = rxt_rates(:ncol,:, 127)*sol(:ncol,:, 90)*sol(:ncol,:, 90) ! rate_const*HO2*HO2
+ rxt_rates(:ncol,:, 128) = rxt_rates(:ncol,:, 128)*sol(:ncol,:, 52)*sol(:ncol,:, 99) ! rate_const*HO2NO2*OH
+ rxt_rates(:ncol,:, 129) = rxt_rates(:ncol,:, 129)*sol(:ncol,:, 91)*sol(:ncol,:, 69) ! rate_const*N2D*O
+ rxt_rates(:ncol,:, 130) = rxt_rates(:ncol,:, 130)*sol(:ncol,:, 91)*sol(:ncol,:, 70) ! rate_const*N2D*O2
rxt_rates(:ncol,:, 131) = rxt_rates(:ncol,:, 131)*sol(:ncol,:, 55)*sol(:ncol,:, 61) ! rate_const*N*NO
rxt_rates(:ncol,:, 132) = rxt_rates(:ncol,:, 132)*sol(:ncol,:, 55)*sol(:ncol,:, 62) ! rate_const*N*NO2
rxt_rates(:ncol,:, 133) = rxt_rates(:ncol,:, 133)*sol(:ncol,:, 55)*sol(:ncol,:, 62) ! rate_const*N*NO2
@@ -146,131 +146,131 @@ subroutine set_rates( rxt_rates, sol, ncol )
rxt_rates(:ncol,:, 136) = rxt_rates(:ncol,:, 136)*sol(:ncol,:, 62)*sol(:ncol,:, 69) ! rate_const*NO2*O
rxt_rates(:ncol,:, 137) = rxt_rates(:ncol,:, 137)*sol(:ncol,:, 62)*sol(:ncol,:, 71) ! rate_const*NO2*O3
rxt_rates(:ncol,:, 138) = rxt_rates(:ncol,:, 138)*sol(:ncol,:, 62)*sol(:ncol,:, 69) ! rate_const*M*NO2*O
- rxt_rates(:ncol,:, 139) = rxt_rates(:ncol,:, 139)*sol(:ncol,:, 63)*sol(:ncol,:, 89) ! rate_const*NO3*HO2
+ rxt_rates(:ncol,:, 139) = rxt_rates(:ncol,:, 139)*sol(:ncol,:, 63)*sol(:ncol,:, 90) ! rate_const*NO3*HO2
rxt_rates(:ncol,:, 140) = rxt_rates(:ncol,:, 140)*sol(:ncol,:, 63)*sol(:ncol,:, 61) ! rate_const*NO3*NO
rxt_rates(:ncol,:, 141) = rxt_rates(:ncol,:, 141)*sol(:ncol,:, 63)*sol(:ncol,:, 69) ! rate_const*NO3*O
- rxt_rates(:ncol,:, 142) = rxt_rates(:ncol,:, 142)*sol(:ncol,:, 63)*sol(:ncol,:, 98) ! rate_const*NO3*OH
- rxt_rates(:ncol,:, 143) = rxt_rates(:ncol,:, 143)*sol(:ncol,:, 55)*sol(:ncol,:, 98) ! rate_const*N*OH
- rxt_rates(:ncol,:, 144) = rxt_rates(:ncol,:, 144)*sol(:ncol,:, 61)*sol(:ncol,:, 89) ! rate_const*NO*HO2
+ rxt_rates(:ncol,:, 142) = rxt_rates(:ncol,:, 142)*sol(:ncol,:, 63)*sol(:ncol,:, 99) ! rate_const*NO3*OH
+ rxt_rates(:ncol,:, 143) = rxt_rates(:ncol,:, 143)*sol(:ncol,:, 55)*sol(:ncol,:, 99) ! rate_const*N*OH
+ rxt_rates(:ncol,:, 144) = rxt_rates(:ncol,:, 144)*sol(:ncol,:, 61)*sol(:ncol,:, 90) ! rate_const*NO*HO2
rxt_rates(:ncol,:, 145) = rxt_rates(:ncol,:, 145)*sol(:ncol,:, 61)*sol(:ncol,:, 71) ! rate_const*NO*O3
rxt_rates(:ncol,:, 146) = rxt_rates(:ncol,:, 146)*sol(:ncol,:, 61)*sol(:ncol,:, 69) ! rate_const*M*NO*O
- rxt_rates(:ncol,:, 147) = rxt_rates(:ncol,:, 147)*sol(:ncol,:, 94)*sol(:ncol,:, 56) ! rate_const*O1D*N2O
- rxt_rates(:ncol,:, 148) = rxt_rates(:ncol,:, 148)*sol(:ncol,:, 94)*sol(:ncol,:, 56) ! rate_const*O1D*N2O
- rxt_rates(:ncol,:, 149) = rxt_rates(:ncol,:, 149)*sol(:ncol,:, 62)*sol(:ncol,:, 89) ! rate_const*M*NO2*HO2
+ rxt_rates(:ncol,:, 147) = rxt_rates(:ncol,:, 147)*sol(:ncol,:, 95)*sol(:ncol,:, 56) ! rate_const*O1D*N2O
+ rxt_rates(:ncol,:, 148) = rxt_rates(:ncol,:, 148)*sol(:ncol,:, 95)*sol(:ncol,:, 56) ! rate_const*O1D*N2O
+ rxt_rates(:ncol,:, 149) = rxt_rates(:ncol,:, 149)*sol(:ncol,:, 62)*sol(:ncol,:, 90) ! rate_const*M*NO2*HO2
rxt_rates(:ncol,:, 150) = rxt_rates(:ncol,:, 150)*sol(:ncol,:, 62)*sol(:ncol,:, 63) ! rate_const*M*NO2*NO3
- rxt_rates(:ncol,:, 151) = rxt_rates(:ncol,:, 151)*sol(:ncol,:, 62)*sol(:ncol,:, 98) ! rate_const*M*NO2*OH
- rxt_rates(:ncol,:, 152) = rxt_rates(:ncol,:, 152)*sol(:ncol,:, 51)*sol(:ncol,:, 98) ! rate_const*HNO3*OH
+ rxt_rates(:ncol,:, 151) = rxt_rates(:ncol,:, 151)*sol(:ncol,:, 62)*sol(:ncol,:, 99) ! rate_const*M*NO2*OH
+ rxt_rates(:ncol,:, 152) = rxt_rates(:ncol,:, 152)*sol(:ncol,:, 51)*sol(:ncol,:, 99) ! rate_const*HNO3*OH
rxt_rates(:ncol,:, 153) = rxt_rates(:ncol,:, 153)*sol(:ncol,:, 52) ! rate_const*M*HO2NO2
rxt_rates(:ncol,:, 154) = rxt_rates(:ncol,:, 154)*sol(:ncol,:, 57) ! rate_const*M*N2O5
rxt_rates(:ncol,:, 155) = rxt_rates(:ncol,:, 155)*sol(:ncol,:, 25)*sol(:ncol,:, 17) ! rate_const*CL*CH2O
rxt_rates(:ncol,:, 156) = rxt_rates(:ncol,:, 156)*sol(:ncol,:, 25)*sol(:ncol,:, 23) ! rate_const*CL*CH4
rxt_rates(:ncol,:, 157) = rxt_rates(:ncol,:, 157)*sol(:ncol,:, 25)*sol(:ncol,:, 41) ! rate_const*CL*H2
rxt_rates(:ncol,:, 158) = rxt_rates(:ncol,:, 158)*sol(:ncol,:, 25)*sol(:ncol,:, 43) ! rate_const*CL*H2O2
- rxt_rates(:ncol,:, 159) = rxt_rates(:ncol,:, 159)*sol(:ncol,:, 25)*sol(:ncol,:, 89) ! rate_const*CL*HO2
- rxt_rates(:ncol,:, 160) = rxt_rates(:ncol,:, 160)*sol(:ncol,:, 25)*sol(:ncol,:, 89) ! rate_const*CL*HO2
+ rxt_rates(:ncol,:, 159) = rxt_rates(:ncol,:, 159)*sol(:ncol,:, 25)*sol(:ncol,:, 90) ! rate_const*CL*HO2
+ rxt_rates(:ncol,:, 160) = rxt_rates(:ncol,:, 160)*sol(:ncol,:, 25)*sol(:ncol,:, 90) ! rate_const*CL*HO2
rxt_rates(:ncol,:, 161) = rxt_rates(:ncol,:, 161)*sol(:ncol,:, 25)*sol(:ncol,:, 71) ! rate_const*CL*O3
rxt_rates(:ncol,:, 162) = rxt_rates(:ncol,:, 162)*sol(:ncol,:, 28)*sol(:ncol,:, 21) ! rate_const*CLO*CH3O2
rxt_rates(:ncol,:, 163) = rxt_rates(:ncol,:, 163)*sol(:ncol,:, 28)*sol(:ncol,:, 28) ! rate_const*CLO*CLO
rxt_rates(:ncol,:, 164) = rxt_rates(:ncol,:, 164)*sol(:ncol,:, 28)*sol(:ncol,:, 28) ! rate_const*CLO*CLO
rxt_rates(:ncol,:, 165) = rxt_rates(:ncol,:, 165)*sol(:ncol,:, 28)*sol(:ncol,:, 28) ! rate_const*CLO*CLO
- rxt_rates(:ncol,:, 166) = rxt_rates(:ncol,:, 166)*sol(:ncol,:, 28)*sol(:ncol,:, 89) ! rate_const*CLO*HO2
+ rxt_rates(:ncol,:, 166) = rxt_rates(:ncol,:, 166)*sol(:ncol,:, 28)*sol(:ncol,:, 90) ! rate_const*CLO*HO2
rxt_rates(:ncol,:, 167) = rxt_rates(:ncol,:, 167)*sol(:ncol,:, 28)*sol(:ncol,:, 61) ! rate_const*CLO*NO
rxt_rates(:ncol,:, 168) = rxt_rates(:ncol,:, 168)*sol(:ncol,:, 29)*sol(:ncol,:, 25) ! rate_const*CLONO2*CL
rxt_rates(:ncol,:, 169) = rxt_rates(:ncol,:, 169)*sol(:ncol,:, 28)*sol(:ncol,:, 62) ! rate_const*M*CLO*NO2
rxt_rates(:ncol,:, 170) = rxt_rates(:ncol,:, 170)*sol(:ncol,:, 29)*sol(:ncol,:, 69) ! rate_const*CLONO2*O
- rxt_rates(:ncol,:, 171) = rxt_rates(:ncol,:, 171)*sol(:ncol,:, 29)*sol(:ncol,:, 98) ! rate_const*CLONO2*OH
+ rxt_rates(:ncol,:, 171) = rxt_rates(:ncol,:, 171)*sol(:ncol,:, 29)*sol(:ncol,:, 99) ! rate_const*CLONO2*OH
rxt_rates(:ncol,:, 172) = rxt_rates(:ncol,:, 172)*sol(:ncol,:, 28)*sol(:ncol,:, 69) ! rate_const*CLO*O
- rxt_rates(:ncol,:, 173) = rxt_rates(:ncol,:, 173)*sol(:ncol,:, 28)*sol(:ncol,:, 98) ! rate_const*CLO*OH
- rxt_rates(:ncol,:, 174) = rxt_rates(:ncol,:, 174)*sol(:ncol,:, 28)*sol(:ncol,:, 98) ! rate_const*CLO*OH
+ rxt_rates(:ncol,:, 173) = rxt_rates(:ncol,:, 173)*sol(:ncol,:, 28)*sol(:ncol,:, 99) ! rate_const*CLO*OH
+ rxt_rates(:ncol,:, 174) = rxt_rates(:ncol,:, 174)*sol(:ncol,:, 28)*sol(:ncol,:, 99) ! rate_const*CLO*OH
rxt_rates(:ncol,:, 175) = rxt_rates(:ncol,:, 175)*sol(:ncol,:, 49)*sol(:ncol,:, 69) ! rate_const*HCL*O
- rxt_rates(:ncol,:, 176) = rxt_rates(:ncol,:, 176)*sol(:ncol,:, 49)*sol(:ncol,:, 98) ! rate_const*HCL*OH
+ rxt_rates(:ncol,:, 176) = rxt_rates(:ncol,:, 176)*sol(:ncol,:, 49)*sol(:ncol,:, 99) ! rate_const*HCL*OH
rxt_rates(:ncol,:, 177) = rxt_rates(:ncol,:, 177)*sol(:ncol,:, 54)*sol(:ncol,:, 25) ! rate_const*HOCL*CL
rxt_rates(:ncol,:, 178) = rxt_rates(:ncol,:, 178)*sol(:ncol,:, 54)*sol(:ncol,:, 69) ! rate_const*HOCL*O
- rxt_rates(:ncol,:, 179) = rxt_rates(:ncol,:, 179)*sol(:ncol,:, 54)*sol(:ncol,:, 98) ! rate_const*HOCL*OH
- rxt_rates(:ncol,:, 180) = rxt_rates(:ncol,:, 180)*sol(:ncol,:, 94)*sol(:ncol,:, 8) ! rate_const*O1D*CCL4
- rxt_rates(:ncol,:, 181) = rxt_rates(:ncol,:, 181)*sol(:ncol,:, 94)*sol(:ncol,:, 9) ! rate_const*O1D*CF2CLBR
- rxt_rates(:ncol,:, 182) = rxt_rates(:ncol,:, 182)*sol(:ncol,:, 94)*sol(:ncol,:, 11) ! rate_const*O1D*CFC11
- rxt_rates(:ncol,:, 183) = rxt_rates(:ncol,:, 183)*sol(:ncol,:, 94)*sol(:ncol,:, 12) ! rate_const*O1D*CFC113
- rxt_rates(:ncol,:, 184) = rxt_rates(:ncol,:, 184)*sol(:ncol,:, 94)*sol(:ncol,:, 13) ! rate_const*O1D*CFC114
- rxt_rates(:ncol,:, 185) = rxt_rates(:ncol,:, 185)*sol(:ncol,:, 94)*sol(:ncol,:, 14) ! rate_const*O1D*CFC115
- rxt_rates(:ncol,:, 186) = rxt_rates(:ncol,:, 186)*sol(:ncol,:, 94)*sol(:ncol,:, 15) ! rate_const*O1D*CFC12
- rxt_rates(:ncol,:, 187) = rxt_rates(:ncol,:, 187)*sol(:ncol,:, 94)*sol(:ncol,:, 49) ! rate_const*O1D*HCL
- rxt_rates(:ncol,:, 188) = rxt_rates(:ncol,:, 188)*sol(:ncol,:, 94)*sol(:ncol,:, 49) ! rate_const*O1D*HCL
+ rxt_rates(:ncol,:, 179) = rxt_rates(:ncol,:, 179)*sol(:ncol,:, 54)*sol(:ncol,:, 99) ! rate_const*HOCL*OH
+ rxt_rates(:ncol,:, 180) = rxt_rates(:ncol,:, 180)*sol(:ncol,:, 95)*sol(:ncol,:, 8) ! rate_const*O1D*CCL4
+ rxt_rates(:ncol,:, 181) = rxt_rates(:ncol,:, 181)*sol(:ncol,:, 95)*sol(:ncol,:, 9) ! rate_const*O1D*CF2CLBR
+ rxt_rates(:ncol,:, 182) = rxt_rates(:ncol,:, 182)*sol(:ncol,:, 95)*sol(:ncol,:, 11) ! rate_const*O1D*CFC11
+ rxt_rates(:ncol,:, 183) = rxt_rates(:ncol,:, 183)*sol(:ncol,:, 95)*sol(:ncol,:, 12) ! rate_const*O1D*CFC113
+ rxt_rates(:ncol,:, 184) = rxt_rates(:ncol,:, 184)*sol(:ncol,:, 95)*sol(:ncol,:, 13) ! rate_const*O1D*CFC114
+ rxt_rates(:ncol,:, 185) = rxt_rates(:ncol,:, 185)*sol(:ncol,:, 95)*sol(:ncol,:, 14) ! rate_const*O1D*CFC115
+ rxt_rates(:ncol,:, 186) = rxt_rates(:ncol,:, 186)*sol(:ncol,:, 95)*sol(:ncol,:, 15) ! rate_const*O1D*CFC12
+ rxt_rates(:ncol,:, 187) = rxt_rates(:ncol,:, 187)*sol(:ncol,:, 95)*sol(:ncol,:, 49) ! rate_const*O1D*HCL
+ rxt_rates(:ncol,:, 188) = rxt_rates(:ncol,:, 188)*sol(:ncol,:, 95)*sol(:ncol,:, 49) ! rate_const*O1D*HCL
rxt_rates(:ncol,:, 189) = rxt_rates(:ncol,:, 189)*sol(:ncol,:, 28)*sol(:ncol,:, 28) ! rate_const*M*CLO*CLO
rxt_rates(:ncol,:, 190) = rxt_rates(:ncol,:, 190)*sol(:ncol,:, 27) ! rate_const*M*CL2O2
rxt_rates(:ncol,:, 191) = rxt_rates(:ncol,:, 191)*sol(:ncol,:, 3)*sol(:ncol,:, 17) ! rate_const*BR*CH2O
- rxt_rates(:ncol,:, 192) = rxt_rates(:ncol,:, 192)*sol(:ncol,:, 3)*sol(:ncol,:, 89) ! rate_const*BR*HO2
+ rxt_rates(:ncol,:, 192) = rxt_rates(:ncol,:, 192)*sol(:ncol,:, 3)*sol(:ncol,:, 90) ! rate_const*BR*HO2
rxt_rates(:ncol,:, 193) = rxt_rates(:ncol,:, 193)*sol(:ncol,:, 3)*sol(:ncol,:, 71) ! rate_const*BR*O3
rxt_rates(:ncol,:, 194) = rxt_rates(:ncol,:, 194)*sol(:ncol,:, 5)*sol(:ncol,:, 5) ! rate_const*BRO*BRO
rxt_rates(:ncol,:, 195) = rxt_rates(:ncol,:, 195)*sol(:ncol,:, 5)*sol(:ncol,:, 28) ! rate_const*BRO*CLO
rxt_rates(:ncol,:, 196) = rxt_rates(:ncol,:, 196)*sol(:ncol,:, 5)*sol(:ncol,:, 28) ! rate_const*BRO*CLO
rxt_rates(:ncol,:, 197) = rxt_rates(:ncol,:, 197)*sol(:ncol,:, 5)*sol(:ncol,:, 28) ! rate_const*BRO*CLO
- rxt_rates(:ncol,:, 198) = rxt_rates(:ncol,:, 198)*sol(:ncol,:, 5)*sol(:ncol,:, 89) ! rate_const*BRO*HO2
+ rxt_rates(:ncol,:, 198) = rxt_rates(:ncol,:, 198)*sol(:ncol,:, 5)*sol(:ncol,:, 90) ! rate_const*BRO*HO2
rxt_rates(:ncol,:, 199) = rxt_rates(:ncol,:, 199)*sol(:ncol,:, 5)*sol(:ncol,:, 61) ! rate_const*BRO*NO
rxt_rates(:ncol,:, 200) = rxt_rates(:ncol,:, 200)*sol(:ncol,:, 5)*sol(:ncol,:, 62) ! rate_const*M*BRO*NO2
rxt_rates(:ncol,:, 201) = rxt_rates(:ncol,:, 201)*sol(:ncol,:, 6)*sol(:ncol,:, 69) ! rate_const*BRONO2*O
rxt_rates(:ncol,:, 202) = rxt_rates(:ncol,:, 202)*sol(:ncol,:, 5)*sol(:ncol,:, 69) ! rate_const*BRO*O
- rxt_rates(:ncol,:, 203) = rxt_rates(:ncol,:, 203)*sol(:ncol,:, 5)*sol(:ncol,:, 98) ! rate_const*BRO*OH
+ rxt_rates(:ncol,:, 203) = rxt_rates(:ncol,:, 203)*sol(:ncol,:, 5)*sol(:ncol,:, 99) ! rate_const*BRO*OH
rxt_rates(:ncol,:, 204) = rxt_rates(:ncol,:, 204)*sol(:ncol,:, 45)*sol(:ncol,:, 69) ! rate_const*HBR*O
- rxt_rates(:ncol,:, 205) = rxt_rates(:ncol,:, 205)*sol(:ncol,:, 45)*sol(:ncol,:, 98) ! rate_const*HBR*OH
+ rxt_rates(:ncol,:, 205) = rxt_rates(:ncol,:, 205)*sol(:ncol,:, 45)*sol(:ncol,:, 99) ! rate_const*HBR*OH
rxt_rates(:ncol,:, 206) = rxt_rates(:ncol,:, 206)*sol(:ncol,:, 53)*sol(:ncol,:, 69) ! rate_const*HOBR*O
- rxt_rates(:ncol,:, 207) = rxt_rates(:ncol,:, 207)*sol(:ncol,:, 94)*sol(:ncol,:, 10) ! rate_const*O1D*CF3BR
- rxt_rates(:ncol,:, 208) = rxt_rates(:ncol,:, 208)*sol(:ncol,:, 94)*sol(:ncol,:, 24) ! rate_const*O1D*CHBR3
- rxt_rates(:ncol,:, 209) = rxt_rates(:ncol,:, 209)*sol(:ncol,:, 94)*sol(:ncol,:, 42) ! rate_const*O1D*H2402
- rxt_rates(:ncol,:, 210) = rxt_rates(:ncol,:, 210)*sol(:ncol,:, 94)*sol(:ncol,:, 45) ! rate_const*O1D*HBR
- rxt_rates(:ncol,:, 211) = rxt_rates(:ncol,:, 211)*sol(:ncol,:, 94)*sol(:ncol,:, 45) ! rate_const*O1D*HBR
+ rxt_rates(:ncol,:, 207) = rxt_rates(:ncol,:, 207)*sol(:ncol,:, 95)*sol(:ncol,:, 10) ! rate_const*O1D*CF3BR
+ rxt_rates(:ncol,:, 208) = rxt_rates(:ncol,:, 208)*sol(:ncol,:, 95)*sol(:ncol,:, 24) ! rate_const*O1D*CHBR3
+ rxt_rates(:ncol,:, 209) = rxt_rates(:ncol,:, 209)*sol(:ncol,:, 95)*sol(:ncol,:, 42) ! rate_const*O1D*H2402
+ rxt_rates(:ncol,:, 210) = rxt_rates(:ncol,:, 210)*sol(:ncol,:, 95)*sol(:ncol,:, 45) ! rate_const*O1D*HBR
+ rxt_rates(:ncol,:, 211) = rxt_rates(:ncol,:, 211)*sol(:ncol,:, 95)*sol(:ncol,:, 45) ! rate_const*O1D*HBR
rxt_rates(:ncol,:, 212) = rxt_rates(:ncol,:, 212)*sol(:ncol,:, 39)*sol(:ncol,:, 23) ! rate_const*F*CH4
rxt_rates(:ncol,:, 213) = rxt_rates(:ncol,:, 213)*sol(:ncol,:, 39)*sol(:ncol,:, 41) ! rate_const*F*H2
- rxt_rates(:ncol,:, 214) = rxt_rates(:ncol,:, 214)*sol(:ncol,:, 39)*sol(:ncol,:, 102) ! rate_const*F*H2O
+ rxt_rates(:ncol,:, 214) = rxt_rates(:ncol,:, 214)*sol(:ncol,:, 39)*sol(:ncol,:, 103) ! rate_const*F*H2O
rxt_rates(:ncol,:, 215) = rxt_rates(:ncol,:, 215)*sol(:ncol,:, 39)*sol(:ncol,:, 51) ! rate_const*F*HNO3
- rxt_rates(:ncol,:, 216) = rxt_rates(:ncol,:, 216)*sol(:ncol,:, 94)*sol(:ncol,:, 33) ! rate_const*O1D*COF2
- rxt_rates(:ncol,:, 217) = rxt_rates(:ncol,:, 217)*sol(:ncol,:, 94)*sol(:ncol,:, 34) ! rate_const*O1D*COFCL
+ rxt_rates(:ncol,:, 216) = rxt_rates(:ncol,:, 216)*sol(:ncol,:, 95)*sol(:ncol,:, 33) ! rate_const*O1D*COF2
+ rxt_rates(:ncol,:, 217) = rxt_rates(:ncol,:, 217)*sol(:ncol,:, 95)*sol(:ncol,:, 34) ! rate_const*O1D*COFCL
rxt_rates(:ncol,:, 218) = rxt_rates(:ncol,:, 218)*sol(:ncol,:, 16)*sol(:ncol,:, 25) ! rate_const*CH2BR2*CL
- rxt_rates(:ncol,:, 219) = rxt_rates(:ncol,:, 219)*sol(:ncol,:, 16)*sol(:ncol,:, 98) ! rate_const*CH2BR2*OH
+ rxt_rates(:ncol,:, 219) = rxt_rates(:ncol,:, 219)*sol(:ncol,:, 16)*sol(:ncol,:, 99) ! rate_const*CH2BR2*OH
rxt_rates(:ncol,:, 220) = rxt_rates(:ncol,:, 220)*sol(:ncol,:, 18)*sol(:ncol,:, 25) ! rate_const*CH3BR*CL
- rxt_rates(:ncol,:, 221) = rxt_rates(:ncol,:, 221)*sol(:ncol,:, 18)*sol(:ncol,:, 98) ! rate_const*CH3BR*OH
- rxt_rates(:ncol,:, 222) = rxt_rates(:ncol,:, 222)*sol(:ncol,:, 19)*sol(:ncol,:, 98) ! rate_const*CH3CCL3*OH
+ rxt_rates(:ncol,:, 221) = rxt_rates(:ncol,:, 221)*sol(:ncol,:, 18)*sol(:ncol,:, 99) ! rate_const*CH3BR*OH
+ rxt_rates(:ncol,:, 222) = rxt_rates(:ncol,:, 222)*sol(:ncol,:, 19)*sol(:ncol,:, 99) ! rate_const*CH3CCL3*OH
rxt_rates(:ncol,:, 223) = rxt_rates(:ncol,:, 223)*sol(:ncol,:, 20)*sol(:ncol,:, 25) ! rate_const*CH3CL*CL
- rxt_rates(:ncol,:, 224) = rxt_rates(:ncol,:, 224)*sol(:ncol,:, 20)*sol(:ncol,:, 98) ! rate_const*CH3CL*OH
+ rxt_rates(:ncol,:, 224) = rxt_rates(:ncol,:, 224)*sol(:ncol,:, 20)*sol(:ncol,:, 99) ! rate_const*CH3CL*OH
rxt_rates(:ncol,:, 225) = rxt_rates(:ncol,:, 225)*sol(:ncol,:, 24)*sol(:ncol,:, 25) ! rate_const*CHBR3*CL
- rxt_rates(:ncol,:, 226) = rxt_rates(:ncol,:, 226)*sol(:ncol,:, 24)*sol(:ncol,:, 98) ! rate_const*CHBR3*OH
- rxt_rates(:ncol,:, 227) = rxt_rates(:ncol,:, 227)*sol(:ncol,:, 46)*sol(:ncol,:, 98) ! rate_const*HCFC141B*OH
- rxt_rates(:ncol,:, 228) = rxt_rates(:ncol,:, 228)*sol(:ncol,:, 47)*sol(:ncol,:, 98) ! rate_const*HCFC142B*OH
- rxt_rates(:ncol,:, 229) = rxt_rates(:ncol,:, 229)*sol(:ncol,:, 48)*sol(:ncol,:, 98) ! rate_const*HCFC22*OH
- rxt_rates(:ncol,:, 230) = rxt_rates(:ncol,:, 230)*sol(:ncol,:, 94)*sol(:ncol,:, 16) ! rate_const*O1D*CH2BR2
- rxt_rates(:ncol,:, 231) = rxt_rates(:ncol,:, 231)*sol(:ncol,:, 94)*sol(:ncol,:, 18) ! rate_const*O1D*CH3BR
- rxt_rates(:ncol,:, 232) = rxt_rates(:ncol,:, 232)*sol(:ncol,:, 94)*sol(:ncol,:, 46) ! rate_const*O1D*HCFC141B
- rxt_rates(:ncol,:, 233) = rxt_rates(:ncol,:, 233)*sol(:ncol,:, 94)*sol(:ncol,:, 47) ! rate_const*O1D*HCFC142B
- rxt_rates(:ncol,:, 234) = rxt_rates(:ncol,:, 234)*sol(:ncol,:, 94)*sol(:ncol,:, 48) ! rate_const*O1D*HCFC22
+ rxt_rates(:ncol,:, 226) = rxt_rates(:ncol,:, 226)*sol(:ncol,:, 24)*sol(:ncol,:, 99) ! rate_const*CHBR3*OH
+ rxt_rates(:ncol,:, 227) = rxt_rates(:ncol,:, 227)*sol(:ncol,:, 46)*sol(:ncol,:, 99) ! rate_const*HCFC141B*OH
+ rxt_rates(:ncol,:, 228) = rxt_rates(:ncol,:, 228)*sol(:ncol,:, 47)*sol(:ncol,:, 99) ! rate_const*HCFC142B*OH
+ rxt_rates(:ncol,:, 229) = rxt_rates(:ncol,:, 229)*sol(:ncol,:, 48)*sol(:ncol,:, 99) ! rate_const*HCFC22*OH
+ rxt_rates(:ncol,:, 230) = rxt_rates(:ncol,:, 230)*sol(:ncol,:, 95)*sol(:ncol,:, 16) ! rate_const*O1D*CH2BR2
+ rxt_rates(:ncol,:, 231) = rxt_rates(:ncol,:, 231)*sol(:ncol,:, 95)*sol(:ncol,:, 18) ! rate_const*O1D*CH3BR
+ rxt_rates(:ncol,:, 232) = rxt_rates(:ncol,:, 232)*sol(:ncol,:, 95)*sol(:ncol,:, 46) ! rate_const*O1D*HCFC141B
+ rxt_rates(:ncol,:, 233) = rxt_rates(:ncol,:, 233)*sol(:ncol,:, 95)*sol(:ncol,:, 47) ! rate_const*O1D*HCFC142B
+ rxt_rates(:ncol,:, 234) = rxt_rates(:ncol,:, 234)*sol(:ncol,:, 95)*sol(:ncol,:, 48) ! rate_const*O1D*HCFC22
rxt_rates(:ncol,:, 235) = rxt_rates(:ncol,:, 235)*sol(:ncol,:, 17)*sol(:ncol,:, 63) ! rate_const*CH2O*NO3
rxt_rates(:ncol,:, 236) = rxt_rates(:ncol,:, 236)*sol(:ncol,:, 17)*sol(:ncol,:, 69) ! rate_const*CH2O*O
- rxt_rates(:ncol,:, 237) = rxt_rates(:ncol,:, 237)*sol(:ncol,:, 17)*sol(:ncol,:, 98) ! rate_const*CH2O*OH
- rxt_rates(:ncol,:, 238) = rxt_rates(:ncol,:, 238)*sol(:ncol,:, 21)*sol(:ncol,:, 89) ! rate_const*CH3O2*HO2
+ rxt_rates(:ncol,:, 237) = rxt_rates(:ncol,:, 237)*sol(:ncol,:, 17)*sol(:ncol,:, 99) ! rate_const*CH2O*OH
+ rxt_rates(:ncol,:, 238) = rxt_rates(:ncol,:, 238)*sol(:ncol,:, 21)*sol(:ncol,:, 90) ! rate_const*CH3O2*HO2
rxt_rates(:ncol,:, 239) = rxt_rates(:ncol,:, 239)*sol(:ncol,:, 21)*sol(:ncol,:, 61) ! rate_const*CH3O2*NO
- rxt_rates(:ncol,:, 240) = rxt_rates(:ncol,:, 240)*sol(:ncol,:, 22)*sol(:ncol,:, 98) ! rate_const*CH3OOH*OH
- rxt_rates(:ncol,:, 241) = rxt_rates(:ncol,:, 241)*sol(:ncol,:, 23)*sol(:ncol,:, 98) ! rate_const*CH4*OH
- rxt_rates(:ncol,:, 242) = rxt_rates(:ncol,:, 242)*sol(:ncol,:, 94)*sol(:ncol,:, 23) ! rate_const*O1D*CH4
- rxt_rates(:ncol,:, 243) = rxt_rates(:ncol,:, 243)*sol(:ncol,:, 94)*sol(:ncol,:, 23) ! rate_const*O1D*CH4
- rxt_rates(:ncol,:, 244) = rxt_rates(:ncol,:, 244)*sol(:ncol,:, 94)*sol(:ncol,:, 23) ! rate_const*O1D*CH4
- rxt_rates(:ncol,:, 245) = rxt_rates(:ncol,:, 245)*sol(:ncol,:, 31)*sol(:ncol,:, 98) ! rate_const*CO*OH
+ rxt_rates(:ncol,:, 240) = rxt_rates(:ncol,:, 240)*sol(:ncol,:, 22)*sol(:ncol,:, 99) ! rate_const*CH3OOH*OH
+ rxt_rates(:ncol,:, 241) = rxt_rates(:ncol,:, 241)*sol(:ncol,:, 23)*sol(:ncol,:, 99) ! rate_const*CH4*OH
+ rxt_rates(:ncol,:, 242) = rxt_rates(:ncol,:, 242)*sol(:ncol,:, 95)*sol(:ncol,:, 23) ! rate_const*O1D*CH4
+ rxt_rates(:ncol,:, 243) = rxt_rates(:ncol,:, 243)*sol(:ncol,:, 95)*sol(:ncol,:, 23) ! rate_const*O1D*CH4
+ rxt_rates(:ncol,:, 244) = rxt_rates(:ncol,:, 244)*sol(:ncol,:, 95)*sol(:ncol,:, 23) ! rate_const*O1D*CH4
+ rxt_rates(:ncol,:, 245) = rxt_rates(:ncol,:, 245)*sol(:ncol,:, 31)*sol(:ncol,:, 99) ! rate_const*CO*OH
rxt_rates(:ncol,:, 246) = rxt_rates(:ncol,:, 246)*sol(:ncol,:, 35)*sol(:ncol,:, 63) ! rate_const*DMS*NO3
- rxt_rates(:ncol,:, 247) = rxt_rates(:ncol,:, 247)*sol(:ncol,:, 35)*sol(:ncol,:, 98) ! rate_const*DMS*OH
- rxt_rates(:ncol,:, 248) = rxt_rates(:ncol,:, 248)*sol(:ncol,:, 73)*sol(:ncol,:, 69) ! rate_const*OCS*O
- rxt_rates(:ncol,:, 249) = rxt_rates(:ncol,:, 249)*sol(:ncol,:, 73)*sol(:ncol,:, 98) ! rate_const*OCS*OH
- rxt_rates(:ncol,:, 250) = rxt_rates(:ncol,:, 250)*sol(:ncol,:, 76)*sol(:ncol,:, 70) ! rate_const*S*O2
- rxt_rates(:ncol,:, 251) = rxt_rates(:ncol,:, 251)*sol(:ncol,:, 79)*sol(:ncol,:, 98) ! rate_const*M*SO2*OH
- rxt_rates(:ncol,:, 252) = rxt_rates(:ncol,:, 252)*sol(:ncol,:, 76)*sol(:ncol,:, 71) ! rate_const*S*O3
- rxt_rates(:ncol,:, 253) = rxt_rates(:ncol,:, 253)*sol(:ncol,:, 78)*sol(:ncol,:, 5) ! rate_const*SO*BRO
- rxt_rates(:ncol,:, 254) = rxt_rates(:ncol,:, 254)*sol(:ncol,:, 78)*sol(:ncol,:, 28) ! rate_const*SO*CLO
- rxt_rates(:ncol,:, 255) = rxt_rates(:ncol,:, 255)*sol(:ncol,:, 76)*sol(:ncol,:, 98) ! rate_const*S*OH
- rxt_rates(:ncol,:, 256) = rxt_rates(:ncol,:, 256)*sol(:ncol,:, 78)*sol(:ncol,:, 62) ! rate_const*SO*NO2
- rxt_rates(:ncol,:, 257) = rxt_rates(:ncol,:, 257)*sol(:ncol,:, 78)*sol(:ncol,:, 70) ! rate_const*SO*O2
- rxt_rates(:ncol,:, 258) = rxt_rates(:ncol,:, 258)*sol(:ncol,:, 78)*sol(:ncol,:, 71) ! rate_const*SO*O3
- rxt_rates(:ncol,:, 259) = rxt_rates(:ncol,:, 259)*sol(:ncol,:, 78)*sol(:ncol,:, 72) ! rate_const*SO*OCLO
- rxt_rates(:ncol,:, 260) = rxt_rates(:ncol,:, 260)*sol(:ncol,:, 78)*sol(:ncol,:, 98) ! rate_const*SO*OH
- rxt_rates(:ncol,:, 261) = rxt_rates(:ncol,:, 261)*sol(:ncol,:, 35)*sol(:ncol,:, 98) ! rate_const*DMS*OH
- rxt_rates(:ncol,:, 262) = rxt_rates(:ncol,:, 262)*sol(:ncol,:, 80)*sol(:ncol,:, 102) ! rate_const*SO3*H2O
- rxt_rates(:ncol,:, 263) = rxt_rates(:ncol,:, 263)*sol(:ncol,:, 89) ! rate_const*HO2
+ rxt_rates(:ncol,:, 247) = rxt_rates(:ncol,:, 247)*sol(:ncol,:, 35)*sol(:ncol,:, 99) ! rate_const*DMS*OH
+ rxt_rates(:ncol,:, 248) = rxt_rates(:ncol,:, 248)*sol(:ncol,:, 74)*sol(:ncol,:, 69) ! rate_const*OCS*O
+ rxt_rates(:ncol,:, 249) = rxt_rates(:ncol,:, 249)*sol(:ncol,:, 74)*sol(:ncol,:, 99) ! rate_const*OCS*OH
+ rxt_rates(:ncol,:, 250) = rxt_rates(:ncol,:, 250)*sol(:ncol,:, 77)*sol(:ncol,:, 70) ! rate_const*S*O2
+ rxt_rates(:ncol,:, 251) = rxt_rates(:ncol,:, 251)*sol(:ncol,:, 80)*sol(:ncol,:, 99) ! rate_const*M*SO2*OH
+ rxt_rates(:ncol,:, 252) = rxt_rates(:ncol,:, 252)*sol(:ncol,:, 77)*sol(:ncol,:, 71) ! rate_const*S*O3
+ rxt_rates(:ncol,:, 253) = rxt_rates(:ncol,:, 253)*sol(:ncol,:, 79)*sol(:ncol,:, 5) ! rate_const*SO*BRO
+ rxt_rates(:ncol,:, 254) = rxt_rates(:ncol,:, 254)*sol(:ncol,:, 79)*sol(:ncol,:, 28) ! rate_const*SO*CLO
+ rxt_rates(:ncol,:, 255) = rxt_rates(:ncol,:, 255)*sol(:ncol,:, 77)*sol(:ncol,:, 99) ! rate_const*S*OH
+ rxt_rates(:ncol,:, 256) = rxt_rates(:ncol,:, 256)*sol(:ncol,:, 79)*sol(:ncol,:, 62) ! rate_const*SO*NO2
+ rxt_rates(:ncol,:, 257) = rxt_rates(:ncol,:, 257)*sol(:ncol,:, 79)*sol(:ncol,:, 70) ! rate_const*SO*O2
+ rxt_rates(:ncol,:, 258) = rxt_rates(:ncol,:, 258)*sol(:ncol,:, 79)*sol(:ncol,:, 71) ! rate_const*SO*O3
+ rxt_rates(:ncol,:, 259) = rxt_rates(:ncol,:, 259)*sol(:ncol,:, 79)*sol(:ncol,:, 73) ! rate_const*SO*OCLO
+ rxt_rates(:ncol,:, 260) = rxt_rates(:ncol,:, 260)*sol(:ncol,:, 79)*sol(:ncol,:, 99) ! rate_const*SO*OH
+ rxt_rates(:ncol,:, 261) = rxt_rates(:ncol,:, 261)*sol(:ncol,:, 35)*sol(:ncol,:, 99) ! rate_const*DMS*OH
+ rxt_rates(:ncol,:, 262) = rxt_rates(:ncol,:, 262)*sol(:ncol,:, 81)*sol(:ncol,:, 103) ! rate_const*SO3*H2O
+ rxt_rates(:ncol,:, 263) = rxt_rates(:ncol,:, 263)*sol(:ncol,:, 90) ! rate_const*HO2
rxt_rates(:ncol,:, 264) = rxt_rates(:ncol,:, 264)*sol(:ncol,:, 57) ! rate_const*N2O5
rxt_rates(:ncol,:, 265) = rxt_rates(:ncol,:, 265)*sol(:ncol,:, 62) ! rate_const*NO2
rxt_rates(:ncol,:, 266) = rxt_rates(:ncol,:, 266)*sol(:ncol,:, 63) ! rate_const*NO3
@@ -291,33 +291,33 @@ subroutine set_rates( rxt_rates, sol, ncol )
rxt_rates(:ncol,:, 281) = rxt_rates(:ncol,:, 281)*sol(:ncol,:, 57) ! rate_const*N2O5
rxt_rates(:ncol,:, 282) = rxt_rates(:ncol,:, 282)*sol(:ncol,:, 29) ! rate_const*CLONO2
rxt_rates(:ncol,:, 283) = rxt_rates(:ncol,:, 283)*sol(:ncol,:, 29)*sol(:ncol,:, 49) ! rate_const*CLONO2*HCL
- rxt_rates(:ncol,:, 284) = rxt_rates(:ncol,:, 284)*sol(:ncol,:, 101) ! rate_const*Op2P
- rxt_rates(:ncol,:, 285) = rxt_rates(:ncol,:, 285)*sol(:ncol,:, 100) ! rate_const*Op2D
- rxt_rates(:ncol,:, 286) = rxt_rates(:ncol,:, 286)*sol(:ncol,:, 101) ! rate_const*Op2P
- rxt_rates(:ncol,:, 287) = rxt_rates(:ncol,:, 287)*sol(:ncol,:, 92)*sol(:ncol,:, 88) ! rate_const*NOp*e
- rxt_rates(:ncol,:, 288) = rxt_rates(:ncol,:, 288)*sol(:ncol,:, 97)*sol(:ncol,:, 88) ! rate_const*O2p*e
- rxt_rates(:ncol,:, 289) = rxt_rates(:ncol,:, 289)*sol(:ncol,:, 91)*sol(:ncol,:, 88) ! rate_const*N2p*e
- rxt_rates(:ncol,:, 290) = rxt_rates(:ncol,:, 290)*sol(:ncol,:, 91)*sol(:ncol,:, 70) ! rate_const*N2p*O2
- rxt_rates(:ncol,:, 291) = rxt_rates(:ncol,:, 291)*sol(:ncol,:, 91)*sol(:ncol,:, 69) ! rate_const*N2p*O
- rxt_rates(:ncol,:, 292) = rxt_rates(:ncol,:, 292)*sol(:ncol,:, 91)*sol(:ncol,:, 69) ! rate_const*N2p*O
- rxt_rates(:ncol,:, 293) = rxt_rates(:ncol,:, 293)*sol(:ncol,:, 93)*sol(:ncol,:, 69) ! rate_const*Np*O
- rxt_rates(:ncol,:, 294) = rxt_rates(:ncol,:, 294)*sol(:ncol,:, 93)*sol(:ncol,:, 70) ! rate_const*Np*O2
- rxt_rates(:ncol,:, 295) = rxt_rates(:ncol,:, 295)*sol(:ncol,:, 93)*sol(:ncol,:, 70) ! rate_const*Np*O2
- rxt_rates(:ncol,:, 296) = rxt_rates(:ncol,:, 296)*sol(:ncol,:, 97)*sol(:ncol,:, 55) ! rate_const*O2p*N
- rxt_rates(:ncol,:, 297) = rxt_rates(:ncol,:, 297)*sol(:ncol,:, 97) ! rate_const*N2*O2p
- rxt_rates(:ncol,:, 298) = rxt_rates(:ncol,:, 298)*sol(:ncol,:, 97)*sol(:ncol,:, 61) ! rate_const*O2p*NO
- rxt_rates(:ncol,:, 299) = rxt_rates(:ncol,:, 299)*sol(:ncol,:, 99)*sol(:ncol,:, 32) ! rate_const*Op*CO2
- rxt_rates(:ncol,:, 300) = rxt_rates(:ncol,:, 300)*sol(:ncol,:, 99) ! rate_const*N2*Op
- rxt_rates(:ncol,:, 301) = rxt_rates(:ncol,:, 301)*sol(:ncol,:, 99)*sol(:ncol,:, 90) ! rate_const*Op*N2D
- rxt_rates(:ncol,:, 302) = rxt_rates(:ncol,:, 302)*sol(:ncol,:, 99)*sol(:ncol,:, 70) ! rate_const*Op*O2
- rxt_rates(:ncol,:, 303) = rxt_rates(:ncol,:, 303)*sol(:ncol,:, 100)*sol(:ncol,:, 88) ! rate_const*Op2D*e
- rxt_rates(:ncol,:, 304) = rxt_rates(:ncol,:, 304)*sol(:ncol,:, 100) ! rate_const*N2*Op2D
- rxt_rates(:ncol,:, 305) = rxt_rates(:ncol,:, 305)*sol(:ncol,:, 100)*sol(:ncol,:, 69) ! rate_const*Op2D*O
- rxt_rates(:ncol,:, 306) = rxt_rates(:ncol,:, 306)*sol(:ncol,:, 100)*sol(:ncol,:, 70) ! rate_const*Op2D*O2
- rxt_rates(:ncol,:, 307) = rxt_rates(:ncol,:, 307)*sol(:ncol,:, 101)*sol(:ncol,:, 88) ! rate_const*Op2P*e
- rxt_rates(:ncol,:, 308) = rxt_rates(:ncol,:, 308)*sol(:ncol,:, 101)*sol(:ncol,:, 88) ! rate_const*Op2P*e
- rxt_rates(:ncol,:, 309) = rxt_rates(:ncol,:, 309)*sol(:ncol,:, 101) ! rate_const*N2*Op2P
- rxt_rates(:ncol,:, 310) = rxt_rates(:ncol,:, 310)*sol(:ncol,:, 101) ! rate_const*N2*Op2P
- rxt_rates(:ncol,:, 311) = rxt_rates(:ncol,:, 311)*sol(:ncol,:, 101)*sol(:ncol,:, 69) ! rate_const*Op2P*O
+ rxt_rates(:ncol,:, 284) = rxt_rates(:ncol,:, 284)*sol(:ncol,:, 102) ! rate_const*Op2P
+ rxt_rates(:ncol,:, 285) = rxt_rates(:ncol,:, 285)*sol(:ncol,:, 101) ! rate_const*Op2D
+ rxt_rates(:ncol,:, 286) = rxt_rates(:ncol,:, 286)*sol(:ncol,:, 102) ! rate_const*Op2P
+ rxt_rates(:ncol,:, 287) = rxt_rates(:ncol,:, 287)*sol(:ncol,:, 93)*sol(:ncol,:, 89) ! rate_const*NOp*e
+ rxt_rates(:ncol,:, 288) = rxt_rates(:ncol,:, 288)*sol(:ncol,:, 98)*sol(:ncol,:, 89) ! rate_const*O2p*e
+ rxt_rates(:ncol,:, 289) = rxt_rates(:ncol,:, 289)*sol(:ncol,:, 92)*sol(:ncol,:, 89) ! rate_const*N2p*e
+ rxt_rates(:ncol,:, 290) = rxt_rates(:ncol,:, 290)*sol(:ncol,:, 92)*sol(:ncol,:, 70) ! rate_const*N2p*O2
+ rxt_rates(:ncol,:, 291) = rxt_rates(:ncol,:, 291)*sol(:ncol,:, 92)*sol(:ncol,:, 69) ! rate_const*N2p*O
+ rxt_rates(:ncol,:, 292) = rxt_rates(:ncol,:, 292)*sol(:ncol,:, 92)*sol(:ncol,:, 69) ! rate_const*N2p*O
+ rxt_rates(:ncol,:, 293) = rxt_rates(:ncol,:, 293)*sol(:ncol,:, 94)*sol(:ncol,:, 69) ! rate_const*Np*O
+ rxt_rates(:ncol,:, 294) = rxt_rates(:ncol,:, 294)*sol(:ncol,:, 94)*sol(:ncol,:, 70) ! rate_const*Np*O2
+ rxt_rates(:ncol,:, 295) = rxt_rates(:ncol,:, 295)*sol(:ncol,:, 94)*sol(:ncol,:, 70) ! rate_const*Np*O2
+ rxt_rates(:ncol,:, 296) = rxt_rates(:ncol,:, 296)*sol(:ncol,:, 98)*sol(:ncol,:, 55) ! rate_const*O2p*N
+ rxt_rates(:ncol,:, 297) = rxt_rates(:ncol,:, 297)*sol(:ncol,:, 98) ! rate_const*N2*O2p
+ rxt_rates(:ncol,:, 298) = rxt_rates(:ncol,:, 298)*sol(:ncol,:, 98)*sol(:ncol,:, 61) ! rate_const*O2p*NO
+ rxt_rates(:ncol,:, 299) = rxt_rates(:ncol,:, 299)*sol(:ncol,:, 100)*sol(:ncol,:, 32) ! rate_const*Op*CO2
+ rxt_rates(:ncol,:, 300) = rxt_rates(:ncol,:, 300)*sol(:ncol,:, 100) ! rate_const*N2*Op
+ rxt_rates(:ncol,:, 301) = rxt_rates(:ncol,:, 301)*sol(:ncol,:, 100)*sol(:ncol,:, 91) ! rate_const*Op*N2D
+ rxt_rates(:ncol,:, 302) = rxt_rates(:ncol,:, 302)*sol(:ncol,:, 100)*sol(:ncol,:, 70) ! rate_const*Op*O2
+ rxt_rates(:ncol,:, 303) = rxt_rates(:ncol,:, 303)*sol(:ncol,:, 101)*sol(:ncol,:, 89) ! rate_const*Op2D*e
+ rxt_rates(:ncol,:, 304) = rxt_rates(:ncol,:, 304)*sol(:ncol,:, 101) ! rate_const*N2*Op2D
+ rxt_rates(:ncol,:, 305) = rxt_rates(:ncol,:, 305)*sol(:ncol,:, 101)*sol(:ncol,:, 69) ! rate_const*Op2D*O
+ rxt_rates(:ncol,:, 306) = rxt_rates(:ncol,:, 306)*sol(:ncol,:, 101)*sol(:ncol,:, 70) ! rate_const*Op2D*O2
+ rxt_rates(:ncol,:, 307) = rxt_rates(:ncol,:, 307)*sol(:ncol,:, 102)*sol(:ncol,:, 89) ! rate_const*Op2P*e
+ rxt_rates(:ncol,:, 308) = rxt_rates(:ncol,:, 308)*sol(:ncol,:, 102)*sol(:ncol,:, 89) ! rate_const*Op2P*e
+ rxt_rates(:ncol,:, 309) = rxt_rates(:ncol,:, 309)*sol(:ncol,:, 102) ! rate_const*N2*Op2P
+ rxt_rates(:ncol,:, 310) = rxt_rates(:ncol,:, 310)*sol(:ncol,:, 102) ! rate_const*N2*Op2P
+ rxt_rates(:ncol,:, 311) = rxt_rates(:ncol,:, 311)*sol(:ncol,:, 102)*sol(:ncol,:, 69) ! rate_const*Op2P*O
end subroutine set_rates
end module mo_rxt_rates_conv
diff --git a/src/chemistry/pp_waccm_ma_mam5/mo_sim_dat.F90 b/src/chemistry/pp_waccm_ma_mam5/mo_sim_dat.F90
index 4b884922d5..adb157e52e 100644
--- a/src/chemistry/pp_waccm_ma_mam5/mo_sim_dat.F90
+++ b/src/chemistry/pp_waccm_ma_mam5/mo_sim_dat.F90
@@ -31,11 +31,12 @@ subroutine set_sim_dat
is_scalar = .false.
is_vector = .true.
- clscnt(:) = (/ 0, 0, 0, 102, 0 /)
+ clscnt(:) = (/ 1, 0, 0, 102, 0 /)
+ cls_rxt_cnt(:,1) = (/ 0, 0, 0, 1 /)
cls_rxt_cnt(:,4) = (/ 8, 112, 191, 102 /)
- solsym(:102) = (/ 'bc_a1 ','bc_a4 ','BR ','BRCL ','BRO ', &
+ solsym(:103) = (/ 'bc_a1 ','bc_a4 ','BR ','BRCL ','BRO ', &
'BRONO2 ','BRY ','CCL4 ','CF2CLBR ','CF3BR ', &
'CFC11 ','CFC113 ','CFC114 ','CFC115 ','CFC12 ', &
'CH2BR2 ','CH2O ','CH3BR ','CH3CCL3 ','CH3CL ', &
@@ -49,15 +50,15 @@ subroutine set_sim_dat
'N2O ','N2O5 ','ncl_a1 ','ncl_a2 ','ncl_a3 ', &
'NO ','NO2 ','NO3 ','num_a1 ','num_a2 ', &
'num_a3 ','num_a4 ','num_a5 ','O ','O2 ', &
- 'O3 ','OCLO ','OCS ','pom_a1 ','pom_a4 ', &
- 'S ','SF6 ','SO ','SO2 ','SO3 ', &
- 'so4_a1 ','so4_a2 ','so4_a3 ','so4_a5 ','soa_a1 ', &
- 'soa_a2 ','SOAG ','e ','HO2 ','N2D ', &
- 'N2p ','NOp ','Np ','O1D ','O2_1D ', &
- 'O2_1S ','O2p ','OH ','Op ','Op2D ', &
- 'Op2P ','H2O ' /)
+ 'O3 ','O3S ','OCLO ','OCS ','pom_a1 ', &
+ 'pom_a4 ','S ','SF6 ','SO ','SO2 ', &
+ 'SO3 ','so4_a1 ','so4_a2 ','so4_a3 ','so4_a5 ', &
+ 'soa_a1 ','soa_a2 ','SOAG ','e ','HO2 ', &
+ 'N2D ','N2p ','NOp ','Np ','O1D ', &
+ 'O2_1D ','O2_1S ','O2p ','OH ','Op ', &
+ 'Op2D ','Op2P ','H2O ' /)
- adv_mass(:102) = (/ 12.011000_r8, 12.011000_r8, 79.904000_r8, 115.356700_r8, 95.903400_r8, &
+ adv_mass(:103) = (/ 12.011000_r8, 12.011000_r8, 79.904000_r8, 115.356700_r8, 95.903400_r8, &
141.908940_r8, 99.716850_r8, 153.821800_r8, 165.364506_r8, 148.910210_r8, &
137.367503_r8, 187.375310_r8, 170.921013_r8, 154.466716_r8, 120.913206_r8, &
173.833800_r8, 30.025200_r8, 94.937200_r8, 133.402300_r8, 50.485900_r8, &
@@ -71,15 +72,15 @@ subroutine set_sim_dat
44.012880_r8, 108.010480_r8, 58.442468_r8, 58.442468_r8, 58.442468_r8, &
30.006140_r8, 46.005540_r8, 62.004940_r8, 1.007400_r8, 1.007400_r8, &
1.007400_r8, 1.007400_r8, 1.007400_r8, 15.999400_r8, 31.998800_r8, &
- 47.998200_r8, 67.451500_r8, 60.076400_r8, 12.011000_r8, 12.011000_r8, &
- 32.066000_r8, 146.056419_r8, 48.065400_r8, 64.064800_r8, 80.064200_r8, &
- 115.107340_r8, 115.107340_r8, 115.107340_r8, 115.107340_r8, 12.011000_r8, &
- 12.011000_r8, 12.011000_r8, 0.548567E-03_r8, 33.006200_r8, 14.006740_r8, &
- 28.013480_r8, 30.006140_r8, 14.006740_r8, 15.999400_r8, 31.998800_r8, &
- 31.998800_r8, 31.998800_r8, 17.006800_r8, 15.999400_r8, 15.999400_r8, &
- 15.999400_r8, 18.014200_r8 /)
+ 47.998200_r8, 47.998200_r8, 67.451500_r8, 60.076400_r8, 12.011000_r8, &
+ 12.011000_r8, 32.066000_r8, 146.056419_r8, 48.065400_r8, 64.064800_r8, &
+ 80.064200_r8, 115.107340_r8, 115.107340_r8, 115.107340_r8, 115.107340_r8, &
+ 12.011000_r8, 12.011000_r8, 12.011000_r8, 0.548567E-03_r8, 33.006200_r8, &
+ 14.006740_r8, 28.013480_r8, 30.006140_r8, 14.006740_r8, 15.999400_r8, &
+ 31.998800_r8, 31.998800_r8, 31.998800_r8, 17.006800_r8, 15.999400_r8, &
+ 15.999400_r8, 15.999400_r8, 18.014200_r8 /)
- crb_mass(:102) = (/ 12.011000_r8, 12.011000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, &
+ crb_mass(:103) = (/ 12.011000_r8, 12.011000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, &
0.000000_r8, 0.000000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, &
12.011000_r8, 24.022000_r8, 24.022000_r8, 24.022000_r8, 12.011000_r8, &
12.011000_r8, 12.011000_r8, 12.011000_r8, 24.022000_r8, 12.011000_r8, &
@@ -93,16 +94,17 @@ subroutine set_sim_dat
0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, &
0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, &
0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, &
- 0.000000_r8, 0.000000_r8, 12.011000_r8, 12.011000_r8, 12.011000_r8, &
+ 0.000000_r8, 0.000000_r8, 0.000000_r8, 12.011000_r8, 12.011000_r8, &
+ 12.011000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, &
0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, &
- 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 12.011000_r8, &
- 12.011000_r8, 12.011000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, &
+ 12.011000_r8, 12.011000_r8, 12.011000_r8, 0.000000_r8, 0.000000_r8, &
0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, &
0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, 0.000000_r8, &
- 0.000000_r8, 0.000000_r8 /)
+ 0.000000_r8, 0.000000_r8, 0.000000_r8 /)
fix_mass(: 2) = (/ 0.00000000_r8, 28.0134800_r8 /)
+ clsmap(: 1,1) = (/ 72 /)
clsmap(:102,4) = (/ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, &
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, &
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, &
@@ -110,10 +112,10 @@ subroutine set_sim_dat
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, &
51, 52, 53, 54, 55, 56, 57, 58, 59, 60, &
61, 62, 63, 64, 65, 66, 67, 68, 69, 70, &
- 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, &
- 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, &
- 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, &
- 101, 102 /)
+ 71, 73, 74, 75, 76, 77, 78, 79, 80, 81, &
+ 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, &
+ 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, &
+ 102, 103 /)
permute(:102,4) = (/ 1, 2, 97, 45, 101, 62, 3, 27, 34, 35, &
29, 36, 30, 37, 31, 58, 86, 63, 32, 54, &
diff --git a/src/chemistry/utils/tracer_data.F90 b/src/chemistry/utils/tracer_data.F90
index 861a4cd7eb..f1eeb00e17 100644
--- a/src/chemistry/utils/tracer_data.F90
+++ b/src/chemistry/utils/tracer_data.F90
@@ -92,10 +92,10 @@ module tracer_data
real(r8) :: one_yr = 0
real(r8) :: curr_mod_time ! model time - calendar day
real(r8) :: next_mod_time ! model time - calendar day - next time step
- integer :: nlon
- integer :: nlat
- integer :: nlev
- integer :: nilev
+ integer :: nlon = 0
+ integer :: nlat = 0
+ integer :: nlev = 0
+ integer :: nilev = 0
integer :: ps_coords(3) ! LATDIM | LONDIM | TIMDIM
integer :: ps_order(3) ! LATDIM | LONDIM | TIMDIM
real(r8), pointer, dimension(:) :: lons => null()
@@ -104,7 +104,6 @@ module tracer_data
real(r8), pointer, dimension(:) :: ilevs => null()
real(r8), pointer, dimension(:) :: hyam => null()
real(r8), pointer, dimension(:) :: hybm => null()
- real(r8), pointer, dimension(:,:) :: ps => null()
real(r8), pointer, dimension(:) :: hyai => null()
real(r8), pointer, dimension(:) :: hybi => null()
real(r8), pointer, dimension(:,:) :: weight_x => null(), weight_y => null()
@@ -340,12 +339,6 @@ subroutine trcdata_init( specifier, filename, filelist, datapath, flds, file, &
lat_dimid = old_dimid
endif
- allocate( file%ps(file%nlon,file%nlat), stat=astat )
- if( astat /= 0 ) then
- write(iulog,*) 'trcdata_init: file%ps allocation error = ',astat
- call endrun('trcdata_init: failed to allocate x array')
- end if
-
call pio_seterrorhandling(File%curr_fileid, PIO_BCAST_ERROR, oldmethod=err_handling)
ierr = pio_inq_varid( file%curr_fileid, 'PS', file%ps_id )
file%has_ps = (ierr==PIO_NOERR)
@@ -435,11 +428,6 @@ subroutine trcdata_init( specifier, filename, filelist, datapath, flds, file, &
ierr = pio_get_var( file%curr_fileid, varid, file%hybi )
endif
- allocate( file %ps (pcols,begchunk:endchunk), stat=astat )
- if( astat/= 0 ) then
- write(iulog,*) 'trcdata_init: failed to allocate file%ps array; error = ',astat
- call endrun
- end if
allocate( file%ps_in(1)%data(pcols,begchunk:endchunk), stat=astat )
if( astat/= 0 ) then
write(iulog,*) 'trcdata_init: failed to allocate file%ps_in(1)%data array; error = ',astat
diff --git a/src/control/cam_budget.F90 b/src/control/cam_budget.F90
new file mode 100644
index 0000000000..1ae7fd20f4
--- /dev/null
+++ b/src/control/cam_budget.F90
@@ -0,0 +1,398 @@
+module cam_budget
+ !----------------------------------------------------------------------------
+ !
+ ! Adds support for energy and mass snapshots and budgets using cam_history api.
+ !
+ ! Public functions/subroutines:
+ !
+ ! cam_budget_init
+ ! cam_budget_em_snapshot
+ ! cam_budget_em_register
+ ! cam_budget_get_global
+ ! cam_budget_readnl
+ ! budget_ind_byname
+ ! is_cam_budget
+ !-----------------------------------------------------------------------
+
+ use cam_abortutils, only: endrun
+ use cam_history, only: addfld, add_default, horiz_only
+ use cam_history_support, only: max_fieldname_len
+ use cam_logfile, only: iulog
+ use cam_thermo, only: thermo_budget_vars, thermo_budget_vars_descriptor, &
+ thermo_budget_vars_unit, thermo_budget_vars_massv, thermo_budget_num_vars,teidx,wvidx,wlidx,wiidx
+ use shr_kind_mod, only: r8 => shr_kind_r8
+ use shr_kind_mod, only: cl => shr_kind_cl
+ use spmd_utils, only: masterproc, masterprocid, mpicom
+
+ implicit none
+ private
+ save
+
+ ! Public interfaces
+ public :: &
+ cam_budget_init, &! initialize budget variables
+ cam_budget_em_snapshot, &! define a snapshot and add to history buffer
+ cam_budget_em_register, &! define a budget and add to history buffer
+ cam_budget_get_global, &! get global budget from history buffer
+ cam_budget_readnl, &! read budget namelist setting
+ is_cam_budget ! return logical if budget_defined
+
+ ! Private
+ real(r8) :: dstepsize
+ integer, parameter :: budget_array_max = 500 ! max number of budgets
+ character*3 :: budget_optype(budget_array_max) = '' ! allows 'dif' or 'sum'
+ character*3 :: budget_pkgtype(budget_array_max) = '' ! allows 'phy' or 'dyn'
+
+ ! Public data
+ integer, public, protected :: budget_num = 0 ! current number of defined budgets.
+ character(cl), public, protected :: budget_name(budget_array_max) = '' ! budget names
+ character(cl), public, protected :: budget_longname(budget_array_max) = '' ! descriptive name of budget
+ character(cl), public, protected :: budget_stagename(budget_array_max)= '' ! shortname of both of the 3 char snapshot components
+ character(cl), public, protected :: budget_stg1name(budget_array_max) = '' ! The 1st of 2 snapshots used to calculate a budget
+ character(cl), public, protected :: budget_stg2name(budget_array_max) = '' ! The 2nd of 2 snapshots used to calculate a budget
+
+ integer, public, protected :: thermo_budget_histfile_num = 1 ! The history tape number for budget fields
+ logical, public, protected :: thermo_budget_history = .false. ! Turn budgeting on or off
+
+
+ !==============================================================================================
+CONTAINS
+ !==============================================================================================
+ !
+ ! Read namelist variables.
+ subroutine cam_budget_readnl(nlfile)
+ use dycore, only: dycore_is
+ use namelist_utils, only: find_group_name
+ use spmd_utils, only: mpi_character, mpi_logical, mpi_integer, mpi_success
+ use shr_string_mod, only: shr_string_toUpper
+ use string_utils, only: int2str
+
+ ! Dummy argument: filepath for file containing namelist input
+ character(len=*), intent(in) :: nlfile
+
+ ! Local variables
+ integer :: unitn, ierr
+ character(len=*), parameter :: subname = 'cam_budget_readnl :: '
+
+ namelist /thermo_budget_nl/ thermo_budget_history, thermo_budget_histfile_num
+ !-----------------------------------------------------------------------
+
+ if (masterproc) then
+ open(newunit=unitn, file=trim(nlfile), status='old')
+ call find_group_name(unitn, 'thermo_budget_nl', status=ierr)
+ if (ierr == 0) then
+ read(unitn, thermo_budget_nl, iostat=ierr)
+ if (ierr /= 0) then
+ call endrun(subname//'ERROR reading namelist, thermo_budget_nl, errcode = '//int2str(ierr))
+ end if
+ end if
+ close(unitn)
+ end if
+
+ ! Broadcast namelist variables
+ call mpi_bcast(thermo_budget_history , 1 , mpi_logical , masterprocid, mpicom, ierr)
+ if (ierr /= mpi_success) call endrun(subname//": FATAL: mpi_bcast: thermo_budget_history")
+ call mpi_bcast(thermo_budget_histfile_num , 1 , mpi_integer , masterprocid, mpicom, ierr)
+ if (ierr /= mpi_success) call endrun(subname//": FATAL: mpi_bcast: thermo_budget_histfile_num")
+
+ ! Write out thermo_budget options
+ if (masterproc) then
+ if (thermo_budget_history) then
+ if (dycore_is('EUL').or.dycore_is('FV').or.dycore_is('FV3')) then
+ call endrun(subname//'ERROR thermodynamic budgets not implemented for this dycore')
+ else
+ write(iulog,*)'Thermo budgets will be written to the log file and diagnostics saved to history file:',&
+ thermo_budget_histfile_num
+ end if
+ end if
+ end if
+ end subroutine cam_budget_readnl
+
+ !==============================================================================================
+
+ subroutine cam_budget_init()
+ use time_manager, only: get_step_size
+
+ dstepsize=get_step_size()
+
+ end subroutine cam_budget_init
+
+ !==============================================================================================
+
+ subroutine cam_budget_em_snapshot (name, pkgtype, longname)
+ use dycore, only: dycore_is
+ use cam_grid_support, only: cam_grid_id
+
+ character(len=*), intent(in) :: &
+ name ! budget name used as variable name in history file output (8 char max)
+ character(len=*), intent(in) :: &
+ pkgtype ! budget type either phy or dyn
+ character(len=*), intent(in) :: &
+ longname ! value for long_name attribute in netcdf output (128 char max, defaults to name)
+
+ character (cl) :: errmsg
+ character (len=max_fieldname_len) :: name_str
+ character (cl) :: desc_str, units_str
+ character (cl) :: gridname
+ integer :: ivars
+ character(len=*), parameter :: sub='cam_budget_em_snapshot'
+ logical :: use_cslam ! using cslam transport for mass tracers
+ !-----------------------------------------------------------------------
+
+ if (thermo_budget_history) then
+ ! FVM grid is only registered when using cslam
+ use_cslam=cam_grid_id('FVM')>0
+
+ do ivars=1, thermo_budget_num_vars
+ write(name_str,*) TRIM(ADJUSTL(thermo_budget_vars(ivars))),"_",TRIM(ADJUSTL(name))
+ write(desc_str,*) TRIM(ADJUSTL(thermo_budget_vars_descriptor(ivars)))," ", &
+ TRIM(ADJUSTL(longname))
+ write(units_str,*) TRIM(ADJUSTL(thermo_budget_vars_unit(ivars)))
+
+ if (budget_num < budget_array_max) then
+ budget_num = budget_num + 1
+ else
+ write(errmsg, *) sub, ': Maximum number of budgets reached - increase budget_array_max parameter '
+ call endrun(errmsg)
+ end if
+ ! set budget name and constants
+ budget_name(budget_num) = trim(name_str)
+ budget_longname(budget_num) = trim(desc_str)
+
+ budget_pkgtype(budget_num)=pkgtype
+ budget_stagename(budget_num)= trim(name)
+
+ if (pkgtype=='phy') then
+ gridname='physgrid'
+ else
+ if (dycore_is('SE')) then
+ if (use_cslam .and. thermo_budget_vars_massv(ivars)) then
+ gridname='FVM'
+ else
+ gridname='GLL'
+ end if
+ else if (dycore_is('MPAS')) then
+ gridname='mpas_cell'
+ else
+ write(errmsg, *) sub, ': budget_add is only supported for MPAS and SE dycores'
+ call endrun(errmsg)
+ end if
+ end if
+ call addfld (TRIM(ADJUSTL(name_str)), horiz_only, 'N', TRIM(ADJUSTL(units_str)), &
+ TRIM(ADJUSTL(desc_str)), gridname=trim(gridname))
+ call add_default(TRIM(ADJUSTL(name_str)), thermo_budget_histfile_num, 'N')
+ end do
+ end if
+ end subroutine cam_budget_em_snapshot
+
+ !==============================================================================
+
+ subroutine cam_budget_em_register (name, stg1name, stg2name, pkgtype, optype, longname)
+ use dycore, only: dycore_is
+ use cam_grid_support, only: cam_grid_id
+
+ ! Register a budget.
+
+ character(len=*), intent(in) :: &
+ name,stg1name,stg2name ! budget name used as variable name in history file output (8 char max)
+
+ character(len=*), intent(in) :: &
+ pkgtype ! budget type either phy or dyn
+
+ character(len=*), intent(in) :: &
+ optype ! dif (difference) or sum
+
+ character(len=*), intent(in) :: &
+ longname ! value for long_name attribute in netcdf output (128 char max, defaults to name)
+
+ character(len=*), parameter :: sub='cam_budget_em_register'
+ character(cl) :: errmsg
+ character(len=1) :: opchar
+ character (len=max_fieldname_len) :: name_str
+ character (cl) :: desc_str, units_str
+ character (cl) :: gridname
+ character (cl) :: strstg1, strstg2
+ integer :: ivars
+ logical :: use_cslam ! true => use cslam to transport mass variables
+ !-----------------------------------------------------------------------
+
+ if (thermo_budget_history) then
+ ! the FVM gridname is only defined when use_cslam is true.
+ use_cslam=cam_grid_id('FVM')>0
+
+ ! register history budget variables
+ do ivars=1, thermo_budget_num_vars
+ write(name_str,*) TRIM(ADJUSTL(thermo_budget_vars(ivars))),"_",TRIM(ADJUSTL(name))
+ write(strstg1,*) TRIM(ADJUSTL(thermo_budget_vars(ivars))),"_",TRIM(ADJUSTL(stg1name))
+ write(strstg2,*) TRIM(ADJUSTL(thermo_budget_vars(ivars))),"_",TRIM(ADJUSTL(stg2name))
+ write(desc_str,*) TRIM(ADJUSTL(thermo_budget_vars_descriptor(ivars)))," ", &
+ TRIM(ADJUSTL(longname))
+ write(units_str,*) TRIM(ADJUSTL(thermo_budget_vars_unit(ivars)))
+
+ if (budget_num < budget_array_max) then
+ budget_num = budget_num + 1
+ else
+ write(errmsg, *) sub, ': Maximum number of budgets reached - increase budget_array_max parameter '
+ call endrun(errmsg)
+ end if
+ budget_pkgtype(budget_num)=pkgtype
+
+ ! set budget name and constants
+ budget_name(budget_num) = trim(name_str)
+ budget_longname(budget_num) = trim(desc_str)
+
+ if (optype=='dif') then
+ opchar='-'
+ else if (optype=='sum') then
+ opchar='+'
+ else
+ write(errmsg,*) sub, ': FATAL: unknown operation type, expecting "sum" or "dif":', optype
+ call endrun(errmsg)
+ end if
+ budget_stg1name(budget_num) = trim(adjustl(strstg1))
+ budget_stg2name(budget_num) = trim(adjustl(strstg2))
+ budget_stagename(budget_num)= trim(adjustl(strstg1))//trim(opchar)//trim(adjustl(strstg2))
+ budget_optype(budget_num)=optype
+
+ if (pkgtype=='phy') then
+ gridname='physgrid'
+ else
+ if (dycore_is('SE')) then
+ if (use_cslam .and. thermo_budget_vars_massv(ivars)) then
+ gridname='FVM'
+ else
+ gridname='GLL'
+ end if
+ else if (dycore_is('MPAS')) then
+ gridname='mpas_cell'
+ else
+ write(errmsg, *) sub, ': budget_add is only supported for MPAS and SE dycores'
+ call endrun(errmsg)
+ end if
+ end if
+ call addfld (TRIM(ADJUSTL(name_str)), horiz_only, 'N', TRIM(ADJUSTL(units_str)),TRIM(ADJUSTL(desc_str)), &
+ gridname=gridname,optype=optype,op_f1name=TRIM(ADJUSTL(strstg1)),op_f2name=TRIM(ADJUSTL(strstg2)))
+ call add_default(TRIM(ADJUSTL(name_str)), thermo_budget_histfile_num, 'N')
+ end do
+ end if
+ end subroutine cam_budget_em_register
+
+ !==============================================================================
+
+ subroutine cam_budget_get_global (name, me_idx, global)
+
+ use cam_history, only: get_field_properties
+ use cam_history_support, only: active_entry,ptapes
+ use cam_thermo, only: thermo_budget_vars_massv
+
+ ! Get the global integral of a budget. Endrun will be called
+ ! when name is not found.
+ !-----------------------------Arguments---------------------------------
+ character(len=*), intent(in) :: name ! budget name
+ integer, intent(in) :: me_idx ! mass energy variable index
+ real(r8), intent(out) :: global ! global integral of the budget field
+
+ !---------------------------Local workspace-----------------------------
+ type (active_entry), pointer :: tape(:) ! history tapes
+ character (len=max_fieldname_len) :: name_str
+ character(cl) :: errmsg
+ integer :: b_ind ! budget index
+ integer :: h_ind(ptapes) ! hentry index
+ integer :: m_ind ! masterlist index
+ integer :: idx,pidx,midx,uidx ! substring index for sum dif char
+ integer :: m ! budget index
+ logical :: found ! true if global integral found
+
+ character(len=*), parameter :: sub='cam_budget_get_global'
+ !-----------------------------------------------------------------------
+ ! Initialize tape pointer here to avoid initialization only on first invocation
+ nullify(tape)
+
+ name_str=''
+ write(name_str,*) TRIM(ADJUSTL(name))
+
+ midx=index(name_str, '-')
+ pidx=index(name_str, '+')
+ idx=midx+pidx
+
+ ! check for budget using stagename short format (stg1//op//stg2) where stg1 is name without thermo string appended
+ if (idx /= 0 .and. (midx==0 .or. pidx==0)) then
+ write(name_str,*) TRIM(ADJUSTL(thermo_budget_vars(me_idx)))//"_"//trim(adjustl(name_str(1:idx)))// &
+ TRIM(ADJUSTL(thermo_budget_vars(me_idx)))//"_"//TRIM(ADJUSTL(name_str(idx+1:)))
+ end if
+
+ uidx=index(name_str, '_')
+ if (uidx == 0) then
+ !This is a stage name need to append the type of thermo variable using input index
+ write(name_str,*) TRIM(ADJUSTL(thermo_budget_vars(me_idx)))//"_"//trim(adjustl(name_str(1:)))
+ end if
+
+ b_ind=budget_ind_byname(trim(adjustl(name_str)))
+
+ if (b_ind < 0) call endrun(sub//': FATAL field name '//name//' not found'//' looked for '//trim(adjustl(name_str)))
+
+ write(name_str,*) TRIM(ADJUSTL(budget_name(b_ind)))
+
+ ! Find budget name in list and return global value
+ call get_field_properties(trim(adjustl(name_str)), found, tape_out=tape, ff_out=m_ind, f_out=h_ind)
+
+ if (found.and.h_ind(thermo_budget_histfile_num)>0) then
+ call tape(thermo_budget_histfile_num)%hlist(h_ind(thermo_budget_histfile_num))%get_global(global)
+ if (.not. thermo_budget_vars_massv(me_idx)) &
+ global=global/dstepsize
+ else
+ write(errmsg,*) sub, ': FATAL: name not found: ', trim(name)
+ call endrun(errmsg)
+ end if
+
+ CONTAINS
+ pure function budget_ind_byname (name)
+ !
+ ! Get the index of a budget. Ret -1 for not found
+ !-----------------------------Arguments---------------------------------
+ character(len=*), intent(in) :: name ! budget name
+
+ !---------------------------Local workspace-----------------------------
+ integer :: budget_ind_byname ! function return
+ integer :: m ! budget index
+ !-----------------------------------------------------------------------
+ ! Find budget name in list
+ budget_ind_byname = -1
+ do m = 1, budget_num
+ if (trim(adjustl(name)) == trim(adjustl(budget_name(m))).or. &
+ trim(adjustl(name)) == trim(adjustl(budget_stagename(m)))) then
+ budget_ind_byname = m
+ return
+ end if
+ end do
+ end function budget_ind_byname
+ end subroutine cam_budget_get_global
+ !==============================================================================
+
+ pure function is_cam_budget(name)
+
+ ! Get the index of a budget.
+
+ !-----------------------------Arguments---------------------------------
+ character(len=*), intent(in) :: name ! budget name
+
+ !---------------------------Local workspace-----------------------------
+ logical :: is_cam_budget ! function return
+ integer :: m ! budget index
+ !-----------------------------------------------------------------------
+
+ ! Find budget name in list of defined budgets
+
+ is_cam_budget = .false.
+ do m = 1, budget_num
+ if (trim(adjustl(name)) == trim(adjustl(budget_name(m))).or. &
+ trim(adjustl(name)) == trim(adjustl(budget_stagename(m)))) then
+ is_cam_budget = .true.
+ return
+ end if
+ end do
+ end function is_cam_budget
+
+ !===========================================================================
+
+end module cam_budget
diff --git a/src/control/cam_comp.F90 b/src/control/cam_comp.F90
index 51b21d6fac..9982df6d2c 100644
--- a/src/control/cam_comp.F90
+++ b/src/control/cam_comp.F90
@@ -16,9 +16,7 @@ module cam_comp
use spmd_utils, only: masterproc, mpicom
use cam_control_mod, only: cam_ctrl_init, cam_ctrl_set_orbit
use runtime_opts, only: read_namelist
-use time_manager, only: timemgr_init, get_step_size, &
- get_nstep, is_first_step, is_first_restart_step
-
+use time_manager, only: timemgr_init, get_nstep
use camsrfexch, only: cam_out_t, cam_in_t
use ppgrid, only: begchunk, endchunk
use physics_types, only: physics_state, physics_tend
@@ -82,7 +80,6 @@ subroutine cam_init( &
use cam_restart, only: cam_read_restart
use stepon, only: stepon_init
use ionosphere_interface, only: ionosphere_init
-
use camsrfexch, only: hub2atm_alloc, atm2hub_alloc
use cam_history, only: intht
use history_scam, only: scm_intht
@@ -362,7 +359,8 @@ subroutine cam_run4( cam_out, cam_in, rstwr, nlend, &
! file output.
!
!-----------------------------------------------------------------------
- use cam_history, only: wshist, wrapup
+ use dycore_budget, only: print_budget
+ use cam_history, only: wshist, wrapup, hstwr
use cam_restart, only: cam_write_restart
use qneg_module, only: qneg_print_summary
use time_manager, only: is_last_step
@@ -405,6 +403,8 @@ subroutine cam_run4( cam_out, cam_in, rstwr, nlend, &
call qneg_print_summary(is_last_step())
+ call print_budget(hstwr)
+
call shr_sys_flush(iulog)
end subroutine cam_run4
diff --git a/src/control/cam_control_mod.F90 b/src/control/cam_control_mod.F90
index ce6b3deaad..3d954f68ce 100644
--- a/src/control/cam_control_mod.F90
+++ b/src/control/cam_control_mod.F90
@@ -33,8 +33,9 @@ module cam_control_mod
logical, protected :: ideal_phys ! true => run Held-Suarez (1994) physics
logical, protected :: kessler_phys ! true => run Kessler physics
logical, protected :: tj2016_phys ! true => run tj2016 physics
+logical, protected :: frierson_phys ! true => run frierson physics
logical, protected :: simple_phys ! true => adiabatic or ideal_phys or kessler_phys
- ! or tj2016
+ ! or tj2016 or frierson
logical, protected :: aqua_planet ! Flag to run model in "aqua planet" mode
logical, protected :: moist_physics ! true => moist physics enabled, i.e.,
! (.not. ideal_phys) .and. (.not. adiabatic)
@@ -135,8 +136,9 @@ subroutine cam_ctrl_set_physics_type(phys_package)
ideal_phys = trim(phys_package) == 'held_suarez'
kessler_phys = trim(phys_package) == 'kessler'
tj2016_phys = trim(phys_package) == 'tj2016'
+ frierson_phys = trim(phys_package) == 'grayrad'
- simple_phys = adiabatic .or. ideal_phys .or. kessler_phys .or. tj2016_phys
+ simple_phys = adiabatic .or. ideal_phys .or. kessler_phys .or. tj2016_phys .or. frierson_phys
moist_physics = .not. (adiabatic .or. ideal_phys)
@@ -154,6 +156,8 @@ subroutine cam_ctrl_set_physics_type(phys_package)
write(iulog,*) 'Run model with Kessler warm-rain physics forcing'
else if (tj2016_phys) then
write(iulog,*) 'Run model with Thatcher-Jablonowski (2016) physics forcing (moist Held-Suarez)'
+ else if (frierson_phys) then
+ write(iulog,*) 'Run model with Frierson (2006) physics'
end if
end if
diff --git a/src/control/cam_history.F90 b/src/control/cam_history.F90
index 5b0e6f47f2..28e1d848f2 100644
--- a/src/control/cam_history.F90
+++ b/src/control/cam_history.F90
@@ -38,7 +38,8 @@ module cam_history
pio_int, pio_real, pio_double, pio_char, &
pio_offset_kind, pio_unlimited, pio_global, &
pio_inq_dimlen, pio_def_var, pio_enddef, &
- pio_put_att, pio_put_var, pio_get_att
+ pio_put_att, pio_put_var, pio_get_att, &
+ pio_file_is_open
use perf_mod, only: t_startf, t_stopf
@@ -49,7 +50,8 @@ module cam_history
field_info, active_entry, hentry, &
horiz_only, write_hist_coord_attrs, &
write_hist_coord_vars, interp_info_t, &
- lookup_hist_coord_indices, get_hist_coord_index
+ lookup_hist_coord_indices, get_hist_coord_index, &
+ field_op_len
use string_utils, only: date2yyyymmdd, sec2hms
use sat_hist, only: is_satfile
use solar_parms_data, only: solar_parms_on, kp=>solar_parms_kp, ap=>solar_parms_ap
@@ -57,6 +59,7 @@ module cam_history
use solar_wind_data, only: solar_wind_on, byimf=>solar_wind_byimf, bzimf=>solar_wind_bzimf
use solar_wind_data, only: swvel=>solar_wind_swvel, swden=>solar_wind_swden
use epotential_params, only: epot_active, epot_crit_colats
+ use cam_grid_support, only: maxsplitfiles
implicit none
private
@@ -68,19 +71,28 @@ module cam_history
public :: cam_history_snapshot_deactivate
public :: cam_history_snapshot_activate
+ type grid_area_entry
+ integer :: decomp_type = -1 ! type of decomposition (e.g., physics or dynamics)
+ real(r8), allocatable :: wbuf(:,:) ! for area weights
+ end type grid_area_entry
+ type (grid_area_entry), target, allocatable:: grid_wts(:) ! area wts for each decomp type
+ type (grid_area_entry), pointer :: allgrids_wt(:) => null() ! area wts for each decomp type
!
! master_entry: elements of an entry in the master field list
!
type master_entry
- type (field_info) :: field ! field information
+ type (field_info) :: field ! field information
character(len=max_fieldname_len) :: meridional_field = '' ! for vector fields
character(len=max_fieldname_len) :: zonal_field = '' ! for vector fields
- character(len=1) :: avgflag(ptapes) ! averaging flag
- character(len=max_chars) :: time_op(ptapes) ! time operator (e.g. max, min, avg)
- logical :: act_sometape ! Field is active on some tape
- logical :: actflag(ptapes) ! Per tape active/inactive flag
- integer :: htapeindx(ptapes)! This field's index on particular history tape
- type(master_entry), pointer :: next_entry => null() ! The next master entry
+ character(len=1) :: avgflag(ptapes) ! averaging flag
+ character(len=max_chars) :: time_op(ptapes) ! time operator (e.g. max, min, avg)
+ character(len=field_op_len) :: field_op = '' ! field derived from sum or dif of field1 and field2
+ character(len=max_fieldname_len) :: op_field1 = '' ! first field name to be operated on
+ character(len=max_fieldname_len) :: op_field2 = '' ! second field name to be operated on
+ logical :: act_sometape ! Field is active on some tape
+ logical :: actflag(ptapes) ! Per tape active/inactive flag
+ integer :: htapeindx(ptapes)! This field's index on particular history tape
+ type(master_entry), pointer :: next_entry => null() ! The next master entry
end type master_entry
type (master_entry), pointer :: masterlinkedlist => null() ! master field linkedlist top
@@ -115,8 +127,8 @@ module cam_history
!
! The size of these parameters should match the assignments in restart_vars_setnames and restart_dims_setnames below
!
- integer, parameter :: restartvarcnt = 38
- integer, parameter :: restartdimcnt = 10
+ integer, parameter :: restartvarcnt = 45
+ integer, parameter :: restartdimcnt = 11
type(rvar_id) :: restartvars(restartvarcnt)
type(rdim_id) :: restartdims(restartdimcnt)
integer, parameter :: ptapes_dim_ind = 1
@@ -129,6 +141,15 @@ module cam_history
integer, parameter :: maxvarmdims_dim_ind = 8
integer, parameter :: registeredmdims_dim_ind = 9
integer, parameter :: max_hcoordname_len_dim_ind = 10
+ integer, parameter :: max_num_split_files = 11
+
+ ! Indices for split history files; must be 1 and 2
+ integer, parameter :: instantaneous_file_index = 1
+ integer, parameter :: accumulated_file_index = 2
+ ! Indices for non-split history files; must be 1 or 2
+ integer, parameter :: sat_file_index = 1
+ integer, parameter :: restart_file_index = 1
+ integer, parameter :: init_file_index = 1
integer :: nfmaster = 0 ! number of fields in master field list
integer :: nflds(ptapes) ! number of fields per tape
@@ -146,6 +167,7 @@ module cam_history
logical :: rgnht(ptapes) = .false. ! flag array indicating regeneration volumes
logical :: hstwr(ptapes) = .false. ! Flag for history writes
logical :: empty_htapes = .false. ! Namelist flag indicates no default history fields
+ logical :: write_nstep0 = .false. ! write nstep==0 time sample to history files (except monthly)
logical :: htapes_defined = .false. ! flag indicates history contents have been defined
character(len=cl) :: model_doi_url = '' ! Model DOI
@@ -153,8 +175,8 @@ module cam_history
character(len=*), parameter :: history_namelist = 'cam_history_nl'
character(len=max_string_len) :: hrestpath(ptapes) = (/(' ',idx=1,ptapes)/) ! Full history restart pathnames
character(len=max_string_len) :: nfpath(ptapes) = (/(' ',idx=1,ptapes)/) ! Array of first pathnames, for header
- character(len=max_string_len) :: cpath(ptapes) ! Array of current pathnames
- character(len=max_string_len) :: nhfil(ptapes) ! Array of current file names
+ character(len=max_string_len) :: cpath(ptapes,maxsplitfiles) ! Array of current pathnames
+ character(len=max_string_len) :: nhfil(ptapes,maxsplitfiles) ! Array of current file names
character(len=1) :: avgflag_pertape(ptapes) = (/(' ',idx=1,ptapes)/) ! per tape averaging flag
character(len=16) :: logname ! user name
character(len=16) :: host ! host name
@@ -177,8 +199,7 @@ module cam_history
! Allowed history averaging flags
! This should match namelist_definition.xml => avgflag_pertape (+ ' ')
- ! The presence of 'ABI' and 'XML' in this string is a coincidence
- character(len=7), parameter :: HIST_AVG_FLAGS = ' ABIXML'
+ character(len=9), parameter :: HIST_AVG_FLAGS = ' ABILMNSX'
character(len=22) ,parameter :: LT_DESC = 'mean (over local time)' ! local time description
logical :: collect_column_output(ptapes)
@@ -287,6 +308,8 @@ module cam_history
!
character(len=max_string_len) :: rhfilename_spec = '%c.cam.rh%t.%y-%m-%d-%s.nc' ! history restart
character(len=max_string_len) :: hfilename_spec(ptapes) = (/ (' ', idx=1, ptapes) /) ! filename specifyer
+ ! Flag for if there are accumulated fields specified for a given tape
+ logical :: hfile_accum(ptapes) = .false.
interface addfld
@@ -349,6 +372,8 @@ subroutine intht (model_doi_url_in)
use cam_control_mod, only: restart_run, branch_run
use sat_hist, only: sat_hist_init
use spmd_utils, only: mpicom, masterprocid, mpi_character
+ use cam_grid_support, only: cam_grid_get_areawt
+ use cam_history_support, only: dim_index_2d
!
!-----------------------------------------------------------------------
!
@@ -358,7 +383,7 @@ subroutine intht (model_doi_url_in)
!
! Local workspace
!
- integer :: t, f ! tape, field indices
+ integer :: t, fld ! tape, field indices
integer :: begdim1 ! on-node dim1 start index
integer :: enddim1 ! on-node dim1 end index
integer :: begdim2 ! on-node dim2 start index
@@ -367,8 +392,13 @@ subroutine intht (model_doi_url_in)
integer :: enddim3 ! on-node chunk or lat end index
integer :: day, sec ! day and seconds from base date
integer :: rcode ! shr_sys_getenv return code
+ integer :: wtidx(1) ! area weight index
+ integer :: i,k,c,ib,ie,jb,je,count ! index
+ integer :: fdecomp ! field decomp
+ type(dim_index_2d) :: dimind ! 2-D dimension index
+ real(r8), pointer :: areawt(:) ! pointer to areawt values for attribute
type(master_entry), pointer :: listentry
- character(len=32) :: fldname ! temp variable used to produce a left justified field name
+ character(len=32) :: fldname ! temp variable used to produce a left justified field name
! in the formatted logfile output
!
@@ -385,18 +415,18 @@ subroutine intht (model_doi_url_in)
write(iulog,*)' ******* MASTER FIELD LIST *******'
end if
listentry=>masterlinkedlist
- f=0
+ fld=0
do while(associated(listentry))
- f=f+1
+ fld=fld+1
if(masterproc) then
fldname = listentry%field%name
- write(iulog,9000) f, fldname, listentry%field%units, listentry%field%numlev, &
+ write(iulog,9000) fld, fldname, listentry%field%units, listentry%field%numlev, &
listentry%avgflag(1), trim(listentry%field%long_name)
9000 format(i5, 1x, a32, 1x, a16, 1x, i4, 1x, a1, 2x, a)
end if
listentry=>listentry%next_entry
end do
- nfmaster = f
+ nfmaster = fld
if(masterproc) write(iulog,*)'intht:nfmaster=',nfmaster
!
@@ -453,27 +483,65 @@ subroutine intht (model_doi_url_in)
! Initialize history variables
!
do t=1,ptapes
- do f=1,nflds(t)
- begdim1 = tape(t)%hlist(f)%field%begdim1
- enddim1 = tape(t)%hlist(f)%field%enddim1
- begdim2 = tape(t)%hlist(f)%field%begdim2
- enddim2 = tape(t)%hlist(f)%field%enddim2
- begdim3 = tape(t)%hlist(f)%field%begdim3
- enddim3 = tape(t)%hlist(f)%field%enddim3
- allocate(tape(t)%hlist(f)%hbuf(begdim1:enddim1,begdim2:enddim2,begdim3:enddim3))
- tape(t)%hlist(f)%hbuf = 0._r8
- if (tape(t)%hlist(f)%avgflag .eq. 'S') then ! allocate the variance buffer for standard dev
- allocate(tape(t)%hlist(f)%sbuf(begdim1:enddim1,begdim2:enddim2,begdim3:enddim3))
- tape(t)%hlist(f)%sbuf = 0._r8
+ do fld=1,nflds(t)
+ if (nhtfrq(t) == 1) then
+ ! Override any non-I flags if nhtfrq equals 1
+ tape(t)%hlist(fld)%avgflag = 'I'
+ end if
+ if (tape(t)%hlist(fld)%avgflag .ne. 'I') then
+ hfile_accum(t) = .true.
+ end if
+ begdim1 = tape(t)%hlist(fld)%field%begdim1
+ enddim1 = tape(t)%hlist(fld)%field%enddim1
+ begdim2 = tape(t)%hlist(fld)%field%begdim2
+ enddim2 = tape(t)%hlist(fld)%field%enddim2
+ begdim3 = tape(t)%hlist(fld)%field%begdim3
+ enddim3 = tape(t)%hlist(fld)%field%enddim3
+ allocate(tape(t)%hlist(fld)%hbuf(begdim1:enddim1,begdim2:enddim2,begdim3:enddim3))
+ tape(t)%hlist(fld)%hbuf = 0._r8
+ if (tape(t)%hlist(fld)%avgflag .eq. 'S') then ! allocate the variance buffer for standard dev
+ allocate(tape(t)%hlist(fld)%sbuf(begdim1:enddim1,begdim2:enddim2,begdim3:enddim3))
+ tape(t)%hlist(fld)%sbuf = 0._r8
+ endif
+ if (tape(t)%hlist(fld)%avgflag .eq. 'N') then ! set up areawt weight buffer
+ fdecomp = tape(t)%hlist(fld)%field%decomp_type
+ if (any(allgrids_wt(:)%decomp_type == fdecomp)) then
+ wtidx=MAXLOC(allgrids_wt(:)%decomp_type, MASK = allgrids_wt(:)%decomp_type .EQ. fdecomp)
+ tape(t)%hlist(fld)%wbuf => allgrids_wt(wtidx(1))%wbuf
+ else
+ ! area weights not found for this grid, then create them
+ ! first check for an available spot in the array
+ if (any(allgrids_wt(:)%decomp_type == -1)) then
+ wtidx=MINLOC(allgrids_wt(:)%decomp_type)
+ else
+ call endrun('cam_history:intht: Error initializing allgrids_wt with area weights')
+ end if
+ allgrids_wt(wtidx)%decomp_type=fdecomp
+ areawt => cam_grid_get_areawt(fdecomp)
+ allocate(allgrids_wt(wtidx(1))%wbuf(begdim1:enddim1,begdim3:enddim3))
+ allgrids_wt(wtidx(1))%wbuf(begdim1:enddim1,begdim3:enddim3)=0._r8
+ count=0
+ do c=begdim3,enddim3
+ dimind = tape(t)%hlist(fld)%field%get_dims(c)
+ ib=dimind%beg1
+ ie=dimind%end1
+ do i=ib,ie
+ count=count+1
+ allgrids_wt(wtidx(1))%wbuf(i,c)=areawt(count)
+ end do
+ end do
+ tape(t)%hlist(fld)%wbuf => allgrids_wt(wtidx(1))%wbuf
+ endif
endif
- if(tape(t)%hlist(f)%field%flag_xyfill .or. (avgflag_pertape(t) .eq. 'L')) then
- allocate (tape(t)%hlist(f)%nacs(begdim1:enddim1,begdim3:enddim3))
+ if(tape(t)%hlist(fld)%field%flag_xyfill .or. (avgflag_pertape(t) .eq. 'L')) then
+ allocate (tape(t)%hlist(fld)%nacs(begdim1:enddim1,begdim3:enddim3))
else
- allocate (tape(t)%hlist(f)%nacs(1,begdim3:enddim3))
+ allocate (tape(t)%hlist(fld)%nacs(1,begdim3:enddim3))
end if
- tape(t)%hlist(f)%nacs(:,:) = 0
- tape(t)%hlist(f)%field%meridional_complement = -1
- tape(t)%hlist(f)%field%zonal_complement = -1
+ tape(t)%hlist(fld)%nacs(:,:) = 0
+ tape(t)%hlist(fld)%beg_nstep = 0
+ tape(t)%hlist(fld)%field%meridional_complement = -1
+ tape(t)%hlist(fld)%field%zonal_complement = -1
end do
end do
! Setup vector pairs for unstructured grid interpolation
@@ -506,6 +574,7 @@ subroutine history_readnl(nlfile)
integer :: dtime ! Step time in seconds
integer :: unitn, ierr, f, t
character(len=8) :: ctemp ! Temporary character string
+ integer :: filename_len
character(len=fieldname_lenp2) :: fincl1(pflds)
character(len=fieldname_lenp2) :: fincl2(pflds)
@@ -558,7 +627,7 @@ subroutine history_readnl(nlfile)
! History namelist items
namelist /cam_history_nl/ ndens, nhtfrq, mfilt, inithist, inithist_all, &
- avgflag_pertape, empty_htapes, lcltod_start, lcltod_stop, &
+ avgflag_pertape, empty_htapes, write_nstep0, lcltod_start, lcltod_stop,&
fincl1lonlat, fincl2lonlat, fincl3lonlat, fincl4lonlat, fincl5lonlat, &
fincl6lonlat, fincl7lonlat, fincl8lonlat, fincl9lonlat, &
fincl10lonlat, collect_column_output, hfilename_spec, &
@@ -721,6 +790,13 @@ subroutine history_readnl(nlfile)
nhtfrq(t) = nint((-nhtfrq(t) * 3600._r8) / dtime)
end if
end do
+ ! If nhtfrq == 1, then the output is instantaneous. Enforce this by setting
+ ! the per-file averaging flag.
+ do t = 1, ptapes
+ if (nhtfrq(t) == 1) then
+ avgflag_pertape(t) = 'I'
+ end if
+ end do
!
! Initialize the filename specifier if not already set
! This is the format for the history filenames:
@@ -731,10 +807,15 @@ subroutine history_readnl(nlfile)
if ( len_trim(hfilename_spec(t)) == 0 )then
if ( nhtfrq(t) == 0 )then
! Monthly files
- hfilename_spec(t) = '%c.cam' // trim(inst_suffix) // '.h%t.%y-%m.nc'
+ hfilename_spec(t) = '%c.cam' // trim(inst_suffix) // '.h%t%f.%y-%m.nc'
else
- hfilename_spec(t) = '%c.cam' // trim(inst_suffix) // '.h%t.%y-%m-%d-%s.nc'
+ hfilename_spec(t) = '%c.cam' // trim(inst_suffix) // '.h%t%f.%y-%m-%d-%s.nc'
end if
+ else
+ ! Append file type - instantaneous or accumulated - to filename
+ ! specifier provided (in front of the .nc extension).
+ filename_len = len_trim(hfilename_spec(t))
+ hfilename_spec(t) = hfilename_spec(t)(:filename_len-3) // '%f.nc'
end if
!
! Only one time sample allowed per monthly average file
@@ -745,8 +826,14 @@ subroutine history_readnl(nlfile)
end do
end if ! masterproc
- ! Print per-tape averaging flags
+ ! log output
if (masterproc) then
+
+ if (write_nstep0) then
+ write(iulog,*)'nstep==0 time sample will be written to all files except monthly average.'
+ end if
+
+ ! Print per-tape averaging flags
do t = 1, ptapes
if (avgflag_pertape(t) /= ' ') then
write(iulog,*)'Unless overridden by namelist input on a per-field basis (FINCL),'
@@ -805,6 +892,7 @@ subroutine history_readnl(nlfile)
call mpi_bcast(lcltod_stop, ptapes, mpi_integer, masterprocid, mpicom, ierr)
call mpi_bcast(collect_column_output, ptapes, mpi_logical, masterprocid, mpicom, ierr)
call mpi_bcast(empty_htapes,1, mpi_logical, masterprocid, mpicom, ierr)
+ call mpi_bcast(write_nstep0,1, mpi_logical, masterprocid, mpicom, ierr)
call mpi_bcast(avgflag_pertape, ptapes, mpi_character, masterprocid, mpicom, ierr)
call mpi_bcast(hfilename_spec, len(hfilename_spec(1))*ptapes, mpi_character, masterprocid, mpicom, ierr)
call mpi_bcast(fincl, len(fincl (1,1))*pflds*ptapes, mpi_character, masterprocid, mpicom, ierr)
@@ -888,7 +976,7 @@ subroutine setup_interpolation_and_define_vector_complements()
use interp_mod, only: setup_history_interpolation
! Local variables
- integer :: hf, f, ff
+ integer :: hf, fld, ffld
logical :: interp_ok
character(len=max_fieldname_len) :: mname
character(len=max_fieldname_len) :: zname
@@ -900,31 +988,31 @@ subroutine setup_interpolation_and_define_vector_complements()
interpolate_output, interpolate_info)
do hf = 1, ptapes - 2
if((.not. is_satfile(hf)) .and. (.not. is_initfile(hf))) then
- do f = 1, nflds(hf)
- if (field_part_of_vector(trim(tape(hf)%hlist(f)%field%name), &
+ do fld = 1, nflds(hf)
+ if (field_part_of_vector(trim(tape(hf)%hlist(fld)%field%name), &
mname, zname)) then
if (len_trim(mname) > 0) then
! This field is a zonal part of a set, find the meridional partner
- do ff = 1, nflds(hf)
- if (trim(mname) == trim(tape(hf)%hlist(ff)%field%name)) then
- tape(hf)%hlist(f)%field%meridional_complement = ff
- tape(hf)%hlist(ff)%field%zonal_complement = f
+ do ffld = 1, nflds(hf)
+ if (trim(mname) == trim(tape(hf)%hlist(ffld)%field%name)) then
+ tape(hf)%hlist(fld)%field%meridional_complement = ffld
+ tape(hf)%hlist(ffld)%field%zonal_complement = fld
exit
end if
- if (ff == nflds(hf)) then
- call endrun(trim(subname)//': No meridional match for '//trim(tape(hf)%hlist(f)%field%name))
+ if (ffld == nflds(hf)) then
+ call endrun(trim(subname)//': No meridional match for '//trim(tape(hf)%hlist(fld)%field%name))
end if
end do
else if (len_trim(zname) > 0) then
! This field is a meridional part of a set, find the zonal partner
- do ff = 1, nflds(hf)
- if (trim(zname) == trim(tape(hf)%hlist(ff)%field%name)) then
- tape(hf)%hlist(f)%field%zonal_complement = ff
- tape(hf)%hlist(ff)%field%meridional_complement = f
+ do ffld = 1, nflds(hf)
+ if (trim(zname) == trim(tape(hf)%hlist(ffld)%field%name)) then
+ tape(hf)%hlist(fld)%field%zonal_complement = ffld
+ tape(hf)%hlist(ffld)%field%meridional_complement = fld
exit
end if
- if (ff == nflds(hf)) then
- call endrun(trim(subname)//': No zonal match for '//trim(tape(hf)%hlist(f)%field%name))
+ if (ffld == nflds(hf)) then
+ call endrun(trim(subname)//': No zonal match for '//trim(tape(hf)%hlist(fld)%field%name))
end if
end do
else
@@ -937,6 +1025,47 @@ subroutine setup_interpolation_and_define_vector_complements()
end if
end subroutine setup_interpolation_and_define_vector_complements
+ subroutine define_composed_field_ids(t)
+
+ ! Dummy arguments
+ integer, intent(in) :: t ! Current tape
+
+ ! Local variables
+ integer :: fld, ffld
+ character(len=max_fieldname_len) :: field1
+ character(len=max_fieldname_len) :: field2
+ character(len=*), parameter :: subname='define_composed_field_ids'
+ logical :: is_composed
+
+ do fld = 1, nflds(t)
+ call composed_field_info(tape(t)%hlist(fld)%field%name,is_composed,fname1=field1,fname2=field2)
+ if (is_composed) then
+ if (len_trim(field1) > 0 .and. len_trim(field2) > 0) then
+ ! set field1/field2 names for htape from the masterfield list
+ tape(t)%hlist(fld)%op_field1=trim(field1)
+ tape(t)%hlist(fld)%op_field2=trim(field2)
+ ! find ids for field1/2
+ do ffld = 1, nflds(t)
+ if (trim(field1) == trim(tape(t)%hlist(ffld)%field%name)) then
+ tape(t)%hlist(fld)%field%op_field1_id = ffld
+ end if
+ if (trim(field2) == trim(tape(t)%hlist(ffld)%field%name)) then
+ tape(t)%hlist(fld)%field%op_field2_id = ffld
+ end if
+ end do
+ if (tape(t)%hlist(fld)%field%op_field1_id == -1) then
+ call endrun(trim(subname)//': No op_field1 match for '//trim(tape(t)%hlist(fld)%field%name))
+ end if
+ if (tape(t)%hlist(fld)%field%op_field2_id == -1) then
+ call endrun(trim(subname)//': No op_field2 match for '//trim(tape(t)%hlist(fld)%field%name))
+ end if
+ else
+ call endrun(trim(subname)//': Component fields not found for composed field')
+ end if
+ end if
+ end do
+ end subroutine define_composed_field_ids
+
subroutine restart_vars_setnames()
! Local variable
@@ -982,16 +1111,18 @@ subroutine restart_vars_setnames()
rvindex = rvindex + 1
restartvars(rvindex)%name = 'cpath'
restartvars(rvindex)%type = pio_char
- restartvars(rvindex)%ndims = 2
+ restartvars(rvindex)%ndims = 3
restartvars(rvindex)%dims(1) = max_string_len_dim_ind
restartvars(rvindex)%dims(2) = ptapes_dim_ind
+ restartvars(rvindex)%dims(3) = max_num_split_files
rvindex = rvindex + 1
restartvars(rvindex)%name = 'nhfil'
restartvars(rvindex)%type = pio_char
- restartvars(rvindex)%ndims = 2
+ restartvars(rvindex)%ndims = 3
restartvars(rvindex)%dims(1) = max_string_len_dim_ind
restartvars(rvindex)%dims(2) = ptapes_dim_ind
+ restartvars(rvindex)%dims(3) = max_num_split_files
rvindex = rvindex + 1
restartvars(rvindex)%name = 'ndens'
@@ -1077,6 +1208,25 @@ subroutine restart_vars_setnames()
restartvars(rvindex)%fillset = .true.
restartvars(rvindex)%ifill = 0
+ rvindex = rvindex + 1
+ restartvars(rvindex)%name = 'beg_nstep'
+ restartvars(rvindex)%type = pio_int
+ restartvars(rvindex)%ndims = 2
+ restartvars(rvindex)%dims(1) = maxnflds_dim_ind
+ restartvars(rvindex)%dims(2) = ptapes_dim_ind
+ restartvars(rvindex)%fillset = .true.
+ restartvars(rvindex)%ifill = 0
+
+ rvindex = rvindex + 1
+ restartvars(rvindex)%name = 'hbuf_integral'
+ restartvars(rvindex)%type = pio_double
+ restartvars(rvindex)%ndims = 2
+ restartvars(rvindex)%dims(1) = maxnflds_dim_ind
+ restartvars(rvindex)%dims(2) = ptapes_dim_ind
+ restartvars(rvindex)%fillset = .true.
+ restartvars(rvindex)%ifill = 0
+
+
rvindex = rvindex + 1
restartvars(rvindex)%name = 'avgflag'
restartvars(rvindex)%type = pio_char
@@ -1217,6 +1367,48 @@ subroutine restart_vars_setnames()
restartvars(rvindex)%fillset = .true.
restartvars(rvindex)%ifill = 0
+ rvindex = rvindex + 1
+ restartvars(rvindex)%name = 'field_op'
+ restartvars(rvindex)%type = pio_char
+ restartvars(rvindex)%ndims = 3
+ restartvars(rvindex)%dims(1) = max_chars_dim_ind
+ restartvars(rvindex)%dims(2) = maxnflds_dim_ind
+ restartvars(rvindex)%dims(3) = ptapes_dim_ind
+
+ rvindex = rvindex + 1
+ restartvars(rvindex)%name = 'op_field1_id'
+ restartvars(rvindex)%type = pio_int
+ restartvars(rvindex)%ndims = 2
+ restartvars(rvindex)%dims(1) = maxnflds_dim_ind
+ restartvars(rvindex)%dims(2) = ptapes_dim_ind
+ restartvars(rvindex)%fillset = .true.
+ restartvars(rvindex)%ifill = 0
+
+ rvindex = rvindex + 1
+ restartvars(rvindex)%name = 'op_field2_id'
+ restartvars(rvindex)%type = pio_int
+ restartvars(rvindex)%ndims = 2
+ restartvars(rvindex)%dims(1) = maxnflds_dim_ind
+ restartvars(rvindex)%dims(2) = ptapes_dim_ind
+ restartvars(rvindex)%fillset = .true.
+ restartvars(rvindex)%ifill = 0
+
+ rvindex = rvindex + 1
+ restartvars(rvindex)%name = 'op_field1'
+ restartvars(rvindex)%type = pio_char
+ restartvars(rvindex)%ndims = 3
+ restartvars(rvindex)%dims(1) = max_fieldname_len_dim_ind
+ restartvars(rvindex)%dims(2) = maxnflds_dim_ind
+ restartvars(rvindex)%dims(3) = ptapes_dim_ind
+
+ rvindex = rvindex + 1
+ restartvars(rvindex)%name = 'op_field2'
+ restartvars(rvindex)%type = pio_char
+ restartvars(rvindex)%ndims = 3
+ restartvars(rvindex)%dims(1) = max_fieldname_len_dim_ind
+ restartvars(rvindex)%dims(2) = maxnflds_dim_ind
+ restartvars(rvindex)%dims(3) = ptapes_dim_ind
+
end subroutine restart_vars_setnames
subroutine restart_dims_setnames()
@@ -1253,6 +1445,9 @@ subroutine restart_dims_setnames()
restartdims(max_hcoordname_len_dim_ind)%name = 'max_hcoordname_len'
restartdims(max_hcoordname_len_dim_ind)%len = max_hcoordname_len
+ restartdims(max_num_split_files)%name = 'max_num_split_files'
+ restartdims(max_num_split_files)%len = maxsplitfiles
+
end subroutine restart_dims_setnames
@@ -1352,7 +1547,7 @@ subroutine write_restart_history ( File, &
!
! Local workspace
!
- integer :: ierr, t, f
+ integer :: ierr, t, fld
integer :: rgnht_int(ptapes), start(2), startc(3)
type(var_desc_t), pointer :: vdesc
@@ -1366,6 +1561,8 @@ subroutine write_restart_history ( File, &
type(var_desc_t), pointer :: longname_desc
type(var_desc_t), pointer :: units_desc
type(var_desc_t), pointer :: hwrt_prec_desc
+ type(var_desc_t), pointer :: hbuf_integral_desc
+ type(var_desc_t), pointer :: beg_nstep_desc
type(var_desc_t), pointer :: xyfill_desc
type(var_desc_t), pointer :: mdims_desc ! mdim name indices
type(var_desc_t), pointer :: mdimname_desc ! mdim names
@@ -1378,6 +1575,11 @@ subroutine write_restart_history ( File, &
type(var_desc_t), pointer :: interpolate_nlon_desc
type(var_desc_t), pointer :: meridional_complement_desc
type(var_desc_t), pointer :: zonal_complement_desc
+ type(var_desc_t), pointer :: field_op_desc
+ type(var_desc_t), pointer :: op_field1_id_desc
+ type(var_desc_t), pointer :: op_field2_id_desc
+ type(var_desc_t), pointer :: op_field1_desc
+ type(var_desc_t), pointer :: op_field2_desc
integer, allocatable :: allmdims(:,:,:)
integer, allocatable :: xyfill(:,:)
@@ -1385,7 +1587,7 @@ subroutine write_restart_history ( File, &
integer, allocatable :: interp_output(:)
integer :: maxnflds
-
+ real(r8) :: integral ! hbuf area weighted integral
maxnflds = maxval(nflds)
allocate(xyfill(maxnflds, ptapes))
@@ -1454,10 +1656,10 @@ subroutine write_restart_history ( File, &
ierr= pio_put_var(File, vdesc, nfpath(1:ptapes))
vdesc => restartvar_getdesc('cpath')
- ierr= pio_put_var(File, vdesc, cpath(1:ptapes))
+ ierr= pio_put_var(File, vdesc, cpath(1:ptapes,:))
vdesc => restartvar_getdesc('nhfil')
- ierr= pio_put_var(File, vdesc, nhfil(1:ptapes))
+ ierr= pio_put_var(File, vdesc, nhfil(1:ptapes,:))
vdesc => restartvar_getdesc('ndens')
ierr= pio_put_var(File, vdesc, ndens(1:ptapes))
@@ -1479,6 +1681,8 @@ subroutine write_restart_history ( File, &
decomp_type_desc => restartvar_getdesc('decomp_type')
numlev_desc => restartvar_getdesc('numlev')
hwrt_prec_desc => restartvar_getdesc('hwrt_prec')
+ hbuf_integral_desc => restartvar_getdesc('hbuf_integral')
+ beg_nstep_desc => restartvar_getdesc('beg_nstep')
sseq_desc => restartvar_getdesc('sampling_seq')
cm_desc => restartvar_getdesc('cell_methods')
@@ -1497,6 +1701,12 @@ subroutine write_restart_history ( File, &
meridional_complement_desc => restartvar_getdesc('meridional_complement')
zonal_complement_desc => restartvar_getdesc('zonal_complement')
+ field_op_desc => restartvar_getdesc('field_op')
+ op_field1_id_desc => restartvar_getdesc('op_field1_id')
+ op_field2_id_desc => restartvar_getdesc('op_field2_id')
+ op_field1_desc => restartvar_getdesc('op_field1')
+ op_field2_desc => restartvar_getdesc('op_field2')
+
mdims_desc => restartvar_getdesc('mdims')
mdimname_desc => restartvar_getdesc('mdimnames')
fillval_desc => restartvar_getdesc('fillvalue')
@@ -1511,32 +1721,40 @@ subroutine write_restart_history ( File, &
do t = 1,ptapes
start(2)=t
startc(3)=t
- do f=1,nflds(t)
- start(1)=f
- startc(2)=f
- ierr = pio_put_var(File, field_name_desc,startc,tape(t)%hlist(f)%field%name)
- ierr = pio_put_var(File, decomp_type_desc,start,tape(t)%hlist(f)%field%decomp_type)
- ierr = pio_put_var(File, numlev_desc,start,tape(t)%hlist(f)%field%numlev)
-
- ierr = pio_put_var(File, hwrt_prec_desc,start,tape(t)%hlist(f)%hwrt_prec)
- ierr = pio_put_var(File, sseq_desc,startc,tape(t)%hlist(f)%field%sampling_seq)
- ierr = pio_put_var(File, cm_desc,startc,tape(t)%hlist(f)%field%cell_methods)
- ierr = pio_put_var(File, longname_desc,startc,tape(t)%hlist(f)%field%long_name)
- ierr = pio_put_var(File, units_desc,startc,tape(t)%hlist(f)%field%units)
- ierr = pio_put_var(File, avgflag_desc,start, tape(t)%hlist(f)%avgflag)
-
- ierr = pio_put_var(File, fillval_desc,start, tape(t)%hlist(f)%field%fillvalue)
- ierr = pio_put_var(File, meridional_complement_desc,start, tape(t)%hlist(f)%field%meridional_complement)
- ierr = pio_put_var(File, zonal_complement_desc,start, tape(t)%hlist(f)%field%zonal_complement)
- if(associated(tape(t)%hlist(f)%field%mdims)) then
- allmdims(1:size(tape(t)%hlist(f)%field%mdims),f,t) = tape(t)%hlist(f)%field%mdims
+ do fld=1,nflds(t)
+ start(1)=fld
+ startc(2)=fld
+ ierr = pio_put_var(File, field_name_desc,startc,tape(t)%hlist(fld)%field%name)
+ ierr = pio_put_var(File, decomp_type_desc,start,tape(t)%hlist(fld)%field%decomp_type)
+ ierr = pio_put_var(File, numlev_desc,start,tape(t)%hlist(fld)%field%numlev)
+
+ ierr = pio_put_var(File, hwrt_prec_desc,start,tape(t)%hlist(fld)%hwrt_prec)
+ call tape(t)%hlist(fld)%get_global(integral)
+ ierr = pio_put_var(File, hbuf_integral_desc,start,integral)
+ ierr = pio_put_var(File, beg_nstep_desc,start,tape(t)%hlist(fld)%beg_nstep)
+ ierr = pio_put_var(File, sseq_desc,startc,tape(t)%hlist(fld)%field%sampling_seq)
+ ierr = pio_put_var(File, cm_desc,startc,tape(t)%hlist(fld)%field%cell_methods)
+ ierr = pio_put_var(File, longname_desc,startc,tape(t)%hlist(fld)%field%long_name)
+ ierr = pio_put_var(File, units_desc,startc,tape(t)%hlist(fld)%field%units)
+ ierr = pio_put_var(File, avgflag_desc,start, tape(t)%hlist(fld)%avgflag)
+
+ ierr = pio_put_var(File, fillval_desc,start, tape(t)%hlist(fld)%field%fillvalue)
+ ierr = pio_put_var(File, meridional_complement_desc,start, tape(t)%hlist(fld)%field%meridional_complement)
+ ierr = pio_put_var(File, zonal_complement_desc,start, tape(t)%hlist(fld)%field%zonal_complement)
+ ierr = pio_put_var(File, field_op_desc,startc, tape(t)%hlist(fld)%field%field_op)
+ ierr = pio_put_var(File, op_field1_id_desc,start, tape(t)%hlist(fld)%field%op_field1_id)
+ ierr = pio_put_var(File, op_field2_id_desc,start, tape(t)%hlist(fld)%field%op_field2_id)
+ ierr = pio_put_var(File, op_field1_desc,startc, tape(t)%hlist(fld)%op_field1)
+ ierr = pio_put_var(File, op_field2_desc,startc, tape(t)%hlist(fld)%op_field2)
+ if(associated(tape(t)%hlist(fld)%field%mdims)) then
+ allmdims(1:size(tape(t)%hlist(fld)%field%mdims),fld,t) = tape(t)%hlist(fld)%field%mdims
else
end if
- if(tape(t)%hlist(f)%field%flag_xyfill) then
- xyfill(f,t) = 1
+ if(tape(t)%hlist(fld)%field%flag_xyfill) then
+ xyfill(fld,t) = 1
end if
- if(tape(t)%hlist(f)%field%is_subcol) then
- is_subcol(f,t) = 1
+ if(tape(t)%hlist(fld)%field%is_subcol) then
+ is_subcol(fld,t) = 1
end if
end do
if (interpolate_output(t)) then
@@ -1570,13 +1788,12 @@ subroutine write_restart_history ( File, &
ierr = pio_put_var(File, interpolate_nlon_desc, interp_output)
! Registered history coordinates
start(1) = 1
- do f = 1, registeredmdims
- start(2) = f
- ierr = pio_put_var(File, mdimname_desc, start, hist_coord_name(f))
+ do fld = 1, registeredmdims
+ start(2) = fld
+ ierr = pio_put_var(File, mdimname_desc, start, hist_coord_name(fld))
end do
- deallocate(xyfill, allmdims)
- return
+ deallocate(xyfill, allmdims, is_subcol, interp_output, restarthistory_tape)
end subroutine write_restart_history
@@ -1591,11 +1808,13 @@ subroutine read_restart_history (File)
use ioFileMod, only: getfil
use sat_hist, only: sat_hist_define, sat_hist_init
use cam_grid_support, only: cam_grid_read_dist_array, cam_grid_num_grids
- use cam_history_support, only: get_hist_coord_index, add_hist_coord
+ use cam_history_support, only: get_hist_coord_index, add_hist_coord, dim_index_2d
use constituents, only: cnst_get_ind, cnst_get_type_byind
+ use cam_grid_support, only: cam_grid_get_areawt
use shr_sys_mod, only: shr_sys_getenv
use spmd_utils, only: mpicom, mpi_character, masterprocid
+ use time_manager, only: get_nstep
!
!-----------------------------------------------------------------------
!
@@ -1605,7 +1824,7 @@ subroutine read_restart_history (File)
!
! Local workspace
!
- integer t, f, ff ! tape, field indices
+ integer t, f, fld, ffld ! tape, file, field indices
integer begdim2 ! on-node vert start index
integer enddim2 ! on-node vert end index
integer begdim1 ! on-node dim1 start index
@@ -1619,8 +1838,11 @@ subroutine read_restart_history (File)
character(len=max_string_len) :: locfn ! Local filename
character(len=max_fieldname_len), allocatable :: tmpname(:,:)
+ character(len=max_fieldname_len), allocatable :: tmpf1name(:,:)
+ character(len=max_fieldname_len), allocatable :: tmpf2name(:,:)
integer, allocatable :: decomp(:,:), tmpnumlev(:,:)
- integer, pointer :: nacs(:,:) ! accumulation counter
+ integer, pointer :: nacs(:,:) ! outfld accumulation counter
+ integer :: beg_nstep ! start timestep of this slice for nstep accumulation counter
character(len=max_fieldname_len) :: fname_tmp ! local copy of field name
character(len=max_fieldname_len) :: dname_tmp ! local copy of dim name
@@ -1635,7 +1857,15 @@ subroutine read_restart_history (File)
type(var_desc_t) :: fillval_desc
type(var_desc_t) :: meridional_complement_desc
type(var_desc_t) :: zonal_complement_desc
+ type(var_desc_t) :: field_op_desc
+ type(var_desc_t) :: op_field1_id_desc
+ type(var_desc_t) :: op_field2_id_desc
+ type(var_desc_t) :: op_field1_desc
+ type(var_desc_t) :: op_field2_desc
+ type(dim_index_2d) :: dimind ! 2-D dimension index
integer, allocatable :: tmpprec(:,:)
+ real(r8), allocatable :: tmpintegral(:,:)
+ integer, allocatable :: tmpbeg_nstep(:,:)
integer, allocatable :: xyfill(:,:)
integer, allocatable :: allmdims(:,:,:)
integer, allocatable :: is_subcol(:,:)
@@ -1658,6 +1888,8 @@ subroutine read_restart_history (File)
integer :: fdecomp ! Grid ID for field
integer :: idx
character(len=3) :: mixing_ratio
+ integer :: c,ib,ie,jb,je,k,cnt,wtidx(1)
+ real(r8), pointer :: areawt(:) ! pointer to areawt values for attribute
!
! Get users logname and machine hostname
@@ -1705,9 +1937,9 @@ subroutine read_restart_history (File)
ierr = pio_inq_varid(File, 'nfpath', vdesc)
ierr = pio_get_var(File, vdesc, nfpath(1:mtapes))
ierr = pio_inq_varid(File, 'cpath', vdesc)
- ierr = pio_get_var(File, vdesc, cpath(1:mtapes))
+ ierr = pio_get_var(File, vdesc, cpath(1:mtapes,:))
ierr = pio_inq_varid(File, 'nhfil', vdesc)
- ierr = pio_get_var(File, vdesc, nhfil(1:mtapes))
+ ierr = pio_get_var(File, vdesc, nhfil(1:mtapes,:))
ierr = pio_inq_varid(File, 'hrestpath', vdesc)
ierr = pio_get_var(File, vdesc, hrestpath(1:mtapes))
@@ -1735,33 +1967,38 @@ subroutine read_restart_history (File)
ierr = pio_inq_varid(File, 'lcltod_stop', vdesc)
ierr = pio_get_var(File, vdesc, lcltod_stop(1:mtapes))
-
-
-
allocate(tmpname(maxnflds, mtapes), decomp(maxnflds, mtapes), tmpnumlev(maxnflds,mtapes))
ierr = pio_inq_varid(File, 'field_name', vdesc)
ierr = pio_get_var(File, vdesc, tmpname)
-
ierr = pio_inq_varid(File, 'decomp_type', vdesc)
ierr = pio_get_var(File, vdesc, decomp)
ierr = pio_inq_varid(File, 'numlev', vdesc)
ierr = pio_get_var(File, vdesc, tmpnumlev)
- allocate(tmpprec(maxnflds,mtapes))
+ ierr = pio_inq_varid(File, 'hbuf_integral',vdesc)
+ allocate(tmpintegral(maxnflds,mtapes))
+ ierr = pio_get_var(File, vdesc, tmpintegral(:,:))
+
+
ierr = pio_inq_varid(File, 'hwrt_prec',vdesc)
+ allocate(tmpprec(maxnflds,mtapes))
ierr = pio_get_var(File, vdesc, tmpprec(:,:))
- allocate(xyfill(maxnflds,mtapes))
+ ierr = pio_inq_varid(File, 'beg_nstep',vdesc)
+ allocate(tmpbeg_nstep(maxnflds,mtapes))
+ ierr = pio_get_var(File, vdesc, tmpbeg_nstep(:,:))
+
ierr = pio_inq_varid(File, 'xyfill', vdesc)
+ allocate(xyfill(maxnflds,mtapes))
ierr = pio_get_var(File, vdesc, xyfill)
- allocate(is_subcol(maxnflds,mtapes))
ierr = pio_inq_varid(File, 'is_subcol', vdesc)
+ allocate(is_subcol(maxnflds,mtapes))
ierr = pio_get_var(File, vdesc, is_subcol)
!! interpolated output
- allocate(interp_output(mtapes))
ierr = pio_inq_varid(File, 'interpolate_output', vdesc)
+ allocate(interp_output(mtapes))
ierr = pio_get_var(File, vdesc, interp_output)
interpolate_output(1:mtapes) = interp_output(1:mtapes) > 0
if (ptapes > mtapes) then
@@ -1816,6 +2053,13 @@ subroutine read_restart_history (File)
end if
end do
+ allocate(tmpf1name(maxnflds, mtapes), tmpf2name(maxnflds, mtapes))
+ ierr = pio_inq_varid(File, 'op_field1', vdesc)
+ ierr = pio_get_var(File, vdesc, tmpf1name)
+ ierr = pio_inq_varid(File, 'op_field2', vdesc)
+ ierr = pio_get_var(File, vdesc, tmpf2name)
+
+
ierr = pio_inq_varid(File, 'avgflag', avgflag_desc)
ierr = pio_inq_varid(File, 'long_name', longname_desc)
@@ -1826,6 +2070,9 @@ subroutine read_restart_history (File)
ierr = pio_inq_varid(File, 'fillvalue', fillval_desc)
ierr = pio_inq_varid(File, 'meridional_complement', meridional_complement_desc)
ierr = pio_inq_varid(File, 'zonal_complement', zonal_complement_desc)
+ ierr = pio_inq_varid(File, 'field_op', field_op_desc)
+ ierr = pio_inq_varid(File, 'op_field1_id', op_field1_id_desc)
+ ierr = pio_inq_varid(File, 'op_field2_id', op_field2_id_desc)
rgnht(:)=.false.
@@ -1839,111 +2086,160 @@ subroutine read_restart_history (File)
call strip_null(nfpath(t))
- call strip_null(cpath(t))
+ call strip_null(cpath(t,1))
+ call strip_null(cpath(t,2))
call strip_null(hrestpath(t))
allocate(tape(t)%hlist(nflds(t)))
- do f=1,nflds(t)
- if (associated(tape(t)%hlist(f)%field%mdims)) then
- deallocate(tape(t)%hlist(f)%field%mdims)
+ do fld=1,nflds(t)
+ if (associated(tape(t)%hlist(fld)%field%mdims)) then
+ deallocate(tape(t)%hlist(fld)%field%mdims)
end if
- nullify(tape(t)%hlist(f)%field%mdims)
- ierr = pio_get_var(File,fillval_desc, (/f,t/), tape(t)%hlist(f)%field%fillvalue)
- ierr = pio_get_var(File,meridional_complement_desc, (/f,t/), tape(t)%hlist(f)%field%meridional_complement)
- ierr = pio_get_var(File,zonal_complement_desc, (/f,t/), tape(t)%hlist(f)%field%zonal_complement)
- ierr = pio_get_var(File,avgflag_desc, (/f,t/), tape(t)%hlist(f)%avgflag)
- ierr = pio_get_var(File,longname_desc, (/1,f,t/), tape(t)%hlist(f)%field%long_name)
- ierr = pio_get_var(File,units_desc, (/1,f,t/), tape(t)%hlist(f)%field%units)
- tape(t)%hlist(f)%field%sampling_seq(1:max_chars) = ' '
- ierr = pio_get_var(File,sseq_desc, (/1,f,t/), tape(t)%hlist(f)%field%sampling_seq)
- call strip_null(tape(t)%hlist(f)%field%sampling_seq)
- tape(t)%hlist(f)%field%cell_methods(1:max_chars) = ' '
- ierr = pio_get_var(File,cm_desc, (/1,f,t/), tape(t)%hlist(f)%field%cell_methods)
- call strip_null(tape(t)%hlist(f)%field%cell_methods)
- if(xyfill(f,t) ==1) then
- tape(t)%hlist(f)%field%flag_xyfill=.true.
+ nullify(tape(t)%hlist(fld)%field%mdims)
+ ierr = pio_get_var(File,fillval_desc, (/fld,t/), tape(t)%hlist(fld)%field%fillvalue)
+ ierr = pio_get_var(File,meridional_complement_desc, (/fld,t/), tape(t)%hlist(fld)%field%meridional_complement)
+ ierr = pio_get_var(File,zonal_complement_desc, (/fld,t/), tape(t)%hlist(fld)%field%zonal_complement)
+ tape(t)%hlist(fld)%field%field_op(1:field_op_len) = ' '
+ ierr = pio_get_var(File,field_op_desc, (/1,fld,t/), tape(t)%hlist(fld)%field%field_op)
+ call strip_null(tape(t)%hlist(fld)%field%field_op)
+ ierr = pio_get_var(File,op_field1_id_desc, (/fld,t/), tape(t)%hlist(fld)%field%op_field1_id)
+ ierr = pio_get_var(File,op_field2_id_desc, (/fld,t/), tape(t)%hlist(fld)%field%op_field2_id)
+ ierr = pio_get_var(File,avgflag_desc, (/fld,t/), tape(t)%hlist(fld)%avgflag)
+ ierr = pio_get_var(File,longname_desc, (/1,fld,t/), tape(t)%hlist(fld)%field%long_name)
+ ierr = pio_get_var(File,units_desc, (/1,fld,t/), tape(t)%hlist(fld)%field%units)
+ tape(t)%hlist(fld)%field%sampling_seq(1:max_chars) = ' '
+ ierr = pio_get_var(File,sseq_desc, (/1,fld,t/), tape(t)%hlist(fld)%field%sampling_seq)
+ call strip_null(tape(t)%hlist(fld)%field%sampling_seq)
+ tape(t)%hlist(fld)%field%cell_methods(1:max_chars) = ' '
+ ierr = pio_get_var(File,cm_desc, (/1,fld,t/), tape(t)%hlist(fld)%field%cell_methods)
+ call strip_null(tape(t)%hlist(fld)%field%cell_methods)
+ if(xyfill(fld,t) ==1) then
+ tape(t)%hlist(fld)%field%flag_xyfill=.true.
else
- tape(t)%hlist(f)%field%flag_xyfill=.false.
+ tape(t)%hlist(fld)%field%flag_xyfill=.false.
end if
- if(is_subcol(f,t) ==1) then
- tape(t)%hlist(f)%field%is_subcol=.true.
+ if(is_subcol(fld,t) ==1) then
+ tape(t)%hlist(fld)%field%is_subcol=.true.
else
- tape(t)%hlist(f)%field%is_subcol=.false.
+ tape(t)%hlist(fld)%field%is_subcol=.false.
end if
- call strip_null(tmpname(f,t))
- tape(t)%hlist(f)%field%name = tmpname(f,t)
- tape(t)%hlist(f)%field%decomp_type = decomp(f,t)
- tape(t)%hlist(f)%field%numlev = tmpnumlev(f,t)
- tape(t)%hlist(f)%hwrt_prec = tmpprec(f,t)
-
+ call strip_null(tmpname(fld,t))
+ call strip_null(tmpf1name(fld,t))
+ call strip_null(tmpf2name(fld,t))
+ tape(t)%hlist(fld)%field%name = tmpname(fld,t)
+ tape(t)%hlist(fld)%op_field1 = tmpf1name(fld,t)
+ tape(t)%hlist(fld)%op_field2 = tmpf2name(fld,t)
+ tape(t)%hlist(fld)%field%decomp_type = decomp(fld,t)
+ tape(t)%hlist(fld)%field%numlev = tmpnumlev(fld,t)
+ tape(t)%hlist(fld)%hwrt_prec = tmpprec(fld,t)
+ tape(t)%hlist(fld)%beg_nstep = tmpbeg_nstep(fld,t)
+ call tape(t)%hlist(fld)%put_global(tmpintegral(fld,t))
! If the field is an advected constituent set the mixing_ratio attribute
- fname_tmp = strip_suffix(tape(t)%hlist(f)%field%name)
+ fname_tmp = strip_suffix(tape(t)%hlist(fld)%field%name)
call cnst_get_ind(fname_tmp, idx, abort=.false.)
mixing_ratio = ''
if (idx > 0) then
mixing_ratio = cnst_get_type_byind(idx)
end if
- tape(t)%hlist(f)%field%mixing_ratio = mixing_ratio
+ tape(t)%hlist(fld)%field%mixing_ratio = mixing_ratio
- mdimcnt = count(allmdims(:,f,t) > 0)
+ mdimcnt = count(allmdims(:,fld,t) > 0)
if(mdimcnt > 0) then
- allocate(tape(t)%hlist(f)%field%mdims(mdimcnt))
+ allocate(tape(t)%hlist(fld)%field%mdims(mdimcnt))
do i = 1, mdimcnt
- tape(t)%hlist(f)%field%mdims(i) = get_hist_coord_index(mdimnames(allmdims(i,f,t)))
+ tape(t)%hlist(fld)%field%mdims(i) = get_hist_coord_index(mdimnames(allmdims(i,fld,t)))
end do
end if
-
end do
end do
- deallocate(tmpname, tmpnumlev, tmpprec, decomp, xyfill, is_subcol)
+ deallocate(tmpname, tmpnumlev, tmpprec, tmpbeg_nstep, decomp, xyfill, is_subcol, tmpintegral)
deallocate(mdimnames)
+ deallocate(tmpf1name,tmpf2name)
+
+ allocate(grid_wts(cam_grid_num_grids() + 1))
+ allgrids_wt => grid_wts
allocate(gridsontape(cam_grid_num_grids() + 1, ptapes))
gridsontape = -1
do t = 1, ptapes
- do f = 1, nflds(t)
- call set_field_dimensions(tape(t)%hlist(f)%field)
-
- begdim1 = tape(t)%hlist(f)%field%begdim1
- enddim1 = tape(t)%hlist(f)%field%enddim1
- begdim2 = tape(t)%hlist(f)%field%begdim2
- enddim2 = tape(t)%hlist(f)%field%enddim2
- begdim3 = tape(t)%hlist(f)%field%begdim3
- enddim3 = tape(t)%hlist(f)%field%enddim3
-
- allocate(tape(t)%hlist(f)%hbuf(begdim1:enddim1,begdim2:enddim2,begdim3:enddim3))
- if (tape(t)%hlist(f)%avgflag .eq. 'S') then ! allocate the variance buffer for standard dev
- allocate(tape(t)%hlist(f)%sbuf(begdim1:enddim1,begdim2:enddim2,begdim3:enddim3))
+ do fld = 1, nflds(t)
+ if (tape(t)%hlist(fld)%avgflag .ne. 'I') then
+ hfile_accum(t) = .true.
+ end if
+ call set_field_dimensions(tape(t)%hlist(fld)%field)
+
+ begdim1 = tape(t)%hlist(fld)%field%begdim1
+ enddim1 = tape(t)%hlist(fld)%field%enddim1
+ begdim2 = tape(t)%hlist(fld)%field%begdim2
+ enddim2 = tape(t)%hlist(fld)%field%enddim2
+ begdim3 = tape(t)%hlist(fld)%field%begdim3
+ enddim3 = tape(t)%hlist(fld)%field%enddim3
+
+ allocate(tape(t)%hlist(fld)%hbuf(begdim1:enddim1,begdim2:enddim2,begdim3:enddim3))
+ if (tape(t)%hlist(fld)%avgflag .eq. 'S') then ! allocate the variance buffer for standard dev
+ allocate(tape(t)%hlist(fld)%sbuf(begdim1:enddim1,begdim2:enddim2,begdim3:enddim3))
endif
- if (associated(tape(t)%hlist(f)%varid)) then
- deallocate(tape(t)%hlist(f)%varid)
+ if (associated(tape(t)%hlist(fld)%varid)) then
+ deallocate(tape(t)%hlist(fld)%varid)
end if
- nullify(tape(t)%hlist(f)%varid)
- if (associated(tape(t)%hlist(f)%nacs)) then
- deallocate(tape(t)%hlist(f)%nacs)
+ nullify(tape(t)%hlist(fld)%varid)
+ if (associated(tape(t)%hlist(fld)%nacs)) then
+ deallocate(tape(t)%hlist(fld)%nacs)
end if
- nullify(tape(t)%hlist(f)%nacs)
- if(tape(t)%hlist(f)%field%flag_xyfill .or. (avgflag_pertape(t)=='L')) then
- allocate (tape(t)%hlist(f)%nacs(begdim1:enddim1,begdim3:enddim3))
+ nullify(tape(t)%hlist(fld)%nacs)
+ if(tape(t)%hlist(fld)%field%flag_xyfill .or. (avgflag_pertape(t)=='L')) then
+ allocate (tape(t)%hlist(fld)%nacs(begdim1:enddim1,begdim3:enddim3))
else
- allocate(tape(t)%hlist(f)%nacs(1,begdim3:enddim3))
+ allocate(tape(t)%hlist(fld)%nacs(1,begdim3:enddim3))
end if
! initialize all buffers to zero - this will be overwritten later by the
! data in the history restart file if it exists.
- call h_zero(f,t)
+ call h_zero(fld,t)
! Make sure this field's decomp is listed on the tape
- fdecomp = tape(t)%hlist(f)%field%decomp_type
- do ff = 1, size(gridsontape, 1)
- if (fdecomp == gridsontape(ff, t)) then
+ fdecomp = tape(t)%hlist(fld)%field%decomp_type
+ do ffld = 1, size(gridsontape, 1)
+ if (fdecomp == gridsontape(ffld, t)) then
exit
- else if (gridsontape(ff, t) < 0) then
- gridsontape(ff, t) = fdecomp
+ else if (gridsontape(ffld, t) < 0) then
+ gridsontape(ffld, t) = fdecomp
exit
end if
end do
+ !
+ !rebuild area wt array and set field wbuf pointer
+ !
+ if (tape(t)%hlist(fld)%avgflag .eq. 'N') then ! set up area weight buffer
+ nullify(tape(t)%hlist(fld)%wbuf)
+ if (any(allgrids_wt(:)%decomp_type == tape(t)%hlist(fld)%field%decomp_type)) then
+ wtidx=MAXLOC(allgrids_wt(:)%decomp_type, MASK = allgrids_wt(:)%decomp_type .EQ. fdecomp)
+ tape(t)%hlist(fld)%wbuf => allgrids_wt(wtidx(1))%wbuf
+ else
+ ! area weights not found for this grid, then create them
+ ! first check for an available spot in the array
+ if (any(allgrids_wt(:)%decomp_type == -1)) then
+ wtidx=MINLOC(allgrids_wt(:)%decomp_type)
+ else
+ call endrun('cam_history.F90:read_restart_history: Error initializing allgrids_wt with area weights')
+ end if
+ allgrids_wt(wtidx)%decomp_type=fdecomp
+ areawt => cam_grid_get_areawt(fdecomp)
+ allocate(allgrids_wt(wtidx(1))%wbuf(begdim1:enddim1,begdim3:enddim3))
+ cnt=0
+ do c=begdim3,enddim3
+ dimind = tape(t)%hlist(fld)%field%get_dims(c)
+ ib=dimind%beg1
+ ie=dimind%end1
+ do i=ib,ie
+ cnt=cnt+1
+ allgrids_wt(wtidx(1))%wbuf(i,c)=areawt(cnt)
+ end do
+ end do
+ tape(t)%hlist(fld)%wbuf => allgrids_wt(wtidx(1))%wbuf
+ endif
+ endif
end do
end do
!
@@ -1967,21 +2263,21 @@ subroutine read_restart_history (File)
! Open history restart file
!
call getfil (hrestpath(t), locfn)
- call cam_pio_openfile(tape(t)%File, locfn, 0)
+ call cam_pio_openfile(tape(t)%Files(restart_file_index), locfn, 0)
!
! Read history restart file
!
- do f = 1, nflds(t)
+ do fld = 1, nflds(t)
- fname_tmp = strip_suffix(tape(t)%hlist(f)%field%name)
+ fname_tmp = strip_suffix(tape(t)%hlist(fld)%field%name)
if(masterproc) write(iulog, *) 'Reading history variable ',fname_tmp
- ierr = pio_inq_varid(tape(t)%File, fname_tmp, vdesc)
+ ierr = pio_inq_varid(tape(t)%Files(restart_file_index), fname_tmp, vdesc)
+ call cam_pio_var_info(tape(t)%Files(restart_file_index), vdesc, ndims, dimids, dimlens)
- call cam_pio_var_info(tape(t)%File, vdesc, ndims, dimids, dimlens)
- if(.not. associated(tape(t)%hlist(f)%field%mdims)) then
+ if(.not. associated(tape(t)%hlist(fld)%field%mdims)) then
dimcnt = 0
do i=1,ndims
- ierr = pio_inq_dimname(tape(t)%File, dimids(i), dname_tmp)
+ ierr = pio_inq_dimname(tape(t)%Files(restart_file_index), dimids(i), dname_tmp)
dimid = get_hist_coord_index(dname_tmp)
if(dimid >= 1) then
dimcnt = dimcnt + 1
@@ -1990,20 +2286,20 @@ subroutine read_restart_history (File)
end if
end do
if(dimcnt > 0) then
- allocate(tape(t)%hlist(f)%field%mdims(dimcnt))
- tape(t)%hlist(f)%field%mdims(:) = tmpdims(1:dimcnt)
+ allocate(tape(t)%hlist(fld)%field%mdims(dimcnt))
+ tape(t)%hlist(fld)%field%mdims(:) = tmpdims(1:dimcnt)
if(dimcnt > maxvarmdims) maxvarmdims=dimcnt
end if
end if
- call set_field_dimensions(tape(t)%hlist(f)%field)
- begdim1 = tape(t)%hlist(f)%field%begdim1
- enddim1 = tape(t)%hlist(f)%field%enddim1
+ call set_field_dimensions(tape(t)%hlist(fld)%field)
+ begdim1 = tape(t)%hlist(fld)%field%begdim1
+ enddim1 = tape(t)%hlist(fld)%field%enddim1
fdims(1) = enddim1 - begdim1 + 1
- begdim2 = tape(t)%hlist(f)%field%begdim2
- enddim2 = tape(t)%hlist(f)%field%enddim2
+ begdim2 = tape(t)%hlist(fld)%field%begdim2
+ enddim2 = tape(t)%hlist(fld)%field%enddim2
fdims(2) = enddim2 - begdim2 + 1
- begdim3 = tape(t)%hlist(f)%field%begdim3
- enddim3 = tape(t)%hlist(f)%field%enddim3
+ begdim3 = tape(t)%hlist(fld)%field%begdim3
+ enddim3 = tape(t)%hlist(fld)%field%enddim3
fdims(3) = enddim3 - begdim3 + 1
if (fdims(2) > 1) then
nfdims = 3
@@ -2011,66 +2307,69 @@ subroutine read_restart_history (File)
nfdims = 2
fdims(2) = fdims(3)
end if
- fdecomp = tape(t)%hlist(f)%field%decomp_type
+ fdecomp = tape(t)%hlist(fld)%field%decomp_type
if (nfdims > 2) then
- call cam_grid_read_dist_array(tape(t)%File, fdecomp, &
- fdims(1:nfdims), dimlens(1:ndims), tape(t)%hlist(f)%hbuf, vdesc)
+ call cam_grid_read_dist_array(tape(t)%Files(restart_file_index), fdecomp, &
+ fdims(1:nfdims), dimlens(1:ndims), tape(t)%hlist(fld)%hbuf, vdesc)
else
- call cam_grid_read_dist_array(tape(t)%File, fdecomp, &
- fdims(1:nfdims), dimlens(1:ndims), tape(t)%hlist(f)%hbuf(:,1,:), vdesc)
+ call cam_grid_read_dist_array(tape(t)%Files(restart_file_index), fdecomp, &
+ fdims(1:nfdims), dimlens(1:ndims), tape(t)%hlist(fld)%hbuf(:,1,:), vdesc)
end if
- if ( associated(tape(t)%hlist(f)%sbuf) ) then
+ if ( associated(tape(t)%hlist(fld)%sbuf) ) then
! read in variance for standard deviation
- ierr = pio_inq_varid(tape(t)%File, trim(fname_tmp)//'_var', vdesc)
+ ierr = pio_inq_varid(tape(t)%Files(restart_file_index), trim(fname_tmp)//'_var', vdesc)
if (nfdims > 2) then
- call cam_grid_read_dist_array(tape(t)%File, fdecomp, &
- fdims(1:nfdims), dimlens(1:ndims), tape(t)%hlist(f)%sbuf, vdesc)
+ call cam_grid_read_dist_array(tape(t)%Files(restart_file_index), fdecomp, &
+ fdims(1:nfdims), dimlens(1:ndims), tape(t)%hlist(fld)%sbuf, vdesc)
else
- call cam_grid_read_dist_array(tape(t)%File, fdecomp, &
- fdims(1:nfdims), dimlens(1:ndims), tape(t)%hlist(f)%sbuf(:,1,:), vdesc)
+ call cam_grid_read_dist_array(tape(t)%Files(restart_file_index), fdecomp, &
+ fdims(1:nfdims), dimlens(1:ndims), tape(t)%hlist(fld)%sbuf(:,1,:), vdesc)
end if
endif
- ierr = pio_inq_varid(tape(t)%File, trim(fname_tmp)//'_nacs', vdesc)
- call cam_pio_var_info(tape(t)%File, vdesc, nacsdimcnt, dimids, dimlens)
+ ierr = pio_inq_varid(tape(t)%Files(restart_file_index), trim(fname_tmp)//'_nacs', vdesc)
+ call cam_pio_var_info(tape(t)%Files(restart_file_index), vdesc, nacsdimcnt, dimids, dimlens)
if(nacsdimcnt > 0) then
if (nfdims > 2) then
! nacs only has 2 dims (no levels)
fdims(2) = fdims(3)
end if
- allocate(tape(t)%hlist(f)%nacs(begdim1:enddim1,begdim3:enddim3))
- nacs => tape(t)%hlist(f)%nacs(:,:)
- call cam_grid_read_dist_array(tape(t)%File, fdecomp, fdims(1:2), &
+ allocate(tape(t)%hlist(fld)%nacs(begdim1:enddim1,begdim3:enddim3))
+ nacs => tape(t)%hlist(fld)%nacs(:,:)
+ call cam_grid_read_dist_array(tape(t)%Files(restart_file_index), fdecomp, fdims(1:2), &
dimlens(1:nacsdimcnt), nacs, vdesc)
else
- allocate(tape(t)%hlist(f)%nacs(1,begdim3:enddim3))
- ierr = pio_get_var(tape(t)%File, vdesc, nacsval)
- tape(t)%hlist(f)%nacs(1,:)= nacsval
+ allocate(tape(t)%hlist(fld)%nacs(1,begdim3:enddim3))
+ ierr = pio_get_var(tape(t)%Files(restart_file_index), vdesc, nacsval)
+ tape(t)%hlist(fld)%nacs(1,:)= nacsval
end if
+ ierr = pio_inq_varid(tape(t)%Files(restart_file_index), trim(fname_tmp)//'_nacs', vdesc)
+ call cam_pio_var_info(tape(t)%Files(restart_file_index), vdesc, nacsdimcnt, dimids, dimlens)
+
end do
!
! Done reading this history restart file
!
- call cam_pio_closefile(tape(t)%File)
+ call cam_pio_closefile(tape(t)%Files(restart_file_index))
end if ! rgnht(t)
! (re)create the master list of grid IDs
- ff = 0
- do f = 1, size(gridsontape, 1)
- if (gridsontape(f, t) > 0) then
- ff = ff + 1
+ ffld = 0
+ do fld = 1, size(gridsontape, 1)
+ if (gridsontape(fld, t) > 0) then
+ ffld = ffld + 1
end if
end do
- allocate(tape(t)%grid_ids(ff))
- ff = 1
- do f = 1, size(gridsontape, 1)
- if (gridsontape(f, t) > 0) then
- tape(t)%grid_ids(ff) = gridsontape(f, t)
- ff = ff + 1
+ allocate(tape(t)%grid_ids(ffld))
+ ffld = 1
+ do fld = 1, size(gridsontape, 1)
+ if (gridsontape(fld, t) > 0) then
+ tape(t)%grid_ids(ffld) = gridsontape(fld, t)
+ ffld = ffld + 1
end if
end do
call patch_init(t)
@@ -2082,7 +2381,6 @@ subroutine read_restart_history (File)
!
! NOTE: No need to perform this operation for IC history files or empty files
!
-
do t=1,mtapes
if (is_initfile(file_index=t)) then
! Initialize filename specifier for IC file
@@ -2092,13 +2390,19 @@ subroutine read_restart_history (File)
nfils(t) = 0
else
if (nfils(t) > 0) then
- call getfil (cpath(t), locfn)
- call cam_pio_openfile(tape(t)%File, locfn, PIO_WRITE)
+ ! Always create the instantaneous file
+ call getfil (cpath(t,instantaneous_file_index), locfn)
+ call cam_pio_openfile(tape(t)%Files(instantaneous_file_index), locfn, PIO_WRITE)
+ if (hfile_accum(t)) then
+ ! Conditionally create the accumulated file
+ call getfil (cpath(t,accumulated_file_index), locfn)
+ call cam_pio_openfile(tape(t)%Files(accumulated_file_index), locfn, PIO_WRITE)
+ end if
call h_inquire (t)
if(is_satfile(t)) then
! Initialize the sat following history subsystem
call sat_hist_init()
- call sat_hist_define(tape(t)%File)
+ call sat_hist_define(tape(t)%Files(sat_file_index))
end if
end if
!
@@ -2106,13 +2410,21 @@ subroutine read_restart_history (File)
!
if (nfils(t) >= mfilt(t)) then
if (masterproc) then
- write(iulog,*)'READ_RESTART_HISTORY: nf_close(',t,')=',nhfil(t), mfilt(t)
+ do f = 1, maxsplitfiles
+ if (pio_file_is_open(tape(t)%Files(f))) then
+ write(iulog,*)'READ_RESTART_HISTORY: nf_close(',t,')=',nhfil(t,f), mfilt(t)
+ end if
+ end do
end if
- do f=1,nflds(t)
- deallocate(tape(t)%hlist(f)%varid)
- nullify(tape(t)%hlist(f)%varid)
+ do fld=1,nflds(t)
+ deallocate(tape(t)%hlist(fld)%varid)
+ nullify(tape(t)%hlist(fld)%varid)
+ end do
+ do f = 1, maxsplitfiles
+ if (pio_file_is_open(tape(t)%Files(f))) then
+ call cam_pio_closefile(tape(t)%Files(f))
+ end if
end do
- call cam_pio_closefile(tape(t)%File)
nfils(t) = 0
end if
end if
@@ -2130,7 +2442,7 @@ end subroutine read_restart_history
!#######################################################################
- character(len=max_string_len) function get_hfilepath( tape )
+ character(len=max_string_len) function get_hfilepath( tape, accumulated_flag )
!
!-----------------------------------------------------------------------
!
@@ -2141,8 +2453,14 @@ character(len=max_string_len) function get_hfilepath( tape )
!-----------------------------------------------------------------------
!
integer, intent(in) :: tape ! Tape number
+ logical, intent(in) :: accumulated_flag ! True if calling routine wants the accumulated
+ ! file path, False for instantaneous
- get_hfilepath = cpath( tape )
+ if (accumulated_flag) then
+ get_hfilepath = cpath( tape, accumulated_file_index )
+ else
+ get_hfilepath = cpath( tape, instantaneous_file_index )
+ end if
end function get_hfilepath
!#######################################################################
@@ -2210,8 +2528,10 @@ subroutine AvgflagToString(avgflag, time_op)
time_op(:) = 'mean'
case ('B')
time_op(:) = 'mean00z'
+ case ('N')
+ time_op(:) = 'mean_over_nsteps'
case ('I')
- time_op(:) = ' '
+ time_op(:) = 'point'
case ('X')
time_op(:) = 'maximum'
case ('M')
@@ -2244,8 +2564,8 @@ subroutine fldlst ()
!
!---------------------------Local variables-----------------------------
!
- integer t, f ! tape, field indices
- integer ff ! index into include, exclude and fprec list
+ integer t, fld ! tape, field indices
+ integer ffld ! index into include, exclude and fprec list
integer :: i
character(len=fieldname_len) :: name ! field name portion of fincl (i.e. no avgflag separator)
character(len=max_fieldname_len) :: mastername ! name from masterlist field
@@ -2264,16 +2584,6 @@ subroutine fldlst ()
! on that grid.
integer, allocatable :: gridsontape(:,:)
- ! The following list of field names are only valid for the FV dycore. They appear
- ! in fincl settings of WACCM use case files which are not restricted to the FV dycore.
- ! To avoid duplicating long fincl lists in use case files to provide both FV and non-FV
- ! versions this short list of fields is checked for and removed from fincl lists when
- ! the dycore is not FV.
- integer, parameter :: n_fv_only = 10
- character(len=6) :: fv_only_flds(n_fv_only) = &
- [ 'VTHzm ', 'WTHzm ', 'UVzm ', 'UWzm ', 'Uzm ', 'Vzm ', 'Wzm ', &
- 'THzm ', 'TH ', 'MSKtem' ]
-
integer :: n_vec_comp, add_fincl_idx
integer, parameter :: nvecmax = 50 ! max number of vector components in a fincl list
character(len=2) :: avg_suffix
@@ -2286,34 +2596,18 @@ subroutine fldlst ()
errors_found = 0
do t=1,ptapes
- f = 1
+ fld = 1
n_vec_comp = 0
vec_comp_names = ' '
vec_comp_avgflag = ' '
-fincls: do while (f < pflds .and. fincl(f,t) /= ' ')
- name = getname (fincl(f,t))
-
- if (.not. dycore_is('FV')) then
- ! filter out fields only provided by FV dycore
- do i = 1, n_fv_only
- if (name == fv_only_flds(i)) then
- write(errormsg,'(3a,2(i0,a))')'FLDLST: ', trim(name), &
- ' in fincl(', f,', ',t, ') only available with FV dycore'
- if (masterproc) then
- write(iulog,*) trim(errormsg)
- call shr_sys_flush(iulog)
- end if
- f = f + 1
- cycle fincls
- end if
- end do
- end if
+ do while (fld < pflds .and. fincl(fld,t) /= ' ')
+ name = getname (fincl(fld,t))
mastername=''
listentry => get_entry_by_name(masterlinkedlist, name)
if (associated(listentry)) mastername = listentry%field%name
if (name /= mastername) then
- write(errormsg,'(3a,2(i0,a))')'FLDLST: ', trim(name), ' in fincl(', f,', ',t, ') not found'
+ write(errormsg,'(3a,2(i0,a))')'FLDLST: ', trim(name), ' in fincl(', fld,', ',t, ') not found'
if (masterproc) then
write(iulog,*) trim(errormsg)
call shr_sys_flush(iulog)
@@ -2323,7 +2617,7 @@ subroutine fldlst ()
if (len_trim(mastername)>0 .and. interpolate_output(t)) then
if (n_vec_comp >= nvecmax) call endrun('FLDLST: need to increase nvecmax')
! If this is a vector component then save the name of the complement
- avgflag = getflag(fincl(f,t))
+ avgflag = getflag(fincl(fld,t))
if (len_trim(listentry%meridional_field) > 0) then
n_vec_comp = n_vec_comp + 1
vec_comp_names(n_vec_comp) = listentry%meridional_field
@@ -2335,20 +2629,20 @@ subroutine fldlst ()
end if
end if
end if
- f = f + 1
- end do fincls
+ fld = fld + 1
+ end do
! Interpolation of vector components requires that both be present. If the fincl
! specifier contains any vector components, then the complement was saved in the
! array vec_comp_names. Next insure (for interpolated output only) that all complements
! are also present in the fincl array.
- ! The first empty slot in the current fincl array is index f from loop above.
- add_fincl_idx = f
- if (f > 1 .and. interpolate_output(t)) then
+ ! The first empty slot in the current fincl array is index fld from loop above.
+ add_fincl_idx = fld
+ if (fld > 1 .and. interpolate_output(t)) then
do i = 1, n_vec_comp
- call list_index(fincl(:,t), vec_comp_names(i), ff)
- if (ff == 0) then
+ call list_index(fincl(:,t), vec_comp_names(i), ffld)
+ if (ffld == 0) then
! Add vector component to fincl. Don't need to check whether its in the master
! list since this was done at the time of registering the vector components.
@@ -2367,39 +2661,39 @@ subroutine fldlst ()
end do
end if
- f = 1
- do while (f < pflds .and. fexcl(f,t) /= ' ')
+ fld = 1
+ do while (fld < pflds .and. fexcl(fld,t) /= ' ')
mastername=''
- listentry => get_entry_by_name(masterlinkedlist, fexcl(f,t))
+ listentry => get_entry_by_name(masterlinkedlist, fexcl(fld,t))
if(associated(listentry)) mastername = listentry%field%name
- if (fexcl(f,t) /= mastername) then
- write(errormsg,'(3a,2(i0,a))')'FLDLST: ', trim(fexcl(f,t)), ' in fexcl(', f,', ',t, ') not found'
+ if (fexcl(fld,t) /= mastername) then
+ write(errormsg,'(3a,2(i0,a))')'FLDLST: ', trim(fexcl(fld,t)), ' in fexcl(', fld,', ',t, ') not found'
if (masterproc) then
write(iulog,*) trim(errormsg)
call shr_sys_flush(iulog)
end if
errors_found = errors_found + 1
end if
- f = f + 1
+ fld = fld + 1
end do
- f = 1
- do while (f < pflds .and. fwrtpr(f,t) /= ' ')
- name = getname (fwrtpr(f,t))
+ fld = 1
+ do while (fld < pflds .and. fwrtpr(fld,t) /= ' ')
+ name = getname (fwrtpr(fld,t))
mastername=''
listentry => get_entry_by_name(masterlinkedlist, name)
if(associated(listentry)) mastername = listentry%field%name
if (name /= mastername) then
- write(errormsg,'(3a,i0,a)')'FLDLST: ', trim(name), ' in fwrtpr(', f, ') not found'
+ write(errormsg,'(3a,i0,a)')'FLDLST: ', trim(name), ' in fwrtpr(', fld, ') not found'
if (masterproc) then
write(iulog,*) trim(errormsg)
call shr_sys_flush(iulog)
end if
errors_found = errors_found + 1
end if
- do ff=1,f-1 ! If duplicate entry is found, stop
- if (trim(name) == trim(getname(fwrtpr(ff,t)))) then
+ do ffld=1,fld-1 ! If duplicate entry is found, stop
+ if (trim(name) == trim(getname(fwrtpr(ffld,t)))) then
write(errormsg,'(3a)')'FLDLST: Duplicate field ', trim(name), ' in fwrtpr'
if (masterproc) then
write(iulog,*) trim(errormsg)
@@ -2408,7 +2702,7 @@ subroutine fldlst ()
errors_found = errors_found + 1
end if
end do
- f = f + 1
+ fld = fld + 1
end do
end do
@@ -2430,6 +2724,8 @@ subroutine fldlst ()
end if
+ allocate(grid_wts(cam_grid_num_grids() + 1))
+ allgrids_wt => grid_wts
allocate(gridsontape(cam_grid_num_grids() + 1, ptapes))
gridsontape = -1
@@ -2444,14 +2740,14 @@ subroutine fldlst ()
listentry => masterlinkedlist
do while(associated(listentry))
mastername = listentry%field%name
- call list_index (fincl(1,t), mastername, ff)
+ call list_index (fincl(1,t), mastername, ffld)
fieldontape = .false.
- if (ff > 0) then
+ if (ffld > 0) then
fieldontape = .true.
else if ((.not. empty_htapes) .or. (is_initfile(file_index=t))) then
- call list_index (fexcl(1,t), mastername, ff)
- if (ff == 0 .and. listentry%actflag(t)) then
+ call list_index (fexcl(1,t), mastername, ffld)
+ if (ffld == 0 .and. listentry%actflag(t)) then
fieldontape = .true.
end if
end if
@@ -2459,11 +2755,11 @@ subroutine fldlst ()
! The field is active so increment the number fo fields and add
! its decomp type to the list of decomp types on this tape
nflds(t) = nflds(t) + 1
- do ff = 1, size(gridsontape, 1)
- if (listentry%field%decomp_type == gridsontape(ff, t)) then
+ do ffld = 1, size(gridsontape, 1)
+ if (listentry%field%decomp_type == gridsontape(ffld, t)) then
exit
- else if (gridsontape(ff, t) < 0) then
- gridsontape(ff, t) = listentry%field%decomp_type
+ else if (gridsontape(ffld, t) < 0) then
+ gridsontape(ffld, t) = listentry%field%decomp_type
exit
end if
end do
@@ -2492,26 +2788,27 @@ subroutine fldlst ()
! Allocate the correct number of hentry slots
allocate(tape(t)%hlist(nflds(t)))
! Count up the number of grids output on this tape
- ff = 0
- do f = 1, size(gridsontape, 1)
- if (gridsontape(f, t) > 0) then
- ff = ff + 1
+ ffld = 0
+ do fld = 1, size(gridsontape, 1)
+ if (gridsontape(fld, t) > 0) then
+ ffld = ffld + 1
end if
end do
- allocate(tape(t)%grid_ids(ff))
- ff = 1
- do f = 1, size(gridsontape, 1)
- if (gridsontape(f, t) > 0) then
- tape(t)%grid_ids(ff) = gridsontape(f, t)
- ff = ff + 1
+ allocate(tape(t)%grid_ids(ffld))
+ ffld = 1
+ do fld = 1, size(gridsontape, 1)
+ if (gridsontape(fld, t) > 0) then
+ tape(t)%grid_ids(ffld) = gridsontape(fld, t)
+ ffld = ffld + 1
end if
end do
end if
- do ff=1,nflds(t)
- nullify(tape(t)%hlist(ff)%hbuf)
- nullify(tape(t)%hlist(ff)%sbuf)
- nullify(tape(t)%hlist(ff)%nacs)
- nullify(tape(t)%hlist(ff)%varid)
+ do ffld=1,nflds(t)
+ nullify(tape(t)%hlist(ffld)%hbuf)
+ nullify(tape(t)%hlist(ffld)%sbuf)
+ nullify(tape(t)%hlist(ffld)%wbuf)
+ nullify(tape(t)%hlist(ffld)%nacs)
+ nullify(tape(t)%hlist(ffld)%varid)
end do
@@ -2520,21 +2817,21 @@ subroutine fldlst ()
do while(associated(listentry))
mastername = listentry%field%name
- call list_index (fwrtpr(1,t), mastername, ff)
- if (ff > 0) then
- prec_wrt = getflag(fwrtpr(ff,t))
+ call list_index (fwrtpr(1,t), mastername, ffld)
+ if (ffld > 0) then
+ prec_wrt = getflag(fwrtpr(ffld,t))
else
prec_wrt = ' '
end if
- call list_index (fincl(1,t), mastername, ff)
+ call list_index (fincl(1,t), mastername, ffld)
- if (ff > 0) then
- avgflag = getflag (fincl(ff,t))
+ if (ffld > 0) then
+ avgflag = getflag (fincl(ffld,t))
call inifld (t, listentry, avgflag, prec_wrt)
else if ((.not. empty_htapes) .or. (is_initfile(file_index=t))) then
- call list_index (fexcl(1,t), mastername, ff)
- if (ff == 0 .and. listentry%actflag(t)) then
+ call list_index (fexcl(1,t), mastername, ffld)
+ if (ffld == 0 .and. listentry%actflag(t)) then
call inifld (t, listentry, ' ', prec_wrt)
else
listentry%actflag(t) = .false.
@@ -2560,19 +2857,30 @@ subroutine fldlst ()
! entries for efficiency in OUTFLD. Simple bubble sort.
!
!!XXgoldyXX: v In the future, we will sort according to decomp to speed I/O
- do f=nflds(t)-1,1,-1
- do ff=1,f
+ do fld=nflds(t)-1,1,-1
+ do ffld=1,fld
+
+ if (tape(t)%hlist(ffld)%field%numlev > tape(t)%hlist(ffld+1)%field%numlev) then
+ tmp = tape(t)%hlist(ffld)
+ tape(t)%hlist(ffld ) = tape(t)%hlist(ffld+1)
+ tape(t)%hlist(ffld+1) = tmp
+ end if
+
+ end do
+
+ do ffld=1,fld
- if (tape(t)%hlist(ff)%field%name > tape(t)%hlist(ff+1)%field%name) then
+ if ((tape(t)%hlist(ffld)%field%numlev == tape(t)%hlist(ffld+1)%field%numlev) .and. &
+ (tape(t)%hlist(ffld)%field%name > tape(t)%hlist(ffld+1)%field%name)) then
- tmp = tape(t)%hlist(ff)
- tape(t)%hlist(ff ) = tape(t)%hlist(ff+1)
- tape(t)%hlist(ff+1) = tmp
+ tmp = tape(t)%hlist(ffld)
+ tape(t)%hlist(ffld ) = tape(t)%hlist(ffld+1)
+ tape(t)%hlist(ffld+1) = tmp
- else if (tape(t)%hlist(ff )%field%name == tape(t)%hlist(ff+1)%field%name) then
+ else if (tape(t)%hlist(ffld)%field%name == tape(t)%hlist(ffld+1)%field%name) then
write(errormsg,'(2a,2(a,i3))') 'FLDLST: Duplicate field: ', &
- trim(tape(t)%hlist(ff)%field%name),', tape = ', t, ', ff = ', ff
+ trim(tape(t)%hlist(ffld)%field%name),', tape = ', t, ', ffld = ', ffld
call endrun(errormsg)
end if
@@ -2580,6 +2888,9 @@ subroutine fldlst ()
end do
end do
+ ! Initialize the field names/ids for each composed field on tapes
+ call define_composed_field_ids(t)
+
end do ! do t=1,ptapes
deallocate(gridsontape)
@@ -2613,7 +2924,7 @@ end subroutine fldlst
subroutine print_active_fldlst()
- integer :: f, ff, i, t
+ integer :: fld, ffld, i, t
integer :: num_patches
character(len=6) :: prec_str
@@ -2629,7 +2940,7 @@ subroutine print_active_fldlst()
if (nflds(t) > 0) then
write(iulog,*) ' '
- write(iulog,*)'FLDLST: History file ', t, ' contains ', nflds(t), ' fields'
+ write(iulog,*)'FLDLST: History stream ', t, ' contains ', nflds(t), ' fields'
if (is_initfile(file_index=t)) then
write(iulog,*) ' Write frequency: ',inithist,' (INITIAL CONDITIONS)'
@@ -2664,23 +2975,23 @@ subroutine print_active_fldlst()
end if
- do f = 1, nflds(t)
+ do fld = 1, nflds(t)
if (associated(hfile(t)%patches)) then
num_patches = size(hfile(t)%patches)
- fldname = strip_suffix(hfile(t)%hlist(f)%field%name)
+ fldname = strip_suffix(hfile(t)%hlist(fld)%field%name)
do i = 1, num_patches
- ff = (f-1)*num_patches + i
+ ffld = (fld-1)*num_patches + i
fname_tmp = trim(fldname)
call hfile(t)%patches(i)%field_name(fname_tmp)
- write(iulog,9000) ff, fname_tmp, hfile(t)%hlist(f)%field%units, &
- hfile(t)%hlist(f)%field%numlev, hfile(t)%hlist(f)%avgflag, &
- trim(hfile(t)%hlist(f)%field%long_name)
+ write(iulog,9000) ffld, fname_tmp, hfile(t)%hlist(fld)%field%units, &
+ hfile(t)%hlist(fld)%field%numlev, hfile(t)%hlist(fld)%avgflag, &
+ trim(hfile(t)%hlist(fld)%field%long_name)
end do
else
- fldname = hfile(t)%hlist(f)%field%name
- write(iulog,9000) f, fldname, hfile(t)%hlist(f)%field%units, &
- hfile(t)%hlist(f)%field%numlev, hfile(t)%hlist(f)%avgflag, &
- trim(hfile(t)%hlist(f)%field%long_name)
+ fldname = hfile(t)%hlist(fld)%field%name
+ write(iulog,9000) fld, fldname, hfile(t)%hlist(fld)%field%units, &
+ hfile(t)%hlist(fld)%field%numlev, hfile(t)%hlist(fld)%avgflag, &
+ trim(hfile(t)%hlist(fld)%field%long_name)
end if
end do
@@ -3277,12 +3588,13 @@ end subroutine subcol_field_avg_handler
!
! Local variables
!
- integer :: t, f ! tape, field indices
+ integer :: t, fld ! tape, field indices
character*1 :: avgflag ! averaging flag
type (active_entry), pointer :: otape(:) ! Local history_tape pointer
real(r8),pointer :: hbuf(:,:) ! history buffer
+ real(r8),pointer :: wbuf(:) ! area weights for field
real(r8),pointer :: sbuf(:,:) ! variance buffer
integer, pointer :: nacs(:) ! accumulation counter
integer :: begdim2, enddim2, endi
@@ -3313,27 +3625,30 @@ end subroutine subcol_field_avg_handler
! write(iulog,*)'fname_loc=',fname_loc
do t = 1, ptapes
if ( .not. masterlist(ff)%thisentry%actflag(t)) cycle
- f = masterlist(ff)%thisentry%htapeindx(t)
+ fld = masterlist(ff)%thisentry%htapeindx(t)
!
! Update history buffer
!
- flag_xyfill = otape(t)%hlist(f)%field%flag_xyfill
- fillvalue = otape(t)%hlist(f)%field%fillvalue
- avgflag = otape(t)%hlist(f)%avgflag
- nacs => otape(t)%hlist(f)%nacs(:,c)
- hbuf => otape(t)%hlist(f)%hbuf(:,:,c)
- if (associated(tape(t)%hlist(f)%sbuf)) then
- sbuf => otape(t)%hlist(f)%sbuf(:,:,c)
+ flag_xyfill = otape(t)%hlist(fld)%field%flag_xyfill
+ fillvalue = otape(t)%hlist(fld)%field%fillvalue
+ avgflag = otape(t)%hlist(fld)%avgflag
+ nacs => otape(t)%hlist(fld)%nacs(:,c)
+ hbuf => otape(t)%hlist(fld)%hbuf(:,:,c)
+ if (associated(tape(t)%hlist(fld)%wbuf)) then
+ wbuf => otape(t)%hlist(fld)%wbuf(:,c)
+ endif
+ if (associated(tape(t)%hlist(fld)%sbuf)) then
+ sbuf => otape(t)%hlist(fld)%sbuf(:,:,c)
endif
- dimind = otape(t)%hlist(f)%field%get_dims(c)
+ dimind = otape(t)%hlist(fld)%field%get_dims(c)
! See notes above about validity of avg_subcol_field
- if (otape(t)%hlist(f)%field%is_subcol) then
+ if (otape(t)%hlist(fld)%field%is_subcol) then
if (present(avg_subcol_field)) then
call endrun('OUTFLD: Cannot average '//trim(fname)//', subcolumn output was requested in addfld')
end if
avg_subcols = .false.
- else if (otape(t)%hlist(f)%field%decomp_type == phys_decomp) then
+ else if (otape(t)%hlist(fld)%field%decomp_type == phys_decomp) then
if (present(avg_subcol_field)) then
avg_subcols = avg_subcol_field
else
@@ -3347,15 +3662,15 @@ end subroutine subcol_field_avg_handler
end if
end if
- begdim2 = otape(t)%hlist(f)%field%begdim2
- enddim2 = otape(t)%hlist(f)%field%enddim2
+ begdim2 = otape(t)%hlist(fld)%field%begdim2
+ enddim2 = otape(t)%hlist(fld)%field%enddim2
if (avg_subcols) then
allocate(afield(pcols, begdim2:enddim2))
call subcol_field_avg_handler(idim, field, c, afield)
! Hack! Avoid duplicating select statement below
call outfld(fname, afield, pcols, c)
deallocate(afield)
- else if (otape(t)%hlist(f)%field%is_subcol) then
+ else if (otape(t)%hlist(fld)%field%is_subcol) then
! We have to assume that using mdimnames (e.g., psubcols) is
! incompatible with the begdimx, enddimx usage (checked in addfld)
! Since psubcols is included in levels, take that out
@@ -3395,6 +3710,10 @@ end subroutine subcol_field_avg_handler
call hbuf_accum_add00z(hbuf, ufield, nacs, dimind, pcols, &
flag_xyfill, fillvalue)
+ case ('N') ! Time average over nsteps
+ call hbuf_accum_add(hbuf, ufield, nacs, dimind, pcols, &
+ flag_xyfill, fillvalue)
+
case ('X') ! Maximum over time
call hbuf_accum_max (hbuf, ufield, nacs, dimind, pcols, &
flag_xyfill, fillvalue)
@@ -3406,7 +3725,7 @@ end subroutine subcol_field_avg_handler
case ('L')
call hbuf_accum_addlcltime(hbuf, ufield, nacs, dimind, pcols, &
flag_xyfill, fillvalue, c, &
- otape(t)%hlist(f)%field%decomp_type, &
+ otape(t)%hlist(fld)%field%decomp_type, &
lcltod_start(t), lcltod_stop(t))
case ('S') ! Standard deviation
@@ -3433,6 +3752,10 @@ end subroutine subcol_field_avg_handler
call hbuf_accum_add00z(hbuf, field, nacs, dimind, idim, &
flag_xyfill, fillvalue)
+ case ('N') ! Time average over nsteps
+ call hbuf_accum_add (hbuf, field, nacs, dimind, idim, &
+ flag_xyfill, fillvalue)
+
case ('X') ! Maximum over time
call hbuf_accum_max (hbuf, field, nacs, dimind, idim, &
flag_xyfill, fillvalue)
@@ -3444,7 +3767,7 @@ end subroutine subcol_field_avg_handler
case ('L')
call hbuf_accum_addlcltime(hbuf, field, nacs, dimind, idim, &
flag_xyfill, fillvalue, c, &
- otape(t)%hlist(f)%field%decomp_type, &
+ otape(t)%hlist(fld)%field%decomp_type, &
lcltod_start(t), lcltod_stop(t))
case ('S') ! Standard deviation
@@ -3464,7 +3787,7 @@ end subroutine outfld
!#######################################################################
- subroutine get_field_properties(fname, found, tape_out, ff_out, no_tape_check_in)
+ subroutine get_field_properties(fname, found, tape_out, ff_out, no_tape_check_in, f_out)
implicit none
!
@@ -3487,6 +3810,7 @@ subroutine get_field_properties(fname, found, tape_out, ff_out, no_tape_check_in
type(active_entry), pointer, optional :: tape_out(:)
integer, intent(out), optional :: ff_out
logical, intent(in), optional :: no_tape_check_in
+ integer, intent(out), optional :: f_out(:)
!
! Local variables
@@ -3515,6 +3839,9 @@ subroutine get_field_properties(fname, found, tape_out, ff_out, no_tape_check_in
if (present(ff_out)) then
ff_out = -1
end if
+ if (present(f_out)) then
+ f_out = -1
+ end if
!
! If ( ff < 0 ), the field is not defined on the masterlist. This check
@@ -3548,8 +3875,12 @@ subroutine get_field_properties(fname, found, tape_out, ff_out, no_tape_check_in
if (present(ff_out)) then
ff_out = ff
end if
- ! We found the info so we are done with the loop
- exit
+ if (present(f_out)) then
+ f_out(t) = masterlist(ff)%thisentry%htapeindx(t)
+ else
+ ! only need to loop through all ptapes if f_out present
+ exit
+ end if
end if
end do
@@ -3631,7 +3962,7 @@ subroutine h_inquire (t)
!
! Local workspace
!
- integer :: f ! field index
+ integer :: f, fld ! file, field index
integer :: ierr
integer :: i
integer :: num_patches
@@ -3644,103 +3975,118 @@ subroutine h_inquire (t)
!
tape => history_tape
-
-
!
! Create variables for model timing and header information
!
- if(.not. is_satfile(t)) then
- ierr=pio_inq_varid (tape(t)%File,'ndcur ', tape(t)%ndcurid)
- ierr=pio_inq_varid (tape(t)%File,'nscur ', tape(t)%nscurid)
- ierr=pio_inq_varid (tape(t)%File,'nsteph ', tape(t)%nstephid)
-
- ierr=pio_inq_varid (tape(t)%File,'time_bnds', tape(t)%tbndid)
- ierr=pio_inq_varid (tape(t)%File,'date_written',tape(t)%date_writtenid)
- ierr=pio_inq_varid (tape(t)%File,'time_written',tape(t)%time_writtenid)
+ do f = 1, maxsplitfiles
+ if (.not. pio_file_is_open(tape(t)%Files(f))) then
+ cycle
+ end if
+ if(.not. is_satfile(t)) then
+ if (f == instantaneous_file_index) then
+ ierr=pio_inq_varid (tape(t)%Files(f),'ndcur ', tape(t)%ndcurid)
+ ierr=pio_inq_varid (tape(t)%Files(f),'nscur ', tape(t)%nscurid)
+ ierr=pio_inq_varid (tape(t)%Files(f),'nsteph ', tape(t)%nstephid)
+ end if
+ ierr=pio_inq_varid (tape(t)%Files(f),'time_bounds', tape(t)%tbndid)
+ ierr=pio_inq_varid (tape(t)%Files(f),'date_written', tape(t)%date_writtenid)
+ ierr=pio_inq_varid (tape(t)%Files(f),'time_written', tape(t)%time_writtenid)
#if ( defined BFB_CAM_SCAM_IOP )
- ierr=pio_inq_varid (tape(t)%File,'tsec ',tape(t)%tsecid)
- ierr=pio_inq_varid (tape(t)%File,'bdate ',tape(t)%bdateid)
+ ierr=pio_inq_varid (tape(t)%Files(f),'tsec ',tape(t)%tsecid)
+ ierr=pio_inq_varid (tape(t)%Files(f),'bdate ',tape(t)%bdateid)
#endif
- if (.not. is_initfile(file_index=t) ) then
- ! Don't write the GHG/Solar forcing data to the IC file. It is never
- ! read from that file so it's confusing to have it there.
- ierr=pio_inq_varid (tape(t)%File,'co2vmr ', tape(t)%co2vmrid)
- ierr=pio_inq_varid (tape(t)%File,'ch4vmr ', tape(t)%ch4vmrid)
- ierr=pio_inq_varid (tape(t)%File,'n2ovmr ', tape(t)%n2ovmrid)
- ierr=pio_inq_varid (tape(t)%File,'f11vmr ', tape(t)%f11vmrid)
- ierr=pio_inq_varid (tape(t)%File,'f12vmr ', tape(t)%f12vmrid)
- ierr=pio_inq_varid (tape(t)%File,'sol_tsi ', tape(t)%sol_tsiid)
- if (solar_parms_on) then
- ierr=pio_inq_varid (tape(t)%File,'f107 ', tape(t)%f107id)
- ierr=pio_inq_varid (tape(t)%File,'f107a ', tape(t)%f107aid)
- ierr=pio_inq_varid (tape(t)%File,'f107p ', tape(t)%f107pid)
- ierr=pio_inq_varid (tape(t)%File,'kp ', tape(t)%kpid)
- ierr=pio_inq_varid (tape(t)%File,'ap ', tape(t)%apid)
- endif
- if (solar_wind_on) then
- ierr=pio_inq_varid (tape(t)%File,'byimf', tape(t)%byimfid)
- ierr=pio_inq_varid (tape(t)%File,'bzimf', tape(t)%bzimfid)
- ierr=pio_inq_varid (tape(t)%File,'swvel', tape(t)%swvelid)
- ierr=pio_inq_varid (tape(t)%File,'swden', tape(t)%swdenid)
- endif
- if (epot_active) then
- ierr=pio_inq_varid (tape(t)%File,'colat_crit1', tape(t)%colat_crit1_id)
- ierr=pio_inq_varid (tape(t)%File,'colat_crit2', tape(t)%colat_crit2_id)
- endif
- end if
- end if
- ierr=pio_inq_varid (tape(t)%File,'date ', tape(t)%dateid)
- ierr=pio_inq_varid (tape(t)%File,'datesec ', tape(t)%datesecid)
- ierr=pio_inq_varid (tape(t)%File,'time ', tape(t)%timeid)
-
+ if (.not. is_initfile(file_index=t) .and. f == instantaneous_file_index) then
+ ! Don't write the GHG/Solar forcing data to the IC file. It is never
+ ! read from that file so it's confusing to have it there.
+ ! Only write the GHG/Solar forcing data to the instantaneous file
+ ierr=pio_inq_varid (tape(t)%Files(f),'co2vmr ', tape(t)%co2vmrid)
+ ierr=pio_inq_varid (tape(t)%Files(f),'ch4vmr ', tape(t)%ch4vmrid)
+ ierr=pio_inq_varid (tape(t)%Files(f),'n2ovmr ', tape(t)%n2ovmrid)
+ ierr=pio_inq_varid (tape(t)%Files(f),'f11vmr ', tape(t)%f11vmrid)
+ ierr=pio_inq_varid (tape(t)%Files(f),'f12vmr ', tape(t)%f12vmrid)
+ ierr=pio_inq_varid (tape(t)%Files(f),'sol_tsi ', tape(t)%sol_tsiid)
+ if (solar_parms_on) then
+ ierr=pio_inq_varid (tape(t)%Files(f),'f107 ', tape(t)%f107id)
+ ierr=pio_inq_varid (tape(t)%Files(f),'f107a ', tape(t)%f107aid)
+ ierr=pio_inq_varid (tape(t)%Files(f),'f107p ', tape(t)%f107pid)
+ ierr=pio_inq_varid (tape(t)%Files(f),'kp ', tape(t)%kpid)
+ ierr=pio_inq_varid (tape(t)%Files(f),'ap ', tape(t)%apid)
+ endif
+ if (solar_wind_on) then
+ ierr=pio_inq_varid (tape(t)%Files(f),'byimf', tape(t)%byimfid)
+ ierr=pio_inq_varid (tape(t)%Files(f),'bzimf', tape(t)%bzimfid)
+ ierr=pio_inq_varid (tape(t)%Files(f),'swvel', tape(t)%swvelid)
+ ierr=pio_inq_varid (tape(t)%Files(f),'swden', tape(t)%swdenid)
+ endif
+ if (epot_active) then
+ ierr=pio_inq_varid (tape(t)%Files(f),'colat_crit1', tape(t)%colat_crit1_id)
+ ierr=pio_inq_varid (tape(t)%Files(f),'colat_crit2', tape(t)%colat_crit2_id)
+ endif
+ end if
+ end if
+ ierr=pio_inq_varid (tape(t)%Files(f),'date ', tape(t)%dateid)
+ ierr=pio_inq_varid (tape(t)%Files(f),'datesec ', tape(t)%datesecid)
+ ierr=pio_inq_varid (tape(t)%Files(f),'time ', tape(t)%timeid)
+
+ !
+ ! Obtain variable name from ID which was read from restart file
+ !
+ do fld=1,nflds(t)
+ if (f == accumulated_file_index) then
+ ! this is the accumulated file - skip instantaneous fields
+ if (tape(t)%hlist(fld)%avgflag == 'I') then
+ cycle
+ end if
+ else
+ ! this is the instantaneous file - skip accumulated fields
+ if (tape(t)%hlist(fld)%avgflag /= 'I') then
+ cycle
+ end if
+ end if
- !
- ! Obtain variable name from ID which was read from restart file
- !
- do f=1,nflds(t)
- if(.not. associated(tape(t)%hlist(f)%varid)) then
- if (associated(tape(t)%patches)) then
- allocate(tape(t)%hlist(f)%varid(size(tape(t)%patches)))
- else
- allocate(tape(t)%hlist(f)%varid(1))
- end if
- end if
- !
- ! If this field will be put out as columns then get column names for field
- !
- if (associated(tape(t)%patches)) then
- num_patches = size(tape(t)%patches)
- fldname = strip_suffix(tape(t)%hlist(f)%field%name)
- do i = 1, num_patches
- fname_tmp = trim(fldname)
- call tape(t)%patches(i)%field_name(fname_tmp)
- ierr = pio_inq_varid(tape(t)%File, trim(fname_tmp), tape(t)%hlist(f)%varid(i))
- call cam_pio_handle_error(ierr, 'H_INQUIRE: Error getting ID for '//trim(fname_tmp))
- ierr = pio_get_att(tape(t)%File, tape(t)%hlist(f)%varid(i), 'basename', basename)
- call cam_pio_handle_error(ierr, 'H_INQUIRE: Error getting basename for '//trim(fname_tmp))
- if (trim(fldname) /= trim(basename)) then
- call endrun('H_INQUIRE: basename ('//trim(basename)//') does not match fldname ('//trim(fldname)//')')
- end if
- end do
- else
- fldname = tape(t)%hlist(f)%field%name
- ierr = pio_inq_varid(tape(t)%File, trim(fldname), tape(t)%hlist(f)%varid(1))
- call cam_pio_handle_error(ierr, 'H_INQUIRE: Error getting ID for '//trim(fldname))
- end if
- if(tape(t)%hlist(f)%field%numlev>1) then
- ierr = pio_inq_attlen(tape(t)%File,tape(t)%hlist(f)%varid(1),'mdims', mdimsize)
- if(.not. associated(tape(t)%hlist(f)%field%mdims)) then
- allocate(tape(t)%hlist(f)%field%mdims(mdimsize))
- end if
- ierr=pio_get_att(tape(t)%File,tape(t)%hlist(f)%varid(1),'mdims', &
- tape(t)%hlist(f)%field%mdims(1:mdimsize))
- if(mdimsize > int(maxvarmdims, kind=pio_offset_kind)) then
- maxvarmdims = int(mdimsize)
- end if
- end if
+ if(.not. associated(tape(t)%hlist(fld)%varid)) then
+ if (associated(tape(t)%patches)) then
+ allocate(tape(t)%hlist(fld)%varid(size(tape(t)%patches)))
+ else
+ allocate(tape(t)%hlist(fld)%varid(1))
+ end if
+ end if
+ !
+ ! If this field will be put out as columns then get column names for field
+ !
+ if (associated(tape(t)%patches)) then
+ num_patches = size(tape(t)%patches)
+ fldname = strip_suffix(tape(t)%hlist(fld)%field%name)
+ do i = 1, num_patches
+ fname_tmp = trim(fldname)
+ call tape(t)%patches(i)%field_name(fname_tmp)
+ ierr = pio_inq_varid(tape(t)%Files(f), trim(fname_tmp), tape(t)%hlist(fld)%varid(i))
+ call cam_pio_handle_error(ierr, 'H_INQUIRE: Error getting ID for '//trim(fname_tmp))
+ ierr = pio_get_att(tape(t)%Files(f), tape(t)%hlist(fld)%varid(i), 'basename', basename)
+ call cam_pio_handle_error(ierr, 'H_INQUIRE: Error getting basename for '//trim(fname_tmp))
+ if (trim(fldname) /= trim(basename)) then
+ call endrun('H_INQUIRE: basename ('//trim(basename)//') does not match fldname ('//trim(fldname)//')')
+ end if
+ end do
+ else
+ fldname = tape(t)%hlist(fld)%field%name
+ ierr = pio_inq_varid(tape(t)%Files(f), trim(fldname), tape(t)%hlist(fld)%varid(1))
+ call cam_pio_handle_error(ierr, 'H_INQUIRE: Error getting ID for '//trim(fldname))
+ end if
+ if(tape(t)%hlist(fld)%field%numlev>1) then
+ ierr = pio_inq_attlen(tape(t)%Files(f),tape(t)%hlist(fld)%varid(1),'mdims', mdimsize)
+ if(.not. associated(tape(t)%hlist(fld)%field%mdims)) then
+ allocate(tape(t)%hlist(fld)%field%mdims(mdimsize))
+ end if
+ ierr=pio_get_att(tape(t)%Files(f),tape(t)%hlist(fld)%varid(1),'mdims', &
+ tape(t)%hlist(fld)%field%mdims(1:mdimsize))
+ if(mdimsize > int(maxvarmdims, kind=pio_offset_kind)) then
+ maxvarmdims = int(mdimsize)
+ end if
+ end if
+ end do
end do
-
if(masterproc) then
write(iulog,*)'H_INQUIRE: Successfully opened netcdf file '
end if
@@ -3834,15 +4180,16 @@ subroutine h_override (t)
type(master_entry), pointer :: listentry
-
avgflg = avgflag_pertape(t)
-
listentry=>masterlinkedlist
do while(associated(listentry))
- call AvgflagToString(avgflg, listentry%time_op(t))
- listentry%avgflag(t) = avgflag_pertape(t)
- listentry=>listentry%next_entry
+ ! Budgets require flag to be N, dont override
+ if (listentry%avgflag(t) /= 'N' ) then
+ call AvgflagToString(avgflg, listentry%time_op(t))
+ listentry%avgflag(t) = avgflag_pertape(t)
+ end if
+ listentry=>listentry%next_entry
end do
end subroutine h_override
@@ -3858,7 +4205,7 @@ subroutine h_define (t, restart)
! Method: Issue the required netcdf wrapper calls to define the history file contents
!
!-----------------------------------------------------------------------
- use phys_control, only: phys_getopts
+ use phys_control, only: phys_getopts
use cam_grid_support, only: cam_grid_header_info_t
use cam_grid_support, only: cam_grid_write_attr, cam_grid_write_var
use time_manager, only: get_step_size, get_ref_date, timemgr_get_calendar_cf
@@ -3877,9 +4224,9 @@ subroutine h_define (t, restart)
!
! Local workspace
!
- integer :: i, j ! longitude, latitude indices
+ integer :: i, j, f ! longitude, latitude, file indices
integer :: grd ! indices for looping through grids
- integer :: f ! field index
+ integer :: fld ! field index
integer :: ncreal ! real data type for output
integer :: dtime ! timestep size
integer :: sec_nhtfrq ! nhtfrq converted to seconds
@@ -3934,6 +4281,7 @@ subroutine h_define (t, restart)
character(len=32) :: cam_take_snapshot_before
character(len=32) :: cam_take_snapshot_after
+
call phys_getopts(cam_take_snapshot_before_out= cam_take_snapshot_before, &
cam_take_snapshot_after_out = cam_take_snapshot_after, &
cam_snapshot_before_num_out = cam_snapshot_before_num, &
@@ -3944,34 +4292,50 @@ subroutine h_define (t, restart)
if(masterproc) write(iulog,*)'Opening netcdf history restart file ', trim(hrestpath(t))
else
tape => history_tape
- if(masterproc) write(iulog,*)'Opening netcdf history file ', trim(nhfil(t))
+ if(masterproc) then
+ if (hfile_accum(t)) then
+ ! We have an accumulated file in addition to the instantaneous
+ write(iulog,*)'Opening netcdf history files ', trim(nhfil(t,accumulated_file_index)), &
+ ' ', trim(nhfil(t,instantaneous_file_index))
+ else
+ ! We just have the instantaneous file
+ write(iulog,*)'Opening instantaneous netcdf history file ', trim(nhfil(t,instantaneous_file_index))
+ end if
+ end if
end if
amode = PIO_CLOBBER
if(restart) then
- call cam_pio_createfile (tape(t)%File, hrestpath(t), amode)
+ call cam_pio_createfile (tape(t)%Files(restart_file_index), hrestpath(t), amode)
+ else if (is_initfile(file_index=t) .or. is_satfile(t)) then
+ call cam_pio_createfile (tape(t)%Files(sat_file_index), nhfil(t,sat_file_index), amode)
else
- call cam_pio_createfile (tape(t)%File, nhfil(t), amode)
+ ! figure out how many history files to generate for this tape
+ ! Always create the instantaneous file
+ call cam_pio_createfile (tape(t)%Files(instantaneous_file_index), nhfil(t,instantaneous_file_index), amode)
+ if (hfile_accum(t)) then
+ ! Conditionally create the accumulated file
+ call cam_pio_createfile (tape(t)%Files(accumulated_file_index), nhfil(t,accumulated_file_index), amode)
+ end if
end if
if(is_satfile(t)) then
interpolate = .false. ! !!XXgoldyXX: Do we ever want to support this?
patch_output = .false.
- call cam_pio_def_dim(tape(t)%File, 'ncol', pio_unlimited, timdim)
- call cam_pio_def_dim(tape(t)%File, 'nbnd', 2, bnddim)
+ call cam_pio_def_dim(tape(t)%Files(sat_file_index), 'ncol', pio_unlimited, timdim)
+ call cam_pio_def_dim(tape(t)%Files(sat_file_index), 'nbnd', 2, bnddim)
allocate(latvar(1), lonvar(1))
allocate(latvar(1)%vd, lonvar(1)%vd)
- call cam_pio_def_var(tape(t)%File, 'lat', pio_double, (/timdim/), &
+ call cam_pio_def_var(tape(t)%Files(sat_file_index), 'lat', pio_double, (/timdim/), &
latvar(1)%vd)
- ierr=pio_put_att (tape(t)%File, latvar(1)%vd, 'long_name', 'latitude')
- ierr=pio_put_att (tape(t)%File, latvar(1)%vd, 'units', 'degrees_north')
+ ierr=pio_put_att (tape(t)%Files(sat_file_index), latvar(1)%vd, 'long_name', 'latitude')
+ ierr=pio_put_att (tape(t)%Files(sat_file_index), latvar(1)%vd, 'units', 'degrees_north')
- call cam_pio_def_var(tape(t)%File, 'lon', pio_double, (/timdim/), &
+ call cam_pio_def_var(tape(t)%Files(sat_file_index), 'lon', pio_double, (/timdim/), &
lonvar(1)%vd)
- ierr=pio_put_att (tape(t)%File, lonvar(1)%vd,'long_name','longitude')
- ierr=pio_put_att (tape(t)%File, lonvar(1)%vd,'units','degrees_east')
-
+ ierr=pio_put_att (tape(t)%Files(sat_file_index), lonvar(1)%vd,'long_name','longitude')
+ ierr=pio_put_att (tape(t)%Files(sat_file_index), lonvar(1)%vd,'units','degrees_east')
else
!
! Setup netcdf file - create the dimensions of lat,lon,time,level
@@ -3984,7 +4348,11 @@ subroutine h_define (t, restart)
! Interpolation is special in that we ignore the native grids
if(interpolate) then
allocate(header_info(1))
- call cam_grid_write_attr(tape(t)%File, interpolate_info(t)%grid_id, header_info(1))
+ do f = 1, maxsplitfiles
+ if (pio_file_is_open(tape(t)%Files(f))) then
+ call cam_grid_write_attr(tape(t)%Files(f), interpolate_info(t)%grid_id, header_info(1), file_index=f)
+ end if
+ end do
else if (patch_output) then
! We are doing patch (column) output
if (allocated(header_info)) then
@@ -3992,91 +4360,42 @@ subroutine h_define (t, restart)
call endrun('H_DEFINE: header_info should not be allocated for patch output')
end if
do i = 1, size(tape(t)%patches)
- call tape(t)%patches(i)%write_attrs(tape(t)%File)
+ do f = 1, maxsplitfiles
+ if (pio_file_is_open(tape(t)%Files(f))) then
+ call tape(t)%patches(i)%write_attrs(tape(t)%Files(f))
+ end if
+ end do
end do
else
allocate(header_info(size(tape(t)%grid_ids)))
do i = 1, size(tape(t)%grid_ids)
- call cam_grid_write_attr(tape(t)%File, tape(t)%grid_ids(i), header_info(i))
+ do f = 1, maxsplitfiles
+ if (pio_file_is_open(tape(t)%Files(f))) then
+ call cam_grid_write_attr(tape(t)%Files(f), tape(t)%grid_ids(i), header_info(i), file_index=f)
+ end if
+ end do
end do
end if ! interpolate
-
! Define the unlimited time dim
- call cam_pio_def_dim(tape(t)%File, 'time', pio_unlimited, timdim)
- call cam_pio_def_dim(tape(t)%File, 'nbnd', 2, bnddim, existOK=.true.)
- call cam_pio_def_dim(tape(t)%File, 'chars', 8, chardim)
+ do f = 1, maxsplitfiles
+ if (pio_file_is_open(tape(t)%Files(f))) then
+ call cam_pio_def_dim(tape(t)%Files(f), 'time', pio_unlimited, timdim)
+ call cam_pio_def_dim(tape(t)%Files(f), 'nbnd', 2, bnddim, existOK=.true.)
+ call cam_pio_def_dim(tape(t)%Files(f), 'chars', 8, chardim)
+ end if
+ end do
end if ! is satfile
- ! Store snapshot location
- if (t == cam_snapshot_before_num) then
- ierr=pio_put_att(tape(t)%File, PIO_GLOBAL, 'cam_snapshot_before', &
- trim(cam_take_snapshot_before))
- end if
- if (t == cam_snapshot_after_num) then
- ierr=pio_put_att(tape(t)%File, PIO_GLOBAL, 'cam_snapshot_after', &
- trim(cam_take_snapshot_after))
- end if
-
- ! Populate the history coordinate (well, mdims anyway) attributes
- ! This routine also allocates the mdimids array
- call write_hist_coord_attrs(tape(t)%File, bnddim, mdimids, restart)
-
call get_ref_date(yr, mon, day, nbsec)
nbdate = yr*10000 + mon*100 + day
- ierr=pio_def_var (tape(t)%File,'time',pio_double,(/timdim/),tape(t)%timeid)
- ierr=pio_put_att (tape(t)%File, tape(t)%timeid, 'long_name', 'time')
- str = 'days since ' // date2yyyymmdd(nbdate) // ' ' // sec2hms(nbsec)
- ierr=pio_put_att (tape(t)%File, tape(t)%timeid, 'units', trim(str))
-
calendar = timemgr_get_calendar_cf()
- ierr=pio_put_att (tape(t)%File, tape(t)%timeid, 'calendar', trim(calendar))
-
-
- ierr=pio_def_var (tape(t)%File,'date ',pio_int,(/timdim/),tape(t)%dateid)
- str = 'current date (YYYYMMDD)'
- ierr=pio_put_att (tape(t)%File, tape(t)%dateid, 'long_name', trim(str))
-
-
- ierr=pio_def_var (tape(t)%File,'datesec ',pio_int,(/timdim/), tape(t)%datesecid)
- str = 'current seconds of current date'
- ierr=pio_put_att (tape(t)%File, tape(t)%datesecid, 'long_name', trim(str))
-
- !
- ! Character header information
- !
- str = 'CF-1.0'
- ierr=pio_put_att (tape(t)%File, PIO_GLOBAL, 'Conventions', trim(str))
- ierr=pio_put_att (tape(t)%File, PIO_GLOBAL, 'source', 'CAM')
-#if ( defined BFB_CAM_SCAM_IOP )
- ierr=pio_put_att (tape(t)%File, PIO_GLOBAL, 'CAM_GENERATED_FORCING','create SCAM IOP dataset')
-#endif
- ierr=pio_put_att (tape(t)%File, PIO_GLOBAL, 'case',caseid)
- ierr=pio_put_att (tape(t)%File, PIO_GLOBAL, 'logname',logname)
- ierr=pio_put_att (tape(t)%File, PIO_GLOBAL, 'host', host)
-
-! Put these back in when they are filled properly
-! ierr=pio_put_att (tape(t)%File, PIO_GLOBAL, 'title',ctitle)
-! ierr= pio_put_att (tape(t)%File, PIO_GLOBAL, 'Version', &
-! '$Name$')
-! ierr= pio_put_att (tape(t)%File, PIO_GLOBAL, 'revision_Id', &
-! '$Id$')
-
- ierr=pio_put_att (tape(t)%File, PIO_GLOBAL, 'initial_file', ncdata)
- ierr=pio_put_att (tape(t)%File, PIO_GLOBAL, 'topography_file', bnd_topo)
- if (len_trim(model_doi_url) > 0) then
- ierr=pio_put_att (tape(t)%File, PIO_GLOBAL, 'model_doi_url', model_doi_url)
- end if
-
! Determine what time period frequency is being output for each file
! Note that nhtfrq is now in timesteps
-
sec_nhtfrq = nhtfrq(t)
-
! If nhtfrq is in hours, convert to seconds
if (nhtfrq(t) < 0) then
sec_nhtfrq = abs(nhtfrq(t))*3600
end if
-
dtime = get_step_size()
if (sec_nhtfrq == 0) then !month
time_per_freq = 'month_1'
@@ -4090,412 +4409,495 @@ subroutine h_define (t, restart)
write(time_per_freq,999) 'second_',sec_nhtfrq*dtime
end if
999 format(a,i0)
+ do f = 1, maxsplitfiles
+ if (.not. pio_file_is_open(tape(t)%Files(f))) then
+ cycle
+ end if
+ ! Store snapshot location
+ if (t == cam_snapshot_before_num) then
+ ierr=pio_put_att(tape(t)%Files(f), PIO_GLOBAL, 'cam_snapshot_before', &
+ trim(cam_take_snapshot_before))
+ end if
+ if (t == cam_snapshot_after_num) then
+ ierr=pio_put_att(tape(t)%Files(f), PIO_GLOBAL, 'cam_snapshot_after', &
+ trim(cam_take_snapshot_after))
+ end if
- ierr=pio_put_att (tape(t)%File, PIO_GLOBAL, 'time_period_freq', trim(time_per_freq))
-
- if(.not. is_satfile(t)) then
+ ! Populate the history coordinate (well, mdims anyway) attributes
+ ! This routine also allocates the mdimids array
+ call write_hist_coord_attrs(tape(t)%Files(f), bnddim, mdimids, restart)
- ierr=pio_put_att (tape(t)%File, tape(t)%timeid, 'bounds', 'time_bnds')
+ ierr=pio_def_var (tape(t)%Files(f),'time',pio_double,(/timdim/),tape(t)%timeid)
- ierr=pio_def_var (tape(t)%File,'time_bnds',pio_double,(/bnddim,timdim/),tape(t)%tbndid)
- ierr=pio_put_att (tape(t)%File, tape(t)%tbndid, 'long_name', 'time interval endpoints')
- !
- ! Character
- !
- dimenchar(1) = chardim
- dimenchar(2) = timdim
- ierr=pio_def_var (tape(t)%File,'date_written',PIO_CHAR,dimenchar, tape(t)%date_writtenid)
- ierr=pio_def_var (tape(t)%File,'time_written',PIO_CHAR,dimenchar, tape(t)%time_writtenid)
- !
- ! Integer Header
- !
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%timeid, 'long_name', 'time')
+ str = 'days since ' // date2yyyymmdd(nbdate) // ' ' // sec2hms(nbsec)
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%timeid, 'units', trim(str))
- ierr=pio_def_var (tape(t)%File,'ndbase',PIO_INT,tape(t)%ndbaseid)
- str = 'base day'
- ierr=pio_put_att (tape(t)%File, tape(t)%ndbaseid, 'long_name', trim(str))
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%timeid, 'calendar', trim(calendar))
- ierr=pio_def_var (tape(t)%File,'nsbase',PIO_INT,tape(t)%nsbaseid)
- str = 'seconds of base day'
- ierr=pio_put_att (tape(t)%File, tape(t)%nsbaseid, 'long_name', trim(str))
+ ierr=pio_def_var (tape(t)%Files(f),'date ',pio_int,(/timdim/),tape(t)%dateid)
+ str = 'current date (YYYYMMDD)'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%dateid, 'long_name', trim(str))
- ierr=pio_def_var (tape(t)%File,'nbdate',PIO_INT,tape(t)%nbdateid)
- str = 'base date (YYYYMMDD)'
- ierr=pio_put_att (tape(t)%File, tape(t)%nbdateid, 'long_name', trim(str))
+ ierr=pio_def_var (tape(t)%Files(f),'datesec ',pio_int,(/timdim/), tape(t)%datesecid)
+ str = 'current seconds of current date'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%datesecid, 'long_name', trim(str))
+ !
+ ! Character header information
+ !
+ str = 'CF-1.0'
+ ierr=pio_put_att (tape(t)%Files(f), PIO_GLOBAL, 'Conventions', trim(str))
+ ierr=pio_put_att (tape(t)%Files(f), PIO_GLOBAL, 'source', 'CAM')
#if ( defined BFB_CAM_SCAM_IOP )
- ierr=pio_def_var (tape(t)%File,'bdate',PIO_INT,tape(t)%bdateid)
- str = 'base date (YYYYMMDD)'
- ierr=pio_put_att (tape(t)%File, tape(t)%bdateid, 'long_name', trim(str))
+ ierr=pio_put_att (tape(t)%Files(f), PIO_GLOBAL, 'CAM_GENERATED_FORCING','create SCAM IOP dataset')
#endif
- ierr=pio_def_var (tape(t)%File,'nbsec',PIO_INT,tape(t)%nbsecid)
- str = 'seconds of base date'
- ierr=pio_put_att (tape(t)%File, tape(t)%nbsecid, 'long_name', trim(str))
+ ierr=pio_put_att (tape(t)%Files(f), PIO_GLOBAL, 'case',caseid)
+ ierr=pio_put_att (tape(t)%Files(f), PIO_GLOBAL, 'logname',logname)
+ ierr=pio_put_att (tape(t)%Files(f), PIO_GLOBAL, 'host', host)
+
+ ierr=pio_put_att (tape(t)%Files(f), PIO_GLOBAL, 'initial_file', ncdata)
+ ierr=pio_put_att (tape(t)%Files(f), PIO_GLOBAL, 'topography_file', bnd_topo)
+ if (len_trim(model_doi_url) > 0) then
+ ierr=pio_put_att (tape(t)%Files(f), PIO_GLOBAL, 'model_doi_url', model_doi_url)
+ end if
- ierr=pio_def_var (tape(t)%File,'mdt',PIO_INT,tape(t)%mdtid)
- ierr=pio_put_att (tape(t)%File, tape(t)%mdtid, 'long_name', 'timestep')
- ierr=pio_put_att (tape(t)%File, tape(t)%mdtid, 'units', 's')
+ ierr=pio_put_att (tape(t)%Files(f), PIO_GLOBAL, 'time_period_freq', trim(time_per_freq))
- !
- ! Create variables for model timing and header information
- !
+ if(.not. is_satfile(t)) then
- ierr=pio_def_var (tape(t)%File,'ndcur ',pio_int,(/timdim/),tape(t)%ndcurid)
- str = 'current day (from base day)'
- ierr=pio_put_att (tape(t)%File, tape(t)%ndcurid, 'long_name', trim(str))
-
- ierr=pio_def_var (tape(t)%File,'nscur ',pio_int,(/timdim/),tape(t)%nscurid)
- str = 'current seconds of current day'
- ierr=pio_put_att (tape(t)%File, tape(t)%nscurid, 'long_name', trim(str))
-
-
- if (.not. is_initfile(file_index=t)) then
- ! Don't write the GHG/Solar forcing data to the IC file.
- ierr=pio_def_var (tape(t)%File,'co2vmr ',pio_double,(/timdim/),tape(t)%co2vmrid)
- str = 'co2 volume mixing ratio'
- ierr=pio_put_att (tape(t)%File, tape(t)%co2vmrid, 'long_name', trim(str))
-
- ierr=pio_def_var (tape(t)%File,'ch4vmr ',pio_double,(/timdim/),tape(t)%ch4vmrid)
- str = 'ch4 volume mixing ratio'
- ierr=pio_put_att (tape(t)%File, tape(t)%ch4vmrid, 'long_name', trim(str))
-
- ierr=pio_def_var (tape(t)%File,'n2ovmr ',pio_double,(/timdim/),tape(t)%n2ovmrid)
- str = 'n2o volume mixing ratio'
- ierr=pio_put_att (tape(t)%File, tape(t)%n2ovmrid, 'long_name', trim(str))
-
- ierr=pio_def_var (tape(t)%File,'f11vmr ',pio_double,(/timdim/),tape(t)%f11vmrid)
- str = 'f11 volume mixing ratio'
- ierr=pio_put_att (tape(t)%File, tape(t)%f11vmrid, 'long_name', trim(str))
-
- ierr=pio_def_var (tape(t)%File,'f12vmr ',pio_double,(/timdim/),tape(t)%f12vmrid)
- str = 'f12 volume mixing ratio'
- ierr=pio_put_att (tape(t)%File, tape(t)%f12vmrid, 'long_name', trim(str))
-
- ierr=pio_def_var (tape(t)%File,'sol_tsi ',pio_double,(/timdim/),tape(t)%sol_tsiid)
- str = 'total solar irradiance'
- ierr=pio_put_att (tape(t)%File, tape(t)%sol_tsiid, 'long_name', trim(str))
- str = 'W/m2'
- ierr=pio_put_att (tape(t)%File, tape(t)%sol_tsiid, 'units', trim(str))
-
- if (solar_parms_on) then
- ! solar / geomagetic activity indices...
- ierr=pio_def_var (tape(t)%File,'f107',pio_double,(/timdim/),tape(t)%f107id)
- str = '10.7 cm solar radio flux (F10.7)'
- ierr=pio_put_att (tape(t)%File, tape(t)%f107id, 'long_name', trim(str))
- str = '10^-22 W m^-2 Hz^-1'
- ierr=pio_put_att (tape(t)%File, tape(t)%f107id, 'units', trim(str))
-
- ierr=pio_def_var (tape(t)%File,'f107a',pio_double,(/timdim/),tape(t)%f107aid)
- str = '81-day centered mean of 10.7 cm solar radio flux (F10.7)'
- ierr=pio_put_att (tape(t)%File, tape(t)%f107aid, 'long_name', trim(str))
-
- ierr=pio_def_var (tape(t)%File,'f107p',pio_double,(/timdim/),tape(t)%f107pid)
- str = 'Pervious day 10.7 cm solar radio flux (F10.7)'
- ierr=pio_put_att (tape(t)%File, tape(t)%f107pid, 'long_name', trim(str))
-
- ierr=pio_def_var (tape(t)%File,'kp',pio_double,(/timdim/),tape(t)%kpid)
- str = 'Daily planetary K geomagnetic index'
- ierr=pio_put_att (tape(t)%File, tape(t)%kpid, 'long_name', trim(str))
-
- ierr=pio_def_var (tape(t)%File,'ap',pio_double,(/timdim/),tape(t)%apid)
- str = 'Daily planetary A geomagnetic index'
- ierr=pio_put_att (tape(t)%File, tape(t)%apid, 'long_name', trim(str))
- endif
- if (solar_wind_on) then
-
- ierr=pio_def_var (tape(t)%File,'byimf',pio_double,(/timdim/),tape(t)%byimfid)
- str = 'Y component of the interplanetary magnetic field'
- ierr=pio_put_att (tape(t)%File, tape(t)%byimfid, 'long_name', trim(str))
- str = 'nT'
- ierr=pio_put_att (tape(t)%File, tape(t)%byimfid, 'units', trim(str))
-
- ierr=pio_def_var (tape(t)%File,'bzimf',pio_double,(/timdim/),tape(t)%bzimfid)
- str = 'Z component of the interplanetary magnetic field'
- ierr=pio_put_att (tape(t)%File, tape(t)%bzimfid, 'long_name', trim(str))
- str = 'nT'
- ierr=pio_put_att (tape(t)%File, tape(t)%bzimfid, 'units', trim(str))
-
- ierr=pio_def_var (tape(t)%File,'swvel',pio_double,(/timdim/),tape(t)%swvelid)
- str = 'Solar wind speed'
- ierr=pio_put_att (tape(t)%File, tape(t)%swvelid, 'long_name', trim(str))
- str = 'km/sec'
- ierr=pio_put_att (tape(t)%File, tape(t)%swvelid, 'units', trim(str))
-
- ierr=pio_def_var (tape(t)%File,'swden',pio_double,(/timdim/),tape(t)%swdenid)
- str = 'Solar wind ion number density'
- ierr=pio_put_att (tape(t)%File, tape(t)%swdenid, 'long_name', trim(str))
- str = 'cm-3'
- ierr=pio_put_att (tape(t)%File, tape(t)%swdenid, 'units', trim(str))
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%timeid, 'bounds', 'time_bounds')
- endif
- if (epot_active) then
- ierr=pio_def_var (tape(t)%File,'colat_crit1',pio_double,(/timdim/),tape(t)%colat_crit1_id)
- ierr=pio_put_att (tape(t)%File, tape(t)%colat_crit1_id, 'long_name', &
- 'First co-latitude of electro-potential critical angle')
- ierr=pio_put_att (tape(t)%File, tape(t)%colat_crit1_id, 'units', 'degrees')
-
- ierr=pio_def_var (tape(t)%File,'colat_crit2',pio_double,(/timdim/),tape(t)%colat_crit2_id)
- ierr=pio_put_att (tape(t)%File, tape(t)%colat_crit2_id, 'long_name',&
- 'Second co-latitude of electro-potential critical angle')
- ierr=pio_put_att (tape(t)%File, tape(t)%colat_crit2_id, 'units', 'degrees')
- endif
- end if
+ ierr=pio_def_var (tape(t)%Files(f),'time_bounds',pio_double,(/bnddim,timdim/),tape(t)%tbndid)
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%tbndid, 'long_name', 'time interval endpoints')
+ str = 'days since ' // date2yyyymmdd(nbdate) // ' ' // sec2hms(nbsec)
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%tbndid, 'units', trim(str))
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%tbndid, 'calendar', trim(calendar))
+ !
+ ! Character
+ !
+ dimenchar(1) = chardim
+ dimenchar(2) = timdim
+ ierr=pio_def_var (tape(t)%Files(f),'date_written',PIO_CHAR,dimenchar, tape(t)%date_writtenid)
+ ierr=pio_def_var (tape(t)%Files(f),'time_written',PIO_CHAR,dimenchar, tape(t)%time_writtenid)
+ !
+ ! Integer Header
+ !
+ ierr=pio_def_var (tape(t)%Files(f),'ndbase',PIO_INT,tape(t)%ndbaseid)
+ str = 'base day'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%ndbaseid, 'long_name', trim(str))
-#if ( defined BFB_CAM_SCAM_IOP )
- ierr=pio_def_var (tape(t)%File,'tsec ',pio_int,(/timdim/), tape(t)%tsecid)
- str = 'current seconds of current date needed for scam'
- ierr=pio_put_att (tape(t)%File, tape(t)%tsecid, 'long_name', trim(str))
-#endif
- ierr=pio_def_var (tape(t)%File,'nsteph ',pio_int,(/timdim/),tape(t)%nstephid)
- str = 'current timestep'
- ierr=pio_put_att (tape(t)%File, tape(t)%nstephid, 'long_name', trim(str))
- end if ! .not. is_satfile
+ ierr=pio_def_var (tape(t)%Files(f),'nsbase',PIO_INT,tape(t)%nsbaseid)
+ str = 'seconds of base day'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%nsbaseid, 'long_name', trim(str))
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !
- ! Create variables and attributes for field list
- !
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ ierr=pio_def_var (tape(t)%Files(f),'nbdate',PIO_INT,tape(t)%nbdateid)
+ str = 'base date (YYYYMMDD)'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%nbdateid, 'long_name', trim(str))
- do f = 1, nflds(t)
+#if ( defined BFB_CAM_SCAM_IOP )
+ ierr=pio_def_var (tape(t)%Files(f),'bdate',PIO_INT,tape(t)%bdateid)
+ str = 'base date (YYYYMMDD)'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%bdateid, 'long_name', trim(str))
+#endif
+ ierr=pio_def_var (tape(t)%Files(f),'nbsec',PIO_INT,tape(t)%nbsecid)
+ str = 'seconds of base date'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%nbsecid, 'long_name', trim(str))
+
+ ierr=pio_def_var (tape(t)%Files(f),'mdt',PIO_INT,tape(t)%mdtid)
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%mdtid, 'long_name', 'timestep')
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%mdtid, 'units', 's')
+
+ !
+ ! Create variables for model timing and header information
+ !
+ if (f == instantaneous_file_index) then
+ ierr=pio_def_var (tape(t)%Files(f),'ndcur ',pio_int,(/timdim/),tape(t)%ndcurid)
+ str = 'current day (from base day)'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%ndcurid, 'long_name', trim(str))
+ ierr=pio_def_var (tape(t)%Files(f),'nscur ',pio_int,(/timdim/),tape(t)%nscurid)
+ str = 'current seconds of current day'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%nscurid, 'long_name', trim(str))
+ end if
- !! Collect some field properties
- call AvgflagToString(tape(t)%hlist(f)%avgflag, tape(t)%hlist(f)%time_op)
- if ((tape(t)%hlist(f)%hwrt_prec == 8) .or. restart) then
- ncreal = pio_double
- else
- ncreal = pio_real
- end if
- if(associated(tape(t)%hlist(f)%field%mdims)) then
- mdims => tape(t)%hlist(f)%field%mdims
- mdimsize = size(mdims)
- else if(tape(t)%hlist(f)%field%numlev > 1) then
- call endrun('mdims not defined for variable '//trim(tape(t)%hlist(f)%field%name))
- else
- mdimsize=0
- end if
+ if (.not. is_initfile(file_index=t) .and. f == instantaneous_file_index) then
+ ! Don't write the GHG/Solar forcing data to the IC file.
+ ! Only write the GHG/Solar forcing data to the instantaneous file
+ ierr=pio_def_var (tape(t)%Files(f),'co2vmr ',pio_double,(/timdim/),tape(t)%co2vmrid)
+ str = 'co2 volume mixing ratio'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%co2vmrid, 'long_name', trim(str))
+
+ ierr=pio_def_var (tape(t)%Files(f),'ch4vmr ',pio_double,(/timdim/),tape(t)%ch4vmrid)
+ str = 'ch4 volume mixing ratio'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%ch4vmrid, 'long_name', trim(str))
+
+ ierr=pio_def_var (tape(t)%Files(f),'n2ovmr ',pio_double,(/timdim/),tape(t)%n2ovmrid)
+ str = 'n2o volume mixing ratio'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%n2ovmrid, 'long_name', trim(str))
+
+ ierr=pio_def_var (tape(t)%Files(f),'f11vmr ',pio_double,(/timdim/),tape(t)%f11vmrid)
+ str = 'f11 volume mixing ratio'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%f11vmrid, 'long_name', trim(str))
+
+ ierr=pio_def_var (tape(t)%Files(f),'f12vmr ',pio_double,(/timdim/),tape(t)%f12vmrid)
+ str = 'f12 volume mixing ratio'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%f12vmrid, 'long_name', trim(str))
+
+ ierr=pio_def_var (tape(t)%Files(f),'sol_tsi ',pio_double,(/timdim/),tape(t)%sol_tsiid)
+ str = 'total solar irradiance'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%sol_tsiid, 'long_name', trim(str))
+ str = 'W/m2'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%sol_tsiid, 'units', trim(str))
+
+ if (solar_parms_on) then
+ ! solar / geomagnetic activity indices...
+ ierr=pio_def_var (tape(t)%Files(f),'f107',pio_double,(/timdim/),tape(t)%f107id)
+ str = '10.7 cm solar radio flux (F10.7)'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%f107id, 'long_name', trim(str))
+ str = '10^-22 W m^-2 Hz^-1'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%f107id, 'units', trim(str))
+
+ ierr=pio_def_var (tape(t)%Files(f),'f107a',pio_double,(/timdim/),tape(t)%f107aid)
+ str = '81-day centered mean of 10.7 cm solar radio flux (F10.7)'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%f107aid, 'long_name', trim(str))
+
+ ierr=pio_def_var (tape(t)%Files(f),'f107p',pio_double,(/timdim/),tape(t)%f107pid)
+ str = 'Pervious day 10.7 cm solar radio flux (F10.7)'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%f107pid, 'long_name', trim(str))
+
+ ierr=pio_def_var (tape(t)%Files(f),'kp',pio_double,(/timdim/),tape(t)%kpid)
+ str = 'Daily planetary K geomagnetic index'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%kpid, 'long_name', trim(str))
+
+ ierr=pio_def_var (tape(t)%Files(f),'ap',pio_double,(/timdim/),tape(t)%apid)
+ str = 'Daily planetary A geomagnetic index'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%apid, 'long_name', trim(str))
+ endif
+ if (solar_wind_on) then
+
+ ierr=pio_def_var (tape(t)%Files(f),'byimf',pio_double,(/timdim/),tape(t)%byimfid)
+ str = 'Y component of the interplanetary magnetic field'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%byimfid, 'long_name', trim(str))
+ str = 'nT'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%byimfid, 'units', trim(str))
+
+ ierr=pio_def_var (tape(t)%Files(f),'bzimf',pio_double,(/timdim/),tape(t)%bzimfid)
+ str = 'Z component of the interplanetary magnetic field'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%bzimfid, 'long_name', trim(str))
+ str = 'nT'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%bzimfid, 'units', trim(str))
+
+ ierr=pio_def_var (tape(t)%Files(f),'swvel',pio_double,(/timdim/),tape(t)%swvelid)
+ str = 'Solar wind speed'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%swvelid, 'long_name', trim(str))
+ str = 'km/sec'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%swvelid, 'units', trim(str))
+
+ ierr=pio_def_var (tape(t)%Files(f),'swden',pio_double,(/timdim/),tape(t)%swdenid)
+ str = 'Solar wind ion number density'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%swdenid, 'long_name', trim(str))
+ str = 'cm-3'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%swdenid, 'units', trim(str))
+
+ endif
+ if (epot_active) then
+ ierr=pio_def_var (tape(t)%Files(f),'colat_crit1',pio_double,(/timdim/),tape(t)%colat_crit1_id)
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%colat_crit1_id, 'long_name', &
+ 'First co-latitude of electro-potential critical angle')
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%colat_crit1_id, 'units', 'degrees')
+
+ ierr=pio_def_var (tape(t)%Files(f),'colat_crit2',pio_double,(/timdim/),tape(t)%colat_crit2_id)
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%colat_crit2_id, 'long_name',&
+ 'Second co-latitude of electro-potential critical angle')
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%colat_crit2_id, 'units', 'degrees')
+ endif
+ end if
- ! num_patches will loop through the number of patches (or just one
- ! for the whole grid) for this field for this tape
- if (patch_output) then
- num_patches = size(tape(t)%patches)
- else
- num_patches = 1
- end if
- if(.not.associated(tape(t)%hlist(f)%varid)) then
- allocate(tape(t)%hlist(f)%varid(num_patches))
- end if
- fname_tmp = strip_suffix(tape(t)%hlist(f)%field%name)
-
- if(is_satfile(t)) then
- num_hdims=0
- nfils(t)=1
- call sat_hist_define(tape(t)%File)
- else if (interpolate) then
- ! Interpolate can't use normal grid code since we are forcing fields
- ! to use interpolate decomp
- if (.not. allocated(header_info)) then
- ! Safety check
- call endrun('h_define: header_info not allocated')
- end if
- num_hdims = 2
- do i = 1, num_hdims
- dimindex(i) = header_info(1)%get_hdimid(i)
- nacsdims(i) = header_info(1)%get_hdimid(i)
- end do
- else if (patch_output) then
- ! All patches for this variable should be on the same grid
- num_hdims = tape(t)%patches(1)%num_hdims(tape(t)%hlist(f)%field%decomp_type)
- else
- ! Normal grid output
- ! Find appropriate grid in header_info
- if (.not. allocated(header_info)) then
- ! Safety check
- call endrun('h_define: header_info not allocated')
- end if
- grd = -1
- do i = 1, size(header_info)
- if (header_info(i)%get_gridid() == tape(t)%hlist(f)%field%decomp_type) then
- grd = i
- exit
- end if
- end do
- if (grd < 0) then
- write(errormsg, '(a,i0,2a)') 'grid, ',tape(t)%hlist(f)%field%decomp_type,', not found for ',trim(fname_tmp)
- call endrun('H_DEFINE: '//errormsg)
- end if
- num_hdims = header_info(grd)%num_hdims()
- do i = 1, num_hdims
- dimindex(i) = header_info(grd)%get_hdimid(i)
- nacsdims(i) = header_info(grd)%get_hdimid(i)
- end do
- end if ! is_satfile
+ if (f == instantaneous_file_index) then
+#if ( defined BFB_CAM_SCAM_IOP )
+ ierr=pio_def_var (tape(t)%Files(f),'tsec ',pio_int,(/timdim/), tape(t)%tsecid)
+ str = 'current seconds of current date needed for scam'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%tsecid, 'long_name', trim(str))
+#endif
+ ierr=pio_def_var (tape(t)%Files(f),'nsteph ',pio_int,(/timdim/),tape(t)%nstephid)
+ str = 'current timestep'
+ ierr=pio_put_att (tape(t)%Files(f), tape(t)%nstephid, 'long_name', trim(str))
+ end if
+ end if ! .not. is_satfile
+
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !
+ ! Create variables and attributes for field list
+ !
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+ do fld = 1, nflds(t)
+ if (.not. is_satfile(t) .and. .not. restart .and. .not. is_initfile(t)) then
+ if (f == accumulated_file_index) then
+ ! this is the accumulated file of a potentially split history tape - skip instantaneous fields
+ if (tape(t)%hlist(fld)%avgflag == 'I') then
+ cycle
+ end if
+ else
+ ! this is the instantaneous file of a potentially split history tape - skip accumulated fields
+ if (tape(t)%hlist(fld)%avgflag /= 'I') then
+ cycle
+ end if
+ end if
+ end if
+ !! Collect some field properties
+ call AvgflagToString(tape(t)%hlist(fld)%avgflag, tape(t)%hlist(fld)%time_op)
+ if ((tape(t)%hlist(fld)%hwrt_prec == 8) .or. restart) then
+ ncreal = pio_double
+ else
+ ncreal = pio_real
+ end if
- !
- ! Create variables and atributes for fields written out as columns
- !
+ if(associated(tape(t)%hlist(fld)%field%mdims)) then
+ mdims => tape(t)%hlist(fld)%field%mdims
+ mdimsize = size(mdims)
+ else if(tape(t)%hlist(fld)%field%numlev > 1) then
+ call endrun('mdims not defined for variable '//trim(tape(t)%hlist(fld)%field%name))
+ else
+ mdimsize=0
+ end if
- do i = 1, num_patches
- fname_tmp = strip_suffix(tape(t)%hlist(f)%field%name)
- varid => tape(t)%hlist(f)%varid(i)
- dimids_tmp = dimindex
- ! Figure the dimension ID array for this field
- ! We have defined the horizontal grid dimensions in dimindex
- fdims = num_hdims
- do j = 1, mdimsize
- fdims = fdims + 1
- dimids_tmp(fdims) = mdimids(mdims(j))
- end do
- if(.not. restart) then
- ! Only add time dimension if this is not a restart history tape
- fdims = fdims + 1
- dimids_tmp(fdims) = timdim
- end if
- if (patch_output) then
- ! For patch output, we need new dimension IDs and a different name
- call tape(t)%patches(i)%get_var_data(fname_tmp, &
- dimids_tmp(1:fdims), tape(t)%hlist(f)%field%decomp_type)
- end if
- ! Define the variable
- call cam_pio_def_var(tape(t)%File, trim(fname_tmp), ncreal, &
- dimids_tmp(1:fdims), varid)
- if (mdimsize > 0) then
- ierr = pio_put_att(tape(t)%File, varid, 'mdims', mdims(1:mdimsize))
- call cam_pio_handle_error(ierr, 'h_define: cannot define mdims for '//trim(fname_tmp))
- end if
- str = tape(t)%hlist(f)%field%sampling_seq
- if (len_trim(str) > 0) then
- ierr = pio_put_att(tape(t)%File, varid, 'Sampling_Sequence', trim(str))
- call cam_pio_handle_error(ierr, 'h_define: cannot define Sampling_Sequence for '//trim(fname_tmp))
- end if
+ ! num_patches will loop through the number of patches (or just one
+ ! for the whole grid) for this field for this tape
+ if (patch_output) then
+ num_patches = size(tape(t)%patches)
+ else
+ num_patches = 1
+ end if
+ if(.not.associated(tape(t)%hlist(fld)%varid)) then
+ allocate(tape(t)%hlist(fld)%varid(num_patches))
+ end if
+ fname_tmp = strip_suffix(tape(t)%hlist(fld)%field%name)
+
+ if(is_satfile(t)) then
+ num_hdims=0
+ nfils(t)=1
+ call sat_hist_define(tape(t)%Files(f))
+ else if (interpolate) then
+ ! Interpolate can't use normal grid code since we are forcing fields
+ ! to use interpolate decomp
+ if (.not. allocated(header_info)) then
+ ! Safety check
+ call endrun('h_define: header_info not allocated')
+ end if
+ num_hdims = 2
+ do i = 1, num_hdims
+ dimindex(i) = header_info(1)%get_hdimid(i)
+ nacsdims(i) = header_info(1)%get_hdimid(i)
+ end do
+ else if (patch_output) then
+ ! All patches for this variable should be on the same grid
+ num_hdims = tape(t)%patches(1)%num_hdims(tape(t)%hlist(fld)%field%decomp_type)
+ else
+ ! Normal grid output
+ ! Find appropriate grid in header_info
+ if (.not. allocated(header_info)) then
+ ! Safety check
+ call endrun('h_define: header_info not allocated')
+ end if
+ grd = -1
+ do i = 1, size(header_info)
+ if (header_info(i)%get_gridid() == tape(t)%hlist(fld)%field%decomp_type) then
+ grd = i
+ exit
+ end if
+ end do
+ if (grd < 0) then
+ write(errormsg, '(a,i0,2a)') 'grid, ',tape(t)%hlist(fld)%field%decomp_type,', not found for ',trim(fname_tmp)
+ call endrun('H_DEFINE: '//errormsg)
+ end if
+ num_hdims = header_info(grd)%num_hdims()
+ do i = 1, num_hdims
+ dimindex(i) = header_info(grd)%get_hdimid(i)
+ nacsdims(i) = header_info(grd)%get_hdimid(i)
+ end do
+ end if ! is_satfile
+
+ !
+ ! Create variables and atributes for fields written out as columns
+ !
+
+ do i = 1, num_patches
+ fname_tmp = strip_suffix(tape(t)%hlist(fld)%field%name)
+ varid => tape(t)%hlist(fld)%varid(i)
+ dimids_tmp = dimindex
+ ! Figure the dimension ID array for this field
+ ! We have defined the horizontal grid dimensions in dimindex
+ fdims = num_hdims
+ do j = 1, mdimsize
+ fdims = fdims + 1
+ dimids_tmp(fdims) = mdimids(mdims(j))
+ end do
+ if(.not. restart) then
+ ! Only add time dimension if this is not a restart history tape
+ fdims = fdims + 1
+ dimids_tmp(fdims) = timdim
+ end if
+ if (patch_output) then
+ ! For patch output, we need new dimension IDs and a different name
+ call tape(t)%patches(i)%get_var_data(fname_tmp, &
+ dimids_tmp(1:fdims), tape(t)%hlist(fld)%field%decomp_type)
+ end if
+ ! Define the variable
+ call cam_pio_def_var(tape(t)%Files(f), trim(fname_tmp), ncreal, &
+ dimids_tmp(1:fdims), varid)
+ if (mdimsize > 0) then
+ ierr = pio_put_att(tape(t)%Files(f), varid, 'mdims', mdims(1:mdimsize))
+ call cam_pio_handle_error(ierr, 'h_define: cannot define mdims for '//trim(fname_tmp))
+ end if
+ str = tape(t)%hlist(fld)%field%sampling_seq
+ if (len_trim(str) > 0) then
+ ierr = pio_put_att(tape(t)%Files(f), varid, 'Sampling_Sequence', trim(str))
+ call cam_pio_handle_error(ierr, 'h_define: cannot define Sampling_Sequence for '//trim(fname_tmp))
+ end if
- if (tape(t)%hlist(f)%field%flag_xyfill) then
- ! Add both _FillValue and missing_value to cover expectations
- ! of various applications.
- ! The attribute type must match the data type.
- if ((tape(t)%hlist(f)%hwrt_prec == 8) .or. restart) then
- ierr = pio_put_att(tape(t)%File, varid, '_FillValue', &
- tape(t)%hlist(f)%field%fillvalue)
- call cam_pio_handle_error(ierr, &
- 'h_define: cannot define _FillValue for '//trim(fname_tmp))
- ierr = pio_put_att(tape(t)%File, varid, 'missing_value', &
- tape(t)%hlist(f)%field%fillvalue)
- call cam_pio_handle_error(ierr, &
- 'h_define: cannot define missing_value for '//trim(fname_tmp))
- else
- ierr = pio_put_att(tape(t)%File, varid, '_FillValue', &
- REAL(tape(t)%hlist(f)%field%fillvalue,r4))
- call cam_pio_handle_error(ierr, &
- 'h_define: cannot define _FillValue for '//trim(fname_tmp))
- ierr = pio_put_att(tape(t)%File, varid, 'missing_value', &
- REAL(tape(t)%hlist(f)%field%fillvalue,r4))
- call cam_pio_handle_error(ierr, &
- 'h_define: cannot define missing_value for '//trim(fname_tmp))
- end if
- end if
+ if (tape(t)%hlist(fld)%field%flag_xyfill) then
+ ! Add both _FillValue and missing_value to cover expectations
+ ! of various applications.
+ ! The attribute type must match the data type.
+ if ((tape(t)%hlist(fld)%hwrt_prec == 8) .or. restart) then
+ ierr = pio_put_att(tape(t)%Files(f), varid, '_FillValue', &
+ tape(t)%hlist(fld)%field%fillvalue)
+ call cam_pio_handle_error(ierr, &
+ 'h_define: cannot define _FillValue for '//trim(fname_tmp))
+ ierr = pio_put_att(tape(t)%Files(f), varid, 'missing_value', &
+ tape(t)%hlist(fld)%field%fillvalue)
+ call cam_pio_handle_error(ierr, &
+ 'h_define: cannot define missing_value for '//trim(fname_tmp))
+ else
+ ierr = pio_put_att(tape(t)%Files(f), varid, '_FillValue', &
+ REAL(tape(t)%hlist(fld)%field%fillvalue,r4))
+ call cam_pio_handle_error(ierr, &
+ 'h_define: cannot define _FillValue for '//trim(fname_tmp))
+ ierr = pio_put_att(tape(t)%Files(f), varid, 'missing_value', &
+ REAL(tape(t)%hlist(fld)%field%fillvalue,r4))
+ call cam_pio_handle_error(ierr, &
+ 'h_define: cannot define missing_value for '//trim(fname_tmp))
+ end if
+ end if
- str = tape(t)%hlist(f)%field%units
- if (len_trim(str) > 0) then
- ierr=pio_put_att (tape(t)%File, varid, 'units', trim(str))
- call cam_pio_handle_error(ierr, &
- 'h_define: cannot define units for '//trim(fname_tmp))
- end if
+ str = tape(t)%hlist(fld)%field%units
+ if (len_trim(str) > 0) then
+ ierr=pio_put_att (tape(t)%Files(f), varid, 'units', trim(str))
+ call cam_pio_handle_error(ierr, &
+ 'h_define: cannot define units for '//trim(fname_tmp))
+ end if
- str = tape(t)%hlist(f)%field%mixing_ratio
- if (len_trim(str) > 0) then
- ierr=pio_put_att (tape(t)%File, varid, 'mixing_ratio', trim(str))
- call cam_pio_handle_error(ierr, &
- 'h_define: cannot define mixing_ratio for '//trim(fname_tmp))
- end if
+ str = tape(t)%hlist(fld)%field%mixing_ratio
+ if (len_trim(str) > 0) then
+ ierr=pio_put_att (tape(t)%Files(f), varid, 'mixing_ratio', trim(str))
+ call cam_pio_handle_error(ierr, &
+ 'h_define: cannot define mixing_ratio for '//trim(fname_tmp))
+ end if
- str = tape(t)%hlist(f)%field%long_name
- ierr=pio_put_att (tape(t)%File, varid, 'long_name', trim(str))
- call cam_pio_handle_error(ierr, &
- 'h_define: cannot define long_name for '//trim(fname_tmp))
+ str = tape(t)%hlist(fld)%field%long_name
+ ierr=pio_put_att (tape(t)%Files(f), varid, 'long_name', trim(str))
+ call cam_pio_handle_error(ierr, &
+ 'h_define: cannot define long_name for '//trim(fname_tmp))
- ! Assign field attributes defining valid levels and averaging info
+ ! Assign field attributes defining valid levels and averaging info
- cell_methods = ''
- if (len_trim(tape(t)%hlist(f)%field%cell_methods) > 0) then
- if (len_trim(cell_methods) > 0) then
- cell_methods = trim(cell_methods)//' '//trim(tape(t)%hlist(f)%field%cell_methods)
- else
- cell_methods = trim(cell_methods)//trim(tape(t)%hlist(f)%field%cell_methods)
- end if
- end if
- ! Time cell methods is after field method because time averaging is
- ! applied later (just before output) than field method which is applied
- ! before outfld call.
- str = tape(t)%hlist(f)%time_op
- select case (str)
- case ('mean', 'maximum', 'minimum', 'standard_deviation')
- if (len_trim(cell_methods) > 0) then
- cell_methods = trim(cell_methods)//' '//'time: '//str
- else
- cell_methods = trim(cell_methods)//'time: '//str
- end if
- end select
- if (len_trim(cell_methods) > 0) then
- ierr = pio_put_att(tape(t)%File, varid, 'cell_methods', trim(cell_methods))
- call cam_pio_handle_error(ierr, &
- 'h_define: cannot define cell_methods for '//trim(fname_tmp))
- end if
- if (patch_output) then
- ierr = pio_put_att(tape(t)%File, varid, 'basename', &
- tape(t)%hlist(f)%field%name)
- call cam_pio_handle_error(ierr, &
- 'h_define: cannot define basename for '//trim(fname_tmp))
- end if
+ cell_methods = ''
+ if (len_trim(tape(t)%hlist(fld)%field%cell_methods) > 0) then
+ if (len_trim(cell_methods) > 0) then
+ cell_methods = trim(cell_methods)//' '//trim(tape(t)%hlist(fld)%field%cell_methods)
+ else
+ cell_methods = trim(cell_methods)//trim(tape(t)%hlist(fld)%field%cell_methods)
+ end if
+ end if
+ ! Time cell methods is after field method because time averaging is
+ ! applied later (just before output) than field method which is applied
+ ! before outfld call.
+ str = tape(t)%hlist(fld)%time_op
+ if (tape(t)%hlist(fld)%avgflag == 'I') then
+ str = 'point'
+ else
+ str = tape(t)%hlist(fld)%time_op
+ end if
+ cell_methods = adjustl(trim(cell_methods)//' '//'time: '//str)
+ if (len_trim(cell_methods) > 0) then
+ ierr = pio_put_att(tape(t)%Files(f), varid, 'cell_methods', trim(cell_methods))
+ call cam_pio_handle_error(ierr, &
+ 'h_define: cannot define cell_methods for '//trim(fname_tmp))
+ end if
+ if (patch_output) then
+ ierr = pio_put_att(tape(t)%Files(f), varid, 'basename', &
+ tape(t)%hlist(fld)%field%name)
+ call cam_pio_handle_error(ierr, &
+ 'h_define: cannot define basename for '//trim(fname_tmp))
+ end if
- if (restart) then
- ! For restart history files, we need to save accumulation counts
- fname_tmp = trim(fname_tmp)//'_nacs'
- if (.not. associated(tape(t)%hlist(f)%nacs_varid)) then
- allocate(tape(t)%hlist(f)%nacs_varid)
- end if
- if (size(tape(t)%hlist(f)%nacs, 1) > 1) then
- call cam_pio_def_var(tape(t)%File, trim(fname_tmp), pio_int, &
- nacsdims(1:num_hdims), tape(t)%hlist(f)%nacs_varid)
- else
- ! Save just one value representing all chunks
- call cam_pio_def_var(tape(t)%File, trim(fname_tmp), pio_int, &
- tape(t)%hlist(f)%nacs_varid)
- end if
- ! for standard deviation
- if (associated(tape(t)%hlist(f)%sbuf)) then
- fname_tmp = strip_suffix(tape(t)%hlist(f)%field%name)
- fname_tmp = trim(fname_tmp)//'_var'
- if ( .not.associated(tape(t)%hlist(f)%sbuf_varid)) then
- allocate(tape(t)%hlist(f)%sbuf_varid)
+ if (restart) then
+ ! For restart history files, we need to save accumulation counts
+ fname_tmp = trim(fname_tmp)//'_nacs'
+ if (.not. associated(tape(t)%hlist(fld)%nacs_varid)) then
+ allocate(tape(t)%hlist(fld)%nacs_varid)
+ end if
+ if (size(tape(t)%hlist(fld)%nacs, 1) > 1) then
+ call cam_pio_def_var(tape(t)%Files(f), trim(fname_tmp), pio_int, &
+ nacsdims(1:num_hdims), tape(t)%hlist(fld)%nacs_varid)
+ else
+ ! Save just one value representing all chunks
+ call cam_pio_def_var(tape(t)%Files(f), trim(fname_tmp), pio_int, &
+ tape(t)%hlist(fld)%nacs_varid)
+ end if
+ ! for standard deviation
+ if (associated(tape(t)%hlist(fld)%sbuf)) then
+ fname_tmp = strip_suffix(tape(t)%hlist(fld)%field%name)
+ fname_tmp = trim(fname_tmp)//'_var'
+ if ( .not.associated(tape(t)%hlist(fld)%sbuf_varid)) then
+ allocate(tape(t)%hlist(fld)%sbuf_varid)
+ endif
+ call cam_pio_def_var(tape(t)%Files(f), trim(fname_tmp), pio_double, &
+ dimids_tmp(1:fdims), tape(t)%hlist(fld)%sbuf_varid)
endif
- call cam_pio_def_var(tape(t)%File, trim(fname_tmp), pio_double, &
- dimids_tmp(1:fdims), tape(t)%hlist(f)%sbuf_varid)
- endif
- end if
- end do ! Loop over output patches
- end do ! Loop over fields
- !
- deallocate(mdimids)
- ret = pio_enddef(tape(t)%File)
+ end if
+ end do ! Loop over output patches
+ end do ! Loop over fields
+ !
+ deallocate(mdimids)
+ ret = pio_enddef(tape(t)%Files(f))
+ if (ret /= PIO_NOERR) then
+ call endrun('H_DEFINE: ERROR exiting define mode in PIO')
+ end if
- if(masterproc) then
- write(iulog,*)'H_DEFINE: Successfully opened netcdf file '
- endif
+ if(masterproc) then
+ write(iulog,*)'H_DEFINE: Successfully opened netcdf file '
+ endif
+ end do ! Loop over files
!
! Write time-invariant portion of history header
!
if(.not. is_satfile(t)) then
if(interpolate) then
- call cam_grid_write_var(tape(t)%File, interpolate_info(t)%grid_id)
+ do f = 1, maxsplitfiles
+ if (pio_file_is_open(tape(t)%Files(f))) then
+ call cam_grid_write_var(tape(t)%Files(f), interpolate_info(t)%grid_id, file_index=f)
+ end if
+ end do
else if((.not. patch_output) .or. restart) then
do i = 1, size(tape(t)%grid_ids)
- call cam_grid_write_var(tape(t)%File, tape(t)%grid_ids(i))
+ do f = 1, maxsplitfiles
+ if (pio_file_is_open(tape(t)%Files(f))) then
+ call cam_grid_write_var(tape(t)%Files(f), tape(t)%grid_ids(i), file_index=f)
+ end if
+ end do
end do
else
! Patch output
do i = 1, size(tape(t)%patches)
- call tape(t)%patches(i)%write_vals(tape(t)%File)
+ do f = 1, maxsplitfiles
+ if (pio_file_is_open(tape(t)%Files(f))) then
+ call tape(t)%patches(i)%write_vals(tape(t)%Files(f))
+ end if
+ end do
end do
end if ! interpolate
if (allocated(lonvar)) then
@@ -4506,28 +4908,32 @@ subroutine h_define (t, restart)
end if
dtime = get_step_size()
- ierr = pio_put_var(tape(t)%File, tape(t)%mdtid, (/dtime/))
- call cam_pio_handle_error(ierr, 'h_define: cannot put mdt')
- !
- ! Model date info
- !
- ierr = pio_put_var(tape(t)%File, tape(t)%ndbaseid, (/ndbase/))
- call cam_pio_handle_error(ierr, 'h_define: cannot put ndbase')
- ierr = pio_put_var(tape(t)%File, tape(t)%nsbaseid, (/nsbase/))
- call cam_pio_handle_error(ierr, 'h_define: cannot put nsbase')
-
- ierr = pio_put_var(tape(t)%File, tape(t)%nbdateid, (/nbdate/))
- call cam_pio_handle_error(ierr, 'h_define: cannot put nbdate')
+ do f = 1, maxsplitfiles
+ if (.not. pio_file_is_open(tape(t)%Files(f))) then
+ cycle
+ end if
+ ierr = pio_put_var(tape(t)%Files(f), tape(t)%mdtid, (/dtime/))
+ call cam_pio_handle_error(ierr, 'h_define: cannot put mdt')
+ !
+ ! Model date info
+ !
+ ierr = pio_put_var(tape(t)%Files(f), tape(t)%ndbaseid, (/ndbase/))
+ call cam_pio_handle_error(ierr, 'h_define: cannot put ndbase')
+ ierr = pio_put_var(tape(t)%Files(f), tape(t)%nsbaseid, (/nsbase/))
+ call cam_pio_handle_error(ierr, 'h_define: cannot put nsbase')
+
+ ierr = pio_put_var(tape(t)%Files(f), tape(t)%nbdateid, (/nbdate/))
+ call cam_pio_handle_error(ierr, 'h_define: cannot put nbdate')
#if ( defined BFB_CAM_SCAM_IOP )
- ierr = pio_put_var(tape(t)%File, tape(t)%bdateid, (/nbdate/))
- call cam_pio_handle_error(ierr, 'h_define: cannot put bdate')
+ ierr = pio_put_var(tape(t)%Files(f), tape(t)%bdateid, (/nbdate/))
+ call cam_pio_handle_error(ierr, 'h_define: cannot put bdate')
#endif
- ierr = pio_put_var(tape(t)%File, tape(t)%nbsecid, (/nbsec/))
- call cam_pio_handle_error(ierr, 'h_define: cannot put nbsec')
- !
- ! Reduced grid info
- !
-
+ ierr = pio_put_var(tape(t)%Files(f), tape(t)%nbsecid, (/nbsec/))
+ call cam_pio_handle_error(ierr, 'h_define: cannot put nbsec')
+ !
+ ! Reduced grid info
+ !
+ end do
end if ! .not. is_satfile
if (allocated(header_info)) then
@@ -4538,15 +4944,20 @@ subroutine h_define (t, restart)
end if
! Write the mdim variable data
- call write_hist_coord_vars(tape(t)%File, restart)
+ do f = 1, maxsplitfiles
+ if (pio_file_is_open(tape(t)%Files(f))) then
+ call write_hist_coord_vars(tape(t)%Files(f), restart)
+ end if
+ end do
end subroutine h_define
!#######################################################################
- subroutine h_normalize (f, t)
+ subroutine h_normalize (fld, t)
use cam_history_support, only: dim_index_2d
+ use time_manager, only: get_nstep
!
!-----------------------------------------------------------------------
@@ -4560,7 +4971,7 @@ subroutine h_normalize (f, t)
!
! Input arguments
!
- integer, intent(in) :: f ! field index
+ integer, intent(in) :: fld ! field index
integer, intent(in) :: t ! tape index
!
! Local workspace
@@ -4572,23 +4983,26 @@ subroutine h_normalize (f, t)
integer :: begdim3, enddim3 ! Chunk or block bounds
integer :: k ! level
integer :: i, ii
+ integer :: currstep, nsteps
real(r8) :: variance, tmpfill
logical :: flag_xyfill ! non-applicable xy points flagged with fillvalue
character*1 :: avgflag ! averaging flag
+ character(len=max_chars) :: errmsg
+ character(len=*), parameter :: sub='H_NORMALIZE:'
call t_startf ('h_normalize')
- call tape(t)%hlist(f)%field%get_bounds(3, begdim3, enddim3)
+ call tape(t)%hlist(fld)%field%get_bounds(3, begdim3, enddim3)
!
! normalize by number of accumulations for averaged case
!
- flag_xyfill = tape(t)%hlist(f)%field%flag_xyfill
- avgflag = tape(t)%hlist(f)%avgflag
+ flag_xyfill = tape(t)%hlist(fld)%field%flag_xyfill
+ avgflag = tape(t)%hlist(fld)%avgflag
do c = begdim3, enddim3
- dimind = tape(t)%hlist(f)%field%get_dims(c)
+ dimind = tape(t)%hlist(fld)%field%get_dims(c)
ib = dimind%beg1
ie = dimind%end1
@@ -4597,41 +5011,55 @@ subroutine h_normalize (f, t)
if (flag_xyfill) then
do k = jb, je
- where (tape(t)%hlist(f)%nacs(ib:ie, c) == 0)
- tape(t)%hlist(f)%hbuf(ib:ie,k,c) = tape(t)%hlist(f)%field%fillvalue
+ where (tape(t)%hlist(fld)%nacs(ib:ie, c) == 0)
+ tape(t)%hlist(fld)%hbuf(ib:ie,k,c) = tape(t)%hlist(fld)%field%fillvalue
endwhere
end do
end if
if (avgflag == 'A' .or. avgflag == 'B' .or. avgflag == 'L') then
- if (size(tape(t)%hlist(f)%nacs, 1) > 1) then
+ if (size(tape(t)%hlist(fld)%nacs, 1) > 1) then
do k = jb, je
- where (tape(t)%hlist(f)%nacs(ib:ie,c) /= 0)
- tape(t)%hlist(f)%hbuf(ib:ie,k,c) = &
- tape(t)%hlist(f)%hbuf(ib:ie,k,c) &
- / tape(t)%hlist(f)%nacs(ib:ie,c)
+ where (tape(t)%hlist(fld)%nacs(ib:ie,c) /= 0)
+ tape(t)%hlist(fld)%hbuf(ib:ie,k,c) = &
+ tape(t)%hlist(fld)%hbuf(ib:ie,k,c) &
+ / tape(t)%hlist(fld)%nacs(ib:ie,c)
endwhere
end do
- else if(tape(t)%hlist(f)%nacs(1,c) > 0) then
+ else if(tape(t)%hlist(fld)%nacs(1,c) > 0) then
do k=jb,je
- tape(t)%hlist(f)%hbuf(ib:ie,k,c) = &
- tape(t)%hlist(f)%hbuf(ib:ie,k,c) &
- / tape(t)%hlist(f)%nacs(1,c)
+ tape(t)%hlist(fld)%hbuf(ib:ie,k,c) = &
+ tape(t)%hlist(fld)%hbuf(ib:ie,k,c) &
+ / tape(t)%hlist(fld)%nacs(1,c)
end do
end if
end if
+ currstep=get_nstep()
+ if (avgflag == 'N' .and. currstep > 0) then
+ if( currstep > tape(t)%hlist(fld)%beg_nstep) then
+ nsteps=currstep-tape(t)%hlist(fld)%beg_nstep
+ do k=jb,je
+ tape(t)%hlist(fld)%hbuf(ib:ie,k,c) = &
+ tape(t)%hlist(fld)%hbuf(ib:ie,k,c) &
+ / nsteps
+ end do
+ else
+ write(errmsg,*) sub,'FATAL: bad nstep normalization, currstep, beg_nstep=',currstep,',',tape(t)%hlist(fld)%beg_nstep
+ call endrun(trim(errmsg))
+ end if
+ end if
if (avgflag == 'S') then
! standard deviation ...
! from http://www.johndcook.com/blog/standard_deviation/
- tmpfill = merge(tape(t)%hlist(f)%field%fillvalue,0._r8,flag_xyfill)
+ tmpfill = merge(tape(t)%hlist(fld)%field%fillvalue,0._r8,flag_xyfill)
do k=jb,je
do i = ib,ie
ii = merge(i,1,flag_xyfill)
- if (tape(t)%hlist(f)%nacs(ii,c) > 1) then
- variance = tape(t)%hlist(f)%sbuf(i,k,c)/(tape(t)%hlist(f)%nacs(ii,c)-1)
- tape(t)%hlist(f)%hbuf(i,k,c) = sqrt(variance)
+ if (tape(t)%hlist(fld)%nacs(ii,c) > 1) then
+ variance = tape(t)%hlist(fld)%sbuf(i,k,c)/(tape(t)%hlist(fld)%nacs(ii,c)-1)
+ tape(t)%hlist(fld)%hbuf(i,k,c) = sqrt(variance)
else
- tape(t)%hlist(f)%hbuf(i,k,c) = tmpfill
+ tape(t)%hlist(fld)%hbuf(i,k,c) = tmpfill
endif
end do
end do
@@ -4645,8 +5073,9 @@ end subroutine h_normalize
!#######################################################################
- subroutine h_zero (f, t)
+ subroutine h_zero (fld, t)
use cam_history_support, only: dim_index_2d
+ use time_manager, only: get_nstep, is_first_restart_step
!
!-----------------------------------------------------------------------
!
@@ -4656,7 +5085,7 @@ subroutine h_zero (f, t)
!
!-----------------------------------------------------------------------
!
- integer, intent(in) :: f ! field index
+ integer, intent(in) :: fld ! field index
integer, intent(in) :: t ! tape index
!
! Local workspace
@@ -4668,16 +5097,19 @@ subroutine h_zero (f, t)
call t_startf ('h_zero')
- call tape(t)%hlist(f)%field%get_bounds(3, begdim3, enddim3)
+ call tape(t)%hlist(fld)%field%get_bounds(3, begdim3, enddim3)
do c = begdim3, enddim3
- dimind = tape(t)%hlist(f)%field%get_dims(c)
- tape(t)%hlist(f)%hbuf(dimind%beg1:dimind%end1,dimind%beg2:dimind%end2,c)=0._r8
- if (associated(tape(t)%hlist(f)%sbuf)) then ! zero out variance buffer for standard deviation
- tape(t)%hlist(f)%sbuf(dimind%beg1:dimind%end1,dimind%beg2:dimind%end2,c)=0._r8
+ dimind = tape(t)%hlist(fld)%field%get_dims(c)
+ tape(t)%hlist(fld)%hbuf(dimind%beg1:dimind%end1,dimind%beg2:dimind%end2,c)=0._r8
+ if (associated(tape(t)%hlist(fld)%sbuf)) then ! zero out variance buffer for standard deviation
+ tape(t)%hlist(fld)%sbuf(dimind%beg1:dimind%end1,dimind%beg2:dimind%end2,c)=0._r8
end if
end do
- tape(t)%hlist(f)%nacs(:,:) = 0
+ tape(t)%hlist(fld)%nacs(:,:) = 0
+
+ !Don't reset beg_nstep if this is a restart
+ if (.not. is_first_restart_step()) tape(t)%hlist(fld)%beg_nstep = get_nstep()
call t_stopf ('h_zero')
@@ -4686,14 +5118,135 @@ end subroutine h_zero
!#######################################################################
- subroutine dump_field (f, t, restart)
+ subroutine h_global (fld, t)
+
+ use cam_history_support, only: dim_index_2d
+ use shr_reprosum_mod, only: shr_reprosum_calc
+ use spmd_utils, only: mpicom
+ !
+ !-----------------------------------------------------------------------
+ !
+ ! Purpose: compute globals of field
+ !
+ ! Method: Loop through fields on the tape
+ !
+ !-----------------------------------------------------------------------
+ !
+ integer, intent(in) :: fld ! field index
+ integer, intent(in) :: t ! tape index
+ !
+ ! Local workspace
+ !
+ type (dim_index_2d) :: dimind ! 2-D dimension index
+ integer :: ie ! dim3 index
+ integer :: count ! tmp index
+ integer :: i1 ! dim1 index
+ integer :: j1 ! dim2 index
+ integer :: fdims(3) ! array shape
+ integer :: begdim1,enddim1,begdim2,enddim2,begdim3,enddim3 !
+ real(r8) :: globalsum(1) ! globalsum
+ real(r8), allocatable :: globalarr(:) ! globalarr values for this pe
+
+ call t_startf ('h_global')
+
+ ! wbuf contains the area weighting for this field decomposition
+ if (associated(tape(t)%hlist(fld)%wbuf) ) then
+
+ begdim1 = tape(t)%hlist(fld)%field%begdim1
+ enddim1 = tape(t)%hlist(fld)%field%enddim1
+ fdims(1) = enddim1 - begdim1 + 1
+ begdim2 = tape(t)%hlist(fld)%field%begdim2
+ enddim2 = tape(t)%hlist(fld)%field%enddim2
+ fdims(2) = enddim2 - begdim2 + 1
+ begdim3 = tape(t)%hlist(fld)%field%begdim3
+ enddim3 = tape(t)%hlist(fld)%field%enddim3
+ fdims(3) = enddim3 - begdim3 + 1
+
+ allocate(globalarr(fdims(1)*fdims(2)*fdims(3)))
+ count=0
+ globalarr=0._r8
+ do ie = begdim3, enddim3
+ dimind = tape(t)%hlist(fld)%field%get_dims(ie)
+ do j1 = dimind%beg2, dimind%end2
+ do i1 = dimind%beg1, dimind%end1
+ count=count+1
+ globalarr(count)=globalarr(count)+tape(t)%hlist(fld)%hbuf(i1,j1,ie)*tape(t)%hlist(fld)%wbuf(i1,ie)
+ end do
+ end do
+ end do
+ ! call fixed-point algorithm
+ call shr_reprosum_calc (globalarr, globalsum, count, count, 1, commid=mpicom)
+ if (masterproc) write(iulog,*)'h_global:field:',trim(tape(t)%hlist(fld)%field%name),' global integral=',globalsum(1)
+ ! store global entry for this history tape entry
+ call tape(t)%hlist(fld)%put_global(globalsum(1))
+ ! deallocate temp array
+ deallocate(globalarr)
+ end if
+ call t_stopf ('h_global')
+ end subroutine h_global
+
+ subroutine h_field_op (fld, t)
+ use cam_history_support, only: dim_index_2d
+ !
+ !-----------------------------------------------------------------------
+ !
+ ! Purpose: run field sum or dif opperation on all contructed fields
+ !
+ ! Method: Loop through fields on the tape
+ !
+ !-----------------------------------------------------------------------
+ !
+ integer, intent(in) :: fld ! field index
+ integer, intent(in) :: t ! tape index
+ !
+ ! Local workspace
+ !
+ type (dim_index_2d) :: dimind ! 2-D dimension index
+ integer :: c ! chunk index
+ integer :: fld1,fld2 ! fields to be operated on
+ integer :: begdim1, begdim2, begdim3 ! on-node chunk or lat start index
+ integer :: enddim1, enddim2, enddim3 ! on-node chunk or lat end index
+ character(len=field_op_len) :: optype ! field operation only sum or diff supported
+
+ call t_startf ('h_field_op')
+ fld1 = tape(t)%hlist(fld)%field%op_field1_id
+ fld2 = tape(t)%hlist(fld)%field%op_field2_id
+ optype = trim(adjustl(tape(t)%hlist(fld)%field%field_op))
+
+ begdim3 = tape(t)%hlist(fld)%field%begdim3
+ enddim3 = tape(t)%hlist(fld)%field%enddim3
+
+ do c = begdim3, enddim3
+ dimind = tape(t)%hlist(fld)%field%get_dims(c)
+ if (trim(optype) == 'dif') then
+ tape(t)%hlist(fld)%hbuf(dimind%beg1:dimind%end1,dimind%beg2:dimind%end2,c) = &
+ tape(t)%hlist(fld1)%hbuf(dimind%beg1:dimind%end1,dimind%beg2:dimind%end2,c) - &
+ tape(t)%hlist(fld2)%hbuf(dimind%beg1:dimind%end1,dimind%beg2:dimind%end2,c)
+ else if (trim(optype) == 'sum') then
+ tape(t)%hlist(fld)%hbuf(dimind%beg1:dimind%end1,dimind%beg2:dimind%end2,c) = &
+ tape(t)%hlist(fld1)%hbuf(dimind%beg1:dimind%end1,dimind%beg2:dimind%end2,c) + &
+ tape(t)%hlist(fld2)%hbuf(dimind%beg1:dimind%end1,dimind%beg2:dimind%end2,c)
+ else
+ call endrun('h_field_op: ERROR: composed field operation type unknown:'//trim(optype))
+ end if
+ end do
+ ! Set nsteps for composed fields using value of one of the component fields
+ tape(t)%hlist(fld)%beg_nstep=tape(t)%hlist(fld1)%beg_nstep
+ tape(t)%hlist(fld)%nacs(:,:)=tape(t)%hlist(fld1)%nacs(:,:)
+ call t_stopf ('h_field_op')
+ end subroutine h_field_op
+
+ !#######################################################################
+
+ subroutine dump_field (fld, t, f, restart)
use cam_history_support, only: history_patch_t, dim_index_2d, dim_index_3d
use cam_grid_support, only: cam_grid_write_dist_array, cam_grid_dimensions
use interp_mod, only : write_interpolated
! Dummy arguments
- integer, intent(in) :: f
- integer, intent(in) :: t
+ integer, intent(in) :: fld ! Field index
+ integer, intent(in) :: t ! Tape index
+ integer, intent(in) :: f ! File index
logical, intent(in) :: restart
!
!-----------------------------------------------------------------------
@@ -4733,10 +5286,10 @@ subroutine dump_field (f, t, restart)
!!! Get the field's shape and decomposition
! Shape on disk
- call tape(t)%hlist(f)%field%get_shape(fdims, frank)
+ call tape(t)%hlist(fld)%field%get_shape(fdims, frank)
! Shape of array
- dimind = tape(t)%hlist(f)%field%get_dims()
+ dimind = tape(t)%hlist(fld)%field%get_dims()
call dimind%dim_sizes(adims)
if (adims(2) <= 1) then
adims(2) = adims(3)
@@ -4744,7 +5297,7 @@ subroutine dump_field (f, t, restart)
else
nadims = 3
end if
- fdecomp = tape(t)%hlist(f)%field%decomp_type
+ fdecomp = tape(t)%hlist(fld)%field%decomp_type
! num_patches will loop through the number of patches (or just one
! for the whole grid) for this field for this tape
@@ -4755,12 +5308,12 @@ subroutine dump_field (f, t, restart)
end if
do index = 1, num_patches
- varid => tape(t)%hlist(f)%varid(index)
+ varid => tape(t)%hlist(fld)%varid(index)
if (restart) then
- call pio_setframe(tape(t)%File, varid, int(-1,kind=PIO_OFFSET_KIND))
+ call pio_setframe(tape(t)%Files(f), varid, int(-1,kind=PIO_OFFSET_KIND))
else
- call pio_setframe(tape(t)%File, varid, int(max(1,nfils(t)),kind=PIO_OFFSET_KIND))
+ call pio_setframe(tape(t)%Files(f), varid, int(max(1,nfils(t)),kind=PIO_OFFSET_KIND))
end if
if (patch_output) then
! We are outputting patches
@@ -4768,115 +5321,108 @@ subroutine dump_field (f, t, restart)
if (interpolate) then
call endrun('dump_field: interpolate incompatible with regional output')
end if
- call patchptr%write_var(tape(t)%File, fdecomp, adims(1:nadims), &
- pio_double, tape(t)%hlist(f)%hbuf, varid)
+ call patchptr%write_var(tape(t)%Files(f), fdecomp, adims(1:nadims), &
+ pio_double, tape(t)%hlist(fld)%hbuf, varid)
else
! We are doing output via the field's grid
if (interpolate) then
!Determine what the output field kind should be:
- if (tape(t)%hlist(f)%hwrt_prec == 8) then
+ if (tape(t)%hlist(fld)%hwrt_prec == 8) then
ncreal = pio_double
else
ncreal = pio_real
end if
- mdimsize = tape(t)%hlist(f)%field%enddim2 - tape(t)%hlist(f)%field%begdim2 + 1
+ mdimsize = tape(t)%hlist(fld)%field%enddim2 - tape(t)%hlist(fld)%field%begdim2 + 1
if (mdimsize == 0) then
- mdimsize = tape(t)%hlist(f)%field%numlev
+ mdimsize = tape(t)%hlist(fld)%field%numlev
end if
- if (tape(t)%hlist(f)%field%meridional_complement > 0) then
- compind = tape(t)%hlist(f)%field%meridional_complement
+ if (tape(t)%hlist(fld)%field%meridional_complement > 0) then
+ compind = tape(t)%hlist(fld)%field%meridional_complement
compid => tape(t)%hlist(compind)%varid(index)
! We didn't call set frame on the meridional complement field
- call pio_setframe(tape(t)%File, compid, int(max(1,nfils(t)),kind=PIO_OFFSET_KIND))
- call write_interpolated(tape(t)%File, varid, compid, &
- tape(t)%hlist(f)%hbuf, tape(t)%hlist(compind)%hbuf, &
+ call pio_setframe(tape(t)%Files(f), compid, int(max(1,nfils(t)),kind=PIO_OFFSET_KIND))
+ call write_interpolated(tape(t)%Files(f), varid, compid, &
+ tape(t)%hlist(fld)%hbuf, tape(t)%hlist(compind)%hbuf, &
mdimsize, ncreal, fdecomp)
- else if (tape(t)%hlist(f)%field%zonal_complement > 0) then
- ! We don't want to double write so do nothing here
-! compind = tape(t)%hlist(f)%field%zonal_complement
-! compid => tape(t)%hlist(compind)%varid(index)
-! call write_interpolated(tape(t)%File, compid, varid, &
-! tape(t)%hlist(compind)%hbuf, tape(t)%hlist(f)%hbuf, &
-! mdimsize, PIO_DOUBLE, fdecomp)
- else
+ else if (tape(t)%hlist(fld)%field%zonal_complement <= 0) then
! Scalar field
- call write_interpolated(tape(t)%File, varid, &
- tape(t)%hlist(f)%hbuf, mdimsize, ncreal, fdecomp)
+ call write_interpolated(tape(t)%Files(f), varid, &
+ tape(t)%hlist(fld)%hbuf, mdimsize, ncreal, fdecomp)
end if
else if (nadims == 2) then
! Special case for 2D field (no levels) due to hbuf structure
- if ((tape(t)%hlist(f)%hwrt_prec == 4) .and. (.not. restart)) then
- call tape(t)%hlist(f)%field%get_bounds(3, begdim3, enddim3)
+ if ((tape(t)%hlist(fld)%hwrt_prec == 4) .and. (.not. restart)) then
+ call tape(t)%hlist(fld)%field%get_bounds(3, begdim3, enddim3)
allocate(rtemp2(dimind%beg1:dimind%end1, begdim3:enddim3))
rtemp2 = 0.0_r4
do ind3 = begdim3, enddim3
- dimind2 = tape(t)%hlist(f)%field%get_dims(ind3)
+ dimind2 = tape(t)%hlist(fld)%field%get_dims(ind3)
rtemp2(dimind2%beg1:dimind2%end1,ind3) = &
- tape(t)%hlist(f)%hbuf(dimind2%beg1:dimind2%end1, 1, ind3)
+ tape(t)%hlist(fld)%hbuf(dimind2%beg1:dimind2%end1, 1, ind3)
end do
- call cam_grid_write_dist_array(tape(t)%File, fdecomp, &
+ call cam_grid_write_dist_array(tape(t)%Files(f), fdecomp, &
adims(1:nadims), fdims(1:frank), rtemp2, varid)
deallocate(rtemp2)
else
- call cam_grid_write_dist_array(tape(t)%File, fdecomp, &
+ call cam_grid_write_dist_array(tape(t)%Files(f), fdecomp, &
adims(1:nadims), fdims(1:frank), &
- tape(t)%hlist(f)%hbuf(:,1,:), varid)
+ tape(t)%hlist(fld)%hbuf(:,1,:), varid)
end if
else
- if ((tape(t)%hlist(f)%hwrt_prec == 4) .and. (.not. restart)) then
- call tape(t)%hlist(f)%field%get_bounds(3, begdim3, enddim3)
+ if ((tape(t)%hlist(fld)%hwrt_prec == 4) .and. (.not. restart)) then
+ call tape(t)%hlist(fld)%field%get_bounds(3, begdim3, enddim3)
allocate(rtemp3(dimind%beg1:dimind%end1, &
dimind%beg2:dimind%end2, begdim3:enddim3))
rtemp3 = 0.0_r4
do ind3 = begdim3, enddim3
- dimind2 = tape(t)%hlist(f)%field%get_dims(ind3)
+ dimind2 = tape(t)%hlist(fld)%field%get_dims(ind3)
rtemp3(dimind2%beg1:dimind2%end1, dimind2%beg2:dimind2%end2, &
- ind3) = tape(t)%hlist(f)%hbuf(dimind2%beg1:dimind2%end1,&
+ ind3) = tape(t)%hlist(fld)%hbuf(dimind2%beg1:dimind2%end1,&
dimind2%beg2:dimind2%end2, ind3)
end do
- call cam_grid_write_dist_array(tape(t)%File, fdecomp, adims, &
+ call cam_grid_write_dist_array(tape(t)%Files(f), fdecomp, adims, &
fdims(1:frank), rtemp3, varid)
deallocate(rtemp3)
else
- call cam_grid_write_dist_array(tape(t)%File, fdecomp, adims, &
+ call cam_grid_write_dist_array(tape(t)%Files(f), fdecomp, adims, &
fdims(1:frank), &
- tape(t)%hlist(f)%hbuf, varid)
+ tape(t)%hlist(fld)%hbuf, varid)
end if
end if
end if
end do
!! write accumulation counter and variance to hist restart file
if(restart) then
- if (associated(tape(t)%hlist(f)%sbuf) ) then
+ if (associated(tape(t)%hlist(fld)%sbuf) ) then
! write variance data to restart file for standard deviation calc
if (nadims == 2) then
! Special case for 2D field (no levels) due to sbuf structure
- call cam_grid_write_dist_array(tape(t)%File, fdecomp, &
+ call cam_grid_write_dist_array(tape(t)%Files(f), fdecomp, &
adims(1:nadims), fdims(1:frank), &
- tape(t)%hlist(f)%sbuf(:,1,:), tape(t)%hlist(f)%sbuf_varid)
+ tape(t)%hlist(fld)%sbuf(:,1,:), tape(t)%hlist(fld)%sbuf_varid)
else
- call cam_grid_write_dist_array(tape(t)%File, fdecomp, adims, &
- fdims(1:frank), tape(t)%hlist(f)%sbuf, &
- tape(t)%hlist(f)%sbuf_varid)
+ call cam_grid_write_dist_array(tape(t)%Files(f), fdecomp, adims, &
+ fdims(1:frank), tape(t)%hlist(fld)%sbuf, &
+ tape(t)%hlist(fld)%sbuf_varid)
endif
endif
!! NACS
- if (size(tape(t)%hlist(f)%nacs, 1) > 1) then
+ if (size(tape(t)%hlist(fld)%nacs, 1) > 1) then
if (nadims > 2) then
adims(2) = adims(3)
nadims = 2
end if
call cam_grid_dimensions(fdecomp, fdims(1:2), nacsrank)
- call cam_grid_write_dist_array(tape(t)%File, fdecomp, &
+ call cam_grid_write_dist_array(tape(t)%Files(f), fdecomp, &
adims(1:nadims), fdims(1:nacsrank), &
- tape(t)%hlist(f)%nacs, tape(t)%hlist(f)%nacs_varid)
+ tape(t)%hlist(fld)%nacs, tape(t)%hlist(fld)%nacs_varid)
else
- bdim3 = tape(t)%hlist(f)%field%begdim3
- edim3 = tape(t)%hlist(f)%field%enddim3
- ierr = pio_put_var(tape(t)%File, tape(t)%hlist(f)%nacs_varid, &
- tape(t)%hlist(f)%nacs(:, bdim3:edim3))
+ bdim3 = tape(t)%hlist(fld)%field%begdim3
+ edim3 = tape(t)%hlist(fld)%field%enddim3
+ ierr = pio_put_var(tape(t)%Files(f), tape(t)%hlist(fld)%nacs_varid, &
+ tape(t)%hlist(fld)%nacs(:, bdim3:edim3))
end if
end if
@@ -4943,6 +5489,7 @@ subroutine wshist (rgnht_in)
!
!-----------------------------------------------------------------------
use time_manager, only: get_nstep, get_curr_date, get_curr_time, get_step_size
+ use time_manager, only: set_date_from_time_float
use chem_surfvals, only: chem_surfvals_get, chem_surfvals_co2_rad
use solar_irrad_data, only: sol_tsi
use sat_hist, only: sat_hist_write
@@ -4958,7 +5505,7 @@ subroutine wshist (rgnht_in)
character(len=8) :: ctime ! system time
logical :: rgnht(ptapes), restart
- integer t, f ! tape, field indices
+ integer t, f, fld ! tape, file, field indices
integer start ! starting index required by nf_put_vara
integer count1 ! count values required by nf_put_vara
integer startc(2) ! start values required by nf_put_vara (character)
@@ -4970,20 +5517,23 @@ subroutine wshist (rgnht_in)
integer :: yr, mon, day ! year, month, and day components of a date
integer :: nstep ! current timestep number
- integer :: ncdate ! current date in integer format [yyyymmdd]
- integer :: ncsec ! current time of day [seconds]
+ integer :: ncdate(maxsplitfiles) ! current (or midpoint) date in integer format [yyyymmdd]
+ integer :: ncsec(maxsplitfiles) ! current (or midpoint) time of day [seconds]
integer :: ndcur ! day component of current time
integer :: nscur ! seconds component of current time
- real(r8) :: time ! current time
+ real(r8) :: time ! current (or midpoint) time
real(r8) :: tdata(2) ! time interval boundaries
character(len=max_string_len) :: fname ! Filename
+ character(len=max_string_len) :: fname_inst ! Filename for instantaneous tape
+ character(len=max_string_len) :: fname_acc ! Filename for accumulated tape
logical :: prev ! Label file with previous date rather than current
+ logical :: duplicate ! Flag for duplicate file name
integer :: ierr
+ integer :: ncsec_temp
#if ( defined BFB_CAM_SCAM_IOP )
integer :: tsec ! day component of current time
integer :: dtime ! seconds component of current time
#endif
-
if(present(rgnht_in)) then
rgnht=rgnht_in
restart=.true.
@@ -4995,8 +5545,8 @@ subroutine wshist (rgnht_in)
end if
nstep = get_nstep()
- call get_curr_date(yr, mon, day, ncsec)
- ncdate = yr*10000 + mon*100 + day
+ call get_curr_date(yr, mon, day, ncsec(instantaneous_file_index))
+ ncdate(instantaneous_file_index) = yr*10000 + mon*100 + day
call get_curr_time(ndcur, nscur)
!
! Write time-varying portion of history file header
@@ -5014,30 +5564,58 @@ subroutine wshist (rgnht_in)
prev = .false.
else
if (nhtfrq(t) == 0) then
- hstwr(t) = nstep /= 0 .and. day == 1 .and. ncsec == 0
+ hstwr(t) = nstep /= 0 .and. day == 1 .and. ncsec(instantaneous_file_index) == 0
prev = .true.
else
- hstwr(t) = mod(nstep,nhtfrq(t)) == 0
- prev = .false.
- end if
+ if (nstep == 0) then
+ if (write_nstep0) then
+ hstwr(t) = .true.
+ else
+ ! zero the buffers if nstep==0 data not written
+ do f = 1, nflds(t)
+ call h_zero(f, t)
+ end do
+ end if
+ else
+ hstwr(t) = mod(nstep,nhtfrq(t)) == 0
+ endif
+ prev = .false.
+ end if
end if
end if
+ time = ndcur + nscur/86400._r8
+ if (is_initfile(file_index=t)) then
+ tdata = time ! Inithist file is always instantanious data
+ else
+ tdata(1) = beg_time(t)
+ tdata(2) = time
+ end if
+ ! Set midpoint date/datesec for accumulated file
+ call set_date_from_time_float((tdata(1) + tdata(2)) / 2._r8, yr, mon, day, ncsec_temp)
+ ncsec(accumulated_file_index) = ncsec_temp
+ ncdate(accumulated_file_index) = yr*10000 + mon*100 + day
if (hstwr(t) .or. (restart .and. rgnht(t))) then
if(masterproc) then
if(is_initfile(file_index=t)) then
- write(iulog,100) yr,mon,day,ncsec
+ write(iulog,100) yr,mon,day,ncsec(init_file_index)
100 format('WSHIST: writing time sample to Initial Conditions h-file', &
' DATE=',i4.4,'/',i2.2,'/',i2.2,' NCSEC=',i6)
else if(is_satfile(t)) then
- write(iulog,150) nfils(t),t,yr,mon,day,ncsec
+ write(iulog,150) nfils(t),t,yr,mon,day,ncsec(sat_file_index)
150 format('WSHIST: writing sat columns ',i6,' to h-file ', &
i1,' DATE=',i4.4,'/',i2.2,'/',i2.2,' NCSEC=',i6)
else if(hstwr(t)) then
- write(iulog,200) nfils(t),t,yr,mon,day,ncsec
-200 format('WSHIST: writing time sample ',i3,' to h-file ', &
- i1,' DATE=',i4.4,'/',i2.2,'/',i2.2,' NCSEC=',i6)
+ do f = 1, maxsplitfiles
+ if (f == instantaneous_file_index) then
+ write(iulog,200) nfils(t),'instantaneous',t,yr,mon,day,ncsec(f)
+ else
+ write(iulog,200) nfils(t),'accumulated',t,yr,mon,day,ncsec(f)
+ end if
+200 format('WSHIST: writing time sample ',i3,' to ', a, ' h-file ', &
+ i1,' DATE=',i4.4,'/',i2.2,'/',i2.2,' NCSEC=',i6)
+ end do
else if(restart .and. rgnht(t)) then
- write(iulog,300) nfils(t),t,yr,mon,day,ncsec
+ write(iulog,300) nfils(t),t,yr,mon,day,ncsec(restart_file_index)
300 format('WSHIST: writing history restart ',i3,' to hr-file ', &
i1,' DATE=',i4.4,'/',i2.2,'/',i2.2,' NCSEC=',i6)
end if
@@ -5046,6 +5624,9 @@ subroutine wshist (rgnht_in)
!
! Starting a new volume => define the metadata
!
+ fname = ''
+ fname_acc = ''
+ fname_inst = ''
if (nfils(t)==0 .or. (restart.and.rgnht(t))) then
if(restart) then
rhfilename_spec = '%c.cam' // trim(inst_suffix) // '.rh%t.%y-%m-%d-%s.nc'
@@ -5054,28 +5635,53 @@ subroutine wshist (rgnht_in)
else if(is_initfile(file_index=t)) then
fname = interpret_filename_spec( hfilename_spec(t) )
else
- fname = interpret_filename_spec( hfilename_spec(t), number=(t-1), &
- prev=prev )
+ fname_acc = interpret_filename_spec( hfilename_spec(t), number=(t-1), &
+ prev=prev, flag_spec='a' )
+ fname_inst = interpret_filename_spec( hfilename_spec(t), number=(t-1), &
+ prev=prev, flag_spec='i' )
end if
!
! Check that this new filename isn't the same as a previous or current filename
!
- do f = 1, ptapes
- if (masterproc.and. trim(fname) == trim(nhfil(f)) )then
- write(iulog,*)'WSHIST: New filename same as old file = ', trim(fname)
- write(iulog,*)'Is there an error in your filename specifiers?'
- write(iulog,*)'hfilename_spec(', t, ') = ', hfilename_spec(t)
- if ( t /= f )then
- write(iulog,*)'hfilename_spec(', f, ') = ', hfilename_spec(f)
+ duplicate = .false.
+ do f = 1, t
+ if (masterproc)then
+ if (trim(fname) == trim(nhfil(f,1)) .and. trim(fname) /= '') then
+ write(iulog,*)'WSHIST: New filename same as old file = ', trim(fname)
+ duplicate = .true.
+ else if (trim(fname_acc) == trim(nhfil(f,accumulated_file_index)) .and. trim(fname_acc) /= '') then
+ write(iulog,*)'WSHIST: New accumulated filename same as old file = ', trim(fname_acc)
+ duplicate = .true.
+ else if (trim(fname_inst) == trim(nhfil(f,instantaneous_file_index)) .and. trim(fname_inst) /= '') then
+ write(iulog,*)'WSHIST: New instantaneous filename same as old file = ', trim(fname_inst)
+ duplicate = .true.
+ end if
+ if (duplicate) then
+ write(iulog,*)'Is there an error in your filename specifiers?'
+ write(iulog,*)'hfilename_spec(', t, ') = ', trim(hfilename_spec(t))
+ if ( t /= f )then
+ write(iulog,*)'hfilename_spec(', f, ') = ', trim(hfilename_spec(f))
+ end if
+ call endrun('WSHIST: ERROR - see atm log file for information')
end if
- call endrun
end if
end do
if(.not. restart) then
- nhfil(t) = fname
- if(masterproc) write(iulog,*)'WSHIST: nhfil(',t,')=',trim(nhfil(t))
- cpath(t) = nhfil(t)
- if ( len_trim(nfpath(t)) == 0 ) nfpath(t) = cpath(t)
+ if (is_initfile(file_index=t)) then
+ nhfil(t,:) = fname
+ if(masterproc) then
+ write(iulog,*)'WSHIST: initfile nhfil(',t,')=',trim(nhfil(t,init_file_index))
+ end if
+ else
+ nhfil(t,accumulated_file_index) = fname_acc
+ nhfil(t,instantaneous_file_index) = fname_inst
+ if(masterproc) then
+ write(iulog,*)'WSHIST: accumulated nhfil(',t,')=',trim(nhfil(t,accumulated_file_index))
+ write(iulog,*)'WSHIST: instantaneous nhfil(',t,')=',trim(nhfil(t,instantaneous_file_index))
+ end if
+ end if
+ cpath(t,:) = nhfil(t,:)
+ if ( len_trim(nfpath(t)) == 0 ) nfpath(t) = cpath(t, 1)
end if
call h_define (t, restart)
end if
@@ -5094,104 +5700,149 @@ subroutine wshist (rgnht_in)
if (interpolate_output(t) .and. (.not. restart)) then
call set_interp_hfile(t, interpolate_info)
end if
+ ierr = pio_put_var (tape(t)%Files(instantaneous_file_index),tape(t)%ndcurid,(/start/),(/count1/),(/ndcur/))
+ ierr = pio_put_var (tape(t)%Files(instantaneous_file_index), tape(t)%nscurid,(/start/),(/count1/),(/nscur/))
+ do f = 1, maxsplitfiles
+ if (pio_file_is_open(tape(t)%Files(f))) then
+ ierr = pio_put_var (tape(t)%Files(f), tape(t)%dateid,(/start/),(/count1/),(/ncdate(f)/))
+ end if
+ end do
- ierr = pio_put_var (tape(t)%File, tape(t)%ndcurid,(/start/), (/count1/),(/ndcur/))
- ierr = pio_put_var (tape(t)%File, tape(t)%nscurid,(/start/), (/count1/),(/nscur/))
- ierr = pio_put_var (tape(t)%File, tape(t)%dateid,(/start/), (/count1/),(/ncdate/))
-
- if (.not. is_initfile(file_index=t)) then
- ! Don't write the GHG/Solar forcing data to the IC file.
- ierr=pio_put_var (tape(t)%File, tape(t)%co2vmrid,(/start/), (/count1/),(/chem_surfvals_co2_rad(vmr_in=.true.)/))
- ierr=pio_put_var (tape(t)%File, tape(t)%ch4vmrid,(/start/), (/count1/),(/chem_surfvals_get('CH4VMR')/))
- ierr=pio_put_var (tape(t)%File, tape(t)%n2ovmrid,(/start/), (/count1/),(/chem_surfvals_get('N2OVMR')/))
- ierr=pio_put_var (tape(t)%File, tape(t)%f11vmrid,(/start/), (/count1/),(/chem_surfvals_get('F11VMR')/))
- ierr=pio_put_var (tape(t)%File, tape(t)%f12vmrid,(/start/), (/count1/),(/chem_surfvals_get('F12VMR')/))
- ierr=pio_put_var (tape(t)%File, tape(t)%sol_tsiid,(/start/), (/count1/),(/sol_tsi/))
-
- if (solar_parms_on) then
- ierr=pio_put_var (tape(t)%File, tape(t)%f107id, (/start/), (/count1/),(/ f107 /) )
- ierr=pio_put_var (tape(t)%File, tape(t)%f107aid,(/start/), (/count1/),(/ f107a /) )
- ierr=pio_put_var (tape(t)%File, tape(t)%f107pid,(/start/), (/count1/),(/ f107p /) )
- ierr=pio_put_var (tape(t)%File, tape(t)%kpid, (/start/), (/count1/),(/ kp /) )
- ierr=pio_put_var (tape(t)%File, tape(t)%apid, (/start/), (/count1/),(/ ap /) )
- endif
- if (solar_wind_on) then
- ierr=pio_put_var (tape(t)%File, tape(t)%byimfid, (/start/), (/count1/),(/ byimf /) )
- ierr=pio_put_var (tape(t)%File, tape(t)%bzimfid, (/start/), (/count1/),(/ bzimf /) )
- ierr=pio_put_var (tape(t)%File, tape(t)%swvelid, (/start/), (/count1/),(/ swvel /) )
- ierr=pio_put_var (tape(t)%File, tape(t)%swdenid, (/start/), (/count1/),(/ swden /) )
- endif
- if (epot_active) then
- ierr=pio_put_var (tape(t)%File, tape(t)%colat_crit1_id, (/start/), (/count1/),(/ epot_crit_colats(1) /) )
- ierr=pio_put_var (tape(t)%File, tape(t)%colat_crit2_id, (/start/), (/count1/),(/ epot_crit_colats(2) /) )
- endif
- end if
-
- ierr = pio_put_var (tape(t)%File, tape(t)%datesecid,(/start/),(/count1/),(/ncsec/))
+ do f = 1, maxsplitfiles
+ if (.not. is_initfile(file_index=t) .and. f == instantaneous_file_index) then
+ ! Don't write the GHG/Solar forcing data to the IC file.
+ ! Only write GHG/Solar forcing data to the instantaneous file
+ ierr=pio_put_var (tape(t)%Files(f), tape(t)%co2vmrid,(/start/), (/count1/),(/chem_surfvals_co2_rad(vmr_in=.true.)/))
+ ierr=pio_put_var (tape(t)%Files(f), tape(t)%ch4vmrid,(/start/), (/count1/),(/chem_surfvals_get('CH4VMR')/))
+ ierr=pio_put_var (tape(t)%Files(f), tape(t)%n2ovmrid,(/start/), (/count1/),(/chem_surfvals_get('N2OVMR')/))
+ ierr=pio_put_var (tape(t)%Files(f), tape(t)%f11vmrid,(/start/), (/count1/),(/chem_surfvals_get('F11VMR')/))
+ ierr=pio_put_var (tape(t)%Files(f), tape(t)%f12vmrid,(/start/), (/count1/),(/chem_surfvals_get('F12VMR')/))
+ ierr=pio_put_var (tape(t)%Files(f), tape(t)%sol_tsiid,(/start/), (/count1/),(/sol_tsi/))
+
+ if (solar_parms_on) then
+ ierr=pio_put_var (tape(t)%Files(f), tape(t)%f107id, (/start/), (/count1/),(/ f107 /) )
+ ierr=pio_put_var (tape(t)%Files(f), tape(t)%f107aid,(/start/), (/count1/),(/ f107a /) )
+ ierr=pio_put_var (tape(t)%Files(f), tape(t)%f107pid,(/start/), (/count1/),(/ f107p /) )
+ ierr=pio_put_var (tape(t)%Files(f), tape(t)%kpid, (/start/), (/count1/),(/ kp /) )
+ ierr=pio_put_var (tape(t)%Files(f), tape(t)%apid, (/start/), (/count1/),(/ ap /) )
+ endif
+ if (solar_wind_on) then
+ ierr=pio_put_var (tape(t)%Files(f), tape(t)%byimfid, (/start/), (/count1/),(/ byimf /) )
+ ierr=pio_put_var (tape(t)%Files(f), tape(t)%bzimfid, (/start/), (/count1/),(/ bzimf /) )
+ ierr=pio_put_var (tape(t)%Files(f), tape(t)%swvelid, (/start/), (/count1/),(/ swvel /) )
+ ierr=pio_put_var (tape(t)%Files(f), tape(t)%swdenid, (/start/), (/count1/),(/ swden /) )
+ endif
+ if (epot_active) then
+ ierr=pio_put_var (tape(t)%Files(f), tape(t)%colat_crit1_id, (/start/), (/count1/),(/ epot_crit_colats(1) /) )
+ ierr=pio_put_var (tape(t)%Files(f), tape(t)%colat_crit2_id, (/start/), (/count1/),(/ epot_crit_colats(2) /) )
+ endif
+ end if
+ end do
+ do f = 1, maxsplitfiles
+ if (pio_file_is_open(tape(t)%Files(f))) then
+ ierr = pio_put_var (tape(t)%Files(f),tape(t)%datesecid,(/start/),(/count1/),(/ncsec(f)/))
+ end if
+ end do
#if ( defined BFB_CAM_SCAM_IOP )
dtime = get_step_size()
tsec=dtime*nstep
- ierr = pio_put_var (tape(t)%File, tape(t)%tsecid,(/start/),(/count1/),(/tsec/))
+ do f = 1, maxsplitfiles
+ if (pio_file_is_open(tape(t)%Files(f))) then
+ ierr = pio_put_var (tape(t)%Files(f),tape(t)%tsecid,(/start/),(/count1/),(/tsec/))
+ end if
+ end do
#endif
- ierr = pio_put_var (tape(t)%File, tape(t)%nstephid,(/start/),(/count1/),(/nstep/))
- time = ndcur + nscur/86400._r8
- ierr=pio_put_var (tape(t)%File, tape(t)%timeid, (/start/),(/count1/),(/time/))
-
+ ierr = pio_put_var (tape(t)%Files(instantaneous_file_index),tape(t)%nstephid,(/start/),(/count1/),(/nstep/))
startc(1) = 1
startc(2) = start
countc(1) = 2
countc(2) = 1
- if (is_initfile(file_index=t)) then
- tdata = time ! Inithist file is always instantanious data
- else
- tdata(1) = beg_time(t)
- tdata(2) = time
- end if
- ierr=pio_put_var (tape(t)%File, tape(t)%tbndid, startc, countc, tdata)
+ do f = 1, maxsplitfiles
+ if (.not. pio_file_is_open(tape(t)%Files(f))) then
+ cycle
+ end if
+ ! We have two files - one for accumulated and one for instantaneous fields
+ if (f == accumulated_file_index .and. .not. restart .and. .not. is_initfile(t)) then
+ ! accumulated tape - time is midpoint of time_bounds
+ ierr=pio_put_var (tape(t)%Files(f), tape(t)%timeid, (/start/),(/count1/),(/(tdata(1) + tdata(2)) / 2._r8/))
+ else
+ ! not an accumulated history tape - time is current time
+ ierr=pio_put_var (tape(t)%Files(f), tape(t)%timeid, (/start/),(/count1/),(/time/))
+ end if
+ ierr=pio_put_var (tape(t)%Files(f), tape(t)%tbndid, startc, countc, tdata)
+ end do
if(.not.restart) beg_time(t) = time ! update beginning time of next interval
startc(1) = 1
startc(2) = start
countc(1) = 8
countc(2) = 1
call datetime (cdate, ctime)
- ierr = pio_put_var (tape(t)%File, tape(t)%date_writtenid, startc, countc, (/cdate/))
- ierr = pio_put_var (tape(t)%File, tape(t)%time_writtenid, startc, countc, (/ctime/))
+ do f = 1, maxsplitfiles
+ if (pio_file_is_open(tape(t)%Files(f))) then
+ ierr = pio_put_var (tape(t)%Files(f), tape(t)%date_writtenid, startc, countc, (/cdate/))
+ ierr = pio_put_var (tape(t)%Files(f), tape(t)%time_writtenid, startc, countc, (/ctime/))
+ end if
+ end do
if(.not. restart) then
- !$OMP PARALLEL DO PRIVATE (F)
- do f=1,nflds(t)
- ! Normalized averaged fields
- if (tape(t)%hlist(f)%avgflag /= 'I') then
- call h_normalize (f, t)
- end if
- end do
+ !$OMP PARALLEL DO PRIVATE (FLD)
+ do fld=1,nflds(t)
+ ! Normalize all non composed fields, composed fields are calculated next using the normalized components
+ if (tape(t)%hlist(fld)%avgflag /= 'I'.and..not.tape(t)%hlist(fld)%field%is_composed()) then
+ call h_normalize (fld, t)
+ end if
+ end do
+ end if
+
+ if(.not. restart) then
+ !$OMP PARALLEL DO PRIVATE (FLD)
+ do fld=1,nflds(t)
+ ! calculate composed fields from normalized components
+ if (tape(t)%hlist(fld)%field%is_composed()) then
+ call h_field_op (fld, t)
+ end if
+ end do
end if
!
! Write field to history tape. Note that this is NOT threaded due to netcdf limitations
!
call t_startf ('dump_field')
- do f=1,nflds(t)
- call dump_field(f, t, restart)
+ do fld=1,nflds(t)
+ do f = 1, maxsplitfiles
+ if (.not. pio_file_is_open(tape(t)%Files(f))) then
+ cycle
+ end if
+ ! we may have a history split, conditionally skip fields that are for the other file
+ if ((tape(t)%hlist(fld)%avgflag .eq. 'I') .and. f == accumulated_file_index .and. .not. restart) then
+ cycle
+ else if ((tape(t)%hlist(fld)%avgflag .ne. 'I') .and. f == instantaneous_file_index .and. .not. restart) then
+ cycle
+ end if
+ call dump_field(fld, t, f, restart)
+ end do
end do
call t_stopf ('dump_field')
!
+ ! Calculate globals
+ !
+ do fld=1,nflds(t)
+ call h_global(fld, t)
+ end do
+ !
! Zero history buffers and accumulators now that the fields have been written.
!
-
-
-
if(restart) then
- do f=1,nflds(t)
- if(associated(tape(t)%hlist(f)%varid)) then
- deallocate(tape(t)%hlist(f)%varid)
- nullify(tape(t)%hlist(f)%varid)
+ do fld=1,nflds(t)
+ if(associated(tape(t)%hlist(fld)%varid)) then
+ deallocate(tape(t)%hlist(fld)%varid)
+ nullify(tape(t)%hlist(fld)%varid)
end if
end do
- call cam_pio_closefile(tape(t)%File)
+ call cam_pio_closefile(tape(t)%Files(restart_file_index))
else
- !$OMP PARALLEL DO PRIVATE (F)
- do f=1,nflds(t)
- call h_zero (f, t)
+ !$OMP PARALLEL DO PRIVATE (FLD)
+ do fld=1,nflds(t)
+ call h_zero (fld, t)
end do
end if
end if
@@ -5205,7 +5856,8 @@ end subroutine wshist
!#######################################################################
subroutine addfld_1d(fname, vdim_name, avgflag, units, long_name, &
- gridname, flag_xyfill, sampling_seq, standard_name, fill_value)
+ gridname, flag_xyfill, sampling_seq, standard_name, fill_value, &
+ optype, op_f1name, op_f2name)
!
!-----------------------------------------------------------------------
@@ -5234,7 +5886,9 @@ subroutine addfld_1d(fname, vdim_name, avgflag, units, long_name, &
! every other; only during LW/SW radiation calcs, etc.
character(len=*), intent(in), optional :: standard_name ! CF standard name (max_chars)
real(r8), intent(in), optional :: fill_value
-
+ character(len=*), intent(in), optional :: optype ! currently 'dif' or 'sum' is supported
+ character(len=*), intent(in), optional :: op_f1name ! first field to be operated on
+ character(len=*), intent(in), optional :: op_f2name ! second field which is subtracted from or added to first field
!
! Local workspace
!
@@ -5252,12 +5906,14 @@ subroutine addfld_1d(fname, vdim_name, avgflag, units, long_name, &
dimnames(1) = trim(vdim_name)
end if
call addfld(fname, dimnames, avgflag, units, long_name, gridname, &
- flag_xyfill, sampling_seq, standard_name, fill_value)
+ flag_xyfill, sampling_seq, standard_name, fill_value, optype, op_f1name, &
+ op_f2name)
end subroutine addfld_1d
subroutine addfld_nd(fname, dimnames, avgflag, units, long_name, &
- gridname, flag_xyfill, sampling_seq, standard_name, fill_value)
+ gridname, flag_xyfill, sampling_seq, standard_name, fill_value, optype, &
+ op_f1name, op_f2name)
!
!-----------------------------------------------------------------------
@@ -5272,7 +5928,7 @@ subroutine addfld_nd(fname, dimnames, avgflag, units, long_name, &
use cam_history_support, only: fillvalue, hist_coord_find_levels
use cam_grid_support, only: cam_grid_id, cam_grid_is_zonal
use cam_grid_support, only: cam_grid_get_coord_names
- use constituents, only: pcnst, cnst_get_ind, cnst_get_type_byind
+ use constituents, only: cnst_get_ind, cnst_get_type_byind
!
! Arguments
@@ -5290,6 +5946,9 @@ subroutine addfld_nd(fname, dimnames, avgflag, units, long_name, &
! every other; only during LW/SW radiation calcs, etc.
character(len=*), intent(in), optional :: standard_name ! CF standard name (max_chars)
real(r8), intent(in), optional :: fill_value
+ character(len=*), intent(in), optional :: optype ! currently 'dif' or 'sum' supported
+ character(len=*), intent(in), optional :: op_f1name ! first field to be operated on
+ character(len=*), intent(in), optional :: op_f2name ! second field which is subtracted from or added to first field
!
! Local workspace
@@ -5299,10 +5958,13 @@ subroutine addfld_nd(fname, dimnames, avgflag, units, long_name, &
character(len=128) :: errormsg
character(len=3) :: mixing_ratio
type(master_entry), pointer :: listentry
+ type(master_entry), pointer :: f1listentry,f2listentry
integer :: dimcnt
integer :: idx
+ character(len=*), parameter :: subname='ADDFLD_ND'
+
if (htapes_defined) then
call endrun ('ADDFLD: Attempt to add field '//trim(fname)//' after history files set')
end if
@@ -5352,6 +6014,11 @@ subroutine addfld_nd(fname, dimnames, avgflag, units, long_name, &
listentry%field%mixing_ratio = mixing_ratio
listentry%field%meridional_complement = -1
listentry%field%zonal_complement = -1
+ listentry%field%field_op = ''
+ listentry%field%op_field1_id = -1
+ listentry%field%op_field2_id = -1
+ listentry%op_field1 = ''
+ listentry%op_field2 = ''
listentry%htapeindx(:) = -1
listentry%act_sometape = .false.
listentry%actflag(:) = .false.
@@ -5428,8 +6095,8 @@ subroutine addfld_nd(fname, dimnames, avgflag, units, long_name, &
write(errormsg, *) "Cannot add ", trim(fname), &
"Subcolumn history output only allowed on physgrid"
call endrun("ADDFLD: "//errormsg)
- listentry%field%is_subcol = .true.
end if
+ listentry%field%is_subcol = .true.
end if
end if
! Levels
@@ -5453,6 +6120,45 @@ subroutine addfld_nd(fname, dimnames, avgflag, units, long_name, &
call AvgflagToString(avgflag, listentry%time_op(dimcnt))
end do
+ if (present(optype)) then
+ ! make sure optype is "sum" or "dif"
+ if (.not.(trim(optype) == 'dif' .or. trim(optype) == 'sum')) then
+ write(errormsg, '(2a)')': Fatal : optype must be "sum" or "dif" not ',trim(optype)
+ call endrun (trim(subname)//errormsg)
+ end if
+ listentry%field%field_op = optype
+ if (present(op_f1name).and.present(op_f2name)) then
+ ! Look for the field IDs
+ f1listentry => get_entry_by_name(masterlinkedlist, trim(op_f1name))
+ f2listentry => get_entry_by_name(masterlinkedlist, trim(op_f2name))
+ if (associated(f1listentry).and.associated(f2listentry)) then
+ listentry%op_field1=trim(op_f1name)
+ listentry%op_field2=trim(op_f2name)
+ else
+ write(errormsg, '(5a)') ': Attempt to create a composed field using (', &
+ trim(op_f1name), ', ', trim(op_f2name), &
+ ') but both fields have not been added to masterlist via addfld first'
+ call endrun (trim(subname)//errormsg)
+ end if
+ else
+ write(errormsg, *) ': Attempt to create a composed field but no component fields have been specified'
+ call endrun (trim(subname)//errormsg)
+ end if
+
+ else
+ if (present(op_f1name)) then
+ write(errormsg, '(3a)') ': creating a composed field using component field 1:',&
+ trim(op_f1name),' but no field operation (optype=sum or dif) has been defined'
+ call endrun (trim(subname)//errormsg)
+ end if
+ if (present(op_f2name)) then
+ write(errormsg, '(3a)') ': creating a composed field using component field 2:',&
+ trim(op_f2name),' but no field operation (optype=sum or dif) has been defined'
+ call endrun (trim(subname)//errormsg)
+ end if
+ end if
+
+
nullify(listentry%next_entry)
call add_entry_to_master(listentry)
@@ -5461,7 +6167,7 @@ end subroutine addfld_nd
!#######################################################################
- ! field_part_of_vector: Determinie if fname is part of a vector set
+ ! field_part_of_vector: Determine if fname is part of a vector set
! Optionally fill in the names of the vector set fields
logical function field_part_of_vector(fname, meridional_name, zonal_name)
@@ -5501,6 +6207,53 @@ logical function field_part_of_vector(fname, meridional_name, zonal_name)
end function field_part_of_vector
+ !#######################################################################
+ ! composed field_info: Determine if a field is derived from a mathematical
+ ! operation using 2 other defined fields. Optionally,
+ ! retrieve names of the composing fields
+ subroutine composed_field_info(fname, is_composed, fname1, fname2)
+
+ ! Dummy arguments
+ character(len=*), intent(in) :: fname
+ logical, intent(out) :: is_composed
+ character(len=*), optional, intent(out) :: fname1
+ character(len=*), optional, intent(out) :: fname2
+
+ ! Local variables
+ type(master_entry), pointer :: listentry
+ character(len=128) :: errormsg
+ character(len=*), parameter :: subname='composed_field_info'
+
+ listentry => get_entry_by_name(masterlinkedlist, fname)
+ if (associated(listentry)) then
+ if ( (len_trim(listentry%op_field1) > 0) .or. &
+ (len_trim(listentry%op_field2) > 0)) then
+ is_composed = .true.
+ else
+ is_composed = .false.
+ end if
+ if (is_composed) then
+ if (present(fname1)) then
+ fname1=trim(listentry%op_field1)
+ end if
+ if (present(fname2)) then
+ fname2=trim(listentry%op_field2)
+ end if
+ else
+ if (present(fname1)) then
+ fname1 = ''
+ end if
+ if (present(fname2)) then
+ fname2 = ''
+ end if
+ end if
+ else
+ write(errormsg, '(3a)') ': Field:',trim(fname),' not defined in masterlist'
+ call endrun (trim(subname)//errormsg)
+ end if
+
+ end subroutine composed_field_info
+
! register_vector_field: Register a pair of history field names as
! being a vector complement set.
@@ -5624,7 +6377,6 @@ subroutine wrapup (rstwr, nlend)
!
!-----------------------------------------------------------------------
!
- use pio, only : pio_file_is_open
use shr_kind_mod, only: r8 => shr_kind_r8
use ioFileMod
use time_manager, only: get_nstep, get_curr_date, get_curr_time
@@ -5650,7 +6402,8 @@ subroutine wrapup (rstwr, nlend)
logical :: lhfill ! true => history file is full
integer :: t ! History file number
- integer :: f
+ integer :: f ! File index
+ integer :: fld ! Field index
real(r8) :: tday ! Model day number for printout
!-----------------------------------------------------------------------
@@ -5670,7 +6423,6 @@ subroutine wrapup (rstwr, nlend)
!
do t=1,ptapes
if (nflds(t) == 0) cycle
-
lfill(t) = .false.
!
! Find out if file is full
@@ -5692,18 +6444,29 @@ subroutine wrapup (rstwr, nlend)
! Is this the 0 timestep data of a monthly run?
! If so, just close primary unit do not dispose.
!
- if (masterproc) write(iulog,*)'WRAPUP: nf_close(',t,')=',trim(nhfil(t))
- if(pio_file_is_open(tape(t)%File)) then
+ if (masterproc) then
+ do f = 1, maxsplitfiles
+ if (pio_file_is_open(tape(t)%Files(f))) then
+ write(iulog,*)'WRAPUP: nf_close(',t,')=',trim(nhfil(t,f))
+ end if
+ end do
+ end if
+ if(pio_file_is_open(tape(t)%Files(accumulated_file_index)) .or. &
+ pio_file_is_open(tape(t)%Files(instantaneous_file_index))) then
if (nlend .or. lfill(t)) then
- do f=1,nflds(t)
- if (associated(tape(t)%hlist(f)%varid)) then
- deallocate(tape(t)%hlist(f)%varid)
- nullify(tape(t)%hlist(f)%varid)
+ do fld=1,nflds(t)
+ if (associated(tape(t)%hlist(fld)%varid)) then
+ deallocate(tape(t)%hlist(fld)%varid)
+ nullify(tape(t)%hlist(fld)%varid)
end if
end do
end if
- call cam_pio_closefile(tape(t)%File)
end if
+ do f = 1, maxsplitfiles
+ if (pio_file_is_open(tape(t)%Files(f))) then
+ call cam_pio_closefile(tape(t)%Files(f))
+ end if
+ end do
if (nhtfrq(t) /= 0 .or. nstep > 0) then
!
@@ -5726,7 +6489,12 @@ subroutine wrapup (rstwr, nlend)
! Must position auxiliary files if not full
!
if (.not.nlend .and. .not.lfill(t)) then
- call cam_PIO_openfile (tape(t)%File, nhfil(t), PIO_WRITE)
+ ! Always open the instantaneous file
+ call cam_PIO_openfile (tape(t)%Files(instantaneous_file_index), nhfil(t,instantaneous_file_index), PIO_WRITE)
+ if (hfile_accum(t)) then
+ ! Conditionally open the accumulated file
+ call cam_PIO_openfile (tape(t)%Files(accumulated_file_index), nhfil(t,accumulated_file_index), PIO_WRITE)
+ end if
call h_inquire(t)
end if
endif ! if 0 timestep of montly run****
@@ -5971,7 +6739,7 @@ subroutine bld_htapefld_indices
!
! Local.
!
- integer :: f
+ integer :: fld
integer :: t
!
@@ -5989,17 +6757,17 @@ subroutine bld_htapefld_indices
end do
do t = 1, ptapes
- do f = 1, nflds(t)
- listentry => get_entry_by_name(masterlinkedlist, tape(t)%hlist(f)%field%name)
+ do fld = 1, nflds(t)
+ listentry => get_entry_by_name(masterlinkedlist, tape(t)%hlist(fld)%field%name)
if(.not.associated(listentry)) then
write(iulog,*) 'BLD_HTAPEFLD_INDICES: something wrong, field not found on masterlist'
- write(iulog,*) 'BLD_HTAPEFLD_INDICES: t, f, ff = ', t, f
- write(iulog,*) 'BLD_HTAPEFLD_INDICES: tape%name = ', tape(t)%hlist(f)%field%name
+ write(iulog,*) 'BLD_HTAPEFLD_INDICES: t, f, ff = ', t, fld
+ write(iulog,*) 'BLD_HTAPEFLD_INDICES: tape%name = ', tape(t)%hlist(fld)%field%name
call endrun
end if
listentry%act_sometape = .true.
listentry%actflag(t) = .true.
- listentry%htapeindx(t) = f
+ listentry%htapeindx(t) = fld
end do
end do
@@ -6062,10 +6830,10 @@ function hist_fld_col_active(fname, lchnk, numcols)
logical :: hist_fld_col_active(numcols)
! Local variables
- integer :: ff ! masterlist index pointer
+ integer :: ffld ! masterlist index pointer
integer :: i
integer :: t ! history file (tape) index
- integer :: f ! field index
+ integer :: fld ! field index
integer :: decomp
logical :: activeloc(numcols)
integer :: num_patches
@@ -6081,22 +6849,22 @@ function hist_fld_col_active(fname, lchnk, numcols)
hist_fld_col_active = .false.
! Check for name in the master list.
- call get_field_properties(fname, found, tape_out=tape, ff_out=ff)
+ call get_field_properties(fname, found, tape_out=tape, ff_out=ffld)
! If not in master list then return.
if (.not. found) return
! If in master list, but not active on any file then return
- if (.not. masterlist(ff)%thisentry%act_sometape) return
+ if (.not. masterlist(ffld)%thisentry%act_sometape) return
! Loop over history files and check for the field/column in each one
do t = 1, ptapes
! Is the field active in this file? If not the cycle to next file.
- if (.not. masterlist(ff)%thisentry%actflag(t)) cycle
+ if (.not. masterlist(ffld)%thisentry%actflag(t)) cycle
- f = masterlist(ff)%thisentry%htapeindx(t)
- decomp = tape(t)%hlist(f)%field%decomp_type
+ fld = masterlist(ffld)%thisentry%htapeindx(t)
+ decomp = tape(t)%hlist(fld)%field%decomp_type
patch_output = associated(tape(t)%patches)
! Check whether this file has patch (column) output.
diff --git a/src/control/cam_history_buffers.F90 b/src/control/cam_history_buffers.F90
index f9a141247a..b26162753c 100644
--- a/src/control/cam_history_buffers.F90
+++ b/src/control/cam_history_buffers.F90
@@ -111,6 +111,7 @@ subroutine hbuf_accum_add (buf8, field, nacs, dimind, idim, flag_xyfill, fillval
end subroutine hbuf_accum_add
!#######################################################################
+
subroutine hbuf_accum_variance (hbuf, sbuf, field, nacs, dimind, idim, flag_xyfill, fillvalue)
!
!-----------------------------------------------------------------------
diff --git a/src/control/cam_history_support.F90 b/src/control/cam_history_support.F90
index 8251ebde95..07ab2dd81a 100644
--- a/src/control/cam_history_support.F90
+++ b/src/control/cam_history_support.F90
@@ -10,13 +10,12 @@ module cam_history_support
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
use shr_kind_mod, only: r8=>shr_kind_r8, shr_kind_cl, shr_kind_cxx
- use shr_sys_mod, only: shr_sys_flush
use pio, only: var_desc_t, file_desc_t
use cam_abortutils, only: endrun
use cam_logfile, only: iulog
use spmd_utils, only: masterproc
use cam_grid_support, only: cam_grid_patch_t, cam_grid_header_info_t
- use cam_grid_support, only: max_hcoordname_len
+ use cam_grid_support, only: max_hcoordname_len, maxsplitfiles
use cam_pio_utils, only: cam_pio_handle_error
implicit none
@@ -25,9 +24,10 @@ module cam_history_support
integer, parameter, public :: max_string_len = shr_kind_cxx
integer, parameter, public :: max_chars = shr_kind_cl ! max chars for char variables
- integer, parameter, public :: fieldname_len = 32 ! max chars for field name
- integer, parameter, public :: fieldname_suffix_len = 3 ! length of field name suffix ("&IC")
- integer, parameter, public :: fieldname_lenp2 = fieldname_len + 2 ! allow for extra characters
+ integer, parameter, public :: field_op_len = 3 ! max chars for field operation string (sum/dif)
+ integer, parameter, public :: fieldname_len = 32 ! max chars for field name
+ integer, parameter, public :: fieldname_suffix_len = 3 ! length of field name suffix ("&IC")
+ integer, parameter, public :: fieldname_lenp2 = fieldname_len + 2 ! allow for extra characters
! max_fieldname_len = max chars for field name (including suffix)
integer, parameter, public :: max_fieldname_len = fieldname_len + fieldname_suffix_len
@@ -118,6 +118,10 @@ module cam_history_support
integer :: meridional_complement ! meridional field id or -1
integer :: zonal_complement ! zonal field id or -1
+ character(len=field_op_len) :: field_op = '' ! 'sum' or 'dif'
+ integer :: op_field1_id ! first field id or -1
+ integer :: op_field2_id ! second field id or -1
+
character(len=max_fieldname_len) :: name ! field name
character(len=max_chars) :: long_name ! long name
character(len=max_chars) :: units ! units
@@ -127,6 +131,7 @@ module cam_history_support
! radiation calcs; etc.
character(len=max_chars) :: cell_methods ! optional cell_methods attribute
contains
+ procedure :: is_composed => field_info_is_composed
procedure :: get_shape => field_info_get_shape
procedure :: get_bounds => field_info_get_bounds
procedure :: get_dims_2d => field_info_get_dims_2d
@@ -153,17 +158,27 @@ module cam_history_support
!
!---------------------------------------------------------------------------
type, public:: hentry
- type (field_info) :: field ! field information
- character(len=1) :: avgflag ! averaging flag
- character(len=max_chars) :: time_op ! time operator (e.g. max, min, avg)
+ type (field_info) :: field ! field information
+ character(len=1) :: avgflag ! averaging flag
+ character(len=max_chars) :: time_op ! time operator (e.g. max, min, avg)
+ character(len=max_fieldname_len) :: op_field1 ! field1 name for sum or dif operation
+ character(len=max_fieldname_len) :: op_field2 ! field2 name for sum or dif operation
- integer :: hwrt_prec ! history output precision
+ integer :: hwrt_prec ! history output precision
real(r8), pointer :: hbuf(:,:,:) => NULL()
+ real(r8), private :: hbuf_integral ! area weighted integral of active field
real(r8), pointer :: sbuf(:,:,:) => NULL() ! for standard deviation
+ real(r8), pointer :: wbuf(:,:) => NULL() ! pointer to area weights
type(var_desc_t), pointer :: varid(:) => NULL() ! variable ids
integer, pointer :: nacs(:,:) => NULL() ! accumulation counter
type(var_desc_t), pointer :: nacs_varid => NULL()
+ integer :: beg_nstep ! starting time step for nstep normalization
+ type(var_desc_t), pointer :: beg_nstep_varid=> NULL()
type(var_desc_t), pointer :: sbuf_varid => NULL()
+ type(var_desc_t), pointer :: wbuf_varid => NULL()
+ contains
+ procedure :: get_global => hentry_get_global
+ procedure :: put_global => hentry_put_global
end type hentry
!---------------------------------------------------------------------------
@@ -182,7 +197,7 @@ module cam_history_support
! PIO ids
!
- type(file_desc_t) :: File ! PIO file id
+ type(file_desc_t) :: Files(maxsplitfiles) ! PIO file ids
type(var_desc_t) :: mdtid ! var id for timestep
type(var_desc_t) :: ndbaseid ! var id for base day
@@ -205,7 +220,7 @@ module cam_history_support
#endif
type(var_desc_t) :: nstephid ! var id for current timestep
type(var_desc_t) :: timeid ! var id for time
- type(var_desc_t) :: tbndid ! var id for time_bnds
+ type(var_desc_t) :: tbndid ! var id for time_bounds
type(var_desc_t) :: date_writtenid ! var id for date time sample written
type(var_desc_t) :: time_writtenid ! var id for time time sample written
type(var_desc_t) :: f107id ! var id for f107
@@ -435,6 +450,14 @@ type(dim_index_3d) function field_info_get_dims_3d(this) result(dims)
end function field_info_get_dims_3d
+ ! field_info_is_composed: Return whether this field is composed of two other fields
+ pure logical function field_info_is_composed(this)
+ class(field_info), intent(IN) :: this
+
+ field_info_is_composed = ((trim(adjustl(this%field_op))=='sum' .or. trim(adjustl(this%field_op))=='dif') .and. &
+ this%op_field1_id /= -1 .and. this%op_field2_id /= -1)
+ end function field_info_is_composed
+
! field_info_get_shape: Return a pointer to the field's global shape.
! Calculate it first if necessary
subroutine field_info_get_shape(this, shape_out, rank_out)
@@ -503,6 +526,26 @@ subroutine field_info_get_bounds(this, dim, beg, end)
end subroutine field_info_get_bounds
+ subroutine hentry_get_global(this, gval)
+
+ ! Dummy arguments
+ class(hentry) :: this
+ real(r8), intent(out) :: gval
+
+ gval=this%hbuf_integral
+
+ end subroutine hentry_get_global
+
+ subroutine hentry_put_global(this, gval)
+
+ ! Dummy arguments
+ class(hentry) :: this
+ real(r8), intent(in) :: gval
+
+ this%hbuf_integral=gval
+
+ end subroutine hentry_put_global
+
! history_patch_write_attrs: Define coordinate variables and attributes
! for a patch
subroutine history_patch_write_attrs(this, File)
@@ -651,16 +694,8 @@ subroutine history_patch_write_vals(this, File)
type(cam_grid_patch_t), pointer :: patchptr
type(var_desc_t), pointer :: vardesc => NULL() ! PIO var desc
character(len=128) :: errormsg
- character(len=max_chars) :: lat_name
- character(len=max_chars) :: lon_name
- character(len=max_chars) :: col_name
- character(len=max_chars) :: temp_str
- integer :: dimid ! PIO dimension ID
integer :: num_patches
- integer :: temp1, temp2
- integer :: latid, lonid ! Coordinate dims
integer :: i
- logical :: col_only
num_patches = size(this%patches)
if (.not. associated(this%header_info)) then
@@ -957,6 +992,9 @@ subroutine field_copy(f_out, f_in)
f_out%meridional_complement = f_in%meridional_complement ! id or -1
f_out%zonal_complement = f_in%zonal_complement ! id or -1
+ f_out%field_op = f_in%field_op ! sum,dif, or ''
+ f_out%op_field1_id = f_in%op_field1_id ! id or -1
+ f_out%op_field2_id = f_in%op_field2_id ! id or -1
f_out%name = f_in%name ! field name
f_out%long_name = f_in%long_name ! long name
diff --git a/src/control/camsrfexch.F90 b/src/control/camsrfexch.F90
index 6715b6f4cd..de1ea4ce6e 100644
--- a/src/control/camsrfexch.F90
+++ b/src/control/camsrfexch.F90
@@ -61,6 +61,7 @@ module camsrfexch
real(r8) :: co2prog(pcols) ! prognostic co2
real(r8) :: co2diag(pcols) ! diagnostic co2
real(r8) :: ozone(pcols) ! surface ozone concentration (mole/mole)
+ real(r8) :: lightning_flash_freq(pcols) ! cloud-to-ground lightning flash frequency (/min)
real(r8) :: psl(pcols)
real(r8) :: bcphiwet(pcols) ! wet deposition of hydrophilic black carbon
real(r8) :: bcphidry(pcols) ! dry deposition of hydrophilic black carbon
@@ -302,6 +303,7 @@ subroutine atm2hub_alloc( cam_out )
cam_out(c)%co2prog(:) = 0._r8
cam_out(c)%co2diag(:) = 0._r8
cam_out(c)%ozone(:) = 0._r8
+ cam_out(c)%lightning_flash_freq(:) = 0._r8
cam_out(c)%psl(:) = 0._r8
cam_out(c)%bcphidry(:) = 0._r8
cam_out(c)%bcphodry(:) = 0._r8
@@ -319,18 +321,14 @@ subroutine atm2hub_alloc( cam_out )
cam_out(c)%dstwet4(:) = 0._r8
nullify(cam_out(c)%nhx_nitrogen_flx)
- nullify(cam_out(c)%noy_nitrogen_flx)
+ allocate (cam_out(c)%nhx_nitrogen_flx(pcols), stat=ierror)
+ if ( ierror /= 0 ) call endrun(sub//': allocation error nhx_nitrogen_flx')
+ cam_out(c)%nhx_nitrogen_flx(:) = 0._r8
- if (active_Faxa_nhx) then
- allocate (cam_out(c)%nhx_nitrogen_flx(pcols), stat=ierror)
- if ( ierror /= 0 ) call endrun(sub//': allocation error nhx_nitrogen_flx')
- cam_out(c)%nhx_nitrogen_flx(:) = 0._r8
- endif
- if (active_Faxa_noy) then
- allocate (cam_out(c)%noy_nitrogen_flx(pcols), stat=ierror)
- if ( ierror /= 0 ) call endrun(sub//': allocation error noy_nitrogen_flx')
- cam_out(c)%noy_nitrogen_flx(:) = 0._r8
- endif
+ nullify(cam_out(c)%noy_nitrogen_flx)
+ allocate (cam_out(c)%noy_nitrogen_flx(pcols), stat=ierror)
+ if ( ierror /= 0 ) call endrun(sub//': allocation error noy_nitrogen_flx')
+ cam_out(c)%noy_nitrogen_flx(:) = 0._r8
end do
end subroutine atm2hub_alloc
@@ -427,7 +425,7 @@ subroutine cam_export(state,cam_out,pbuf)
integer :: psl_idx
integer :: prec_dp_idx, snow_dp_idx, prec_sh_idx, snow_sh_idx
integer :: prec_sed_idx,snow_sed_idx,prec_pcw_idx,snow_pcw_idx
- integer :: srf_ozone_idx
+ integer :: srf_ozone_idx, lightning_idx
real(r8), pointer :: psl(:)
@@ -440,6 +438,7 @@ subroutine cam_export(state,cam_out,pbuf)
real(r8), pointer :: prec_pcw(:) ! total precipitation from Hack convection
real(r8), pointer :: snow_pcw(:) ! snow from Hack convection
real(r8), pointer :: o3_ptr(:,:), srf_o3_ptr(:)
+ real(r8), pointer :: lightning_ptr(:)
!-----------------------------------------------------------------------
lchnk = state%lchnk
@@ -457,6 +456,7 @@ subroutine cam_export(state,cam_out,pbuf)
prec_pcw_idx = pbuf_get_index('PREC_PCW', errcode=i)
snow_pcw_idx = pbuf_get_index('SNOW_PCW', errcode=i)
srf_ozone_idx = pbuf_get_index('SRFOZONE', errcode=i)
+ lightning_idx = pbuf_get_index('LGHT_FLASH_FREQ', errcode=i)
if (prec_dp_idx > 0) then
call pbuf_get_field(pbuf, prec_dp_idx, prec_dp)
@@ -516,6 +516,12 @@ subroutine cam_export(state,cam_out,pbuf)
cam_out%ozone(:ncol) = o3_ptr(:ncol,pver) * mwdry/mwo3 ! mole/mole
endif
+ ! get cloud to ground lightning flash freq (/min) to export to surface models
+ if (lightning_idx>0) then
+ call pbuf_get_field(pbuf, lightning_idx, lightning_ptr)
+ cam_out%lightning_flash_freq(:ncol) = lightning_ptr(:ncol)
+ end if
+
!
! Precipation and snow rates from shallow convection, deep convection and stratiform processes.
! Compute total convective and stratiform precipitation and snow rates
diff --git a/src/control/filenames.F90 b/src/control/filenames.F90
index 71166c4b07..2640ab6d20 100644
--- a/src/control/filenames.F90
+++ b/src/control/filenames.F90
@@ -48,7 +48,7 @@ end function get_dir
!===============================================================================
character(len=cl) function interpret_filename_spec( filename_spec, number, prev, case, &
- yr_spec, mon_spec, day_spec, sec_spec )
+ yr_spec, mon_spec, day_spec, sec_spec, flag_spec )
! Create a filename from a filename specifier. The
! filename specifyer includes codes for setting things such as the
@@ -77,12 +77,14 @@ end function get_dir
integer , intent(in), optional :: mon_spec ! Simulation month
integer , intent(in), optional :: day_spec ! Simulation day
integer , intent(in), optional :: sec_spec ! Seconds into current simulation day
+ character(len=*), intent(in), optional :: flag_spec ! flag for accumulated or instantaneous
! Local variables
integer :: year ! Simulation year
integer :: month ! Simulation month
integer :: day ! Simulation day
integer :: ncsec ! Seconds into current simulation day
+ character(len=1) :: flag
character(len=cl) :: string ! Temporary character string
character(len=cl) :: format ! Format character string
integer :: i, n ! Loop variables
@@ -116,6 +118,11 @@ end function get_dir
call get_curr_date(year, month, day, ncsec)
end if
end if
+ if (present(flag_spec)) then
+ flag = flag_spec
+ else
+ flag = ''
+ end if
!
! Go through each character in the filename specifyer and interpret if special string
!
@@ -170,6 +177,8 @@ end function get_dir
write(string,'(i2.2)') day
case( 's' ) ! second
write(string,'(i5.5)') ncsec
+ case( 'f' ) ! flag
+ write(string,'(a)') flag
case( '%' ) ! percent character
string = "%"
case default
diff --git a/src/control/runtime_opts.F90 b/src/control/runtime_opts.F90
index efcfafff50..6d5a6e1058 100644
--- a/src/control/runtime_opts.F90
+++ b/src/control/runtime_opts.F90
@@ -64,7 +64,7 @@ subroutine read_namelist(nlfilename, single_column, scmlat, scmlon)
use conv_water, only: conv_water_readnl
use rad_constituents, only: rad_cnst_readnl
use radiation_data, only: rad_data_readnl
- use modal_aer_opt, only: modal_aer_opt_readnl
+ use aerosol_optics_cam, only: aerosol_optics_cam_readnl
use clubb_intr, only: clubb_readnl
use chemistry, only: chem_readnl
use prescribed_volcaero, only: prescribed_volcaero_readnl
@@ -91,6 +91,9 @@ subroutine read_namelist(nlfilename, single_column, scmlat, scmlon)
use rate_diags, only: rate_diags_readnl
use tracers, only: tracers_readnl
use nudging, only: nudging_readnl
+#if ( defined SIMPLE )
+ use frierson_cam, only: frierson_readnl
+#endif
use dyn_comp, only: dyn_readnl
use ionosphere_interface,only: ionosphere_readnl
@@ -98,7 +101,9 @@ subroutine read_namelist(nlfilename, single_column, scmlat, scmlon)
use lunar_tides, only: lunar_tides_readnl
use hemco_interface, only: hemco_readnl
use upper_bc, only: ubc_readnl
+ use cam_budget, only: cam_budget_readnl
use phys_grid_ctem, only: phys_grid_ctem_readnl
+ use mo_lightning, only: lightning_readnl
!---------------------------Arguments-----------------------------------
@@ -164,8 +169,9 @@ subroutine read_namelist(nlfilename, single_column, scmlat, scmlon)
call radiation_readnl(nlfilename)
call rad_cnst_readnl(nlfilename)
call rad_data_readnl(nlfilename)
- call modal_aer_opt_readnl(nlfilename)
+ call aerosol_optics_cam_readnl(nlfilename)
call chem_readnl(nlfilename)
+ call lightning_readnl(nlfilename)
call prescribed_volcaero_readnl(nlfilename)
call prescribed_strataero_readnl(nlfilename)
call solar_data_readnl(nlfilename)
@@ -193,11 +199,15 @@ subroutine read_namelist(nlfilename, single_column, scmlat, scmlon)
call rate_diags_readnl(nlfilename)
call scam_readnl(nlfilename, single_column, scmlat, scmlon)
call nudging_readnl(nlfilename)
+#if ( defined SIMPLE )
+ call frierson_readnl(nlfilename)
+#endif
call dyn_readnl(nlfilename)
call ionosphere_readnl(nlfilename)
call qneg_readnl(nlfilename)
call hemco_readnl(nlfilename)
+ call cam_budget_readnl(nlfilename)
call phys_grid_ctem_readnl(nlfilename)
end subroutine read_namelist
diff --git a/src/control/sat_hist.F90 b/src/control/sat_hist.F90
index 9e777e6519..35879cff90 100644
--- a/src/control/sat_hist.F90
+++ b/src/control/sat_hist.F90
@@ -466,53 +466,53 @@ subroutine sat_hist_write( tape , nflds, nfils)
call get_indices( obs_lats, obs_lons, ncols, nocols, has_dyn_flds, col_ndxs, chk_ndxs, &
fdyn_ndxs, ldyn_ndxs, phs_owners, dyn_owners, mlats, mlons, phs_dists )
- if ( .not. pio_file_is_open(tape%File) ) then
+ if ( .not. pio_file_is_open(tape%Files(1)) ) then
call endrun('sat file not open')
endif
- ierr = pio_inq_dimid(tape%File,'ncol',coldim )
+ ierr = pio_inq_dimid(tape%Files(1),'ncol',coldim )
- ierr = pio_inq_varid(tape%File, 'lat', out_latid )
- ierr = pio_inq_varid(tape%File, 'lon', out_lonid )
- ierr = pio_inq_varid(tape%File, 'distance', out_dstid )
+ ierr = pio_inq_varid(tape%Files(1), 'lat', out_latid )
+ ierr = pio_inq_varid(tape%Files(1), 'lon', out_lonid )
+ ierr = pio_inq_varid(tape%Files(1), 'distance', out_dstid )
call write_record_coord( tape, mlats(:), mlons(:), phs_dists(:), ncols, nfils )
! dump columns of 2D fields
if (has_phys_srf_flds) then
- call dump_columns( tape%File, tape%hlist, nflds, nocols, 1, nfils, &
+ call dump_columns( tape%Files(1), tape%hlist, nflds, nocols, 1, nfils, &
col_ndxs, chk_ndxs, phs_owners, phys_decomp )
endif
if (has_dyn_srf_flds) then
- call dump_columns( tape%File, tape%hlist, nflds, nocols, 1, nfils, &
+ call dump_columns( tape%Files(1), tape%hlist, nflds, nocols, 1, nfils, &
fdyn_ndxs, ldyn_ndxs, dyn_owners, dyn_decomp )
endif
! dump columns of 3D fields defined on mid pres levels
if (has_phys_lev_flds) then
- call dump_columns( tape%File, tape%hlist, nflds, nocols, pver, nfils, &
+ call dump_columns( tape%Files(1), tape%hlist, nflds, nocols, pver, nfils, &
col_ndxs, chk_ndxs, phs_owners, phys_decomp )
endif
if (has_dyn_lev_flds) then
- call dump_columns( tape%File, tape%hlist, nflds, nocols, pver, nfils, &
+ call dump_columns( tape%Files(1), tape%hlist, nflds, nocols, pver, nfils, &
fdyn_ndxs, ldyn_ndxs, dyn_owners, dyn_decomp )
endif
! dump columns of 3D fields defined on interface pres levels
if (has_phys_ilev_flds) then
- call dump_columns( tape%File, tape%hlist, nflds, nocols, pverp, nfils, &
+ call dump_columns( tape%Files(1), tape%hlist, nflds, nocols, pverp, nfils, &
col_ndxs, chk_ndxs, phs_owners, phys_decomp )
endif
if (has_dyn_ilev_flds) then
- call dump_columns( tape%File, tape%hlist, nflds, nocols, pverp, nfils, &
+ call dump_columns( tape%Files(1), tape%hlist, nflds, nocols, pverp, nfils, &
fdyn_ndxs, ldyn_ndxs, dyn_owners, dyn_decomp )
endif
deallocate( col_ndxs, chk_ndxs, fdyn_ndxs, ldyn_ndxs, phs_owners, dyn_owners )
deallocate( mlons, mlats, phs_dists )
deallocate( obs_lons, obs_lats )
- call pio_syncfile(tape%File)
+ call pio_syncfile(tape%Files(1))
nfils = nfils + nocols
@@ -763,19 +763,19 @@ subroutine write_record_coord( tape, mod_lats, mod_lons, mod_dists, ncols, nfils
allocate( rtmp(ncols * sathist_nclosest) )
itmp(:) = ncdate
- ierr = pio_put_var(tape%File, tape%dateid,(/nfils/), (/ncols * sathist_nclosest/),itmp)
+ ierr = pio_put_var(tape%Files(1), tape%dateid,(/nfils/), (/ncols * sathist_nclosest/),itmp)
itmp(:) = ncsec
- ierr = pio_put_var(tape%File, tape%datesecid,(/nfils/),(/ncols * sathist_nclosest/),itmp)
+ ierr = pio_put_var(tape%Files(1), tape%datesecid,(/nfils/),(/ncols * sathist_nclosest/),itmp)
rtmp(:) = time
- ierr = pio_put_var(tape%File, tape%timeid, (/nfils/),(/ncols * sathist_nclosest/),rtmp)
+ ierr = pio_put_var(tape%Files(1), tape%timeid, (/nfils/),(/ncols * sathist_nclosest/),rtmp)
deallocate(itmp)
deallocate(rtmp)
! output model column coordinates
- ierr = pio_put_var(tape%File, out_latid, (/nfils/),(/ncols * sathist_nclosest/), mod_lats)
- ierr = pio_put_var(tape%File, out_lonid, (/nfils/),(/ncols * sathist_nclosest/), mod_lons)
- ierr = pio_put_var(tape%File, out_dstid, (/nfils/),(/ncols * sathist_nclosest/), mod_dists / 1000._r8)
+ ierr = pio_put_var(tape%Files(1), out_latid, (/nfils/),(/ncols * sathist_nclosest/), mod_lats)
+ ierr = pio_put_var(tape%Files(1), out_lonid, (/nfils/),(/ncols * sathist_nclosest/), mod_lons)
+ ierr = pio_put_var(tape%Files(1), out_dstid, (/nfils/),(/ncols * sathist_nclosest/), mod_dists / 1000._r8)
! output instrument location
allocate( out_lats(ncols * sathist_nclosest) )
@@ -786,40 +786,40 @@ subroutine write_record_coord( tape, mod_lats, mod_lons, mod_dists, ncols, nfils
out_lons(((i-1)*sathist_nclosest)+1 : (i*sathist_nclosest)) = obs_lons(i)
enddo
- ierr = pio_put_var(tape%File, out_instr_lat_vid, (/nfils/),(/ncols * sathist_nclosest/), out_lats)
- ierr = pio_put_var(tape%File, out_instr_lon_vid, (/nfils/),(/ncols * sathist_nclosest/), out_lons)
+ ierr = pio_put_var(tape%Files(1), out_instr_lat_vid, (/nfils/),(/ncols * sathist_nclosest/), out_lats)
+ ierr = pio_put_var(tape%Files(1), out_instr_lon_vid, (/nfils/),(/ncols * sathist_nclosest/), out_lons)
deallocate(out_lats)
deallocate(out_lons)
- ierr = copy_data( infile, date_vid, tape%File, out_obs_date_vid, in_start_col, nfils, ncols )
- ierr = copy_data( infile, time_vid, tape%File, out_obs_time_vid, in_start_col, nfils, ncols )
+ ierr = copy_data( infile, date_vid, tape%Files(1), out_obs_date_vid, in_start_col, nfils, ncols )
+ ierr = copy_data( infile, time_vid, tape%Files(1), out_obs_time_vid, in_start_col, nfils, ncols )
! output observation identifiers
if (instr_vid>0) then
- ierr = copy_data( infile, instr_vid, tape%File, out_instrid, in_start_col, nfils, ncols )
+ ierr = copy_data( infile, instr_vid, tape%Files(1), out_instrid, in_start_col, nfils, ncols )
endif
if (orbit_vid>0) then
- ierr = copy_data( infile, orbit_vid, tape%File, out_orbid, in_start_col, nfils, ncols )
+ ierr = copy_data( infile, orbit_vid, tape%Files(1), out_orbid, in_start_col, nfils, ncols )
endif
if (prof_vid>0) then
- ierr = copy_data( infile, prof_vid, tape%File, out_profid, in_start_col, nfils, ncols )
+ ierr = copy_data( infile, prof_vid, tape%Files(1), out_profid, in_start_col, nfils, ncols )
endif
if (zenith_vid>0) then
- ierr = copy_data( infile, zenith_vid, tape%File, out_zenithid, in_start_col, nfils, ncols )
+ ierr = copy_data( infile, zenith_vid, tape%Files(1), out_zenithid, in_start_col, nfils, ncols )
endif
if (in_julian_vid>0) then
- ierr = copy_data( infile, in_julian_vid, tape%File, out_julian_vid, in_start_col, nfils, ncols )
+ ierr = copy_data( infile, in_julian_vid, tape%Files(1), out_julian_vid, in_start_col, nfils, ncols )
endif
if (in_occ_type_vid>0) then
- ierr = copy_data( infile, in_occ_type_vid, tape%File, out_occ_type_vid, in_start_col, nfils, ncols )
+ ierr = copy_data( infile, in_occ_type_vid, tape%Files(1), out_occ_type_vid, in_start_col, nfils, ncols )
endif
if (in_localtime_vid>0) then
- ierr = copy_data( infile, in_localtime_vid, tape%File, out_localtime_vid, in_start_col, nfils, ncols )
+ ierr = copy_data( infile, in_localtime_vid, tape%Files(1), out_localtime_vid, in_start_col, nfils, ncols )
endif
if (in_doy_vid>0) then
- ierr = copy_data( infile, in_doy_vid, tape%File, out_doy_vid, in_start_col, nfils, ncols )
+ ierr = copy_data( infile, in_doy_vid, tape%Files(1), out_doy_vid, in_start_col, nfils, ncols )
endif
call t_stopf ('sat_hist::write_record_coord')
diff --git a/src/cpl/nuopc/atm_comp_nuopc.F90 b/src/cpl/nuopc/atm_comp_nuopc.F90
index a85accd837..8b2ba903d0 100644
--- a/src/cpl/nuopc/atm_comp_nuopc.F90
+++ b/src/cpl/nuopc/atm_comp_nuopc.F90
@@ -4,60 +4,79 @@ module atm_comp_nuopc
! This is the NUOPC cap for CAM
!----------------------------------------------------------------------------
- use ESMF
- use NUOPC , only : NUOPC_CompDerive, NUOPC_CompSetEntryPoint, NUOPC_CompSpecialize
- use NUOPC , only : NUOPC_CompFilterPhaseMap, NUOPC_IsUpdated, NUOPC_IsAtTime
- use NUOPC , only : NUOPC_CompAttributeGet, NUOPC_Advertise
- use NUOPC , only : NUOPC_SetAttribute, NUOPC_CompAttributeGet, NUOPC_CompAttributeSet
- use NUOPC_Model , only : model_routine_SS => SetServices
- use NUOPC_Model , only : SetVM
- use NUOPC_Model , only : model_label_Advance => label_Advance
- use NUOPC_Model , only : model_label_DataInitialize => label_DataInitialize
- use NUOPC_Model , only : model_label_SetRunClock => label_SetRunClock
- use NUOPC_Model , only : model_label_Finalize => label_Finalize
- use NUOPC_Model , only : NUOPC_ModelGet
- use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs
- use shr_sys_mod , only : shr_sys_abort
- use shr_log_mod , only : shr_log_getlogunit, shr_log_setlogunit
- use shr_cal_mod , only : shr_cal_noleap, shr_cal_gregorian, shr_cal_ymd2date
- use shr_const_mod , only : shr_const_pi
- use shr_orb_mod , only : shr_orb_decl, shr_orb_params, SHR_ORB_UNDEF_REAL, SHR_ORB_UNDEF_INT
- use cam_instance , only : cam_instance_init, inst_suffix, inst_index
- use cam_comp , only : cam_init, cam_run1, cam_run2, cam_run3, cam_run4, cam_final
- use camsrfexch , only : cam_out_t, cam_in_t
- use radiation , only : nextsw_cday
- use cam_logfile , only : iulog
- use spmd_utils , only : spmdinit, masterproc, iam, mpicom
- use time_manager , only : get_curr_calday, advance_timestep, get_curr_date, get_nstep, get_step_size
- use atm_import_export , only : read_surface_fields_namelists, advertise_fields, realize_fields
- use atm_import_export , only : import_fields, export_fields
- use nuopc_shr_methods , only : chkerr, state_setscalar, state_getscalar, state_diagnose, alarmInit
- use nuopc_shr_methods , only : set_component_logging, get_component_instance, log_clock_advance
- use perf_mod , only : t_startf, t_stopf
- use ppgrid , only : pcols, begchunk, endchunk
- use dyn_grid , only : get_horiz_grid_dim_d
- use phys_grid , only : get_ncols_p, get_gcol_p, get_rlon_all_p, get_rlat_all_p
- use phys_grid , only : ngcols=>num_global_phys_cols
- use cam_control_mod , only : cam_ctrl_set_orbit
- use cam_pio_utils , only : cam_pio_createfile, cam_pio_openfile, cam_pio_closefile, pio_subsystem
- use cam_initfiles , only : cam_initfiles_get_caseid, cam_initfiles_get_restdir
- use cam_history_support , only : fillvalue
- use filenames , only : interpret_filename_spec
- use pio , only : file_desc_t, io_desc_t, var_desc_t, pio_double, pio_def_dim, PIO_MAX_NAME
- use pio , only : pio_closefile, pio_put_att, pio_enddef, pio_nowrite
- use pio , only : pio_inq_dimid, pio_inq_varid, pio_inquire_dimension, pio_def_var
- use pio , only : pio_initdecomp, pio_freedecomp
- use pio , only : pio_read_darray, pio_write_darray
- use pio , only : pio_noerr, pio_bcast_error, pio_internal_error, pio_seterrorhandling
- use pio , only : pio_def_var, pio_get_var, pio_put_var, PIO_INT
- use ioFileMod
-!$use omp_lib , only : omp_set_num_threads
+ use ESMF , only : operator(<=), operator(>), operator(==), operator(+)
+ use ESMF , only : ESMF_MethodRemove
+ use ESMF , only : ESMF_GridComp, ESMF_GridCompGet, ESMF_State, ESMF_StateGet
+ use ESMF , only : ESMF_Grid, ESMF_GridCreateNoPeriDimUfrm, ESMF_Field, ESMF_FieldGet
+ use ESMF , only : ESMF_DistGrid, ESMF_DistGridCreate
+ use ESMF , only : ESMF_Mesh, ESMF_MeshCreate, ESMF_MeshGet, ESMF_FILEFORMAT_ESMFMESH
+ use ESMF , only : ESMF_Clock, ESMF_ClockGet, ESMF_ClockSet, ESMF_ClockGetNextTime, ESMF_ClockAdvance
+ use ESMF , only : ESMF_Time, ESMF_TimeGet
+ use ESMF , only : ESMF_Alarm, ESMF_ClockGetAlarm, ESMF_AlarmRingerOff, ESMF_AlarmIsRinging
+ use ESMF , only : ESMF_ClockGetAlarmList, ESMF_ALARMLIST_ALL, ESMF_AlarmSet
+ use ESMF , only : ESMF_TimeInterval, ESMF_TimeIntervalGet
+ use ESMF , only : ESMF_CalKind_Flag, ESMF_MAXSTR, ESMF_KIND_I8
+ use ESMF , only : ESMF_CALKIND_NOLEAP, ESMF_CALKIND_GREGORIAN
+ use ESMF , only : ESMF_GridCompSetEntryPoint
+ use ESMF , only : ESMF_VM, ESMF_VMGetCurrent, ESMF_VMGet
+ use ESMF , only : ESMF_LOGMSG_INFO, ESMF_LOGERR_PASSTHRU
+ use ESMF , only : ESMF_LogWrite, ESMF_LogSetError, ESMF_LogFoundError
+ use ESMF , only : ESMF_SUCCESS, ESMF_METHOD_INITIALIZE, ESMF_FAILURE, ESMF_RC_NOT_VALID
+ use ESMF , only : ESMF_STAGGERLOC_CENTER, ESMF_STAGGERLOC_CORNER
+ use NUOPC , only : NUOPC_CompDerive, NUOPC_CompSetEntryPoint, NUOPC_CompSpecialize
+ use NUOPC , only : NUOPC_CompFilterPhaseMap, NUOPC_IsUpdated, NUOPC_IsAtTime
+ use NUOPC , only : NUOPC_CompAttributeGet, NUOPC_Advertise
+ use NUOPC , only : NUOPC_SetAttribute, NUOPC_CompAttributeGet, NUOPC_CompAttributeSet
+ use NUOPC_Model , only : model_routine_SS => SetServices
+ use NUOPC_Model , only : SetVM
+ use NUOPC_Model , only : model_label_Advance => label_Advance
+ use NUOPC_Model , only : model_label_DataInitialize => label_DataInitialize
+ use NUOPC_Model , only : model_label_SetRunClock => label_SetRunClock
+ use NUOPC_Model , only : model_label_Finalize => label_Finalize
+ use NUOPC_Model , only : NUOPC_ModelGet
+ use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs
+ use shr_sys_mod , only : shr_sys_abort
+ use shr_log_mod , only : shr_log_getlogunit, shr_log_setlogunit
+ use shr_cal_mod , only : shr_cal_noleap, shr_cal_gregorian, shr_cal_ymd2date
+ use shr_const_mod , only : shr_const_pi
+ use shr_orb_mod , only : shr_orb_decl, shr_orb_params, SHR_ORB_UNDEF_REAL, SHR_ORB_UNDEF_INT
+ use cam_instance , only : cam_instance_init, inst_suffix, inst_index
+ use cam_comp , only : cam_init, cam_run1, cam_run2, cam_run3, cam_run4, cam_final
+ use camsrfexch , only : cam_out_t, cam_in_t
+ use radiation , only : nextsw_cday
+ use cam_logfile , only : iulog
+ use spmd_utils , only : spmdinit, masterproc, iam, mpicom
+ use time_manager , only : get_curr_calday, advance_timestep, get_curr_date, get_nstep, get_step_size
+ use atm_import_export , only : read_surface_fields_namelists, advertise_fields, realize_fields
+ use atm_import_export , only : import_fields, export_fields
+ use nuopc_shr_methods , only : chkerr, state_setscalar, state_getscalar, state_diagnose, alarmInit
+ use nuopc_shr_methods , only : set_component_logging, get_component_instance, log_clock_advance
+ use perf_mod , only : t_startf, t_stopf
+ use ppgrid , only : pcols, begchunk, endchunk
+ use dyn_grid , only : get_horiz_grid_dim_d
+ use phys_grid , only : get_ncols_p, get_gcol_p, get_rlon_all_p, get_rlat_all_p
+ use phys_grid , only : ngcols=>num_global_phys_cols
+ use cam_control_mod , only : cam_ctrl_set_orbit
+ use cam_pio_utils , only : cam_pio_createfile, cam_pio_openfile, cam_pio_closefile, pio_subsystem
+ use cam_initfiles , only : cam_initfiles_get_caseid, cam_initfiles_get_restdir
+ use cam_history_support , only : fillvalue
+ use filenames , only : interpret_filename_spec
+ use pio , only : file_desc_t, io_desc_t, var_desc_t, pio_double, pio_def_dim, PIO_MAX_NAME
+ use pio , only : pio_closefile, pio_put_att, pio_enddef, pio_nowrite
+ use pio , only : pio_inq_dimid, pio_inq_varid, pio_inquire_dimension, pio_def_var
+ use pio , only : pio_initdecomp, pio_freedecomp
+ use pio , only : pio_read_darray, pio_write_darray
+ use pio , only : pio_noerr, pio_bcast_error, pio_internal_error, pio_seterrorhandling
+ use pio , only : pio_def_var, pio_get_var, pio_put_var, PIO_INT
+ use ioFileMod
+ !$use omp_lib , only : omp_set_num_threads
implicit none
private ! except
public :: SetServices
public :: SetVM
+
!--------------------------------------------------------------------------
! Private interfaces
!--------------------------------------------------------------------------
@@ -109,6 +128,10 @@ module atm_comp_nuopc
character(len=*) , parameter :: orb_fixed_parameters = 'fixed_parameters'
real(R8) , parameter :: grid_tol = 1.e-2_r8 ! tolerance for calculated lat/lon vs read in
+
+ type(ESMF_Mesh) :: model_mesh ! model_mesh
+ type(ESMF_Clock) :: model_clock ! model_clock
+
!===============================================================================
contains
!===============================================================================
@@ -319,7 +342,6 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
type(ESMF_TimeInterval) :: timeStep
type(ESMF_CalKind_Flag) :: esmf_caltype ! esmf calendar type
type(ESMF_DistGrid) :: distGrid
- type(ESMF_Mesh) :: mesh
integer :: spatialDim
integer :: numOwnedElements
real(R8), pointer :: ownedElemCoords(:)
@@ -626,7 +648,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
if (single_column) then
- call cam_set_mesh_for_single_column(scol_lon, scol_lat, mesh, rc)
+ call cam_set_mesh_for_single_column(scol_lon, scol_lat, model_mesh, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
allocate(dof(1))
dof(1) = 1
@@ -657,7 +679,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
call NUOPC_CompAttributeGet(gcomp, name='mesh_atm', value=cvalue, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
- mesh = ESMF_MeshCreate(filename=trim(cvalue), fileformat=ESMF_FILEFORMAT_ESMFMESH, &
+ model_mesh = ESMF_MeshCreate(filename=trim(cvalue), fileformat=ESMF_FILEFORMAT_ESMFMESH, &
elementDistgrid=Distgrid, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (masterproc) then
@@ -665,7 +687,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
end if
! obtain mesh lats and lons
- call ESMF_MeshGet(mesh, spatialDim=spatialDim, numOwnedElements=numOwnedElements, rc=rc)
+ call ESMF_MeshGet(model_mesh, spatialDim=spatialDim, numOwnedElements=numOwnedElements, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (numOwnedElements /= lsize) then
write(tempc1,'(i10)') numOwnedElements
@@ -677,7 +699,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
end if
allocate(ownedElemCoords(spatialDim*numOwnedElements))
allocate(lonMesh(lsize), latMesh(lsize))
- call ESMF_MeshGet(mesh, ownedElemCoords=ownedElemCoords)
+ call ESMF_MeshGet(model_mesh, ownedElemCoords=ownedElemCoords)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
do n = 1,lsize
lonMesh(n) = ownedElemCoords(2*n-1)
@@ -702,7 +724,8 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
! error check differences between internally generated lons and those read in
do n = 1,lsize
- if (abs(lonMesh(n) - lon(n)) > grid_tol .and. abs(lonMesh(n) - lon(n)) /= 360._r8) then
+ if (abs(lonMesh(n) - lon(n)) > grid_tol .and. .not. &
+ abs(abs(lonMesh(n) - lon(n))- 360._r8) < grid_tol) then
write(6,100)n,lon(n),lonMesh(n), abs(lonMesh(n)-lon(n))
100 format('ERROR: CAM n, lonmesh(n), lon(n), diff_lon = ',i6,2(f21.13,3x),d21.5)
call shr_sys_abort()
@@ -722,11 +745,14 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
end if ! end of if single_column
! realize the actively coupled fields
- call realize_fields(gcomp, mesh, flds_scalar_name, flds_scalar_num, single_column, rc)
+ call realize_fields(gcomp, model_mesh, flds_scalar_name, flds_scalar_num, single_column, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ ! Create model_clock as a module variable - needed for generating streams
+ model_clock = clock
+
! Create cam export array and set the state scalars
- call export_fields( gcomp, cam_out, rc=rc )
+ call export_fields( gcomp, model_mesh, model_clock, cam_out, rc=rc )
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call get_horiz_grid_dim_d(hdim1_d, hdim2_d)
@@ -881,7 +907,7 @@ subroutine DataInitialize(gcomp, rc)
call import_fields( gcomp, cam_in, rc=rc )
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call cam_run1 ( cam_in, cam_out )
- call export_fields( gcomp, cam_out, rc=rc )
+ call export_fields( gcomp, model_mesh, model_clock, cam_out, rc=rc )
if (ChkErr(rc,__LINE__,u_FILE_u)) return
else
call cam_read_srfrest( gcomp, clock, rc=rc )
@@ -889,7 +915,7 @@ subroutine DataInitialize(gcomp, rc)
call import_fields( gcomp, cam_in, restart_init=.true., rc=rc )
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call cam_run1 ( cam_in, cam_out )
- call export_fields( gcomp, cam_out, rc=rc )
+ call export_fields( gcomp, model_mesh, model_clock, cam_out, rc=rc )
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end if
@@ -1136,7 +1162,7 @@ subroutine ModelAdvance(gcomp, rc)
if (mediator_present) then
! Set export fields
call t_startf ('CAM_export')
- call export_fields( gcomp, cam_out, rc )
+ call export_fields( gcomp, model_mesh, model_clock, cam_out, rc )
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call t_stopf ('CAM_export')
@@ -1503,7 +1529,7 @@ subroutine cam_orbital_update(clock, logunit, mastertask, eccen, obliqr, lambm0
if(.not. (logprint .and. mastertask)) then
logprint = .false.
endif
-
+
eccen = orb_eccen
call shr_orb_params(orb_year, eccen, orb_obliq, orb_mvelp, obliqr, lambm0, mvelpp, logprint)
diff --git a/src/cpl/nuopc/atm_import_export.F90 b/src/cpl/nuopc/atm_import_export.F90
index bdce379f69..baadd00865 100644
--- a/src/cpl/nuopc/atm_import_export.F90
+++ b/src/cpl/nuopc/atm_import_export.F90
@@ -3,6 +3,7 @@ module atm_import_export
use NUOPC , only : NUOPC_CompAttributeGet, NUOPC_Advertise, NUOPC_IsConnected
use NUOPC_Model , only : NUOPC_ModelGet
use ESMF , only : ESMF_GridComp, ESMF_State, ESMF_Mesh, ESMF_StateGet, ESMF_Field
+ use ESMF , only : ESMF_Clock
use ESMF , only : ESMF_KIND_R8, ESMF_SUCCESS, ESMF_MAXSTR, ESMF_LOGMSG_INFO
use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_ERROR, ESMF_LogFoundError
use ESMF , only : ESMF_STATEITEM_NOTFOUND, ESMF_StateItem_Flag
@@ -23,6 +24,8 @@ module atm_import_export
use srf_field_check , only : set_active_Faoo_fco2_ocn
use srf_field_check , only : set_active_Faxa_nhx
use srf_field_check , only : set_active_Faxa_noy
+ use srf_field_check , only : active_Faxa_nhx, active_Faxa_noy
+ use atm_stream_ndep , only : stream_ndep_init, stream_ndep_interp, stream_ndep_is_initialized
implicit none
private ! except
@@ -57,7 +60,8 @@ module atm_import_export
integer :: drydep_nflds = -huge(1) ! number of dry deposition velocity fields lnd-> atm
integer :: megan_nflds = -huge(1) ! number of MEGAN voc fields from lnd-> atm
integer :: emis_nflds = -huge(1) ! number of fire emission fields from lnd-> atm
- integer, public :: ndep_nflds = -huge(1) ! number of nitrogen deposition fields from atm->lnd/ocn
+ integer, public :: ndep_nflds = -huge(1) ! number of nitrogen deposition fields from atm->lnd/ocn
+ logical :: atm_provides_lightning = .false. ! cld to grnd lightning flash freq (min-1)
character(*),parameter :: F01 = "('(cam_import_export) ',a,i8,2x,i8,2x,d21.14)"
character(*),parameter :: F02 = "('(cam_import_export) ',a,i8,2x,i8,2x,i8,2x,d21.14)"
character(*),parameter :: u_FILE_u = __FILE__
@@ -76,6 +80,7 @@ subroutine read_surface_fields_namelists()
use shr_fire_emis_mod , only : shr_fire_emis_readnl
use shr_carma_mod , only : shr_carma_readnl
use shr_ndep_mod , only : shr_ndep_readnl
+ use shr_lightning_coupling_mod, only : shr_lightning_coupling_readnl
character(len=*), parameter :: nl_file_name = 'drv_flds_in'
@@ -85,9 +90,13 @@ subroutine read_surface_fields_namelists()
call shr_megan_readnl(nl_file_name, megan_nflds)
call shr_fire_emis_readnl(nl_file_name, emis_nflds)
call shr_carma_readnl(nl_file_name, carma_fields)
+ call shr_lightning_coupling_readnl(nl_file_name, atm_provides_lightning)
end subroutine read_surface_fields_namelists
+ !-----------------------------------------------------------
+ ! advertise fields
+ !-----------------------------------------------------------
subroutine advertise_fields(gcomp, flds_scalar_name, rc)
! input/output variables
@@ -100,7 +109,6 @@ subroutine advertise_fields(gcomp, flds_scalar_name, rc)
type(ESMF_State) :: exportState
character(ESMF_MAXSTR) :: stdname
character(ESMF_MAXSTR) :: cvalue
- character(len=2) :: nec_str
integer :: n, num
logical :: flds_co2a ! use case
logical :: flds_co2b ! use case
@@ -186,11 +194,21 @@ subroutine advertise_fields(gcomp, flds_scalar_name, rc)
call fldlist_add(fldsFrAtm_num, fldsFrAtm, 'Sa_co2diag' )
end if
- ! from atm - nitrogen deposition
if (ndep_nflds > 0) then
- call fldlist_add(fldsFrAtm_num, fldsFrAtm, 'Faxa_ndep', ungridded_lbound=1, ungridded_ubound=ndep_nflds)
+ ! The following is when CAM/WACCM computes ndep
call set_active_Faxa_nhx(.true.)
call set_active_Faxa_noy(.true.)
+ else
+ ! The following is used for reading in stream data
+ call set_active_Faxa_nhx(.false.)
+ call set_active_Faxa_noy(.false.)
+ end if
+ ! Assume that 2 fields are always sent as part of Faxa_ndep
+ call fldlist_add(fldsFrAtm_num, fldsFrAtm, 'Faxa_ndep', ungridded_lbound=1, ungridded_ubound=2)
+
+ ! lightning flash freq
+ if (atm_provides_lightning) then
+ call fldlist_add(fldsFrAtm_num, fldsFrAtm, 'Sa_lightning')
end if
! Now advertise above export fields
@@ -859,7 +877,7 @@ end subroutine import_fields
!===============================================================================
- subroutine export_fields( gcomp, cam_out, rc)
+ subroutine export_fields( gcomp, model_mesh, model_clock, cam_out, rc)
! -----------------------------------------------------
! Set field pointers in export set
@@ -877,16 +895,20 @@ subroutine export_fields( gcomp, cam_out, rc)
!-------------------------------
! input/output variables
- type(ESMF_GridComp) :: gcomp
- type(cam_out_t) , intent(in) :: cam_out(begchunk:endchunk)
- integer , intent(out) :: rc
+ type(ESMF_GridComp) :: gcomp
+ type(ESMF_Mesh) , intent(in) :: model_mesh
+ type(ESMF_Clock), intent(in) :: model_clock
+ type(cam_out_t) , intent(inout) :: cam_out(begchunk:endchunk)
+ integer , intent(out) :: rc
! local variables
type(ESMF_State) :: exportState
+ type(ESMF_Clock) :: clock
integer :: i,m,c,n,g ! indices
integer :: ncols ! Number of columns
integer :: nstep
logical :: exists
+ real(r8) :: scale_ndep
! 2d pointers
real(r8), pointer :: fldptr_ndep(:,:)
real(r8), pointer :: fldptr_bcph(:,:) , fldptr_ocph(:,:)
@@ -904,6 +926,7 @@ subroutine export_fields( gcomp, cam_out, rc)
real(r8), pointer :: fldptr_ptem(:) , fldptr_pslv(:)
real(r8), pointer :: fldptr_co2prog(:) , fldptr_co2diag(:)
real(r8), pointer :: fldptr_ozone(:)
+ real(r8), pointer :: fldptr_lght(:)
character(len=*), parameter :: subname='(atm_import_export:export_fields)'
!---------------------------------------------------------------------------
@@ -1033,44 +1056,70 @@ subroutine export_fields( gcomp, cam_out, rc)
end do
end if
- call state_getfldptr(exportState, 'Sa_co2prog', fldptr=fldptr_co2prog, exists=exists, rc=rc)
+ call state_getfldptr(exportState, 'Sa_lightning', fldptr=fldptr_lght, exists=exists, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (exists) then
g = 1
do c = begchunk,endchunk
do i = 1,get_ncols_p(c)
- fldptr_co2prog(g) = cam_out(c)%co2prog(i) ! atm prognostic co2
+ fldptr_lght(g) = cam_out(c)%lightning_flash_freq(i) ! cloud-to-ground lightning flash frequency (/min)
g = g + 1
end do
end do
end if
- call state_getfldptr(exportState, 'Sa_co2diag', fldptr=fldptr_co2diag, exists=exists, rc=rc)
+ call state_getfldptr(exportState, 'Sa_co2prog', fldptr=fldptr_co2prog, exists=exists, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (exists) then
g = 1
do c = begchunk,endchunk
do i = 1,get_ncols_p(c)
- fldptr_co2diag(g) = cam_out(c)%co2diag(i) ! atm diagnostic co2
+ fldptr_co2prog(g) = cam_out(c)%co2prog(i) ! atm prognostic co2
g = g + 1
end do
end do
end if
- call state_getfldptr(exportState, 'Faxa_ndep', fldptr2d=fldptr_ndep, exists=exists, rc=rc)
+ call state_getfldptr(exportState, 'Sa_co2diag', fldptr=fldptr_co2diag, exists=exists, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (exists) then
- ! (1) => nhx, (2) => noy
g = 1
do c = begchunk,endchunk
do i = 1,get_ncols_p(c)
- fldptr_ndep(1,g) = cam_out(c)%nhx_nitrogen_flx(i) * mod2med_areacor(g)
- fldptr_ndep(2,g) = cam_out(c)%noy_nitrogen_flx(i) * mod2med_areacor(g)
+ fldptr_co2diag(g) = cam_out(c)%co2diag(i) ! atm diagnostic co2
g = g + 1
end do
end do
end if
+ ! If ndep fields are not computed in cam and must be obtained from the ndep input stream
+ call state_getfldptr(exportState, 'Faxa_ndep', fldptr2d=fldptr_ndep, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ if (.not. active_Faxa_nhx .and. .not. active_Faxa_noy) then
+ if (.not. stream_ndep_is_initialized) then
+ call stream_ndep_init(model_mesh, model_clock, rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ stream_ndep_is_initialized = .true.
+ end if
+ call stream_ndep_interp(cam_out, rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ ! NDEP read from forcing is expected to be in units of gN/m2/sec - but the mediator
+ ! expects units of kgN/m2/sec
+ scale_ndep = .001_r8
+ else
+ ! If waccm computes ndep, then its in units of kgN/m2/s - and the mediator expects
+ ! units of kgN/m2/sec, so the following conversion needs to happen
+ scale_ndep = 1._r8
+ end if
+ g = 1
+ do c = begchunk,endchunk
+ do i = 1,get_ncols_p(c)
+ fldptr_ndep(1,g) = cam_out(c)%nhx_nitrogen_flx(i) * scale_ndep * mod2med_areacor(g)
+ fldptr_ndep(2,g) = cam_out(c)%noy_nitrogen_flx(i) * scale_ndep * mod2med_areacor(g)
+ g = g + 1
+ end do
+ end do
+
end subroutine export_fields
!===============================================================================
diff --git a/src/cpl/nuopc/atm_stream_ndep.F90 b/src/cpl/nuopc/atm_stream_ndep.F90
new file mode 100644
index 0000000000..394808a529
--- /dev/null
+++ b/src/cpl/nuopc/atm_stream_ndep.F90
@@ -0,0 +1,256 @@
+module atm_stream_ndep
+
+ !-----------------------------------------------------------------------
+ ! Contains methods for reading in nitrogen deposition data file
+ ! Also includes functions for dynamic ndep file handling and
+ ! interpolation.
+ !-----------------------------------------------------------------------
+ !
+ use ESMF , only : ESMF_Clock, ESMF_Mesh
+ use ESMF , only : ESMF_SUCCESS, ESMF_LOGERR_PASSTHRU, ESMF_END_ABORT
+ use ESMF , only : ESMF_Finalize, ESMF_LogFoundError
+ use nuopc_shr_methods , only : chkerr
+ use dshr_strdata_mod , only : shr_strdata_type
+ use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_cl, CS => shr_kind_cs
+ use shr_log_mod , only : errMsg => shr_log_errMsg
+ use spmd_utils , only : mpicom, masterproc, iam
+ use spmd_utils , only : mpi_character, mpi_integer
+ use cam_logfile , only : iulog
+ use cam_abortutils , only : endrun
+
+ implicit none
+ private
+
+ public :: stream_ndep_init ! position datasets for dynamic ndep
+ public :: stream_ndep_interp ! interpolates between two years of ndep file data
+
+ private :: stream_ndep_check_units ! Check the units and make sure they can be used
+
+ type(shr_strdata_type) :: sdat_ndep ! input data stream
+ logical, public :: stream_ndep_is_initialized = .false.
+ character(len=CS) :: stream_varlist_ndep(2)
+ type(ESMF_Clock) :: model_clock
+
+ character(len=*), parameter :: sourcefile = &
+ __FILE__
+
+!==============================================================================
+contains
+!==============================================================================
+
+ subroutine stream_ndep_init(model_mesh, model_clock, rc)
+ !
+ ! Initialize data stream information.
+
+ ! Uses:
+ use cam_instance , only: inst_suffix
+ use shr_nl_mod , only: shr_nl_find_group_name
+ use dshr_strdata_mod , only: shr_strdata_init_from_inline
+
+ ! input/output variables
+ type(ESMF_CLock), intent(in) :: model_clock
+ type(ESMF_Mesh) , intent(in) :: model_mesh
+ integer , intent(out) :: rc
+
+ ! local variables
+ integer :: nu_nml ! unit for namelist file
+ integer :: nml_error ! namelist i/o error flag
+ character(len=CL) :: stream_ndep_data_filename
+ character(len=CL) :: stream_ndep_mesh_filename
+ character(len=CL) :: filein ! atm namelist file
+ integer :: stream_ndep_year_first ! first year in stream to use
+ integer :: stream_ndep_year_last ! last year in stream to use
+ integer :: stream_ndep_year_align ! align stream_year_firstndep with
+ integer :: ierr
+ character(*), parameter :: subName = "('stream_ndep_init')"
+ !-----------------------------------------------------------------------
+
+ namelist /ndep_stream_nl/ &
+ stream_ndep_data_filename, &
+ stream_ndep_mesh_filename, &
+ stream_ndep_year_first, &
+ stream_ndep_year_last, &
+ stream_ndep_year_align
+
+ rc = ESMF_SUCCESS
+
+ ! Default values for namelist
+ stream_ndep_data_filename = ' '
+ stream_ndep_mesh_filename = ' '
+ stream_ndep_year_first = 1 ! first year in stream to use
+ stream_ndep_year_last = 1 ! last year in stream to use
+ stream_ndep_year_align = 1 ! align stream_ndep_year_first with this model year
+
+ ! For now variable list in stream data file is hard-wired
+ stream_varlist_ndep = (/'NDEP_NHx_month', 'NDEP_NOy_month'/)
+
+ ! Read ndep_stream namelist
+ if (masterproc) then
+ filein = "atm_in" // trim(inst_suffix)
+ open( newunit=nu_nml, file=trim(filein), status='old', iostat=nml_error )
+ if (nml_error /= 0) then
+ call endrun(subName//': ERROR opening '//trim(filein)//errMsg(sourcefile, __LINE__))
+ end if
+ call shr_nl_find_group_name(nu_nml, 'ndep_stream_nl', status=nml_error)
+ if (nml_error == 0) then
+ read(nu_nml, nml=ndep_stream_nl, iostat=nml_error)
+ if (nml_error /= 0) then
+ call endrun(' ERROR reading ndep_stream_nl namelist'//errMsg(sourcefile, __LINE__))
+ end if
+ else
+ call endrun(' ERROR finding ndep_stream_nl namelist'//errMsg(sourcefile, __LINE__))
+ end if
+ close(nu_nml)
+ endif
+ call mpi_bcast(stream_ndep_mesh_filename, len(stream_ndep_mesh_filename), mpi_character, 0, mpicom, ierr)
+ if (ierr /= 0) call endrun(trim(subname)//": FATAL: mpi_bcast: stream_ndep_mesh_filename")
+ call mpi_bcast(stream_ndep_data_filename, len(stream_ndep_data_filename), mpi_character, 0, mpicom, ierr)
+ if (ierr /= 0) call endrun(trim(subname)//": FATAL: mpi_bcast: stream_ndep_data_filename")
+ call mpi_bcast(stream_ndep_year_first, 1, mpi_integer, 0, mpicom, ierr)
+ if (ierr /= 0) call endrun(trim(subname)//": FATAL: mpi_bcast: stream_ndep_year_first")
+ call mpi_bcast(stream_ndep_year_last, 1, mpi_integer, 0, mpicom, ierr)
+ if (ierr /= 0) call endrun(trim(subname)//": FATAL: mpi_bcast: stream_ndep_year_last")
+ call mpi_bcast(stream_ndep_year_align, 1, mpi_integer, 0, mpicom, ierr)
+ if (ierr /= 0) call endrun(trim(subname)//": FATAL: mpi_bcast: stream_ndep_year_align")
+
+ if (masterproc) then
+ write(iulog,'(a)' ) ' '
+ write(iulog,'(a,i8)') 'stream ndep settings:'
+ write(iulog,'(a,a)' ) ' stream_ndep_data_filename = ',trim(stream_ndep_data_filename)
+ write(iulog,'(a,a)' ) ' stream_ndep_mesh_filename = ',trim(stream_ndep_mesh_filename)
+ write(iulog,'(a,a,a)') ' stream_varlist_ndep = ',trim(stream_varlist_ndep(1)), trim(stream_varlist_ndep(2))
+ write(iulog,'(a,i8)') ' stream_ndep_year_first = ',stream_ndep_year_first
+ write(iulog,'(a,i8)') ' stream_ndep_year_last = ',stream_ndep_year_last
+ write(iulog,'(a,i8)') ' stream_ndep_year_align = ',stream_ndep_year_align
+ write(iulog,'(a)' ) ' '
+ endif
+
+ ! Read in units
+ call stream_ndep_check_units(stream_ndep_data_filename)
+
+ ! Initialize the cdeps data type sdat_ndep
+ call shr_strdata_init_from_inline(sdat_ndep, &
+ my_task = iam, &
+ logunit = iulog, &
+ compname = 'ATM', &
+ model_clock = model_clock, &
+ model_mesh = model_mesh, &
+ stream_meshfile = trim(stream_ndep_mesh_filename), &
+ stream_filenames = (/trim(stream_ndep_data_filename)/), &
+ stream_yearFirst = stream_ndep_year_first, &
+ stream_yearLast = stream_ndep_year_last, &
+ stream_yearAlign = stream_ndep_year_align, &
+ stream_fldlistFile = stream_varlist_ndep, &
+ stream_fldListModel = stream_varlist_ndep, &
+ stream_lev_dimname = 'null', &
+ stream_mapalgo = 'bilinear', &
+ stream_offset = 0, &
+ stream_taxmode = 'cycle', &
+ stream_dtlimit = 1.0e30_r8, &
+ stream_tintalgo = 'linear', &
+ stream_name = 'Nitrogen deposition data ', &
+ rc = rc)
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
+
+ end subroutine stream_ndep_init
+
+ !================================================================
+ subroutine stream_ndep_check_units( stream_fldFileName_ndep)
+
+ !--------------------------------------------------------
+ ! Check that units are correct on the file and if need any conversion
+ !--------------------------------------------------------
+
+ use cam_pio_utils , only : cam_pio_createfile, cam_pio_openfile, cam_pio_closefile, pio_subsystem
+ use pio , only : file_desc_t, io_desc_t, var_desc_t, pio_double, pio_def_dim
+ use pio , only : pio_bcast_error, pio_seterrorhandling, pio_inq_varid, pio_get_att
+ use pio , only : PIO_NOERR, PIO_NOWRITE
+
+ ! Arguments
+ character(len=*), intent(in) :: stream_fldFileName_ndep ! ndep filename
+ !
+ ! Local variables
+ type(file_desc_t) :: File ! NetCDF filehandle for ndep file
+ type(var_desc_t) :: vardesc ! variable descriptor
+ integer :: ierr ! error status
+ integer :: err_handling ! temporary
+ character(len=CS) :: ndepunits! ndep units
+ !-----------------------------------------------------------------------
+
+ call cam_pio_openfile( File, trim(stream_fldFileName_ndep), PIO_NOWRITE)
+ call pio_seterrorhandling(File, PIO_BCAST_ERROR, err_handling)
+ ierr = pio_inq_varid(File, stream_varlist_ndep(1), vardesc)
+ if (ierr /= PIO_NOERR) then
+ call endrun(' ERROR finding variable: '//trim(stream_varlist_ndep(1))//" in file: "// &
+ trim(stream_fldFileName_ndep)//errMsg(sourcefile, __LINE__))
+ else
+ ierr = PIO_get_att(File, vardesc, "units", ndepunits)
+ end if
+ call pio_seterrorhandling(File, err_handling)
+ call cam_pio_closefile(File)
+
+ ! Now check to make sure they are correct
+ if (.not. trim(ndepunits) == "g(N)/m2/s" )then
+ call endrun(' ERROR in units for nitrogen deposition equal to: '//trim(ndepunits)//" not units expected"// &
+ errMsg(sourcefile, __LINE__))
+ end if
+
+ end subroutine stream_ndep_check_units
+
+ !================================================================
+ subroutine stream_ndep_interp(cam_out, rc)
+
+ use dshr_methods_mod , only : dshr_fldbun_getfldptr
+ use dshr_strdata_mod , only : shr_strdata_advance
+ use camsrfexch , only : cam_out_t
+ use ppgrid , only : begchunk, endchunk
+ use time_manager , only : get_curr_date
+ use phys_grid , only : get_ncols_p
+
+ ! input/output variables
+ type(cam_out_t) , intent(inout) :: cam_out(begchunk:endchunk)
+ integer , intent(out) :: rc
+
+ ! local variables
+ integer :: i,c,g
+ integer :: year ! year (0, ...) for nstep+1
+ integer :: mon ! month (1, ..., 12) for nstep+1
+ integer :: day ! day of month (1, ..., 31) for nstep+1
+ integer :: sec ! seconds into current date for nstep+1
+ integer :: mcdate ! Current model date (yyyymmdd)
+ real(r8), pointer :: dataptr1d_nhx(:)
+ real(r8), pointer :: dataptr1d_noy(:)
+ !-----------------------------------------------------------------------
+
+ ! Advance sdat stream
+ call get_curr_date(year, mon, day, sec)
+ mcdate = year*10000 + mon*100 + day
+ call shr_strdata_advance(sdat_ndep, ymd=mcdate, tod=sec, logunit=iulog, istr='ndepdyn', rc=rc)
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
+
+ ! Get pointer for stream data that is time and spatially interpolated to model time and grid
+ call dshr_fldbun_getFldPtr(sdat_ndep%pstrm(1)%fldbun_model, stream_varlist_ndep(1), fldptr1=dataptr1d_nhx, rc=rc)
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
+ call dshr_fldbun_getFldPtr(sdat_ndep%pstrm(1)%fldbun_model, stream_varlist_ndep(2), fldptr1=dataptr1d_noy, rc=rc)
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
+
+ g = 1
+ do c = begchunk,endchunk
+ do i = 1,get_ncols_p(c)
+ cam_out(c)%nhx_nitrogen_flx(i) = dataptr1d_nhx(g)
+ cam_out(c)%noy_nitrogen_flx(i) = dataptr1d_noy(g)
+ g = g + 1
+ end do
+ end do
+
+ end subroutine stream_ndep_interp
+
+end module atm_stream_ndep
diff --git a/src/dynamics/eul/dp_coupling.F90 b/src/dynamics/eul/dp_coupling.F90
index 946c66b092..bc900e2d0e 100644
--- a/src/dynamics/eul/dp_coupling.F90
+++ b/src/dynamics/eul/dp_coupling.F90
@@ -269,7 +269,7 @@ subroutine d_p_coupling(ps, t3, u3, v3, q3, &
! Compute initial geopotential heights
call geopotential_t (phys_state(lchnk)%lnpint, phys_state(lchnk)%lnpmid , phys_state(lchnk)%pint , &
phys_state(lchnk)%pmid , phys_state(lchnk)%pdel , phys_state(lchnk)%rpdel , &
- phys_state(lchnk)%t , phys_state(lchnk)%q(:,:,1), rairv(:,:,lchnk), gravit, zvirv, &
+ phys_state(lchnk)%t , phys_state(lchnk)%q(:,:,:), rairv(:,:,lchnk), gravit, zvirv, &
phys_state(lchnk)%zi , phys_state(lchnk)%zm , ncol )
! Compute initial dry static energy, include surface geopotential
diff --git a/src/dynamics/eul/dycore_budget.F90 b/src/dynamics/eul/dycore_budget.F90
new file mode 100644
index 0000000000..7531d69ac7
--- /dev/null
+++ b/src/dynamics/eul/dycore_budget.F90
@@ -0,0 +1,27 @@
+module dycore_budget
+implicit none
+
+public :: print_budget
+
+!=========================================================================================
+contains
+!=========================================================================================
+
+subroutine print_budget(hstwr)
+
+ use spmd_utils, only: masterproc
+ use cam_abortutils, only: endrun
+ use cam_budget, only: thermo_budget_history,thermo_budget_histfile_num
+
+ ! arguments
+ logical, intent(in) :: hstwr(:)
+ character(len=*), parameter :: subname = 'dycore_budget:print_budgets:'
+
+ !--------------------------------------------------------------------------------------
+
+ if (masterproc .and. thermo_budget_history .and. hstwr(thermo_budget_histfile_num)) then
+ call endrun(subname//' is not implemented for the EUL dycore')
+ end if
+end subroutine print_budget
+
+end module dycore_budget
diff --git a/src/dynamics/fv/dp_coupling.F90 b/src/dynamics/fv/dp_coupling.F90
index 4f109bf2ee..64b2e7b9c8 100644
--- a/src/dynamics/fv/dp_coupling.F90
+++ b/src/dynamics/fv/dp_coupling.F90
@@ -77,7 +77,7 @@ subroutine d_p_coupling(grid, phys_state, phys_tend, pbuf2d, dyn_out)
use ctem, only: ctem_diags, do_circulation_diags
use diag_module, only: fv_diag_am_calc
use gravity_waves_sources, only: gws_src_fnct
- use cam_thermo, only: cam_thermo_update
+ use cam_thermo, only: cam_thermo_dry_air_update
use shr_const_mod, only: shr_const_rwv
use dyn_comp, only: frontgf_idx, frontga_idx, uzm_idx
use qbo, only: qbo_use_forcing
@@ -85,7 +85,7 @@ subroutine d_p_coupling(grid, phys_state, phys_tend, pbuf2d, dyn_out)
use zonal_mean, only: zonal_mean_3D
use d2a3dikj_mod, only: d2a3dikj
use qneg_module, only: qneg3
-
+ use air_composition,only: dry_air_species_num
!-----------------------------------------------------------------------
implicit none
!-----------------------------------------------------------------------
@@ -571,8 +571,13 @@ subroutine d_p_coupling(grid, phys_state, phys_tend, pbuf2d, dyn_out)
end if
end do
end do
-
- if ( waccmx_is('ionosphere') .or. waccmx_is('neutral') ) then
+ !
+ ! Convert dry type constituents from moist to dry mixing ratio
+ ! (note: cam_thermo_dry_air_update assumes dry unless optional conversion factor provided)
+ !
+ call set_state_pdry(phys_state(lchnk)) ! First get dry pressure to use for this timestep
+ call set_wet_to_dry(phys_state(lchnk)) ! Dynamics had moist, physics wants dry
+ if (dry_air_species_num>0) then
!------------------------------------------------------------
! Apply limiters to mixing ratios of major species
!------------------------------------------------------------
@@ -581,7 +586,7 @@ subroutine d_p_coupling(grid, phys_state, phys_tend, pbuf2d, dyn_out)
! Call cam_thermo_update to compute cpairv, rairv, mbarv, and cappav as constituent dependent variables
! and compute molecular viscosity(kmvis) and conductivity(kmcnd)
!-----------------------------------------------------------------------------
- call cam_thermo_update(phys_state(lchnk)%q, phys_state(lchnk)%t, lchnk, ncol)
+ call cam_thermo_dry_air_update(phys_state(lchnk)%q, phys_state(lchnk)%t, lchnk, ncol)
endif
!------------------------------------------------------------------------
@@ -596,7 +601,7 @@ subroutine d_p_coupling(grid, phys_state, phys_tend, pbuf2d, dyn_out)
! Compute initial geopotential heights
call geopotential_t (phys_state(lchnk)%lnpint, phys_state(lchnk)%lnpmid , phys_state(lchnk)%pint , &
phys_state(lchnk)%pmid , phys_state(lchnk)%pdel , phys_state(lchnk)%rpdel , &
- phys_state(lchnk)%t , phys_state(lchnk)%q(:,:,1), rairv(:,:,lchnk), gravit, zvirv, &
+ phys_state(lchnk)%t , phys_state(lchnk)%q(:,:,:), rairv(:,:,lchnk), gravit, zvirv, &
phys_state(lchnk)%zi , phys_state(lchnk)%zm , ncol )
! Compute initial dry static energy, include surface geopotential
@@ -608,11 +613,6 @@ subroutine d_p_coupling(grid, phys_state, phys_tend, pbuf2d, dyn_out)
end do
!
-! Convert dry type constituents from moist to dry mixing ratio
-!
- call set_state_pdry(phys_state(lchnk)) ! First get dry pressure to use for this timestep
- call set_wet_to_dry(phys_state(lchnk)) ! Dynamics had moist, physics wants dry.
-!
! Ensure tracers are all positive
!
call qneg3('D_P_COUPLING',lchnk ,ncol ,pcols ,pver , &
diff --git a/src/dynamics/fv/dycore_budget.F90 b/src/dynamics/fv/dycore_budget.F90
new file mode 100644
index 0000000000..a672fef9cc
--- /dev/null
+++ b/src/dynamics/fv/dycore_budget.F90
@@ -0,0 +1,27 @@
+module dycore_budget
+implicit none
+
+public :: print_budget
+
+!=========================================================================================
+contains
+!=========================================================================================
+
+subroutine print_budget(hstwr)
+
+ use spmd_utils, only: masterproc
+ use cam_abortutils, only: endrun
+ use cam_budget, only: thermo_budget_histfile_num, thermo_budget_history
+
+ ! arguments
+ logical, intent(in) :: hstwr(:)
+ character(len=*), parameter :: subname = 'dycore_budget:print_budgets:'
+
+ !--------------------------------------------------------------------------------------
+
+ if (masterproc .and. thermo_budget_history .and. hstwr(thermo_budget_histfile_num)) then
+ call endrun(subname//' is not implemented for the FV dycore')
+ end if
+end subroutine print_budget
+
+end module dycore_budget
diff --git a/src/dynamics/fv/metdata.F90 b/src/dynamics/fv/metdata.F90
index 5f49143562..06957af5ef 100644
--- a/src/dynamics/fv/metdata.F90
+++ b/src/dynamics/fv/metdata.F90
@@ -660,7 +660,9 @@ subroutine get_met_srf2( cam_in )
! Nudging land and forcing ocean.
if (met_srf_land_scale) then
- met_rlx_sfc(:ncol) = (1._r8 - cam_in(c)%landfrac(:ncol)) * met_rlx_sfc(:ncol) + cam_in(c)%landfrac(:ncol) * met_rlx(pver)
+ met_rlx_sfc(:ncol) = (1._r8 - cam_in(c)%landfrac(:ncol)) * &
+ met_rlx_sfc(:ncol) + &
+ cam_in(c)%landfrac(:ncol) * met_rlx(pver)
else
where(cam_in(c)%landfrac(:ncol) == 1._r8) met_rlx_sfc(:ncol) = 0._r8
end if
@@ -725,9 +727,9 @@ subroutine get_met_srf2( cam_in )
end if
if (met_srf_refs) then
- cam_in(c)%qref(:ncol) = (1._r8-met_rlx_sfc(:ncol)) * cam_in(c)%qref(:ncol) + met_rlx_sfc(:ncol) * met_qref(:ncol,c)
- cam_in(c)%tref(:ncol) = (1._r8-met_rlx_sfc(:ncol)) * cam_in(c)%tref(:ncol) + met_rlx_sfc(:ncol) * met_tref(:ncol,c)
- cam_in(c)%u10(:ncol) = (1._r8-met_rlx_sfc(:ncol)) * cam_in(c)%u10(:ncol) + met_rlx_sfc(:ncol) * met_u10(:ncol,c)
+ cam_in(c)%qref(:ncol) = (1._r8-met_rlx_sfc(:ncol)) * cam_in(c)%qref(:ncol) + met_rlx_sfc(:ncol) * met_qref(:ncol,c)
+ cam_in(c)%tref(:ncol) = (1._r8-met_rlx_sfc(:ncol)) * cam_in(c)%tref(:ncol) + met_rlx_sfc(:ncol) * met_tref(:ncol,c)
+ cam_in(c)%u10(:ncol) = (1._r8-met_rlx_sfc(:ncol)) * cam_in(c)%u10(:ncol) + met_rlx_sfc(:ncol) * met_u10(:ncol,c)
end if
if (met_srf_sst) then
@@ -902,6 +904,8 @@ subroutine get_dyn_flds( state, tend, dt )
use ppgrid, only: pcols, pver, begchunk, endchunk
use phys_grid, only: get_ncols_p
use cam_history, only: outfld
+ use air_composition,only: thermodynamic_active_species_liq_num, thermodynamic_active_species_ice_num
+ use air_composition,only: thermodynamic_active_species_liq_idx,thermodynamic_active_species_ice_idx
implicit none
@@ -912,7 +916,10 @@ subroutine get_dyn_flds( state, tend, dt )
integer :: lats(pcols) ! array of latitude indices
integer :: lons(pcols) ! array of longitude indices
integer :: c, ncol, i,j,k
- real(r8):: qini(pcols,pver) ! initial specific humidity
+ integer :: m_cnst,m
+ real(r8):: qini(pcols,pver) ! initial specific humidity
+ real(r8):: totliqini(pcols,pver) ! initial total liquid
+ real(r8):: toticeini(pcols,pver) ! initial total ice
real(r8) :: tmp(pcols,pver)
@@ -920,14 +927,26 @@ subroutine get_dyn_flds( state, tend, dt )
do c = begchunk, endchunk
ncol = get_ncols_p(c)
+ !
+ ! update water variables
+ !
+ qini(:ncol,:pver) = state(c)%q(:ncol,:pver,1)
+ totliqini = 0.0_r8
+ do m_cnst=1,thermodynamic_active_species_liq_num
+ m = thermodynamic_active_species_liq_idx(m_cnst)
+ totliqini(:ncol,:pver) = totliqini(:ncol,:pver)+state(c)%q(:ncol,:pver,m)
+ end do
+ toticeini = 0.0_r8
+ do m_cnst=1,thermodynamic_active_species_ice_num
+ m = thermodynamic_active_species_ice_idx(m_cnst)
+ toticeini(:ncol,:pver) = toticeini(:ncol,:pver)+state(c)%q(:ncol,:pver,m)
+ end do
+
do k=1,pver
do i=1,ncol
if (met_nudge_temp) then
state(c)%t(i,k) = (1._r8-met_rlx(k))*state(c)%t(i,k) + met_rlx(k)*met_t(i,k,c)
end if
-
- qini(i,k) = state(c)%q(i,k,1)
-
! at this point tracer mixing ratios have already been
! converted from dry to moist
state(c)%q(i,k,1) = alpha*state(c)%q(i,k,1) + (D1_0-alpha)*met_q(i,k,c)
@@ -940,7 +959,7 @@ subroutine get_dyn_flds( state, tend, dt )
! now adjust mass of each layer now that water vapor has changed
if (( .not. online_test ) .and. (alpha .ne. D1_0 )) then
- call physics_dme_adjust(state(c), tend(c), qini, dt)
+ call physics_dme_adjust(state(c), tend(c), qini, totliqini, toticeini, dt)
endif
end do
diff --git a/src/dynamics/fv3/dp_coupling.F90 b/src/dynamics/fv3/dp_coupling.F90
index 2eb69c448e..3b7fcca69b 100644
--- a/src/dynamics/fv3/dp_coupling.F90
+++ b/src/dynamics/fv3/dp_coupling.F90
@@ -733,7 +733,7 @@ subroutine derived_phys_dry(phys_state, phys_tend, pbuf2d)
! Compute initial geopotential heights - based on full pressure
call geopotential_t (phys_state(lchnk)%lnpint, phys_state(lchnk)%lnpmid , phys_state(lchnk)%pint , &
phys_state(lchnk)%pmid , phys_state(lchnk)%pdel , phys_state(lchnk)%rpdel , &
- phys_state(lchnk)%t , phys_state(lchnk)%q(:,:,1), rairv(:,:,lchnk), gravit, zvirv , &
+ phys_state(lchnk)%t , phys_state(lchnk)%q(:,:,:), rairv(:,:,lchnk), gravit, zvirv , &
phys_state(lchnk)%zi , phys_state(lchnk)%zm , ncol )
! Compute initial dry static energy, include surface geopotential
diff --git a/src/dynamics/fv3/dycore_budget.F90 b/src/dynamics/fv3/dycore_budget.F90
new file mode 100644
index 0000000000..0645edb251
--- /dev/null
+++ b/src/dynamics/fv3/dycore_budget.F90
@@ -0,0 +1,27 @@
+module dycore_budget
+
+implicit none
+
+public :: print_budget
+
+!=========================================================================================
+contains
+!=========================================================================================
+
+subroutine print_budget(hstwr)
+
+ use spmd_utils, only: masterproc
+ use cam_abortutils, only: endrun
+ use cam_budget, only: thermo_budget_histfile_num, thermo_budget_history
+
+ ! arguments
+ logical, intent(in) :: hstwr(:)
+ character(len=*), parameter :: subname = 'dycore_budget:print_budgets:'
+
+ !--------------------------------------------------------------------------------------
+
+ if (masterproc .and. thermo_budget_history .and. hstwr(thermo_budget_histfile_num)) then
+ call endrun(subname//' is not implemented for the FV3 dycore')
+ end if
+end subroutine print_budget
+end module dycore_budget
diff --git a/src/dynamics/mpas/Makefile b/src/dynamics/mpas/Makefile
index 89c4d71931..216be0ff1a 100644
--- a/src/dynamics/mpas/Makefile
+++ b/src/dynamics/mpas/Makefile
@@ -1,4 +1,4 @@
-CPPFLAGS := -D_MPI -DMPAS_NATIVE_TIMERS -DMPAS_GIT_VERSION=unknown -DMPAS_NAMELIST_SUFFIX=atmosphere -DMPAS_CAM_DYCORE -DMPAS_NO_ESMF_INIT
+CPPFLAGS := -D_MPI -DMPAS_NATIVE_TIMERS -DMPAS_GIT_VERSION=unknown -DMPAS_NAMELIST_SUFFIX=atmosphere -DMPAS_CAM_DYCORE -DMPAS_PIO_SUPPORT -DMPAS_NO_ESMF_INIT
ifdef PIODEF
CPPFLAGS += $(PIODEF)
endif
@@ -18,6 +18,7 @@ INTERFACE_OBJS = \
mpas_atm_core_interface.o \
mpas_atm_dimensions.o \
mpas_atm_threading.o \
+ mpas_atm_halos.o \
cam_mpas_subdriver.o
DYN_OBJS = \
@@ -31,10 +32,11 @@ DIAG_OBJS = \
DIAGNOSTICS = \
mpas_atm_diagnostic_template.o \
- isobaric_diagnostics.o \
- convective_diagnostics.o \
- pv_diagnostics.o \
- soundings.o
+ mpas_isobaric_diagnostics.o \
+ mpas_cloud_diagnostics.o \
+ mpas_convective_diagnostics.o \
+ mpas_pv_diagnostics.o \
+ mpas_soundings.o
REG_OBJS = \
parse.o \
@@ -90,7 +92,10 @@ FRAME_OBJS = \
mpas_pool_routines.o \
xml_stream_parser.o \
regex_matching.o \
- mpas_log.o
+ mpas_log.o \
+ mpas_halo.o \
+ mpas_string_utils.o
+
UTIL_OBJS = \
ezxml.o
@@ -129,7 +134,8 @@ mpas_framework.o: mpas_dmpar.o \
mpas_io_units.o \
mpas_block_decomp.o \
mpas_stream_manager.o \
- mpas_c_interfacing.o
+ mpas_c_interfacing.o \
+ mpas_halo.o
mpas_abort.o: mpas_kind_types.o mpas_io_units.o mpas_threading.o
@@ -155,7 +161,7 @@ mpas_dmpar.o: mpas_sort.o mpas_kind_types.o mpas_derived_types.o mpas_hash.o mpa
mpas_sort.o: mpas_kind_types.o mpas_log.o
-mpas_timekeeping.o: mpas_kind_types.o mpas_derived_types.o mpas_dmpar.o mpas_threading.o mpas_log.o
+mpas_timekeeping.o: mpas_string_utils.o mpas_kind_types.o mpas_derived_types.o mpas_dmpar.o mpas_threading.o mpas_log.o
mpas_timer.o: mpas_kind_types.o mpas_dmpar.o mpas_threading.o mpas_log.o
@@ -179,6 +185,7 @@ mpas_stream_manager.o: mpas_io_streams.o mpas_timekeeping.o mpas_derived_types.o
mpas_forcing.o: mpas_derived_types.o mpas_timekeeping.o mpas_stream_manager.o mpas_log.o mpas_io_units.o
+mpas_halo.o: mpas_derived_types.o mpas_pool_routines.o mpas_log.o
#
# Operator dependencies
@@ -234,9 +241,10 @@ mpas_atm_time_integration.o: mpas_atm_iau.o mpas_atm_dimensions.o mpas_atm_bound
#
mpas_atm_diagnostics_manager.o: mpas_atm_diagnostics_utils.o $(DIAGNOSTICS)
-convective_diagnostics.o: mpas_atm_diagnostics_utils.o
-isobaric_diagnostics.o: mpas_atm_diagnostics_utils.o
-pv_diagnostics.o: mpas_atm_diagnostics_utils.o
+mpas_cloud_diagnostics.o: mpas_atm_diagnostics_utils.o
+mpas_convective_diagnostics.o: mpas_atm_diagnostics_utils.o
+mpas_isobaric_diagnostics.o: mpas_atm_diagnostics_utils.o
+mpas_pv_diagnostics.o: mpas_atm_diagnostics_utils.o
#
@@ -244,7 +252,7 @@ pv_diagnostics.o: mpas_atm_diagnostics_utils.o
#
mpas_atm_core_interface.o: mpas_atm_core.o incs
-mpas_atm_core.o: mpas_atm_threading.o mpas_atm_time_integration.o mpas_atm_diagnostics_manager.o
+mpas_atm_core.o: mpas_atm_threading.o mpas_atm_time_integration.o mpas_atm_diagnostics_manager.o mpas_atm_halos.o
cam_mpas_subdriver.o: mpas_atm_core_interface.o mpas_derived_types.o mpas_framework.o mpas_domain_routines.o mpas_pool_routines.o
diff --git a/src/dynamics/mpas/dp_coupling.F90 b/src/dynamics/mpas/dp_coupling.F90
index 2037a820cb..10d75b4b8c 100644
--- a/src/dynamics/mpas/dp_coupling.F90
+++ b/src/dynamics/mpas/dp_coupling.F90
@@ -8,24 +8,21 @@ module dp_coupling
use pmgrid, only: plev
use ppgrid, only: begchunk, endchunk, pcols, pver, pverp
use constituents, only: pcnst, cnst_type
-use physconst, only: gravit, cappa, rh2o, zvir
-use air_composition,only: cpairv, rairv
-
-use spmd_dyn, only: local_dp_map, block_buf_nrecs, chunk_buf_nrecs
-use spmd_utils, only: mpicom, iam, masterproc
-
+use physconst, only: gravit, cappa, zvir
+use air_composition,only: cpairv
+use air_composition,only: dry_air_species_num
use dyn_comp, only: dyn_export_t, dyn_import_t
-
use physics_types, only: physics_state, physics_tend, physics_cnst_limit
-use phys_grid, only: get_dyn_col_p, get_chunk_info_p, get_ncols_p, get_gcol_all_p
+use phys_grid, only: get_dyn_col_p, get_chunk_info_p, get_ncols_p
use phys_grid, only: columns_on_task
use physics_buffer, only: physics_buffer_desc, pbuf_get_chunk, pbuf_get_field
-use cam_logfile, only: iulog
-use perf_mod, only: t_startf, t_stopf, t_barrierf
+use perf_mod, only: t_startf, t_stopf
use cam_abortutils, only: endrun
-use air_composition,only: thermodynamic_active_species_num,thermodynamic_active_species_idx,thermodynamic_active_species_idx_dycore
+use air_composition,only: thermodynamic_active_species_num,thermodynamic_active_species_idx, &
+ thermodynamic_active_species_idx_dycore
+
implicit none
private
save
@@ -41,12 +38,16 @@ module dp_coupling
!=========================================================================================
subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out)
+ use cam_mpas_subdriver, only: cam_mpas_update_halo
! Convert the dynamics output state into the physics input state.
! Note that all pressures and tracer mixing ratios coming from the dycore are based on
! dry air mass.
- use cam_history, only : hist_fld_active
- use mpas_constants, only : Rv_over_Rd => rvord
+ use cam_history, only: hist_fld_active
+ use dyn_comp, only: frontgf_idx, frontga_idx
+ use mpas_constants, only: Rv_over_Rd => rvord
+ use phys_control, only: use_gw_front, use_gw_front_igw
+ use cam_budget, only : thermo_budget_history
! arguments
type(physics_state), intent(inout) :: phys_state(begchunk:endchunk)
@@ -71,17 +72,42 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out)
real(r8), pointer :: theta_m(:,:)
real(r8), pointer :: tracers(:,:,:)
+ !
+ ! mesh information and coefficients needed for
+ ! frontogenesis function calculation
+ !
+ real(r8), pointer :: defc_a(:,:)
+ real(r8), pointer :: defc_b(:,:)
+ real(r8), pointer :: cell_gradient_coef_x(:,:)
+ real(r8), pointer :: cell_gradient_coef_y(:,:)
+ real(r8), pointer :: edgesOnCell_sign(:,:)
+ real(r8), pointer :: dvEdge(:)
+ real(r8), pointer :: areaCell(:)
+
+ integer, pointer :: cellsOnEdge(:,:)
+ integer, pointer :: edgesOnCell(:,:)
+ integer, pointer :: nEdgesOnCell(:)
+
+ real(r8), pointer :: uperp(:,:)
+ real(r8), pointer :: utangential(:,:)
+
+ !
+ ! local storage for frontogenesis function and angle
+ !
+ real(r8), pointer :: frontogenesisFunction(:,:)
+ real(r8), pointer :: frontogenesisAngle(:,:)
+ real(r8), pointer :: pbuf_frontgf(:,:)
+ real(r8), pointer :: pbuf_frontga(:,:)
+ real(r8), allocatable :: frontgf_phys(:,:,:)
+ real(r8), allocatable :: frontga_phys(:,:,:)
+
+ type(physics_buffer_desc), pointer :: pbuf_chnk(:)
integer :: lchnk, icol, icol_p, k, kk ! indices over chunks, columns, physics columns and layers
- integer :: i, m, ncols, blockid
+ integer :: i, m, ncols
integer :: block_index
integer, dimension(:), pointer :: block_offset
- integer :: pgcols(pcols)
- integer :: tsize ! amount of data per grid point passed to physics
- integer, allocatable :: bpter(:,:) ! offsets into block buffer for packing data
- integer, allocatable :: cpter(:,:) ! offsets into chunk buffer for unpacking data
-
real(r8), allocatable:: pmid(:,:) !mid-level hydrostatic pressure consistent with MPAS discrete state
real(r8), allocatable:: pintdry(:,:) !interface hydrostatic pressure consistent with MPAS discrete state
real(r8), allocatable:: pmiddry(:,:) !mid-level hydrostatic dry pressure consistent with MPAS discrete state
@@ -90,10 +116,7 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out)
character(len=*), parameter :: subname = 'd_p_coupling'
!----------------------------------------------------------------------------
- compute_energy_diags=&
- (hist_fld_active('SE_dBF').or.hist_fld_active('SE_dAP').or.hist_fld_active('SE_dAM').or.&
- hist_fld_active('KE_dBF').or.hist_fld_active('KE_dAP').or.hist_fld_active('KE_dAM').or.&
- hist_fld_active('WV_dBF').or.hist_fld_active('WV_dAP').or.hist_fld_active('WV_dAM'))
+ compute_energy_diags=thermo_budget_history
nCellsSolve = dyn_out % nCellsSolve
index_qv = dyn_out % index_qv
@@ -110,7 +133,7 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out)
tracers => dyn_out % tracers
if (compute_energy_diags) then
- call tot_energy(nCellsSolve, plev,size(tracers, 1), index_qv, zz(:,1:nCellsSolve), zint(:,1:nCellsSolve), &
+ call tot_energy_dyn(nCellsSolve, plev,size(tracers, 1), index_qv, zz(:,1:nCellsSolve), zint(:,1:nCellsSolve), &
rho_zz(:,1:nCellsSolve), theta_m(:,1:nCellsSolve), tracers(:,:,1:nCellsSolve),&
ux(:,1:nCellsSolve),uy(:,1:nCellsSolve),'dBF')
end if
@@ -127,9 +150,51 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out)
if( ierr /= 0 ) call endrun(subname//':failed to allocate pintdry array')
call hydrostatic_pressure( &
- nCellsSolve, plev, zz, zint, rho_zz, theta_m, tracers(index_qv,:,:),&
+ nCellsSolve, plev, size(tracers, 1), index_qv, zz, zint, rho_zz, theta_m, exner, tracers,&
pmiddry, pintdry, pmid)
+ if (use_gw_front .or. use_gw_front_igw) then
+ call cam_mpas_update_halo('scalars', endrun) ! scalars is the name of tracers in the MPAS state pool
+ nullify(pbuf_chnk)
+ nullify(pbuf_frontgf)
+ nullify(pbuf_frontga)
+ !
+ ! compute frontogenesis function and angle for gravity wave scheme
+ !
+ defc_a => dyn_out % defc_a
+ defc_b => dyn_out % defc_b
+ cell_gradient_coef_x => dyn_out % cell_gradient_coef_x
+ cell_gradient_coef_y => dyn_out % cell_gradient_coef_y
+ edgesOnCell_sign => dyn_out % edgesOnCell_sign
+ dvEdge => dyn_out % dvEdge
+ areaCell => dyn_out % areaCell
+ cellsOnEdge => dyn_out % cellsOnEdge
+ edgesOnCell => dyn_out % edgesOnCell
+ nEdgesOnCell => dyn_out % nEdgesOnCell
+ uperp => dyn_out % uperp
+ utangential => dyn_out % utangential
+
+ allocate(frontogenesisFunction(plev, nCellsSolve), stat=ierr)
+ if( ierr /= 0 ) call endrun(subname//':failed to allocate frontogenesisFunction array')
+ allocate(frontogenesisAngle(plev, nCellsSolve), stat=ierr)
+ if( ierr /= 0 ) call endrun(subname//':failed to allocate frontogenesisAngle array')
+
+ allocate(frontgf_phys(pcols, pver, begchunk:endchunk), stat=ierr)
+ if( ierr /= 0 ) call endrun(subname//':failed to allocate frontgf_phys array')
+ allocate(frontga_phys(pcols, pver, begchunk:endchunk), stat=ierr)
+ if( ierr /= 0 ) call endrun(subname//':failed to allocate frontga_phys array')
+
+
+ call calc_frontogenesis( frontogenesisFunction, frontogenesisAngle, &
+ theta_m, tracers(index_qv,:,:), &
+ uperp, utangential, defc_a, defc_b, &
+ cell_gradient_coef_x, cell_gradient_coef_y, &
+ areaCell, dvEdge, cellsOnEdge, edgesOnCell, &
+ nEdgesOnCell, edgesOnCell_sign, &
+ plev, nCellsSolve )
+
+ end if
+
call t_startf('dpcopy')
ncols = columns_on_task
@@ -155,6 +220,11 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out)
phys_state(lchnk)%omega(icol_p,k) = -rho_zz(kk,i)*zz(kk,i)*gravit*0.5_r8*(w(kk,i)+w(kk+1,i)) ! omega
phys_state(lchnk)%pmiddry(icol_p,k) = pmiddry(kk,i)
phys_state(lchnk)%pmid(icol_p,k) = pmid(kk,i)
+
+ if (use_gw_front .or. use_gw_front_igw) then
+ frontgf_phys(icol_p, k, lchnk) = frontogenesisFunction(kk, i)
+ frontga_phys(icol_p, k, lchnk) = frontogenesisAngle(kk, i)
+ end if
end do
do k = 1, pverp
@@ -170,6 +240,27 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out)
end do
end do
+ if (use_gw_front .or. use_gw_front_igw) then
+
+ !$omp parallel do private (lchnk, ncols, icol, k, pbuf_chnk, pbuf_frontgf, pbuf_frontga)
+ do lchnk = begchunk, endchunk
+ ncols = get_ncols_p(lchnk)
+ pbuf_chnk => pbuf_get_chunk(pbuf2d, lchnk)
+ call pbuf_get_field(pbuf_chnk, frontgf_idx, pbuf_frontgf)
+ call pbuf_get_field(pbuf_chnk, frontga_idx, pbuf_frontga)
+ do k = 1, pver
+ do icol = 1, ncols
+ pbuf_frontgf(icol, k) = frontgf_phys(icol, k, lchnk)
+ pbuf_frontga(icol, k) = frontga_phys(icol, k, lchnk)
+ end do
+ end do
+ end do
+ deallocate(frontgf_phys)
+ deallocate(frontga_phys)
+ deallocate(frontogenesisFunction)
+ deallocate(frontogenesisAngle)
+ end if
+
call t_stopf('dpcopy')
call t_startf('derived_phys')
@@ -202,7 +293,7 @@ subroutine p_d_coupling(phys_state, phys_tend, dyn_in)
! Local variables
integer :: lchnk, icol, icol_p, k, kk ! indices over chunks, columns, layers
- integer :: i, m, ncols, blockid
+ integer :: i, m, ncols
integer :: block_index
integer, dimension(:), pointer :: block_offset
@@ -212,7 +303,6 @@ subroutine p_d_coupling(phys_state, phys_tend, dyn_in)
! Variables from dynamics import container
integer :: nCellsSolve
integer :: nCells
- integer :: nEdgesSolve
integer :: index_qv
integer, dimension(:), pointer :: mpas_from_cam_cnst
@@ -226,11 +316,6 @@ subroutine p_d_coupling(phys_state, phys_tend, dyn_in)
integer :: idx_phys, idx_dycore
- integer :: pgcols(pcols)
- integer :: tsize ! amount of data per grid point passed to dynamics
- integer, allocatable :: bpter(:,:) ! offsets into block buffer for unpacking data
- integer, allocatable :: cpter(:,:) ! offsets into chunk buffer for packing data
-
type (mpas_pool_type), pointer :: tend_physics
type (field2DReal), pointer :: tend_uzonal, tend_umerid
@@ -247,7 +332,7 @@ subroutine p_d_coupling(phys_state, phys_tend, dyn_in)
allocate( t_tend(pver,nCellsSolve), stat=ierr)
if( ierr /= 0 ) call endrun(subname//':failed to allocate t_tend array')
- allocate( q_tend(thermodynamic_active_species_num,pver,nCellsSolve), stat=ierr)
+ allocate( q_tend(thermodynamic_active_species_num-dry_air_species_num,pver,nCellsSolve), stat=ierr)
if( ierr /= 0 ) call endrun(subname//':failed to allocate q_tend array')
nullify(tend_physics)
@@ -289,7 +374,7 @@ subroutine p_d_coupling(phys_state, phys_tend, dyn_in)
!
! compute tendencies for thermodynamic active species
!
- do m=1,thermodynamic_active_species_num
+ do m=dry_air_species_num + 1,thermodynamic_active_species_num
idx_phys = thermodynamic_active_species_idx(m)
idx_dycore = thermodynamic_active_species_idx_dycore(m)
if (idx_dycore==index_qv) index_qv_phys = m
@@ -324,7 +409,6 @@ end subroutine p_d_coupling
!=========================================================================================
subroutine derived_phys(phys_state, phys_tend, pbuf2d)
-
! Compute fields in the physics state object which are diagnosed from the
! MPAS prognostic fields.
@@ -332,11 +416,12 @@ subroutine derived_phys(phys_state, phys_tend, pbuf2d)
use check_energy, only: check_energy_timestep_init
use shr_vmath_mod, only: shr_vmath_log
use phys_control, only: waccmx_is
- use cam_thermo, only: cam_thermo_update
- use air_composition, only: rairv
+ use cam_thermo, only: cam_thermo_dry_air_update, cam_thermo_water_update
+ use air_composition, only: rairv, dry_air_species_num
use qneg_module, only: qneg3
use shr_const_mod, only: shr_const_rwv
use constituents, only: qmin
+ use dyn_tests_utils, only: vcoord=>vc_height
! Arguments
type(physics_state), intent(inout) :: phys_state(begchunk:endchunk)
type(physics_tend ), intent(inout) :: phys_tend(begchunk:endchunk)
@@ -344,7 +429,7 @@ subroutine derived_phys(phys_state, phys_tend, pbuf2d)
! Local variables
- integer :: i, k, lchnk, m, ncol
+ integer :: k, lchnk, m, ncol, m_cnst
real(r8) :: factor(pcols,pver)
real(r8) :: zvirv(pcols,pver)
@@ -391,7 +476,12 @@ subroutine derived_phys(phys_state, phys_tend, pbuf2d)
do k = 1, pver
! To be consistent with total energy formula in physic's check_energy module only
! include water vapor in moist pdel.
- factor(:ncol,k) = 1._r8 + phys_state(lchnk)%q(:ncol,k,1)
+ factor(:ncol,k) = 1.0_r8
+ do m_cnst=dry_air_species_num + 1,thermodynamic_active_species_num
+ m = thermodynamic_active_species_idx(m_cnst)
+ ! at this point all q's are dry
+ factor(:ncol,k) = factor(:ncol,k)+phys_state(lchnk)%q(:ncol,k,m)
+ end do
phys_state(lchnk)%pdel(:ncol,k) = phys_state(lchnk)%pdeldry(:ncol,k)*factor(:ncol,k)
phys_state(lchnk)%rpdel(:ncol,k) = 1._r8 / phys_state(lchnk)%pdel(:ncol,k)
end do
@@ -418,18 +508,10 @@ subroutine derived_phys(phys_state, phys_tend, pbuf2d)
phys_state(lchnk)%exner(:ncol,k) = (pref / phys_state(lchnk)%pmid(:ncol,k))**cappa
end do
- ! Tracers from MPAS are in dry mixing ratio units. CAM's physics package expects constituents
- ! which have been declared to be type 'wet' when they are registered to be represented by mixing
- ! ratios based on moist air mass (dry air + water vapor). Do appropriate conversion here.
- factor(:ncol,:) = 1._r8/factor(:ncol,:)
- do m = 1,pcnst
- if (cnst_type(m) == 'wet') then
- phys_state(lchnk)%q(:ncol,:,m) = factor(:ncol,:)*phys_state(lchnk)%q(:ncol,:,m)
- end if
- end do
- if ( waccmx_is('ionosphere') .or. waccmx_is('neutral') ) then
+
+ if (dry_air_species_num>0) then
!------------------------------------------------------------
! Apply limiters to mixing ratios of major species
!------------------------------------------------------------
@@ -440,11 +522,25 @@ subroutine derived_phys(phys_state, phys_tend, pbuf2d)
! Compute molecular viscosity(kmvis) and conductivity(kmcnd).
! Fill local zvirv variable; calculated for WACCM-X.
!-----------------------------------------------------------------------------
- call cam_thermo_update(phys_state(lchnk)%q, phys_state(lchnk)%t, lchnk, ncol)
+ call cam_thermo_dry_air_update(phys_state(lchnk)%q, phys_state(lchnk)%t, lchnk, ncol)
zvirv(:,:) = shr_const_rwv / rairv(:,:,lchnk) -1._r8
else
zvirv(:,:) = zvir
endif
+ !
+ ! update cp_dycore in module air_composition.
+ ! (note: at this point q is dry)
+ !
+ call cam_thermo_water_update(phys_state(lchnk)%q(1:ncol,:,:), lchnk, ncol, vcoord)
+ ! Tracers from MPAS are in dry mixing ratio units. CAM's physics package expects constituents
+ ! which have been declared to be type 'wet' when they are registered to be represented by mixing
+ ! ratios based on moist air mass (dry air + water vapor). Do appropriate conversion here.
+ factor(:ncol,:) = 1._r8/factor(:ncol,:)
+ do m = 1,pcnst
+ if (cnst_type(m) == 'wet') then
+ phys_state(lchnk)%q(:ncol,:,m) = factor(:ncol,:)*phys_state(lchnk)%q(:ncol,:,m)
+ end if
+ end do
! Compute geopotential height above surface - based on full pressure
! Note that phys_state%zi(:,plev+1) = 0 whereas zint in MPAS is surface height
@@ -452,7 +548,7 @@ subroutine derived_phys(phys_state, phys_tend, pbuf2d)
call geopotential_t( &
phys_state(lchnk)%lnpint, phys_state(lchnk)%lnpmid, phys_state(lchnk)%pint, &
phys_state(lchnk)%pmid, phys_state(lchnk)%pdel, phys_state(lchnk)%rpdel, &
- phys_state(lchnk)%t, phys_state(lchnk)%q(:,:,1), rairv(:,:,lchnk), gravit, zvirv, &
+ phys_state(lchnk)%t, phys_state(lchnk)%q(:,:,:), rairv(:,:,lchnk), gravit, zvirv, &
phys_state(lchnk)%zi, phys_state(lchnk)%zm, ncol)
! Compute initial dry static energy, include surface geopotential
@@ -484,7 +580,7 @@ subroutine derived_tend(nCellsSolve, nCells, t_tend, u_tend, v_tend, q_tend, dyn
use cam_mpas_subdriver, only : cam_mpas_cell_to_edge_winds, cam_mpas_update_halo
use mpas_constants, only : Rv_over_Rd => rvord
use time_manager, only : get_step_size
-
+ use air_composition, only: get_R
! Arguments
integer, intent(in) :: nCellsSolve
integer, intent(in) :: nCells
@@ -508,13 +604,11 @@ subroutine derived_tend(nCellsSolve, nCells, t_tend, u_tend, v_tend, q_tend, dyn
real(r8), pointer :: north(:,:)
integer, pointer :: cellsOnEdge(:,:)
- real(r8), pointer :: theta(:,:)
- real(r8), pointer :: exner(:,:)
real(r8), pointer :: rho_zz(:,:)
real(r8), pointer :: tracers(:,:,:)
integer :: index_qv,m,idx_dycore
- real(r8) :: rhok,thetavk,thetak,pk,exnerk,tempk,tempk_new,exnerk_new,thetak_new,thetak_m_new,rhodk,tknew,thetaknew
+ real(r8) :: thetak,exnerk,rhodk,tknew,thetaknew
!
! variables for energy diagnostics
!
@@ -525,10 +619,13 @@ subroutine derived_tend(nCellsSolve, nCells, t_tend, u_tend, v_tend, q_tend, dyn
real(r8), pointer :: uy(:,:)
real(r8) :: theta_m_new(pver,nCellsSolve) !modified potential temperature after various physics updates
real(r8) :: rtheta_param(pver,nCellsSolve)!tendency from temperature change only (for diagnostics)
- real(r8) :: qk (thermodynamic_active_species_num,pver,nCellsSolve) !water species before physics (diagnostics)
+ real(r8) :: Rold(nCellsSolve,pver)
+ real(r8) :: Rnew(nCellsSolve,pver)
+ real(r8) :: qk (thermodynamic_active_species_num,pver,nCellsSolve) !water species before physics (diagnostics)
+ real(r8) :: qktmp (nCellsSolve,pver,thermodynamic_active_species_num)
+ integer :: idx_thermo (thermodynamic_active_species_num)
real(r8) :: qwv(pver,nCellsSolve) !water vapor before physics
real(r8) :: facnew, facold
- real(r8), allocatable :: tracers_old(:,:,:)
integer :: iCell,k
@@ -545,8 +642,6 @@ subroutine derived_tend(nCellsSolve, nCells, t_tend, u_tend, v_tend, q_tend, dyn
normal => dyn_in % normal
cellsOnEdge => dyn_in % cellsOnEdge
- theta => dyn_in % theta
- exner => dyn_in % exner
rho_zz => dyn_in % rho_zz
tracers => dyn_in % tracers
index_qv = dyn_in % index_qv
@@ -585,38 +680,76 @@ subroutine derived_tend(nCellsSolve, nCells, t_tend, u_tend, v_tend, q_tend, dyn
zint => dyn_in % zint
ux => dyn_in % ux
uy => dyn_in % uy
+
+ if (compute_energy_diags) then
+ !
+ ! Rnew and Rold are only needed for diagnostics purposes
+ !
+ do m=dry_air_species_num+1,thermodynamic_active_species_num
+ idx_thermo(m) = m
+ idx_dycore = thermodynamic_active_species_idx_dycore(m)
+ do iCell = 1, nCellsSolve
+ do k = 1, pver
+ qktmp(iCell,k,m) = tracers(idx_dycore,k,iCell)
+ end do
+ end do
+ end do
+ call get_R(qktmp,idx_thermo,Rnew)
+ Rnew = Rnew*cv/Rgas
+
+ do m=dry_air_species_num+1,thermodynamic_active_species_num
+ idx_dycore = thermodynamic_active_species_idx_dycore(m)
+ do iCell = 1, nCellsSolve
+ do k = 1, pver
+ qktmp(iCell,k,m) = tracers(idx_dycore,k,iCell)-dtime*q_tend(m,k,iCell)
+ end do
+ end do
+ end do
+ call get_R(qktmp,idx_thermo,Rold)
+ Rold=Rold*cv/Rgas
+ else
+ Rnew = 0.0_r8
+ Rold = 1.0_r8
+ end if
!
! Compute q not updated by physics
!
qwv = tracers(index_qv,:,1:nCellsSolve)-dtime*q_tend(index_qv_phys,:,1:nCellsSolve)
-
+ !
+ ! for energy diagnostics compute state with physics tendency (no water change) first
+ ! and then add water changes (parameterizations + dme_adjust)
+ !
do iCell = 1, nCellsSolve
do k = 1, pver
rhodk = zz(k,iCell) * rho_zz(k,iCell)
facold = 1.0_r8 + Rv_over_Rd *qwv(k,iCell)
thetak = theta_m(k,iCell)/facold
-
exnerk = (rgas*rhodk*theta_m(k,iCell)/p0)**(rgas/cv)
- tknew = exnerk*thetak+(cp/cv)*dtime*t_tend(k,icell)
-
-
- thetaknew = (tknew**(cv/cp))*((rgas*rhodk*facold)/p0)**(-rgas/cp)
+ !
+ ! for compute_energy_diags only
+ !
+ tknew = exnerk*thetak+(cp/Rold(iCell,k))*(Rnew(iCell,k)/cp)*dtime*t_tend(k,icell)!for diags only
+ thetaknew = (tknew**(cv/cp))*((rgas*rhodk*facold)/p0)**(-rgas/cp) !for diags only
!
! calculate theta_m tendency due to parameterizations (but no water adjustment)
+ ! (for diagnostics only)
!
- rtheta_param(k,iCell) = (thetaknew-thetak)/dtime
- rtheta_param(k,iCell) = rtheta_param(k,iCell)*(1.0_r8 + Rv_over_Rd *qwv(k,iCell)) !convert to thetam
- rtheta_param(k,iCell) = rtheta_param(k,iCell)*rho_zz(k,iCell)
+ rtheta_param(k,iCell) = (thetaknew-thetak)/dtime !for diags only
+ rtheta_param(k,iCell) = rtheta_param(k,iCell)*(1.0_r8 + Rv_over_Rd *qwv(k,iCell)) !for diags only
+ !convert to thetam
+ rtheta_param(k,iCell) = rtheta_param(k,iCell)*rho_zz(k,iCell) !for diags only
!
! include water change in theta_m
!
facnew = 1.0_r8 + Rv_over_Rd *tracers(index_qv,k,iCell)
+ tknew = exnerk*thetak+dtime*t_tend(k,icell)
thetaknew = (tknew**(cv/cp))*((rgas*rhodk*facnew)/p0)**(-rgas/cp)
rtheta_tend(k,iCell) = (thetaknew*facnew-thetak*facold)/dtime
rtheta_tend(k,iCell) = rtheta_tend(k,iCell) * rho_zz(k,iCell)
end do
end do
+
if (compute_energy_diags) then
!
! compute energy based on parameterization increment (excl. water change)
@@ -625,19 +758,19 @@ subroutine derived_tend(nCellsSolve, nCells, t_tend, u_tend, v_tend, q_tend, dyn
!
! temporarily save thermodynamic active species (n+1)
!
- do m=1,thermodynamic_active_species_num
+ do m=dry_air_species_num+1,thermodynamic_active_species_num
idx_dycore = thermodynamic_active_species_idx_dycore(m)
qk(m,:,: ) = tracers(idx_dycore,:,1:nCellsSolve)
tracers(idx_dycore,:,1:nCellsSolve)= qk(m,:,: )-dtime*q_tend(m,:,1:nCellsSolve)
end do
- call tot_energy( &
+ call tot_energy_dyn( &
nCellsSolve, plev, size(tracers, 1), index_qv, zz(:,1:nCellsSolve), zint(:,1:nCellsSolve), rho_zz(:,1:nCellsSolve), &
theta_m_new, tracers(:,:,1:nCellsSolve), &
ux(:,1:nCellsSolve)+dtime*u_tend(:,1:nCellsSolve)/rho_zz(:,1:nCellsSolve), &
uy(:,1:nCellsSolve)+dtime*v_tend(:,1:nCellsSolve)/rho_zz(:,1:nCellsSolve),'dAP')
! revert
- do m=1,thermodynamic_active_species_num
+ do m=dry_air_species_num+1,thermodynamic_active_species_num
idx_dycore = thermodynamic_active_species_idx_dycore(m)
tracers(idx_dycore,:,1:nCellsSolve)= qk(m,:,: )
end do
@@ -645,12 +778,17 @@ subroutine derived_tend(nCellsSolve, nCells, t_tend, u_tend, v_tend, q_tend, dyn
! compute energy incl. water change
!
theta_m_new = theta_m(:,1:nCellsSolve)+dtime*rtheta_tend(:,1:nCellsSolve)/rho_zz(:,1:nCellsSolve)
- call tot_energy( &
+ call tot_energy_dyn( &
nCellsSolve, plev, size(tracers, 1), index_qv, zz(:,1:nCellsSolve), zint(:,1:nCellsSolve), &
rho_zz(:,1:nCellsSolve), theta_m_new, tracers(:,:,1:nCellsSolve), &
ux(:,1:nCellsSolve)+dtime*u_tend(:,1:nCellsSolve)/rho_zz(:,1:nCellsSolve), &
uy(:,1:nCellsSolve)+dtime*v_tend(:,1:nCellsSolve)/rho_zz(:,1:nCellsSolve),'dAM')
end if
+ !
+ ! compute energy based on parameterization increment (excl. water change)
+ !
+ theta_m_new = theta_m(:,1:nCellsSolve)+dtime*rtheta_param(:,1:nCellsSolve)/rho_zz(:,1:nCellsSolve)
+
!
! Update halo for rtheta_m tendency
!
@@ -665,8 +803,8 @@ subroutine derived_tend(nCellsSolve, nCells, t_tend, u_tend, v_tend, q_tend, dyn
end subroutine derived_tend
!=========================================================================================
-subroutine hydrostatic_pressure(nCells, nVertLevels, zz, zgrid, rho_zz, theta_m, q, pmiddry, pintdry,pmid)
-
+subroutine hydrostatic_pressure(nCells, nVertLevels, qsize, index_qv, zz, zgrid, rho_zz, theta_m, &
+ exner, q, pmiddry, pintdry,pmid)
! Compute dry hydrostatic pressure at layer interfaces and midpoints
!
! Given arrays of zz, zgrid, rho_zz, and theta_m from the MPAS-A prognostic
@@ -674,77 +812,95 @@ subroutine hydrostatic_pressure(nCells, nVertLevels, zz, zgrid, rho_zz, theta_m,
! The vertical dimension for 3-d arrays is innermost, and k=1 represents
! the lowest layer or level in the fields.
!
- use mpas_constants, only : cp, rgas, cv, gravity, p0, Rv_over_Rd => rvord
- use physconst, only: rair, cpair
+ use mpas_constants, only: cp, rgas, cv, gravity, p0, Rv_over_Rd => rvord
! Arguments
integer, intent(in) :: nCells
integer, intent(in) :: nVertLevels
- real(r8), dimension(nVertLevels, nCells), intent(in) :: zz ! d(zeta)/dz [-]
- real(r8), dimension(nVertLevels+1, nCells), intent(in) :: zgrid ! geometric heights of layer interfaces [m]
- real(r8), dimension(nVertLevels, nCells), intent(in) :: rho_zz ! dry density / zz [kg m^-3]
- real(r8), dimension(nVertLevels, nCells), intent(in) :: theta_m ! modified potential temperature
- real(r8), dimension(nVertLevels, nCells), intent(in) :: q ! water vapor dry mixing ratio
- real(r8), dimension(nVertLevels, nCells), intent(out):: pmiddry ! layer midpoint dry hydrostatic pressure [Pa]
- real(r8), dimension(nVertLevels+1, nCells), intent(out):: pintdry ! layer interface dry hydrostatic pressure [Pa]
- real(r8), dimension(nVertLevels, nCells), intent(out):: pmid ! layer midpoint hydrostatic pressure [Pa]
+ integer, intent(in) :: qsize
+ integer, intent(in) :: index_qv
+ real(r8), dimension(nVertLevels, nCells), intent(in) :: zz ! d(zeta)/dz [-]
+ real(r8), dimension(nVertLevels+1, nCells), intent(in) :: zgrid ! geometric heights of layer interfaces [m]
+ real(r8), dimension(nVertLevels, nCells), intent(in) :: rho_zz ! dry density / zz [kg m^-3]
+ real(r8), dimension(nVertLevels, nCells), intent(in) :: theta_m ! modified potential temperature
+ real(r8), dimension(nVertLevels, nCells), intent(in) :: exner ! Exner function
+ real(r8), dimension(qsize,nVertLevels, nCells), intent(in) :: q ! water vapor dry mixing ratio
+ real(r8), dimension(nVertLevels, nCells), intent(out):: pmiddry ! layer midpoint dry hydrostatic pressure [Pa]
+ real(r8), dimension(nVertLevels+1, nCells), intent(out):: pintdry ! layer interface dry hydrostatic pressure [Pa]
+ real(r8), dimension(nVertLevels, nCells), intent(out):: pmid ! layer midpoint hydrostatic pressure [Pa]
! Local variables
- integer :: iCell, k
- real(r8), dimension(nVertLevels) :: dz ! Geometric layer thickness in column
- real(r8), dimension(nVertLevels+1) :: pint ! hydrostatic pressure at interface
- real(r8) :: pi, t
- real(r8) :: pk,rhok,rhodryk,theta,thetavk,kap1,kap2
-
+ integer :: iCell, k, idx
+ real(r8), dimension(nVertLevels) :: dz ! Geometric layer thickness in column
+ real(r8), dimension(nVertLevels) :: dp,dpdry ! Pressure thickness
+ real(r8), dimension(nVertLevels+1,nCells) :: pint ! hydrostatic pressure at interface
+ real(r8) :: sum_water
+ real(r8) :: pk,rhok,rhodryk,thetavk,kap1,kap2,tvk,tk
!
! For each column, integrate downward from model top to compute dry hydrostatic pressure at layer
! midpoints and interfaces. The pressure averaged to layer midpoints should be consistent with
! the ideal gas law using the rho_zz and theta values prognosed by MPAS at layer midpoints.
!
- kap1 = p0**(-rgas/cp) ! pre-compute constants
- kap2 = cp/cv ! pre-compute constants
do iCell = 1, nCells
-
dz(:) = zgrid(2:nVertLevels+1,iCell) - zgrid(1:nVertLevels,iCell)
+ do k = nVertLevels, 1, -1
+ rhodryk = zz(k,iCell)* rho_zz(k,iCell) !full CAM physics density
+ rhok = 1.0_r8
+ do idx=dry_air_species_num+1,thermodynamic_active_species_num
+ rhok = rhok+q(thermodynamic_active_species_idx_dycore(idx),k,iCell)
+ end do
+ rhok = rhok*rhodryk
+ dp(k) = gravit*dz(k)*rhok
+ dpdry(k) = gravit*dz(k)*rhodryk
+ end do
k = nVertLevels
- rhok = (1.0_r8+q(k,iCell))*zz(k,iCell) * rho_zz(k,iCell) !full CAM physics density
- thetavk = theta_m(k,iCell)/ (1.0_r8 + q(k,iCell)) !convert modified theta to virtual theta
- pk = (rhok*rgas*thetavk*kap1)**kap2 !mid-level top pressure
+ sum_water = 1.0_r8
+ do idx=dry_air_species_num+1,thermodynamic_active_species_num
+ sum_water = sum_water+q(thermodynamic_active_species_idx_dycore(idx),k,iCell)
+ end do
+ rhok = sum_water*zz(k,iCell) * rho_zz(k,iCell)
+ thetavk = theta_m(k,iCell)/sum_water
+ tvk = thetavk*exner(k,iCell)
+ pk = dp(k)*rgas*tvk/(gravit*dz(k))
!
! model top pressure consistently diagnosed using the assumption that the mid level
! is at height z(nVertLevels-1)+0.5*dz
!
pintdry(nVertLevels+1,iCell) = pk-0.5_r8*dz(nVertLevels)*rhok*gravity !hydrostatic
- pint (nVertLevels+1) = pintdry(nVertLevels+1,iCell)
+ pint (nVertLevels+1,iCell) = pintdry(nVertLevels+1,iCell)
do k = nVertLevels, 1, -1
!
! compute hydrostatic dry interface pressure so that (pintdry(k+1)-pintdry(k))/g is pseudo density
!
- rhodryk = zz(k,iCell) * rho_zz(k,iCell)
- rhok = (1.0_r8+q(k,iCell))*rhodryk
- pintdry(k,iCell) = pintdry(k+1,iCell) + gravity * rhodryk * dz(k)
- pint (k) = pint (k+1) + gravity * rhok * dz(k)
- end do
-
- do k = nVertLevels, 1, -1
- !hydrostatic mid-level pressure - MPAS full pressure is (rhok*rgas*thetavk*kap1)**kap2
- pmid (k,iCell) = 0.5_r8*(pint(k+1)+pint(k))
- !hydrostatic dry mid-level dry pressure -
- !MPAS non-hydrostatic dry pressure is pmiddry(k,iCell) = (rhodryk*rgas*theta*kap1)**kap2
- pmiddry(k,iCell) = 0.5_r8*(pintdry(k+1,iCell)+pintdry(k,iCell))
+ sum_water = 1.0_r8
+ do idx=dry_air_species_num+1,thermodynamic_active_species_num
+ sum_water = sum_water+q(thermodynamic_active_species_idx_dycore(idx),k,iCell)
+ end do
+ thetavk = theta_m(k,iCell)/sum_water!convert modified theta to virtual theta
+ tvk = thetavk*exner(k,iCell)
+ tk = tvk*sum_water/(1.0_r8+Rv_over_Rd*q(index_qv,k,iCell))
+ pint (k,iCell) = pint (k+1,iCell)+dp(k)
+ pintdry(k,iCell) = pintdry(k+1,iCell)+dpdry(k)
+ pmid(k,iCell) = dp(k) *rgas*tvk/(gravit*dz(k))
+ pmiddry(k,iCell) = dpdry(k)*rgas*tk /(gravit*dz(k))
end do
end do
end subroutine hydrostatic_pressure
-
-subroutine tot_energy(nCells, nVertLevels, qsize, index_qv, zz, zgrid, rho_zz, theta_m, q, ux,uy,outfld_name_suffix)
- use physconst, only: rair, cpair, gravit,cappa!=R/cp (dry air)
+subroutine tot_energy_dyn(nCells, nVertLevels, qsize, index_qv, zz, zgrid, rho_zz, theta_m, q, ux,uy,outfld_name_suffix)
+ use physconst, only: rair, gravit
use mpas_constants, only: p0,cv,rv,rgas,cp
use cam_history, only: outfld, hist_fld_active
use mpas_constants, only: Rv_over_Rd => rvord
use air_composition, only: thermodynamic_active_species_ice_idx_dycore,thermodynamic_active_species_liq_idx_dycore
use air_composition, only: thermodynamic_active_species_ice_num,thermodynamic_active_species_liq_num
+ use air_composition, only: dry_air_species_num, thermodynamic_active_species_R
+ use cam_thermo, only: wvidx,wlidx,wiidx,seidx,poidx,keidx,teidx,thermo_budget_num_vars
+ use cam_thermo, only: get_hydrostatic_energy,thermo_budget_vars
+ use dyn_tests_utils, only: vcoord=>vc_height
+ use cam_history_support, only: max_fieldname_len
+
! Arguments
integer, intent(in) :: nCells
integer, intent(in) :: nVertLevels
@@ -760,83 +916,179 @@ subroutine tot_energy(nCells, nVertLevels, qsize, index_qv, zz, zgrid, rho_zz, t
character*(*), intent(in) :: outfld_name_suffix ! suffix for "outfld" names
! Local variables
- integer :: iCell, k, idx
- real(r8) :: rho_dz,zcell,temperature,theta,pk,ptop,exner
- real(r8), dimension(nVertLevels, nCells) :: rhod, dz
- real(r8), dimension(nCells) :: kinetic_energy,potential_energy,internal_energy,water_vapor,water_liq,water_ice
+ integer :: iCell, k, idx, idx_tmp
+ integer :: i
+ real(r8) :: rho_dz,theta,pk,ptop,exner,dz,rhod
+ real(r8), dimension(nCells,nVertLevels) :: temperature, pdeldry, cp_or_cv, zcell, u, v
+ real(r8), dimension(nCells) :: phis
+ real(r8), dimension(nCells,nVertLevels,qsize) :: tracers
+ real(r8), dimension(nCells) :: kinetic_energy,potential_energy,internal_energy,water_vapor
real(r8), dimension(nCells) :: liq !total column integrated liquid
real(r8), dimension(nCells) :: ice !total column integrated ice
+ real(r8) :: sum_species
- character(len=16) :: name_out1,name_out2,name_out3,name_out4,name_out5
-
- name_out1 = 'SE_' //trim(outfld_name_suffix)
- name_out2 = 'KE_' //trim(outfld_name_suffix)
- name_out3 = 'WV_' //trim(outfld_name_suffix)
- name_out4 = 'WL_' //trim(outfld_name_suffix)
- name_out5 = 'WI_' //trim(outfld_name_suffix)
-
- if ( hist_fld_active(name_out1).or.hist_fld_active(name_out2).or.hist_fld_active(name_out3).or.&
- hist_fld_active(name_out4).or.hist_fld_active(name_out5)) then
-
- kinetic_energy = 0.0_r8
- potential_energy = 0.0_r8
- internal_energy = 0.0_r8
- water_vapor = 0.0_r8
-
- do iCell = 1, nCells
- do k = 1, nVertLevels
- dz(k,iCell) = zgrid(k+1,iCell) - zgrid(k,iCell)
- zcell = 0.5_r8*(zgrid(k,iCell)+zgrid(k+1,iCell))
- rhod(k,iCell) = zz(k,iCell) * rho_zz(k,iCell)
- rho_dz = (1.0_r8+q(index_qv,k,iCell))*rhod(k,iCell)*dz(k,iCell)
- theta = theta_m(k,iCell)/(1.0_r8 + Rv_over_Rd *q(index_qv,k,iCell))!convert theta_m to theta
-
- exner = (rgas*rhod(k,iCell)*theta_m(k,iCell)/p0)**(rgas/cv)
- temperature = exner*theta
-
- water_vapor(iCell) = water_vapor(iCell) + rhod(k,iCell)*q(index_qv,k,iCell)*dz(k,iCell)
- kinetic_energy(iCell) = kinetic_energy(iCell) + &
- 0.5_r8*(ux(k,iCell)**2._r8+uy(k,iCell)**2._r8)*rho_dz
- potential_energy(iCell) = potential_energy(iCell)+ rho_dz*gravit*zcell
- internal_energy(iCell) = internal_energy(iCell) + rho_dz*cv*temperature
- end do
- internal_energy(iCell) = internal_energy(iCell) + potential_energy(iCell) !static energy
- end do
- call outfld(name_out1,internal_energy,ncells,1)
- call outfld(name_out2,kinetic_energy ,ncells,1)
- call outfld(name_out3,water_vapor ,ncells,1)
- !
- ! vertical integral of total liquid water
- !
- if (hist_fld_active(name_out4)) then
- liq = 0._r8
- do idx = 1,thermodynamic_active_species_liq_num
- do iCell = 1, nCells
- do k = 1, nVertLevels
- liq(iCell) = liq(iCell) + &
- q(thermodynamic_active_species_liq_idx_dycore(idx),k,iCell)*rhod(k,iCell)*dz(k,iCell)
- end do
+ character(len=max_fieldname_len) :: name_out(thermo_budget_num_vars)
+
+
+ do i=1,thermo_budget_num_vars
+ name_out(i)=trim(thermo_budget_vars(i))//'_'//trim(outfld_name_suffix)
+ end do
+
+ kinetic_energy = 0.0_r8
+ potential_energy = 0.0_r8
+ internal_energy = 0.0_r8
+ water_vapor = 0.0_r8
+ tracers = 0.0_r8
+
+ do iCell = 1, nCells
+ do k = 1, nVertLevels
+ dz = zgrid(k+1,iCell) - zgrid(k,iCell)
+ zcell(iCell,k) = 0.5_r8*(zgrid(k,iCell)+zgrid(k+1,iCell))-zgrid(1,iCell)
+ rhod = zz(k,iCell) * rho_zz(k,iCell)
+ theta = theta_m(k,iCell)/(1.0_r8 + Rv_over_Rd *q(index_qv,k,iCell))!convert theta_m to theta
+ exner = (rgas*rhod*theta_m(k,iCell)/p0)**(rgas/cv)
+
+ temperature(iCell,k) = exner*theta
+ pdeldry(iCell,k) = gravit*rhod*dz
+ !
+ ! internal energy coefficient for MPAS
+ ! (equation 92 in Eldred et al. 2023; https://rmets.onlinelibrary.wiley.com/doi/epdf/10.1002/qj.4353)
+ !
+ cp_or_cv(iCell,k) = rair
+ sum_species = 1.0_r8
+ do idx=dry_air_species_num + 1,thermodynamic_active_species_num
+ idx_tmp = thermodynamic_active_species_idx_dycore(idx)
+ cp_or_cv(iCell,k) = cp_or_cv(iCell,k)+thermodynamic_active_species_R(idx)*q(idx_tmp,k,iCell)
+ sum_species = sum_species+q(idx_tmp,k,iCell)
end do
- end do
- call outfld(name_out4,liq,ncells,1)
- end if
- !
- ! vertical integral of total frozen (ice) water
- !
- if (hist_fld_active(name_out5)) then
- ice = 0._r8
- do idx = 1,thermodynamic_active_species_ice_num
- do iCell = 1, nCells
- do k = 1, nVertLevels
- ice(iCell) = ice(iCell) + &
- q(thermodynamic_active_species_ice_idx_dycore(idx),k,iCell)*rhod(k,iCell)*dz(k,iCell)
- end do
+ cp_or_cv(iCell,k) = cv*cp_or_cv(iCell,k)/(sum_species*rair)
+ u(iCell,k) = ux(k,iCell)
+ v(iCell,k) = uy(k,iCell)
+ phis(iCell) = zgrid(1,iCell)*gravit
+ do idx=dry_air_species_num+1,thermodynamic_active_species_num
+ idx_tmp = thermodynamic_active_species_idx_dycore(idx)
+ tracers(iCell,k,idx_tmp) = q(idx_tmp,k,iCell)
end do
+ end do
+ enddo
+ call get_hydrostatic_energy(tracers, .false., pdeldry, cp_or_cv, u, v, temperature, &
+ vcoord=vcoord, phis = phis, z_mid=zcell, dycore_idx=.true., &
+ se=internal_energy, po=potential_energy, ke=kinetic_energy, &
+ wv=water_vapor , liq=liq , ice=ice)
+
+ call outfld(name_out(seidx),internal_energy ,ncells,1)
+ call outfld(name_out(poidx),potential_energy,ncells,1)
+ call outfld(name_out(keidx),kinetic_energy ,ncells,1)
+ call outfld(name_out(wvidx),water_vapor ,ncells,1)
+ call outfld(name_out(wlidx),liq ,ncells,1)
+ call outfld(name_out(wiidx),ice ,ncells,1)
+ call outfld(name_out(teidx),potential_energy+internal_energy+kinetic_energy,ncells,1)
+
+end subroutine tot_energy_dyn
+
+ subroutine calc_frontogenesis( frontogenesisFunction, frontogenesisAngle, &
+ theta_m, qv, u,v, defc_a, defc_b, cell_gradient_coef_x, cell_gradient_coef_y, &
+ areaCell, dvEdge, cellsOnEdge, edgesOnCell, nEdgesOnCell, edgesOnCell_sign, &
+ nVertLevels, nCellsSolve )
+
+ use mpas_constants, only: rvord
+
+ ! inputs
+
+ integer, intent(in) :: nVertLevels, nCellsSolve
+ real(r8), dimension(:,:), intent(in) :: theta_m, qv
+ real(r8), dimension(:,:), intent(in) :: u, v
+ real(r8), dimension(:,:), intent(in) :: defc_a
+ real(r8), dimension(:,:), intent(in) :: defc_b
+ real(r8), dimension(:,:), intent(in) :: cell_gradient_coef_x
+ real(r8), dimension(:,:), intent(in) :: cell_gradient_coef_y
+ real(r8), dimension(:,:), intent(in) :: edgesOnCell_sign
+ real(r8), dimension(:), intent(in) :: dvEdge
+ real(r8), dimension(:), intent(in) :: areaCell
+ integer, dimension(:,:), intent(in) :: cellsOnEdge
+ integer, dimension(:,:), intent(in) :: edgesOnCell
+ integer, dimension(:), intent(in) :: nEdgesOnCell
+
+ ! outputs
+
+ real(r8), dimension(:,:), intent(out) :: frontogenesisFunction(:,:)
+ real(r8), dimension(:,:), intent(out) :: frontogenesisAngle(:,:)
+
+ ! local storage
+
+ integer :: iCell, iEdge, k, cell1, cell2
+ real(r8), dimension(nVertLevels) :: d_diag, d_off_diag, divh, theta_x, theta_y
+ real(r8) :: edge_sign, thetaEdge
+
+ !
+ ! for each column, compute frontogenesis function and del(theta) angle
+ !
+
+ do iCell = 1,nCellsSolve
+
+ d_diag(1:nVertLevels) = 0.0_r8
+ d_off_diag(1:nVertLevels) = 0.0_r8
+ divh(1:nVertLevels) = 0.0_r8
+ theta_x(1:nVertLevels) = 0.0_r8
+ theta_y(1:nVertLevels) = 0.0_r8
+
+ !
+ ! Integrate over edges to compute cell-averaged divergence, deformation,
+ ! d(theta)/dx, and d(theta)/dy. (x,y) are aligned with (lon,lat) at the
+ ! cell center in the 2D tangent-plane approximation used here. This alignment
+ ! is set in the initialization routine for the coefficients
+ ! defc_a, defc_b, cell_gradient_coef_x and cell_gradient_coef_y that is
+ ! part of the MPAS mesh initialization. The horizontal divergence is calculated
+ ! as it is in the MPAS solver, i.e. on the sphere as opposed to on the tangent plane.
+ !
+ do iEdge=1,nEdgesOnCell(iCell)
+
+ edge_sign = edgesOnCell_sign(iEdge,iCell) * dvEdge(edgesOnCell(iEdge,iCell)) / areaCell(iCell)
+ cell1 = cellsOnEdge(1,edgesOnCell(iEdge,iCell))
+ cell2 = cellsOnEdge(2,edgesOnCell(iEdge,iCell))
+
+ do k=1,nVertLevels
+
+ d_diag(k) = d_diag(k) + defc_a(iEdge,iCell)*u(k,EdgesOnCell(iEdge,iCell)) &
+ - defc_b(iEdge,iCell)*v(k,EdgesOnCell(iEdge,iCell))
+ d_off_diag(k) = d_off_diag(k) + defc_b(iEdge,iCell)*u(k,EdgesOnCell(iEdge,iCell)) &
+ + defc_a(iEdge,iCell)*v(k,EdgesOnCell(iEdge,iCell))
+ divh(k) = divh(k) + edge_sign * u(k,EdgesOnCell(iEdge,iCell))
+ thetaEdge = 0.5_r8*( theta_m(k,cell1)/(1.0_r8 + rvord*qv(k,cell1)) &
+ +theta_m(k,cell2)/(1.0_r8 + rvord*qv(k,cell2)) )
+ theta_x(k) = theta_x(k) + cell_gradient_coef_x(iEdge,iCell)*thetaEdge
+ theta_y(k) = theta_y(k) + cell_gradient_coef_y(iEdge,iCell)*thetaEdge
+
+ end do
+
end do
- call outfld(name_out5,ice,ncells,1)
- end if
- end if
- end subroutine tot_energy
+
+ !
+ ! compute the frontogenesis function:
+ ! 1/2 |del(theta)/dt)| = 1/2 (
+ ! - Div * |del(theta)|^2
+ ! - E (d(theta)/dx)^2
+ ! - 2F (d(theta)/dx)*(d(theta)/dy)
+ ! + E (d(theta)/dy) )
+ ! where
+ ! Div = u_x + v_y (horizontal velocity divergence)
+ ! E = u_x - v_y (stretching deformation)
+ ! F = v_x + u_y (shearing deformation)
+ !
+ do k=1, nVertLevels
+
+ frontogenesisFunction(k,iCell) = 0.5_r8*( &
+ -divh(k)*(theta_x(k)**2 + theta_y(k)**2) &
+ -d_diag(k)*theta_x(k)**2 &
+ -2.0_r8*d_off_diag(k)*theta_x(k)*theta_y(k) &
+ +d_diag(k)*theta_y(k)**2 )
+ frontogenesisAngle(k,iCell) = atan2(theta_y(k),theta_x(k))
+
+ end do
+
+ end do
+
+ end subroutine calc_frontogenesis
end module dp_coupling
diff --git a/src/dynamics/mpas/driver/cam_mpas_subdriver.F90 b/src/dynamics/mpas/driver/cam_mpas_subdriver.F90
index 65a098f90e..676bacd4af 100644
--- a/src/dynamics/mpas/driver/cam_mpas_subdriver.F90
+++ b/src/dynamics/mpas/driver/cam_mpas_subdriver.F90
@@ -11,7 +11,8 @@ module cam_mpas_subdriver
!-------------------------------------------------------------------------------
use cam_abortutils, only: endrun
- use mpas_derived_types, only : core_type, dm_info, domain_type, MPAS_Clock_type
+ use mpas_derived_types, only : core_type, domain_type, MPAS_Clock_type
+ use phys_control, only: use_gw_front, use_gw_front_igw
implicit none
@@ -75,7 +76,6 @@ subroutine cam_mpas_init_phase1(mpicom, endrun, logUnits, realkind)
use mpas_domain_routines, only : mpas_allocate_domain
use mpas_framework, only : mpas_framework_init_phase1
use atm_core_interface, only : atm_setup_core, atm_setup_domain
- use mpas_pool_routines, only : mpas_pool_add_config
use mpas_kind_types, only : RKIND
! Dummy argument
@@ -147,7 +147,6 @@ end subroutine cam_mpas_init_phase1
!-----------------------------------------------------------------------
subroutine cam_mpas_init_phase2(pio_subsystem, endrun, cam_calendar)
- use mpas_log, only : mpas_log_write
use mpas_kind_types, only : ShortStrKIND
use pio_types, only : iosystem_desc_t
@@ -159,7 +158,6 @@ subroutine cam_mpas_init_phase2(pio_subsystem, endrun, cam_calendar)
character(len=*), intent(in) :: cam_calendar
integer :: ierr
- logical :: streamsExists
character(len=ShortStrKIND) :: mpas_calendar
@@ -221,52 +219,19 @@ end subroutine cam_mpas_init_phase2
!> the number of constituents.
!
!-----------------------------------------------------------------------
- subroutine cam_mpas_init_phase3(fh_ini, num_scalars, endrun)
+ subroutine cam_mpas_init_phase3(fh_ini, num_scalars)
- use mpas_log, only : mpas_log_write
use pio, only : file_desc_t
- use iso_c_binding, only : c_int, c_char, c_ptr, c_loc
-
- use mpas_derived_types, only : MPAS_Time_type, MPAS_TimeInterval_type
- use mpas_derived_types, only : MPAS_IO_PNETCDF, MPAS_IO_PNETCDF5, MPAS_IO_NETCDF, MPAS_IO_NETCDF4
- use mpas_derived_types, only : MPAS_START_TIME
- use mpas_derived_types, only : MPAS_STREAM_MGR_NOERR
- use mpas_timekeeping, only : mpas_get_clock_time, mpas_get_time, mpas_expand_string, mpas_set_time, &
- mpas_set_timeInterval
- use mpas_stream_manager, only : MPAS_stream_mgr_init, mpas_build_stream_filename, MPAS_stream_mgr_validate_streams
- use mpas_kind_types, only : StrKIND
- use mpas_c_interfacing, only : mpas_c_to_f_string, mpas_f_to_c_string
+ use mpas_derived_types, only : MPAS_IO_NETCDF
+ use mpas_kind_types, only : StrKIND
use mpas_bootstrapping, only : mpas_bootstrap_framework_phase1, mpas_bootstrap_framework_phase2
use mpas_pool_routines, only : mpas_pool_add_config
type (file_desc_t), intent(inout) :: fh_ini
integer, intent(in) :: num_scalars
- procedure(halt_model) :: endrun
- integer :: ierr
- character(kind=c_char), dimension(StrKIND+1) :: c_filename ! StrKIND+1 for C null-termination character
- integer(kind=c_int) :: c_comm
- integer(kind=c_int) :: c_ierr
- type (c_ptr) :: mgr_p
- character(len=StrKIND) :: mesh_stream
character(len=StrKIND) :: mesh_filename
- character(len=StrKIND) :: mesh_filename_temp
- character(len=StrKIND) :: ref_time_temp
- character(len=StrKIND) :: filename_interval_temp
- character(kind=c_char), dimension(StrKIND+1) :: c_mesh_stream
- character(kind=c_char), dimension(StrKIND+1) :: c_mesh_filename_temp
- character(kind=c_char), dimension(StrKIND+1) :: c_ref_time_temp
- character(kind=c_char), dimension(StrKIND+1) :: c_filename_interval_temp
- character(kind=c_char), dimension(StrKIND+1) :: c_iotype
- type (MPAS_Time_type) :: start_time
- type (MPAS_Time_type) :: ref_time
- type (MPAS_TimeInterval_type) :: filename_interval
- character(len=StrKIND) :: start_timestamp
- character(len=StrKIND) :: iotype
- logical :: streamsExists
integer :: mesh_iotype
- integer :: blockID
- character(len=StrKIND) :: timeStamp
character(len=*), parameter :: subname = 'cam_mpas_subdriver::cam_mpas_init_phase3'
@@ -313,15 +278,13 @@ subroutine cam_mpas_init_phase4(endrun)
use mpas_pool_routines, only : mpas_pool_get_subpool, mpas_pool_get_dimension, mpas_pool_get_config, &
mpas_pool_get_field, mpas_pool_get_array, mpas_pool_initialize_time_levels
use atm_core, only : atm_mpas_init_block, core_clock => clock
- use mpas_dmpar, only : mpas_dmpar_exch_halo_field
+ use mpas_atm_halos, only : atm_build_halo_groups, exchange_halo_group
use atm_time_integration, only : mpas_atm_dynamics_init
procedure(halt_model) :: endrun
real (kind=RKIND), pointer :: dt
- character(len=StrKIND) :: timeStamp
- integer :: i
logical, pointer :: config_do_restart
type (mpas_pool_type), pointer :: state
@@ -364,6 +327,14 @@ subroutine cam_mpas_init_phase4(endrun)
clock => domain_ptr % clock
core_clock => domain_ptr % clock
+ !
+ ! Build halo exchange groups and set method for exchanging halos in a group
+ !
+ call atm_build_halo_groups(domain_ptr, ierr)
+ if (ierr /= 0) then
+ call endrun(subname//':failed to build MPAS-A halo exchange groups.')
+ end if
+
call mpas_pool_get_config(domain_ptr % blocklist % configs, 'config_do_restart', config_do_restart)
call mpas_pool_get_config(domain_ptr % blocklist % configs, 'config_dt', dt)
@@ -382,12 +353,10 @@ subroutine cam_mpas_init_phase4(endrun)
if ( ierr /= 0 ) then
call endrun(subname//': failed to get MPAS_START_TIME')
end if
- call mpas_get_time(startTime, dateTimeString=startTimeStamp)
+ call mpas_get_time(startTime, dateTimeString=startTimeStamp)
- call mpas_pool_get_subpool(domain_ptr % blocklist % structs, 'state', state)
- call mpas_pool_get_field(state, 'u', u_field, 1)
- call mpas_dmpar_exch_halo_field(u_field)
+ call exchange_halo_group(domain_ptr, 'initialization:u')
call mpas_pool_get_subpool(domain_ptr % blocklist % structs, 'mesh', mesh)
call mpas_pool_get_subpool(domain_ptr % blocklist % structs, 'state', state)
@@ -404,15 +373,7 @@ subroutine cam_mpas_init_phase4(endrun)
call mpas_pool_get_array(state, 'initial_time', initial_time2, 2)
initial_time2 = initial_time1
- call mpas_pool_get_subpool(domain_ptr % blocklist % structs, 'diag', diag)
- call mpas_pool_get_field(diag, 'pv_edge', pv_edge_field)
- call mpas_dmpar_exch_halo_field(pv_edge_field)
-
- call mpas_pool_get_field(diag, 'ru', ru_field)
- call mpas_dmpar_exch_halo_field(ru_field)
-
- call mpas_pool_get_field(diag, 'rw', rw_field)
- call mpas_dmpar_exch_halo_field(rw_field)
+ call exchange_halo_group(domain_ptr, 'initialization:pv_edge,ru,rw')
!
! Prepare the dynamics for integration
@@ -438,7 +399,7 @@ end subroutine cam_mpas_init_phase4
!> to reorder the constituents; to allow for mapping of indices between CAM
!> physics and the MPAS-A dycore, this routine returns index mapping arrays
!> mpas_from_cam_cnst and cam_from_mpas_cnst.
- !>
+ !>
!
!-----------------------------------------------------------------------
subroutine cam_mpas_define_scalars(block, mpas_from_cam_cnst, cam_from_mpas_cnst, ierr)
@@ -735,7 +696,7 @@ subroutine cam_mpas_get_global_coords(latCellGlobal, lonCellGlobal, areaCellGlob
use mpas_pool_routines, only : mpas_pool_get_subpool, mpas_pool_get_dimension, mpas_pool_get_array
use mpas_derived_types, only : mpas_pool_type
use mpas_kind_types, only : RKIND
- use mpas_dmpar, only : mpas_dmpar_sum_int, mpas_dmpar_max_int, mpas_dmpar_max_real_array
+ use mpas_dmpar, only : mpas_dmpar_sum_int, mpas_dmpar_max_real_array
real (kind=RKIND), dimension(:), intent(out) :: latCellGlobal
real (kind=RKIND), dimension(:), intent(out) :: lonCellGlobal
@@ -770,7 +731,7 @@ subroutine cam_mpas_get_global_coords(latCellGlobal, lonCellGlobal, areaCellGlob
allocate(temp(nCellsGlobal), stat=ierr)
if( ierr /= 0 ) call endrun(subname//':failed to allocate temp array')
-
+
!
! latCellGlobal
!
@@ -946,6 +907,7 @@ subroutine cam_mpas_read_static(fh_ini, endrun)
integer :: ierr_total
type (MPAS_pool_type), pointer :: meshPool
type (MPAS_pool_type), pointer :: reindexPool
+ type (MPAS_pool_type), pointer :: allPackages, reindexPkgs
type (field1DReal), pointer :: latCell, lonCell, xCell, yCell, zCell
type (field1DReal), pointer :: latEdge, lonEdge, xEdge, yEdge, zEdge
type (field1DReal), pointer :: latVertex, lonVertex, xVertex, yVertex, zVertex
@@ -963,9 +925,12 @@ subroutine cam_mpas_read_static(fh_ini, endrun)
type (field3DReal), pointer :: zb, zb3, deriv_two, cellTangentPlane, coeffs_reconstruct
type (field2DReal), pointer :: edgeNormalVectors, localVerticalUnitVectors, defc_a, defc_b
+ type (field2DReal), pointer :: cell_gradient_coef_x, cell_gradient_coef_y
type (MPAS_Stream_type) :: mesh_stream
+ nullify(cell_gradient_coef_x)
+ nullify(cell_gradient_coef_y)
call MPAS_createStream(mesh_stream, domain_ptr % ioContext, 'not_used', MPAS_IO_NETCDF, MPAS_IO_READ, &
pio_file_desc=fh_ini, ierr=ierr)
@@ -1044,9 +1009,15 @@ subroutine cam_mpas_read_static(fh_ini, endrun)
call mpas_pool_get_field(meshPool, 'edgeNormalVectors', edgeNormalVectors)
call mpas_pool_get_field(meshPool, 'localVerticalUnitVectors', localVerticalUnitVectors)
+
call mpas_pool_get_field(meshPool, 'defc_a', defc_a)
call mpas_pool_get_field(meshPool, 'defc_b', defc_b)
+ if (use_gw_front .or. use_gw_front_igw) then
+ call mpas_pool_get_field(meshPool, 'cell_gradient_coef_x', cell_gradient_coef_x)
+ call mpas_pool_get_field(meshPool, 'cell_gradient_coef_y', cell_gradient_coef_y)
+ endif
+
ierr_total = 0
call MPAS_streamAddField(mesh_stream, latCell, ierr=ierr)
@@ -1178,6 +1149,12 @@ subroutine cam_mpas_read_static(fh_ini, endrun)
if (ierr /= MPAS_STREAM_NOERR) ierr_total = ierr_total + 1
call MPAS_streamAddField(mesh_stream, defc_b, ierr=ierr)
if (ierr /= MPAS_STREAM_NOERR) ierr_total = ierr_total + 1
+ if (use_gw_front .or. use_gw_front_igw) then
+ call MPAS_streamAddField(mesh_stream, cell_gradient_coef_x, ierr=ierr)
+ if (ierr /= MPAS_STREAM_NOERR) ierr_total = ierr_total + 1
+ call MPAS_streamAddField(mesh_stream, cell_gradient_coef_y, ierr=ierr)
+ if (ierr /= MPAS_STREAM_NOERR) ierr_total = ierr_total + 1
+ endif
if (ierr_total > 0) then
write(errString, '(a,i0,a)') subname//': FATAL: Failed to add ', ierr_total, ' fields to static input stream.'
@@ -1259,7 +1236,10 @@ subroutine cam_mpas_read_static(fh_ini, endrun)
call MPAS_dmpar_exch_halo_field(localVerticalUnitVectors)
call MPAS_dmpar_exch_halo_field(defc_a)
call MPAS_dmpar_exch_halo_field(defc_b)
-
+ if (use_gw_front .or. use_gw_front_igw) then
+ call MPAS_dmpar_exch_halo_field(cell_gradient_coef_x)
+ call MPAS_dmpar_exch_halo_field(cell_gradient_coef_y)
+ endif
!
! Re-index from global index space to local index space
!
@@ -1274,9 +1254,15 @@ subroutine cam_mpas_read_static(fh_ini, endrun)
call MPAS_pool_add_config(reindexPool, 'edgesOnVertex', 1)
call MPAS_pool_add_config(reindexPool, 'cellsOnVertex', 1)
- call postread_reindex(meshPool, reindexPool)
+ ! Use an empty package list for reindexPool
+ call MPAS_pool_create_pool(reindexPkgs)
+
+ call postread_reindex(meshPool, domain_ptr % streamManager % allPackages, &
+ reindexPool, reindexPkgs)
+
call MPAS_pool_destroy_pool(reindexPool)
+ call MPAS_pool_destroy_pool(reindexPkgs)
end subroutine cam_mpas_read_static
@@ -1342,6 +1328,7 @@ subroutine cam_mpas_setup_restart(fh_rst, restart_stream, direction, endrun)
type (field3DReal), pointer :: zb, zb3, deriv_two, cellTangentPlane, coeffs_reconstruct
type (field2DReal), pointer :: edgeNormalVectors, localVerticalUnitVectors, defc_a, defc_b
+ type (field2DReal), pointer :: cell_gradient_coef_x, cell_gradient_coef_y
type (field0DChar), pointer :: initial_time
type (field0DChar), pointer :: xtime
@@ -1381,6 +1368,8 @@ subroutine cam_mpas_setup_restart(fh_rst, restart_stream, direction, endrun)
type (field1DReal), pointer :: u_init
type (field1DReal), pointer :: qv_init
+ nullify(cell_gradient_coef_x)
+ nullify(cell_gradient_coef_y)
call MPAS_createStream(restart_stream, domain_ptr % ioContext, 'not_used', MPAS_IO_NETCDF, &
direction, pio_file_desc=fh_rst, ierr=ierr)
@@ -1461,7 +1450,10 @@ subroutine cam_mpas_setup_restart(fh_rst, restart_stream, direction, endrun)
call mpas_pool_get_field(allFields, 'localVerticalUnitVectors', localVerticalUnitVectors)
call mpas_pool_get_field(allFields, 'defc_a', defc_a)
call mpas_pool_get_field(allFields, 'defc_b', defc_b)
-
+ if (use_gw_front .or. use_gw_front_igw) then
+ call mpas_pool_get_field(allFields, 'cell_gradient_coef_x', cell_gradient_coef_x)
+ call mpas_pool_get_field(allFields, 'cell_gradient_coef_y', cell_gradient_coef_y)
+ endif
call mpas_pool_get_field(allFields, 'initial_time', initial_time, timeLevel=1)
call mpas_pool_get_field(allFields, 'xtime', xtime, timeLevel=1)
call mpas_pool_get_field(allFields, 'u', u, timeLevel=1)
@@ -1631,7 +1623,12 @@ subroutine cam_mpas_setup_restart(fh_rst, restart_stream, direction, endrun)
if (ierr /= MPAS_STREAM_NOERR) ierr_total = ierr_total + 1
call MPAS_streamAddField(restart_stream, defc_b, ierr=ierr)
if (ierr /= MPAS_STREAM_NOERR) ierr_total = ierr_total + 1
-
+ if (use_gw_front .or. use_gw_front_igw) then
+ call MPAS_streamAddField(restart_stream, cell_gradient_coef_x, ierr=ierr)
+ if (ierr /= MPAS_STREAM_NOERR) ierr_total = ierr_total + 1
+ call MPAS_streamAddField(restart_stream, cell_gradient_coef_y, ierr=ierr)
+ if (ierr /= MPAS_STREAM_NOERR) ierr_total = ierr_total + 1
+ endif
call MPAS_streamAddField(restart_stream, initial_time, ierr=ierr)
if (ierr /= MPAS_STREAM_NOERR) ierr_total = ierr_total + 1
call MPAS_streamAddField(restart_stream, xtime, ierr=ierr)
@@ -1749,8 +1746,6 @@ end subroutine cam_mpas_setup_restart
!-----------------------------------------------------------------------
subroutine cam_mpas_read_restart(restart_stream, endrun)
- use pio, only : file_desc_t
-
use mpas_io_streams, only : MPAS_readStream, MPAS_closeStream
use mpas_derived_types, only : MPAS_Stream_type, MPAS_pool_type, MPAS_STREAM_NOERR
use mpas_pool_routines, only : MPAS_pool_create_pool, MPAS_pool_destroy_pool, MPAS_pool_add_config
@@ -1765,6 +1760,7 @@ subroutine cam_mpas_read_restart(restart_stream, endrun)
integer :: ierr
type (MPAS_pool_type), pointer :: reindexPool
+ type (MPAS_pool_type), pointer :: reindexPkgs
call MPAS_readStream(restart_stream, 1, ierr=ierr)
if (ierr /= MPAS_STREAM_NOERR) then
@@ -1841,7 +1837,10 @@ subroutine cam_mpas_read_restart(restart_stream, endrun)
call cam_mpas_update_halo('localVerticalUnitVectors', endrun)
call cam_mpas_update_halo('defc_a', endrun)
call cam_mpas_update_halo('defc_b', endrun)
-
+ if (use_gw_front .or. use_gw_front_igw) then
+ call cam_mpas_update_halo('cell_gradient_coef_x', endrun)
+ call cam_mpas_update_halo('cell_gradient_coef_y', endrun)
+ endif
call cam_mpas_update_halo('u', endrun)
call cam_mpas_update_halo('w', endrun)
call cam_mpas_update_halo('rho_zz', endrun)
@@ -1889,9 +1888,15 @@ subroutine cam_mpas_read_restart(restart_stream, endrun)
call MPAS_pool_add_config(reindexPool, 'edgesOnVertex', 1)
call MPAS_pool_add_config(reindexPool, 'cellsOnVertex', 1)
- call postread_reindex(domain_ptr % blocklist % allFields, reindexPool)
+ ! Use an empty package list for reindexPool
+ call MPAS_pool_create_pool(reindexPkgs)
+
+ call postread_reindex(domain_ptr % blocklist % allFields, &
+ domain_ptr % streamManager % allPackages, &
+ reindexPool, reindexPkgs)
call MPAS_pool_destroy_pool(reindexPool)
+ call MPAS_pool_destroy_pool(reindexPkgs)
end subroutine cam_mpas_read_restart
@@ -1911,8 +1916,6 @@ end subroutine cam_mpas_read_restart
!-----------------------------------------------------------------------
subroutine cam_mpas_write_restart(restart_stream, endrun)
- use pio, only : file_desc_t
-
use mpas_io_streams, only : MPAS_writeStream, MPAS_closeStream
use mpas_derived_types, only : MPAS_Stream_type, MPAS_pool_type, MPAS_STREAM_NOERR
use mpas_pool_routines, only : MPAS_pool_create_pool, MPAS_pool_destroy_pool, MPAS_pool_add_config
@@ -1927,6 +1930,7 @@ subroutine cam_mpas_write_restart(restart_stream, endrun)
integer :: ierr
type (MPAS_pool_type), pointer :: reindexPool
+ type (MPAS_pool_type), pointer :: reindexPkgs
!
! Re-index from local index space to global index space
@@ -1942,7 +1946,11 @@ subroutine cam_mpas_write_restart(restart_stream, endrun)
call MPAS_pool_add_config(reindexPool, 'edgesOnVertex', 1)
call MPAS_pool_add_config(reindexPool, 'cellsOnVertex', 1)
- call prewrite_reindex(domain_ptr % blocklist % allFields, reindexPool)
+ call MPAS_pool_create_pool(reindexPkgs)
+
+ call prewrite_reindex(domain_ptr % blocklist % allFields, &
+ domain_ptr % streamManager % allPackages, &
+ reindexPool, reindexPkgs)
call MPAS_writeStream(restart_stream, 1, ierr=ierr)
if (ierr /= MPAS_STREAM_NOERR) then
@@ -1952,6 +1960,7 @@ subroutine cam_mpas_write_restart(restart_stream, endrun)
call postwrite_reindex(domain_ptr % blocklist % allFields, reindexPool)
call MPAS_pool_destroy_pool(reindexPool)
+ call MPAS_pool_destroy_pool(reindexPkgs)
call MPAS_closeStream(restart_stream, ierr=ierr)
if (ierr /= MPAS_STREAM_NOERR) then
@@ -2255,17 +2264,17 @@ subroutine cam_mpas_run(integrationLength)
runUntilTime = currTime + integrationLength
do while (currTime < runUntilTime)
- call mpas_get_time(curr_time=currTime, dateTimeString=timeStamp, ierr=ierr)
+ call mpas_get_time(curr_time=currTime, dateTimeString=timeStamp, ierr=ierr)
call mpas_log_write('Dynamics timestep beginning at '//trim(timeStamp))
call mpas_timer_start('time integration')
call atm_do_timestep(domain_ptr, dt, itimestep)
- call mpas_timer_stop('time integration')
+ call mpas_timer_stop('time integration')
! Move time level 2 fields back into time level 1 for next time step
call mpas_pool_get_subpool(domain_ptr % blocklist % structs, 'state', state)
call mpas_pool_shift_time_levels(state)
-
+
! Advance clock before writing output
itimestep = itimestep + 1
call mpas_advance_clock(clock)
@@ -2313,6 +2322,7 @@ subroutine cam_mpas_finalize()
use mpas_timer, only : mpas_timer_stop
use mpas_framework, only : mpas_framework_finalize
use atm_time_integration, only : mpas_atm_dynamics_finalize
+ use mpas_atm_halos, only : atm_destroy_halo_groups
! Local variables
integer :: ierr
@@ -2326,6 +2336,12 @@ subroutine cam_mpas_finalize()
call mpas_destroy_clock(clock, ierr)
call mpas_decomp_destroy_decomp_list(domain_ptr % decompositions)
+
+ call atm_destroy_halo_groups(domain_ptr, ierr)
+ if (ierr /= 0) then
+ call endrun(subname//':failed to destroy MPAS-A halo exchange groups.')
+ end if
+
call mpas_atm_threading_finalize(domain_ptr % blocklist)
call mpas_timer_stop('total time')
@@ -2357,11 +2373,10 @@ subroutine cam_mpas_debug_stream(domain, filename, timeLevel)
use mpas_derived_types, only : MPAS_IO_WRITE, MPAS_IO_NETCDF, MPAS_STREAM_NOERR, MPAS_Stream_type, MPAS_pool_type, &
field0DReal, field1DReal, field2DReal, field3DReal, field4DReal, field5DReal, &
field1DInteger, field2DInteger, field3DInteger
- use mpas_pool_routines, only : MPAS_pool_get_subpool, MPAS_pool_get_field, MPAS_pool_create_pool, MPAS_pool_destroy_pool, &
- MPAS_pool_add_config
+ use mpas_pool_routines, only : MPAS_pool_get_field
use mpas_derived_types, only : MPAS_Pool_iterator_type, MPAS_POOL_FIELD, MPAS_POOL_REAL, MPAS_POOL_INTEGER
- use mpas_pool_routines, only : mpas_pool_begin_iteration, mpas_pool_get_next_member, mpas_pool_get_config
+ use mpas_pool_routines, only : mpas_pool_begin_iteration, mpas_pool_get_next_member
type (domain_type), intent(inout) :: domain
character(len=*), intent(in) :: filename
diff --git a/src/dynamics/mpas/dycore_budget.F90 b/src/dynamics/mpas/dycore_budget.F90
new file mode 100644
index 0000000000..18dd0e1375
--- /dev/null
+++ b/src/dynamics/mpas/dycore_budget.F90
@@ -0,0 +1,407 @@
+module dycore_budget
+use shr_kind_mod, only: r8=>shr_kind_r8
+implicit none
+
+public :: print_budget
+real(r8), parameter :: eps = 1.0E-9_r8
+real(r8), parameter :: eps_mass = 1.0E-12_r8
+real(r8), save :: previous_dEdt_dry_mass_adjust = 0.0_r8
+real(r8), save :: previous_dEdt_phys_dyn_coupl_err_Agrid = 0.0_r8
+!=========================================================================================
+contains
+!=========================================================================================
+
+subroutine print_budget(hstwr)
+
+ use cam_budget, only: cam_budget_get_global, thermo_budget_histfile_num, thermo_budget_history
+ use spmd_utils, only: masterproc
+ use cam_logfile, only: iulog
+ use cam_abortutils, only: endrun
+ use cam_thermo, only: thermo_budget_vars_descriptor, thermo_budget_num_vars, thermo_budget_vars_massv
+ use cam_thermo, only: teidx, seidx, keidx, poidx
+
+ ! arguments
+ logical, intent(in) :: hstwr(:)
+
+ ! Local variables
+ character(len=*), parameter :: subname = 'dycore_budget:print_budgets:'
+ !
+ ! physics energy tendencies
+ !
+ integer :: idx(4)
+ real(r8) :: dEdt_param_physE(4) ! dE/dt CAM physics using physics E formula (phAP-phBP)
+ real(r8) :: dEdt_param_dynE(4) ! dE/dt CAM physics using dycore E (dyAP-dyBP)
+
+ real(r8) :: dEdt_efix_physE(4) ! dE/dt energy fixer using physics E formula (phBP-phBF)
+ real(r8) :: dEdt_efix_dynE(4) ! dE/dt energy fixer using dycore E formula (dyBP-dyBF)
+
+ real(r8) :: dEdt_dme_adjust_physE(4) ! dE/dt dry mass adjustment using physics E formula (phAM-phAP)
+ real(r8) :: dEdt_dme_adjust_dynE(4) ! dE/dt dry mass adjustment using dycore E (dyAM-dyAP)
+
+ real(r8) :: dEdt_param_efix_physE(4) ! dE/dt CAM physics + energy fixer using physics E formula (phAP-phBF)
+ real(r8) :: dEdt_param_efix_dynE(4) ! dE/dt CAM physics + energy fixer using dycore E formula (dyAP-dyBF)
+
+ real(r8) :: dEdt_phys_total_dynE(4) ! dE/dt physics total using dycore E (dyAM-dyBF)
+ ! physics total = parameterizations + efix + dry-mass adjustment
+ !
+ ! dycore specific energy tendencies
+ !
+ real(r8) :: dEdt_phys_total_in_dyn(4) ! dEdt of physics total in dynamical core
+ ! physics total = parameterizations + efix + dry-mass adjustment
+ real(r8) :: dEdt_param_efix_in_dyn(4) ! dEdt CAM physics + energy fixer in dynamical core
+ real(r8) :: dEdt_dme_adjust_in_dyn(4) ! dEdt of dme adjust in dynamical core
+ real(r8) :: dEdt_dycore_and_pdc_estimated_from_efix ! dEdt dycore and PDC errors (estimated in physics)
+ !
+ ! mass budgets physics
+ !
+ real(r8) :: dMdt_efix ! mass tendency energy fixer
+ real(r8) :: dMdt_parameterizations ! mass tendency physics paramterizations
+ real(r8) :: dMdt_dme_adjust ! mass tendency dry-mass adjustment
+ real(r8) :: dMdt_phys_total ! mass tendency physics total (energy fixer + parameterizations + dry-mass adjustment)
+ !
+ ! mass budgets dynamics
+ !
+ real(r8) :: dMdt_phys_total_in_dyn ! mass tendency physics total in dycore
+ real(r8) :: dMdt_PDC ! mass tendency physics-dynamics coupling
+ !
+ ! physics-dynamics coupling variables
+ !
+ real(r8) :: E_dBF(4) ! E of dynamics state at the end of dycore integration (on dycore deomposition)
+ real(r8) :: E_dyBF(4) ! E of physics state using dycore E
+
+
+ real(r8) :: diff, tmp ! dummy variables
+ integer :: m_cnst, i
+ character(LEN=*), parameter :: fmt = "(a40,a15,a1,F6.2,a1,F6.2,a1,E10.2,a5)"
+ character(LEN=*), parameter :: fmtf = "(a48,F8.4,a6)"
+ character(LEN=*), parameter :: fmtm = "(a48,E8.2,a9)"
+ character(LEN=15) :: str(4)
+ character(LEN=5) :: pf ! pass or fail identifier
+ !--------------------------------------------------------------------------------------
+
+ if (masterproc .and. thermo_budget_history .and. hstwr(thermo_budget_histfile_num)) then
+ idx(1) = teidx !total energy index
+ idx(2) = seidx !enthaly index
+ idx(3) = keidx !kinetic energy index
+ idx(4) = poidx !surface potential energy index
+ str(1) = "(total )"
+ str(2) = "(internal )"
+ str(3) = "(kinetic )"
+ str(4) = "(potential )"
+ do i=1,4
+ !
+ ! CAM physics energy tendencies
+ !
+ call cam_budget_get_global('phAP-phBP',idx(i),dEdt_param_physE(i))
+ call cam_budget_get_global('phBP-phBF',idx(i),dEdt_efix_physE(i))
+ call cam_budget_get_global('phAM-phAP',idx(i),dEdt_dme_adjust_physE(i))
+ call cam_budget_get_global('phAP-phBF',idx(i),dEdt_param_efix_physE(i))
+ !
+ ! CAM physics energy tendencies using dycore energy formula scaling
+ ! temperature tendencies for consistency with CAM physics
+ !
+ call cam_budget_get_global('dyAP-dyBP',idx(i),dEdt_param_dynE(i))
+ call cam_budget_get_global('dyBP-dyBF',idx(i),dEdt_efix_dynE(i))
+ call cam_budget_get_global('dyAM-dyAP',idx(i),dEdt_dme_adjust_dynE(i))
+ call cam_budget_get_global('dyAP-dyBF',idx(i),dEdt_param_efix_dynE(i))
+ call cam_budget_get_global('dyAM-dyBF',idx(i),dEdt_phys_total_dynE(i))
+ call cam_budget_get_global('dyBF' ,idx(i),E_dyBF(i))!state beginning physics
+ !
+ ! CAM physics energy tendencies in dynamical core
+ !
+ call cam_budget_get_global('dAP-dBF',teidx,dEdt_param_efix_in_dyn(i))
+ call cam_budget_get_global('dAM-dAP',teidx,dEdt_dme_adjust_in_dyn(i))
+ call cam_budget_get_global('dAM-dBF',teidx,dEdt_param_efix_in_dyn(i))
+
+ call cam_budget_get_global('dAM-dBF',idx(i),dEdt_phys_total_in_dyn(i))
+ call cam_budget_get_global('dBF' ,idx(i),E_dBF(i)) !state passed to physics
+ end do
+ write(iulog,*)" "
+ write(iulog,*)"======================================================================"
+ write(iulog,*)"Total energy diagnostics introduced in Lauritzen and Williamson (2019)"
+ write(iulog,*)"(DOI:10.1029/2018MS001549)"
+ write(iulog,*)"======================================================================"
+ write(iulog,*)" "
+ write(iulog,*)"Globally and vertically integrated total energy (E) diagnostics are"
+ write(iulog,*)"computed at various points in the physics and dynamics loops to compute"
+ write(iulog,*)"energy tendencies (dE/dt) and check for consistency (e.g., is E of"
+ write(iulog,*)"state passed to physics computed using dycore state variables the same"
+ write(iulog,*)"E of the state in the beginning of physics computed using the physics"
+ write(iulog,*)"representation of the state)"
+ write(iulog,*)" "
+ write(iulog,*)"Energy stages in physics:"
+ write(iulog,*)"-------------------------"
+ write(iulog,*)" "
+ write(iulog,*)" xxBF: state passed to parameterizations, before energy fixer"
+ write(iulog,*)" xxBP: after energy fixer, before parameterizations"
+ write(iulog,*)" xxAP: after last phys_update in parameterizations and state "
+ write(iulog,*)" saved for energy fixer"
+ write(iulog,*)" xxAM: after dry mass adjustment"
+ write(iulog,*)" history files saved off here"
+ write(iulog,*)" "
+ write(iulog,*)"where xx='ph','dy' "
+ write(iulog,*)" "
+ write(iulog,*)"Suffix ph is CAM physics total energy"
+ write(iulog,*)"(eq. 111 in Lauritzen et al. 2022; 10.1029/2022MS003117)"
+ write(iulog,*)" "
+ write(iulog,*)"Suffix dy is dycore energy computed in CAM physics using"
+ write(iulog,*)"CAM physics state variables"
+ write(iulog,*)" "
+ write(iulog,*)" "
+ write(iulog,*)"Energy stages in dynamics"
+ write(iulog,*)"-------------------------"
+ write(iulog,*)" "
+ write(iulog,*)" dBF: dynamics state before physics (d_p_coupling)"
+ write(iulog,*)" dAP: dynamics state with T,u,V increment but not incl water changes"
+ write(iulog,*)" dAM: dynamics state with full physics increment (incl. water)"
+ write(iulog,*)" "
+ write(iulog,*)"Note that these energies are computed using the dynamical core"
+ write(iulog,*)"state variables which may be different from the physics prognostic"
+ write(iulog,*)"variables."
+ write(iulog,*)" "
+ write(iulog,*)" "
+ write(iulog,*)"FYI : norm. diff = absolute normalized difference"
+ write(iulog,*)"FYI2: diff = difference (not normalized)"
+ write(iulog,*)" "
+ write(iulog,*)" "
+ write(iulog,*)"Consistency check 0:"
+ write(iulog,*)"--------------------"
+ write(iulog,*)" "
+ write(iulog,*)"For energetic consistency we require that dE/dt [W/m^2] from energy "
+ write(iulog,*)"fixer and all parameterizations computed using physics E and"
+ write(iulog,*)"dycore in physics E are the same! Checking:"
+ write(iulog,*)" "
+ write(iulog,*) " xx=ph xx=dy norm. diff."
+ write(iulog,*) " ----- ----- -----------"
+ do i=1,4
+ diff = abs_diff(dEdt_efix_physE(i),dEdt_efix_dynE(i),pf=pf)
+ write(iulog,fmt)"dE/dt energy fixer (xxBP-xxBF) ",str(i)," ",dEdt_efix_physE(i), " ",dEdt_efix_dynE(i)," ",diff,pf
+ diff = abs_diff(dEdt_param_physE(i),dEdt_param_dynE(i),pf=pf)
+ write(iulog,fmt)"dE/dt all parameterizations (xxAP-xxBP) ",str(i)," ",dEdt_param_physE(i)," ",dEdt_param_dynE(i)," ",diff,pf
+ write(iulog,*) " "
+ if (diff>eps) then
+ write(iulog,*)"FAIL"
+ call endrun(subname//"dE/dt's in physics inconsistent")
+ end if
+ end do
+ write(iulog,*)" "
+ write(iulog,*)" "
+ write(iulog,*)"dE/dt from dry-mass adjustment will differ if dynamics and physics use"
+ write(iulog,*)"different energy definitions! Checking:"
+ write(iulog,*)" "
+ write(iulog,*) " xx=ph xx=dy diff"
+ write(iulog,*) " ----- ----- ----"
+ do i=1,4
+ diff = dEdt_dme_adjust_physE(i)-dEdt_dme_adjust_dynE(i)
+ write(iulog,fmt)"dE/dt dry mass adjustment (xxAM-xxAP) ",str(i)," ",dEdt_dme_adjust_physE(i), &
+ " ",dEdt_dme_adjust_dynE(i)," ",diff
+ end do
+ write(iulog,*)" "
+ write(iulog,*)"Compare to dry mass adjustment in dynamics (xx=d,dy):"
+ write(iulog,*) " xx=d xx=dy norm. diff"
+ write(iulog,*) " ----- ----- ----------"
+ do i=1,4
+ diff = abs_diff(dEdt_dme_adjust_in_dyn(i),dEdt_dme_adjust_dynE(i),pf=pf)
+ write(iulog,fmt)"dE/dt dry mass adjustment (xxAM-xxAP) ",str(i)," ",dEdt_dme_adjust_in_dyn(i),&
+ " ",dEdt_dme_adjust_dynE(i)," ",diff,pf
+ end do
+ write(iulog,*)" "
+ write(iulog,*)" "
+ !
+ ! these diagnostics only make sense time-step to time-step
+ !
+ write(iulog,*)" "
+ write(iulog,*)"Some energy budget observations:"
+ write(iulog,*)"--------------------------------"
+ write(iulog,*)" "
+ write(iulog,*)" Note that total energy fixer fixes:"
+ write(iulog,*)" "
+ write(iulog,*)" -dE/dt energy fixer(t=n) = dE/dt dry mass adjustment (t=n-1) +"
+ write(iulog,*)" dE/dt adiabatic dycore (t=n-1) +"
+ write(iulog,*)" dE/dt physics-dynamics coupling errors (t=n-1)"
+ write(iulog,*)" "
+ write(iulog,*)" (equation 23 in Lauritzen and Williamson (2019))"
+ write(iulog,*)" "
+ write(iulog,*)" Technically this equation is only valid with instantaneous time-step to"
+ write(iulog,*)" time-step output"
+ write(iulog,*) " "
+ write(iulog,*) " dE/dt energy fixer(t=n) = ",dEdt_efix_dynE(1)
+ write(iulog,*) " dE/dt dry mass adjustment (t=n-1) = ",previous_dEdt_dry_mass_adjust
+ write(iulog,*) " dE/dt adiabatic dycore (t=n-1) = unknown"
+ write(iulog,*) " dE/dt PDC errors (A-grid) (t=n-1) = ",previous_dEdt_phys_dyn_coupl_err_Agrid
+ write(iulog,*) " dE/dt PDC errors (other ) (t=n-1) = unknown"
+
+ dEdt_dycore_and_pdc_estimated_from_efix = -dEdt_efix_dynE(1) - &
+ previous_dEdt_phys_dyn_coupl_err_Agrid - &
+ previous_dEdt_dry_mass_adjust
+ write(iulog,*) " "
+ write(iulog,*) "Hence the dycore E dissipation and physics-dynamics coupling errors"
+ write(iulog,*) "associated with mapping wind tendencies to C-grid and dribbling "
+ write(iulog,*) "tendencies in the dycore (PDC other), estimated from energy fixer "
+ write(iulog,'(A39,F6.2,A6)') "based on previous time-step values is ",dEdt_dycore_and_pdc_estimated_from_efix," W/M^2"
+ write(iulog,*) " "
+ write(iulog,*) " "
+ write(iulog,*) "-------------------------------------------------------------------"
+ write(iulog,*) " Consistency check 1: state passed to physics same as end dynamics?"
+ write(iulog,*) "-------------------------------------------------------------------"
+ write(iulog,*) " "
+ write(iulog,*) "Is globally integrated total energy of state at the end of dynamics (dBF)"
+ write(iulog,*) "and beginning of physics (using dynamics in physics energy; dyBF) the same?"
+ write(iulog,*) ""
+
+ if (abs(E_dyBF(1))>eps) then
+ diff = abs_diff(E_dBF(1),E_dyBF(1))
+ if (abs(diff)eps) then
+ do i=1,4
+ write(iulog,*) str(i),":"
+ write(iulog,*) "======"
+ diff = abs_diff(dEdt_phys_total_dynE(i),dEdt_phys_total_in_dyn(i),pf=pf)
+ write(iulog,*) "dE/dt physics-dynamics coupling errors (diff) ",diff
+ write(iulog,*) "dE/dt physics total in dynamics (dAM-dBF) ",dEdt_phys_total_in_dyn(i)
+ write(iulog,*) "dE/dt physics total in physics (pAM-pBF) ",dEdt_phys_total_dynE(i)
+ write(iulog,*) " "
+ write(iulog,*) " physics total = parameterizations + efix + dry-mass adjustment"
+ write(iulog,*) " "
+ end do
+ end if
+ write(iulog,*)" "
+ write(iulog,*)"------------------------------------------------------------"
+ write(iulog,*)" MPAS dycore energy tendencies"
+ write(iulog,*)"------------------------------------------------------------"
+ write(iulog,*)" "
+ write(iulog,*)" Energy diagnostics have not been implemented in the MPAS"
+ write(iulog,*)" dynamical core so a detailed budget is not available."
+ write(iulog,*)" "
+ write(iulog,*)" dE/dt adiabatic dynamical core must therefore be estimated"
+ write(iulog,*)" from"
+ write(iulog,*)" "
+ write(iulog,*)" dE/dt adiabatic dycore (t=n-1) = "
+ write(iulog,*)" -dE/dt dry mass adjustment (t=n-1) +"
+ write(iulog,*)" -dE/dt energy fixer(t=n)"
+ write(iulog,*)" -dE/dt physics-dynamics coupling errors (t=n-1)"
+ write(iulog,*)" "
+ dEdt_dycore_and_pdc_estimated_from_efix = -dEdt_efix_dynE(1)-previous_dEdt_dry_mass_adjust
+ write(iulog,'(A34,F6.2,A6)') " = ",dEdt_dycore_and_pdc_estimated_from_efix," W/M^2"
+ write(iulog,*)" "
+ write(iulog,*)" assuming no physics-dynamics coupling errors, that is,"
+ write(iulog,*)" dE/dt physics-dynamics coupling errors (t=n-1) = 0"
+ write(iulog,*)" "
+ write(iulog,*)" For MPAS the physics-dynamics coupling errors include:"
+ write(iulog,*)" - `dribbling' temperature and wind tendencies during the"
+ write(iulog,*)" dynamical core time-integration"
+ write(iulog,*)" - mapping wind tendencies from A to C grid"
+ write(iulog,*)" "
+
+ write(iulog,*)" "
+ write(iulog,*)"------------------------------------------------------------"
+ write(iulog,*)"Tracer mass budgets"
+ write(iulog,*)"------------------------------------------------------------"
+ write(iulog,*)" "
+ write(iulog,*)"Below the physics-dynamics coupling error is computed as "
+ write(iulog,*)"dMASS/dt physics tendency in dycore (dBD-dAF) minus"
+ write(iulog,*)"dMASS/dt total physics (pAM-pBF)"
+ write(iulog,*)" "
+ write(iulog,*)" "
+ do m_cnst=1,thermo_budget_num_vars
+ if (thermo_budget_vars_massv(m_cnst)) then
+ write(iulog,*)thermo_budget_vars_descriptor(m_cnst)
+ write(iulog,*)"------------------------------"
+ call cam_budget_get_global('phBP-phBF',m_cnst,dMdt_efix)
+ call cam_budget_get_global('phAM-phAP',m_cnst,dMdt_dme_adjust)
+ call cam_budget_get_global('phAP-phBP',m_cnst,dMdt_parameterizations)
+ call cam_budget_get_global('phAM-phBF',m_cnst,dMdt_phys_total)
+ !
+ ! total energy fixer should not affect mass - checking
+ !
+ if (abs(dMdt_efix)>eps_mass) then
+ write(iulog,*) "dMASS/dt energy fixer (pBP-pBF) ",dMdt_efix," Pa/m^2/s"
+ write(iulog,*) "ERROR: Mass not conserved in energy fixer. ABORT"
+ call endrun(subname//"Mass not conserved in energy fixer. See atm.log")
+ endif
+ !
+ ! dry-mass adjustmnt should not affect mass - checking
+ !
+ if (abs(dMdt_dme_adjust)>eps_mass) then
+ write(iulog,*)"dMASS/dt dry mass adjustment (pAM-pAP) ",dMdt_dme_adjust," Pa/m^2/s"
+ write(iulog,*) "ERROR: Mass not conserved in dry mass adjustment. ABORT"
+ call endrun(subname//"Mass not conserved in dry mass adjustment. See atm.log")
+ end if
+ !
+ ! all of the mass-tendency should come from parameterization - checking
+ !
+ if (abs(dMdt_parameterizations-dMdt_phys_total)>eps_mass) then
+ write(iulog,*) "Error: dMASS/dt parameterizations (pAP-pBP) /= dMASS/dt physics total (pAM-pBF)"
+ write(iulog,*) "dMASS/dt parameterizations (pAP-pBP) ",dMdt_parameterizations," Pa/m^2/s"
+ write(iulog,*) "dMASS/dt physics total (pAM-pBF) ",dMdt_phys_total," Pa/m^2/s"
+ call endrun(subname//"mass change not only due to parameterizations. See atm.log")
+ end if
+ write(iulog,*)" "
+ !
+ ! check if mass change in physics is the same as dynamical core
+ !
+ call cam_budget_get_global('dAM-dBF',m_cnst,dMdt_phys_total_in_dyn)
+ dMdt_PDC = dMdt_phys_total-dMdt_phys_total_in_dyn
+ write(iulog,fmtm)" Mass physics-dynamics coupling error ",dMdt_PDC," Pa/m^2/s"
+ write(iulog,*)" "
+ if (abs(dMdt_PDC)>eps_mass) then
+ write(iulog,fmtm)" dMASS/dt physics tendency in dycore (dAM-dBF) ",dMdt_phys_total_in_dyn," Pa/m^2/s"
+ write(iulog,fmtm)" dMASS/dt total physics ",dMdt_phys_total," Pa/m^2/s"
+ end if
+ end if
+ end do
+ !
+ ! save dry-mass adjustment to avoid sampling error
+ !
+ previous_dEdt_dry_mass_adjust = dEdt_dme_adjust_dynE(1)
+ end if
+ end subroutine print_budget
+ !=========================================================================================
+ function abs_diff(a,b,pf)
+ real(r8), intent(in) :: a,b
+ character(LEN=5), optional, intent(out):: pf
+ real(r8) :: abs_diff
+ if (abs(b)>eps) then
+ abs_diff = abs((b-a)/b)
+ else
+ abs_diff = abs(b-a)
+ end if
+ if (present(pf)) then
+ if (abs_diff>eps) then
+ pf = ' FAIL'
+ else
+ pf = ' PASS'
+ end if
+ end if
+ end function abs_diff
+end module dycore_budget
+
diff --git a/src/dynamics/mpas/dyn_comp.F90 b/src/dynamics/mpas/dyn_comp.F90
index d4ff112434..a1b02c1f86 100644
--- a/src/dynamics/mpas/dyn_comp.F90
+++ b/src/dynamics/mpas/dyn_comp.F90
@@ -3,7 +3,7 @@ module dyn_comp
! CAM component interfaces to the MPAS Dynamical Core
use shr_kind_mod, only: r8=>shr_kind_r8
-use spmd_utils, only: iam, masterproc, mpicom, npes
+use spmd_utils, only: masterproc, mpicom, npes
use physconst, only: pi, gravit, rair, cpair
use pmgrid, only: plev, plevp
@@ -13,23 +13,18 @@ module dyn_comp
use cam_control_mod, only: initial_run
use cam_initfiles, only: initial_file_get_id, topo_file_get_id
-use cam_grid_support, only: cam_grid_id, cam_grid_get_gcid, &
- cam_grid_dimensions, cam_grid_get_dim_names, &
- cam_grid_get_latvals, cam_grid_get_lonvals, &
- max_hcoordname_len
+use cam_grid_support, only: cam_grid_id, &
+ cam_grid_get_latvals, cam_grid_get_lonvals
use cam_map_utils, only: iMap
use inic_analytic, only: analytic_ic_active, dyn_set_inic_col
use dyn_tests_utils, only: vcoord=>vc_height
-use cam_history, only: addfld, add_default, horiz_only, register_vector_field, &
- outfld, hist_fld_active
-use cam_history_support, only: max_fieldname_len
+use cam_history, only: addfld, horiz_only
use string_utils, only: date2yyyymmdd, sec2hms, int2str
use ncdio_atm, only: infld
-use pio, only: file_desc_t, pio_seterrorhandling, PIO_BCAST_ERROR, &
- pio_inq_dimid, pio_inq_dimlen, PIO_NOERR
+use pio, only: file_desc_t
use cam_pio_utils, only: clean_iodesc_list
use time_manager, only: get_start_date, get_stop_date, get_run_duration, &
@@ -39,8 +34,11 @@ module dyn_comp
use cam_abortutils, only: endrun
use mpas_timekeeping, only : MPAS_TimeInterval_type
-
use cam_mpas_subdriver, only: cam_mpas_global_sum_real
+use cam_budget, only: cam_budget_em_snapshot, cam_budget_em_register
+
+
+use phys_control, only: use_gw_front, use_gw_front_igw
implicit none
private
@@ -196,7 +194,23 @@ module dyn_comp
real(r8), dimension(:), pointer :: fzm ! Interp weight from k layer midpoint to k layer
! interface [dimensionless] (nver)
real(r8), dimension(:), pointer :: fzp ! Interp weight from k-1 layer midpoint to k
- ! layer interface [dimensionless] (nver)
+ !
+ ! Invariant -- needed for computing the frontogenesis function
+ !
+ real(r8), dimension(:,:), pointer :: defc_a
+ real(r8), dimension(:,:), pointer :: defc_b
+ real(r8), dimension(:,:), pointer :: cell_gradient_coef_x
+ real(r8), dimension(:,:), pointer :: cell_gradient_coef_y
+ real(r8), dimension(:,:), pointer :: edgesOnCell_sign
+ real(r8), dimension(:), pointer :: dvEdge
+ real(r8), dimension(:), pointer :: areaCell ! cell area (m^2)
+
+ integer, dimension(:,:), pointer :: edgesOnCell
+ integer, dimension(:,:), pointer :: cellsOnEdge
+ integer, dimension(:), pointer :: nEdgesOnCell
+
+ real(r8), dimension(:,:), pointer :: utangential ! velocity tangent to cell edge,
+ ! diagnosed by mpas
!
! State that may be directly derived from dycore prognostic state
@@ -216,6 +230,10 @@ module dyn_comp
! (nver,ncol)
end type dyn_export_t
+! Frontogenesis indices
+integer, public :: frontgf_idx = -1
+integer, public :: frontga_idx = -1
+
real(r8), parameter :: rad2deg = 180.0_r8 / pi
real(r8), parameter :: deg2rad = pi / 180.0_r8
@@ -247,11 +265,8 @@ subroutine dyn_readnl(NLFileName)
character(len=*), intent(in) :: NLFileName
! Local variables
- integer :: ierr
integer, dimension(2) :: logUnits ! stdout and stderr for MPAS logging
integer :: yr, mon, day, tod, ndate, nday, nsec
- character(len=10) :: date_str
- character(len=8) :: tod_str
character(len=*), parameter :: subname = 'dyn_comp:dyn_readnl'
!----------------------------------------------------------------------------
@@ -280,6 +295,7 @@ subroutine dyn_readnl(NLFileName)
call mpas_pool_add_config(domain_ptr % configs, 'config_restart_timestamp_name', 'restart_timestamp')
call mpas_pool_add_config(domain_ptr % configs, 'config_IAU_option', 'off')
call mpas_pool_add_config(domain_ptr % configs, 'config_do_DAcycling', .false.)
+ call mpas_pool_add_config(domain_ptr % configs, 'config_halo_exch_method', 'mpas_halo')
call cam_mpas_init_phase2(pio_subsystem, endrun, timemgr_get_calendar_cf())
@@ -294,8 +310,16 @@ subroutine dyn_register()
use physics_buffer, only: pbuf_add_field, dtype_r8
use ppgrid, only: pcols, pver
+ use phys_control, only: use_gw_front, use_gw_front_igw
!----------------------------------------------------------------------------
+ ! These fields are computed by the dycore and passed to the physics via the
+ ! physics buffer.
+
+ if (use_gw_front .or. use_gw_front_igw) then
+ call pbuf_add_field("FRONTGF", "global", dtype_r8, (/pcols,pver/), frontgf_idx)
+ call pbuf_add_field("FRONTGA", "global", dtype_r8, (/pcols,pver/), frontga_idx)
+ end if
end subroutine dyn_register
@@ -315,7 +339,8 @@ subroutine dyn_init(dyn_in, dyn_out)
use mpas_derived_types, only : mpas_pool_type
use mpas_constants, only : mpas_constants_compute_derived
use dyn_tests_utils, only : vc_dycore, vc_height, string_vc, vc_str_lgth
- use constituents, only : cnst_get_ind
+ use cam_budget, only : thermo_budget_history
+
! arguments:
type(dyn_import_t), intent(inout) :: dyn_in
type(dyn_export_t), intent(inout) :: dyn_out
@@ -347,29 +372,21 @@ subroutine dyn_init(dyn_in, dyn_out)
character(len=*), parameter :: subname = 'dyn_comp::dyn_init'
! variables for initializing energy and axial angular momentum diagnostics
- integer, parameter :: num_stages = 3, num_vars = 5
- character (len = 3), dimension(num_stages) :: stage = (/"dBF","dAP","dAM"/)
+ integer, parameter :: num_stages = 6
+ character (len = 8), dimension(num_stages) :: stage = (/"dBF ","dAP ","dAM ","BD_dparm","BD_DMEA ","BD_phys "/)
character (len = 55),dimension(num_stages) :: stage_txt = (/&
" dynamics state before physics (d_p_coupling) ",&
" dynamics state with T,u,V increment but not q ",&
- " dynamics state with full physics increment (incl.q)" &
+ " dynamics state with full physics increment (incl.q)",&
+ "dE/dt params+efix in dycore (dparam)(dAP-dBF) ",&
+ "dE/dt dry mass adjustment in dycore (dAM-dAP)",&
+ "dE/dt physics total in dycore (phys) (dAM-dBF)" &
/)
- character (len = 2) , dimension(num_vars) :: vars = (/"WV" ,"WL" ,"WI" ,"SE" ,"KE"/)
- character (len = 45) , dimension(num_vars) :: vars_descriptor = (/&
- "Total column water vapor ",&
- "Total column cloud water ",&
- "Total column cloud ice ",&
- "Total column static energy ",&
- "Total column kinetic energy "/)
- character (len = 14), dimension(num_vars) :: &
- vars_unit = (/&
- "kg/m2 ","kg/m2 ","kg/m2 ","J/m2 ",&
- "J/m2 "/)
-
integer :: istage, ivars, m
character (len=108) :: str1, str2, str3
character (len=vc_str_lgth) :: vc_str
+ !-------------------------------------------------------
vc_dycore = vc_height
if (masterproc) then
@@ -480,6 +497,24 @@ subroutine dyn_init(dyn_in, dyn_out)
dyn_out % ux => dyn_in % ux
dyn_out % uy => dyn_in % uy
+ ! for frontogenesis calc
+
+ if (use_gw_front .or. use_gw_front_igw) then
+ dyn_out % areaCell => dyn_in % areaCell
+ dyn_out % cellsOnEdge => dyn_in % cellsOnEdge
+ call mpas_pool_get_array(mesh_pool, 'defc_a', dyn_out % defc_a)
+ call mpas_pool_get_array(mesh_pool, 'defc_b', dyn_out % defc_b)
+ call mpas_pool_get_array(mesh_pool, 'cell_gradient_coef_x', dyn_out % cell_gradient_coef_x)
+ call mpas_pool_get_array(mesh_pool, 'cell_gradient_coef_y', dyn_out % cell_gradient_coef_y)
+ call mpas_pool_get_array(mesh_pool, 'edgesOnCell_sign', dyn_out % edgesOnCell_sign)
+ call mpas_pool_get_array(mesh_pool, 'dvEdge', dyn_out % dvEdge)
+ call mpas_pool_get_array(mesh_pool, 'edgesOnCell', dyn_out % edgesOnCell)
+ call mpas_pool_get_array(mesh_pool, 'nEdgesOnCell', dyn_out % nEdgesOnCell)
+ call mpas_pool_get_array(diag_pool, 'v', dyn_out % utangential)
+ endif
+
+ ! cam-required hydrostatic pressures
+
allocate(dyn_out % pmiddry(nVertLevels, nCells), stat=ierr)
if( ierr /= 0 ) call endrun(subname//': failed to allocate dyn_out%pmiddry array')
@@ -536,39 +571,53 @@ subroutine dyn_init(dyn_in, dyn_out)
! Set the interval over which the dycore should integrate during each call to dyn_run.
call MPAS_set_timeInterval(integrationLength, S=nint(dtime), S_n=0, S_d=1)
- do istage = 1, num_stages
- do ivars=1, num_vars
- write(str1,*) TRIM(ADJUSTL(vars(ivars))),"_",TRIM(ADJUSTL(stage(istage)))
- write(str2,*) TRIM(ADJUSTL(vars_descriptor(ivars)))," ", &
- TRIM(ADJUSTL(stage_txt(istage)))
- write(str3,*) TRIM(ADJUSTL(vars_unit(ivars)))
- call addfld (TRIM(ADJUSTL(str1)), horiz_only, 'A', TRIM(ADJUSTL(str3)),TRIM(ADJUSTL(str2)), gridname='mpas_cell')
+ !
+ ! initialize history for MPAS energy budgets
+
+ if (thermo_budget_history) then
+
+ ! Define energy/mass snapshots using stage structure
+ do istage = 1, num_stages
+ call cam_budget_em_snapshot(TRIM(ADJUSTL(stage(istage))), 'dyn', longname=TRIM(ADJUSTL(stage_txt(istage))))
end do
- end do
+ !
+ ! initialize MPAS energy budgets
+ ! add budgets that are derived from stages
+ !
+ call cam_budget_em_register('dEdt_param_efix_in_dyn','dAP','dBF',pkgtype='dyn',optype='dif', &
+ longname="dE/dt parameterizations+efix in dycore (dparam)(dAP-dBF)")
+ call cam_budget_em_register('dEdt_dme_adjust_in_dyn','dAM','dAP',pkgtype='dyn',optype='dif', &
+ longname="dE/dt dry mass adjustment in dycore (dAM-dAP)")
+ call cam_budget_em_register('dEdt_phys_total_in_dyn','dAM','dBF',pkgtype='dyn',optype='dif', &
+ longname="dE/dt physics total in dycore (phys) (dAM-dBF)")
+ end if
!
! initialize CAM thermodynamic infrastructure
!
do m=1,thermodynamic_active_species_num
- thermodynamic_active_species_idx_dycore(m) = dyn_in % mpas_from_cam_cnst(thermodynamic_active_species_idx(m))
- if (masterproc) then
- write(iulog,*) subname//": m,thermodynamic_active_species_idx_dycore: ",m,thermodynamic_active_species_idx_dycore(m)
- end if
+ thermodynamic_active_species_idx_dycore(m) = dyn_out % cam_from_mpas_cnst(thermodynamic_active_species_idx(m))
+ if (masterproc) then
+ write(iulog,'(a,2I4)') subname//": m,thermodynamic_active_species_idx_dycore: ", &
+ m,thermodynamic_active_species_idx_dycore(m)
+ end if
end do
do m=1,thermodynamic_active_species_liq_num
- thermodynamic_active_species_liq_idx_dycore(m) = dyn_in % mpas_from_cam_cnst(thermodynamic_active_species_liq_idx(m))
- if (masterproc) then
- write(iulog,*) subname//": m,thermodynamic_active_species_idx_liq_dycore: ",m,thermodynamic_active_species_liq_idx_dycore(m)
- end if
+ thermodynamic_active_species_liq_idx_dycore(m) = dyn_out % cam_from_mpas_cnst(thermodynamic_active_species_liq_idx(m))
+ if (masterproc) then
+ write(iulog,'(a,2I4)') subname//": m,thermodynamic_active_species_idx_liq_dycore: ", &
+ m,thermodynamic_active_species_liq_idx_dycore(m)
+ end if
end do
do m=1,thermodynamic_active_species_ice_num
- thermodynamic_active_species_ice_idx_dycore(m) = dyn_in % mpas_from_cam_cnst(thermodynamic_active_species_ice_idx(m))
- if (masterproc) then
- write(iulog,*) subname//": m,thermodynamic_active_species_idx_ice_dycore: ",m,thermodynamic_active_species_ice_idx_dycore(m)
- end if
+ thermodynamic_active_species_ice_idx_dycore(m) = dyn_out % cam_from_mpas_cnst(thermodynamic_active_species_ice_idx(m))
+ if (masterproc) then
+ write(iulog,'(a,2I4)') subname//": m,thermodynamic_active_species_idx_ice_dycore: ", &
+ m,thermodynamic_active_species_ice_idx_dycore(m)
+ end if
end do
-end subroutine dyn_init
+ end subroutine dyn_init
!=========================================================================================
@@ -588,6 +637,7 @@ subroutine dyn_run(dyn_in, dyn_out)
! Local variables
type(mpas_pool_type), pointer :: state_pool
character(len=*), parameter :: subname = 'dyn_comp:dyn_run'
+ real(r8) :: dtime
!----------------------------------------------------------------------------
@@ -609,11 +659,10 @@ subroutine dyn_run(dyn_in, dyn_out)
end subroutine dyn_run
-!=========================================================================================
subroutine dyn_final(dyn_in, dyn_out)
- use cam_mpas_subdriver, only : cam_mpas_finalize
+ use cam_mpas_subdriver, only : cam_mpas_finalize
! Deallocates the dynamics import and export states, and finalizes
! the MPAS dycore.
@@ -704,7 +753,7 @@ subroutine read_inidat(dyn_in)
use cam_mpas_subdriver, only : domain_ptr, cam_mpas_update_halo, cam_mpas_cell_to_edge_winds
use cam_initfiles, only : scale_dry_air_mass
- use mpas_pool_routines, only : mpas_pool_get_subpool, mpas_pool_get_array, mpas_pool_get_config
+ use mpas_pool_routines, only : mpas_pool_get_subpool, mpas_pool_get_array
use mpas_derived_types, only : mpas_pool_type
use mpas_vector_reconstruction, only : mpas_reconstruct
use mpas_constants, only : Rv_over_Rd => rvord
@@ -762,7 +811,6 @@ subroutine read_inidat(dyn_in)
real(r8), allocatable :: qv(:), tm(:)
- real(r8) :: dz, h
logical :: readvar
character(len=shr_kind_cx) :: str
@@ -775,7 +823,7 @@ subroutine read_inidat(dyn_in)
real(r8), pointer :: uReconstructZ(:,:)
integer :: mpas_idx, cam_idx, ierr
- character(len=16) :: trac_name
+ character(len=32) :: trac_name
character(len=*), parameter :: subname = 'dyn_comp:read_inidat'
!--------------------------------------------------------------------------------------
@@ -1256,7 +1304,7 @@ subroutine cam_mpas_namelist_read(namelistFilename, configPool)
! if no errors were encountered, all MPI ranks have valid namelists in their configPool.
use spmd_utils, only: mpicom, masterproc, masterprocid, &
- mpi_integer, mpi_real8, mpi_logical, mpi_character, mpi_success
+ mpi_integer, mpi_real8, mpi_logical, mpi_character
use namelist_utils, only: find_group_name
use mpas_derived_types, only: mpas_pool_type
@@ -1309,6 +1357,7 @@ subroutine cam_mpas_namelist_read(namelistFilename, configPool)
real(r8) :: mpas_zd = 22000.0_r8
real(r8) :: mpas_xnutr = 0.2_r8
real(r8) :: mpas_cam_coef = 0.0_r8
+ integer :: mpas_cam_damping_levels = 0
logical :: mpas_rayleigh_damp_u = .true.
real(r8) :: mpas_rayleigh_damp_u_timescale_days = 5.0_r8
integer :: mpas_number_rayleigh_damp_u_levels = 3
@@ -1359,6 +1408,7 @@ subroutine cam_mpas_namelist_read(namelistFilename, configPool)
mpas_zd, &
mpas_xnutr, &
mpas_cam_coef, &
+ mpas_cam_damping_levels, &
mpas_rayleigh_damp_u, &
mpas_rayleigh_damp_u_timescale_days, &
mpas_number_rayleigh_damp_u_levels
@@ -1494,6 +1544,7 @@ subroutine cam_mpas_namelist_read(namelistFilename, configPool)
call mpi_bcast(mpas_zd, 1, mpi_real8, masterprocid, mpicom, mpi_ierr)
call mpi_bcast(mpas_xnutr, 1, mpi_real8, masterprocid, mpicom, mpi_ierr)
call mpi_bcast(mpas_cam_coef, 1, mpi_real8, masterprocid, mpicom, mpi_ierr)
+ call mpi_bcast(mpas_cam_damping_levels, 1, mpi_integer, masterprocid, mpicom, mpi_ierr)
call mpi_bcast(mpas_rayleigh_damp_u, 1, mpi_logical, masterprocid, mpicom, mpi_ierr)
call mpi_bcast(mpas_rayleigh_damp_u_timescale_days, 1, mpi_real8, masterprocid, mpicom, mpi_ierr)
call mpi_bcast(mpas_number_rayleigh_damp_u_levels, 1, mpi_integer, masterprocid, mpicom, mpi_ierr)
@@ -1501,6 +1552,7 @@ subroutine cam_mpas_namelist_read(namelistFilename, configPool)
call mpas_pool_add_config(configPool, 'config_zd', mpas_zd)
call mpas_pool_add_config(configPool, 'config_xnutr', mpas_xnutr)
call mpas_pool_add_config(configPool, 'config_mpas_cam_coef', mpas_cam_coef)
+ call mpas_pool_add_config(configPool, 'config_number_cam_damping_levels', mpas_cam_damping_levels)
call mpas_pool_add_config(configPool, 'config_rayleigh_damp_u', mpas_rayleigh_damp_u)
call mpas_pool_add_config(configPool, 'config_rayleigh_damp_u_timescale_days', mpas_rayleigh_damp_u_timescale_days)
call mpas_pool_add_config(configPool, 'config_number_rayleigh_damp_u_levels', mpas_number_rayleigh_damp_u_levels)
@@ -1651,6 +1703,7 @@ subroutine cam_mpas_namelist_read(namelistFilename, configPool)
write(iulog,*) ' mpas_zd = ', mpas_zd
write(iulog,*) ' mpas_xnutr = ', mpas_xnutr
write(iulog,*) ' mpas_cam_coef = ', mpas_cam_coef
+ write(iulog,*) ' mpas_cam_damping_levels = ', mpas_cam_damping_levels
write(iulog,*) ' mpas_rayleigh_damp_u = ', mpas_rayleigh_damp_u
write(iulog,*) ' mpas_rayleigh_damp_u_timescale_days = ', mpas_rayleigh_damp_u_timescale_days
write(iulog,*) ' mpas_number_rayleigh_damp_u_levels = ', mpas_number_rayleigh_damp_u_levels
@@ -1705,7 +1758,6 @@ subroutine set_dry_mass(dyn_in, target_avg_dry_surface_pressure)
real(r8) :: preliminary_avg_dry_surface_pressure, scaled_avg_dry_surface_pressure
real(r8) :: scaling_ratio
real(r8) :: sphere_surface_area
- real(r8) :: surface_integral, test_value
integer :: ixqv,ierr
diff --git a/src/dynamics/mpas/dyn_grid.F90 b/src/dynamics/mpas/dyn_grid.F90
index c8efc66123..d0b53c5fa0 100644
--- a/src/dynamics/mpas/dyn_grid.F90
+++ b/src/dynamics/mpas/dyn_grid.F90
@@ -130,7 +130,7 @@ subroutine dyn_grid_init()
! MPAS-A always requires at least one scalar (qv). CAM has the same requirement
! and it is enforced by the configure script which sets the cpp macrop PCNST.
- call cam_mpas_init_phase3(fh_ini, pcnst, endrun)
+ call cam_mpas_init_phase3(fh_ini, pcnst)
! Read or compute all time-invariant fields for the MPAS-A dycore
! Time-invariant fields are stored in the MPAS mesh pool. This call
@@ -530,6 +530,7 @@ subroutine define_cam_grids()
use cam_grid_support, only: horiz_coord_t, horiz_coord_create, iMap
use cam_grid_support, only: cam_grid_register, cam_grid_attribute_register
+ use shr_const_mod, only: PI => SHR_CONST_PI
! Local variables
integer :: i, j
@@ -545,6 +546,7 @@ subroutine define_cam_grids()
real(r8), dimension(:), pointer :: latCell ! cell center latitude (radians)
real(r8), dimension(:), pointer :: lonCell ! cell center longitude (radians)
real(r8), dimension(:), pointer :: areaCell ! cell areas in m^2
+ real(r8), dimension(:), pointer :: areaWeight! normalized cell areas weights
integer, dimension(:), pointer :: indexToEdgeID ! global indices of edge nodes
real(r8), dimension(:), pointer :: latEdge ! edge node latitude (radians)
@@ -555,6 +557,13 @@ subroutine define_cam_grids()
real(r8), dimension(:), pointer :: lonVertex ! vertex node longitude (radians)
integer :: ierr
character(len=*), parameter :: subname = 'dyn_grid::define_cam_grids'
+ integer :: hdim1_d ! Global Longitudes or global grid size (nCells_g)
+ integer :: hdim2_d ! Latitudes or 1 for unstructured grids
+ integer :: num_levels ! Number of levels
+ integer :: index_model_top_layer
+ integer :: index_surface_layer
+ logical :: unstructured
+ type (physics_column_t), allocatable :: dyn_cols(:)
!----------------------------------------------------------------------------
call mpas_pool_get_subpool(domain_ptr % blocklist % structs, 'mesh', meshPool)
@@ -578,6 +587,11 @@ subroutine define_cam_grids()
lon_coord => horiz_coord_create('lonCell', 'nCells', nCells_g, 'longitude', &
'degrees_east', 1, nCellsSolve, lonCell(1:nCellsSolve)*rad2deg, map=gidx)
+ allocate(areaWeight(nCellsSolve), stat=ierr)
+ if( ierr /= 0 ) call endrun(subname//':failed to allocate area_weight :'//int2str(__LINE__))
+ call get_dyn_grid_info(hdim1_d, hdim2_d, num_levels, index_model_top_layer, index_surface_layer, unstructured, dyn_cols)
+
+
! Map for cell centers grid
allocate(grid_map(3, nCellsSolve), stat=ierr)
if( ierr /= 0 ) call endrun(subname//':failed to allocate grid_map array at line:'//int2str(__LINE__))
@@ -586,11 +600,19 @@ subroutine define_cam_grids()
grid_map(1, i) = i
grid_map(2, i) = 1
grid_map(3, i) = gidx(i)
+ areaWeight(i) = dyn_cols(i)%weight/(4.0_r8*PI)
end do
! cell center grid for I/O using MPAS names
call cam_grid_register('mpas_cell', dyn_decomp, lat_coord, lon_coord, &
grid_map, block_indexed=.false., unstruct=.true.)
+ call cam_grid_attribute_register('mpas_cell', 'area_cell', 'mpas cell areas', &
+ 'nCells', areaCell, map=gidx)
+ call cam_grid_attribute_register('mpas_cell', 'area_weight_mpas', 'mpas area weight', &
+ 'nCells', areaWeight, map=gidx)
+
+ nullify(areaWeight) ! areaWeight belongs to grid now
+ nullify(areaCell) ! areaCell belongs to grid now
! create new coordinates and grid using CAM names
lat_coord => horiz_coord_create('lat', 'ncol', nCells_g, 'latitude', &
@@ -603,6 +625,8 @@ subroutine define_cam_grids()
! gidx can be deallocated. Values are copied into the coordinate and attribute objects.
deallocate(gidx)
+ deallocate(dyn_cols)
+
! grid_map memory cannot be deallocated. The cam_filemap_t object just points
! to it. Pointer can be disassociated.
nullify(grid_map) ! Map belongs to grid now
diff --git a/src/dynamics/se/advect_tend.F90 b/src/dynamics/se/advect_tend.F90
index 856e3408a2..44ea0ff6f7 100644
--- a/src/dynamics/se/advect_tend.F90
+++ b/src/dynamics/se/advect_tend.F90
@@ -25,7 +25,7 @@ subroutine compute_adv_tends_xyz(elem,fvm,nets,nete,qn0,n0)
use cam_history, only: outfld, hist_fld_active
use time_manager, only: get_step_size
use constituents, only: tottnam,pcnst
- use dimensions_mod, only: nc,np,nlev,ntrac
+ use dimensions_mod, only: nc,np,nlev,use_cslam
use element_mod, only: element_t
use fvm_control_volume_mod, only: fvm_struct
implicit none
@@ -38,7 +38,7 @@ subroutine compute_adv_tends_xyz(elem,fvm,nets,nete,qn0,n0)
logical :: init
real(r8), allocatable, dimension(:,:) :: ftmp
- if (ntrac>0) then
+ if (use_cslam) then
nx=nc
else
nx=np
@@ -52,7 +52,7 @@ subroutine compute_adv_tends_xyz(elem,fvm,nets,nete,qn0,n0)
adv_tendxyz(:,:,:,:,:) = 0._r8
endif
- if (ntrac>0) then
+ if (use_cslam) then
do ie=nets,nete
do ic=1,pcnst
adv_tendxyz(:,:,:,ic,ie) = fvm(ie)%c(1:nc,1:nc,:,ic) - adv_tendxyz(:,:,:,ic,ie)
diff --git a/src/dynamics/se/dp_coupling.F90 b/src/dynamics/se/dp_coupling.F90
index 03132e8ccf..61b7fc54e9 100644
--- a/src/dynamics/se/dp_coupling.F90
+++ b/src/dynamics/se/dp_coupling.F90
@@ -54,10 +54,10 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out)
use phys_control, only: use_gw_front, use_gw_front_igw
use hycoef, only: hyai, ps0
use fvm_mapping, only: dyn2phys_vector, dyn2phys_all_vars
- use time_mod, only: timelevel_qdp
+ use se_dyn_time_mod, only: timelevel_qdp
use control_mod, only: qsplit
use test_fvm_mapping, only: test_mapping_overwrite_dyn_state, test_mapping_output_phys_state
-
+ use prim_advance_mod, only: tot_energy_dyn
! arguments
type(dyn_export_t), intent(inout) :: dyn_out ! dynamics export
type(physics_buffer_desc), pointer :: pbuf2d(:,:)
@@ -128,6 +128,8 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out)
allocate(q_tmp(nphys_pts,pver,pcnst,nelemd))
allocate(omega_tmp(nphys_pts,pver,nelemd))
+ call tot_energy_dyn(elem,dyn_out%fvm, 1, nelemd,tl_f , tl_qdp_np0,'dBF')
+
if (use_gw_front .or. use_gw_front_igw) then
allocate(frontgf(nphys_pts,pver,nelemd), stat=ierr)
if (ierr /= 0) call endrun("dp_coupling: Allocate of frontgf failed.")
@@ -377,9 +379,7 @@ subroutine p_d_coupling(phys_state, phys_tend, dyn_in, tl_f, tl_qdp)
end do
end do
end do
- call thermodynamic_consistency( &
- phys_state(lchnk), phys_tend(lchnk), ncols, pver, lchnk)
- end do
+ end do
call t_startf('pd_copy')
!$omp parallel do num_threads(max_num_threads) private (col_ind, lchnk, icol, ie, blk_ind, ilyr, m)
@@ -539,20 +539,24 @@ subroutine derived_phys_dry(phys_state, phys_tend, pbuf2d)
use constituents, only: qmin
use physconst, only: gravit, zvir
- use cam_thermo, only: cam_thermo_update
- use air_composition, only: cpairv, rairv, cappav
+ use cam_thermo, only: cam_thermo_dry_air_update, cam_thermo_water_update
+ use air_composition, only: thermodynamic_active_species_num
+ use air_composition, only: thermodynamic_active_species_idx
+ use air_composition, only: cpairv, rairv, cappav, dry_air_species_num
use shr_const_mod, only: shr_const_rwv
use phys_control, only: waccmx_is
use geopotential, only: geopotential_t
+ use static_energy, only: update_dry_static_energy_run
use check_energy, only: check_energy_timestep_init
use hycoef, only: hyai, ps0
use shr_vmath_mod, only: shr_vmath_log
use qneg_module, only: qneg3
-
+ use dyn_tests_utils, only: vc_dry_pressure
+ use shr_kind_mod, only: shr_kind_cx
! arguments
type(physics_state), intent(inout), dimension(begchunk:endchunk) :: phys_state
type(physics_tend ), intent(inout), dimension(begchunk:endchunk) :: phys_tend
- type(physics_buffer_desc), pointer :: pbuf2d(:,:)
+ type(physics_buffer_desc), pointer :: pbuf2d(:,:)
! local variables
integer :: lchnk
@@ -560,8 +564,12 @@ subroutine derived_phys_dry(phys_state, phys_tend, pbuf2d)
real(r8) :: zvirv(pcols,pver) ! Local zvir array pointer
real(r8) :: factor_array(pcols,nlev)
- integer :: m, i, k, ncol
+ integer :: m, i, k, ncol, m_cnst
type(physics_buffer_desc), pointer :: pbuf_chnk(:)
+
+ !Needed for "update_dry_static_energy" CCPP scheme
+ integer :: errflg
+ character(len=shr_kind_cx) :: errmsg
!----------------------------------------------------------------------------
! Evaluate derived quantities
@@ -602,13 +610,15 @@ subroutine derived_phys_dry(phys_state, phys_tend, pbuf2d)
end do
! wet pressure variables (should be removed from physics!)
-
- do k=1,nlev
- do i=1,ncol
- ! to be consistent with total energy formula in physic's check_energy module only
- ! include water vapor in in moist dp
- factor_array(i,k) = 1+phys_state(lchnk)%q(i,k,1)
- end do
+ factor_array(:,:) = 1.0_r8
+ do m_cnst=dry_air_species_num + 1,thermodynamic_active_species_num
+ m = thermodynamic_active_species_idx(m_cnst)
+ do k=1,nlev
+ do i=1,ncol
+ ! at this point all q's are dry
+ factor_array(i,k) = factor_array(i,k)+phys_state(lchnk)%q(i,k,m)
+ end do
+ end do
end do
do k=1,nlev
@@ -640,58 +650,59 @@ subroutine derived_phys_dry(phys_state, phys_tend, pbuf2d)
end do
end do
- ! all tracers (including moisture) are in dry mixing ratio units
- ! physics expect water variables moist
- factor_array(1:ncol,1:nlev) = 1/factor_array(1:ncol,1:nlev)
-
- do m = 1,pcnst
- if (cnst_type(m) == 'wet') then
- do k = 1, nlev
- do i = 1, ncol
- phys_state(lchnk)%q(i,k,m) = factor_array(i,k)*phys_state(lchnk)%q(i,k,m)
- end do
- end do
- end if
- end do
-
- if ( waccmx_is('ionosphere') .or. waccmx_is('neutral') ) then
- !------------------------------------------------------------
- ! Apply limiters to mixing ratios of major species
- !------------------------------------------------------------
+ !------------------------------------------------------------
+ ! Apply limiters to mixing ratios of major species (waccmx)
+ !------------------------------------------------------------
+ if (dry_air_species_num>0) then
call physics_cnst_limit( phys_state(lchnk) )
!-----------------------------------------------------------------------------
- ! Call cam_thermo_update to compute cpairv, rairv, mbarv, and cappav as
+ ! Call cam_thermo_dry_air_update to compute cpairv, rairv, mbarv, and cappav as
! constituent dependent variables.
! Compute molecular viscosity(kmvis) and conductivity(kmcnd).
! Fill local zvirv variable; calculated for WACCM-X.
!-----------------------------------------------------------------------------
- call cam_thermo_update(phys_state(lchnk)%q, phys_state(lchnk)%t, lchnk, ncol,&
- to_moist_factor=phys_state(lchnk)%pdeldry(:ncol,:)/phys_state(lchnk)%pdel(:ncol,:) )
+ call cam_thermo_dry_air_update(phys_state(lchnk)%q, phys_state(lchnk)%t, lchnk, ncol)
zvirv(:,:) = shr_const_rwv / rairv(:,:,lchnk) -1._r8
else
zvirv(:,:) = zvir
- endif
-
+ end if
+ !
+ ! update cp_dycore in module air_composition.
+ ! (note: at this point q is dry)
+ !
+ call cam_thermo_water_update(phys_state(lchnk)%q(1:ncol,:,:), lchnk, ncol, vc_dry_pressure)
do k = 1, nlev
do i = 1, ncol
phys_state(lchnk)%exner(i,k) = (phys_state(lchnk)%pint(i,pver+1) &
/ phys_state(lchnk)%pmid(i,k))**cappav(i,k,lchnk)
end do
end do
+ !
+ ! CAM physics: water tracers are moist; the rest dry
+ !
+ factor_array(1:ncol,1:nlev) = 1._r8/factor_array(1:ncol,1:nlev)
+ do m = 1,pcnst
+ if (cnst_type(m) == 'wet') then
+ do k = 1, nlev
+ do i = 1, ncol
+ phys_state(lchnk)%q(i,k,m) = factor_array(i,k)*phys_state(lchnk)%q(i,k,m)
+ end do
+ end do
+ end if
+ end do
! Compute initial geopotential heights - based on full pressure
- call geopotential_t (phys_state(lchnk)%lnpint, phys_state(lchnk)%lnpmid , phys_state(lchnk)%pint , &
- phys_state(lchnk)%pmid , phys_state(lchnk)%pdel , phys_state(lchnk)%rpdel , &
- phys_state(lchnk)%t , phys_state(lchnk)%q(:,:,1), rairv(:,:,lchnk), gravit, zvirv , &
- phys_state(lchnk)%zi , phys_state(lchnk)%zm , ncol )
+ call geopotential_t(phys_state(lchnk)%lnpint, phys_state(lchnk)%lnpmid , phys_state(lchnk)%pint, &
+ phys_state(lchnk)%pmid , phys_state(lchnk)%pdel , phys_state(lchnk)%rpdel , &
+ phys_state(lchnk)%t , phys_state(lchnk)%q(:,:,:), rairv(:,:,lchnk), gravit, zvirv , &
+ phys_state(lchnk)%zi , phys_state(lchnk)%zm , ncol)
! Compute initial dry static energy, include surface geopotential
- do k = 1, pver
- do i = 1, ncol
- phys_state(lchnk)%s(i,k) = cpairv(i,k,lchnk)*phys_state(lchnk)%t(i,k) &
- + gravit*phys_state(lchnk)%zm(i,k) + phys_state(lchnk)%phis(i)
- end do
- end do
+ call update_dry_static_energy_run(pver, gravit, phys_state(lchnk)%t(1:ncol,:), &
+ phys_state(lchnk)%zm(1:ncol,:), &
+ phys_state(lchnk)%phis(1:ncol), &
+ phys_state(lchnk)%s(1:ncol,:), &
+ cpairv(1:ncol,:,lchnk), errflg, errmsg)
! Ensure tracers are all positive
call qneg3('D_P_COUPLING',lchnk ,ncol ,pcols ,pver , &
@@ -705,40 +716,4 @@ subroutine derived_phys_dry(phys_state, phys_tend, pbuf2d)
end do ! lchnk
end subroutine derived_phys_dry
-
-!=========================================================================================
-
-subroutine thermodynamic_consistency(phys_state, phys_tend, ncols, pver, lchnk)
- !
- ! Adjust the physics temperature tendency for thermal energy consistency with the
- ! dynamics.
- ! Note: mixing ratios are assumed to be dry.
- !
- use dimensions_mod, only: lcp_moist
- use air_composition, only: get_cp
- use control_mod, only: phys_dyn_cp
- use air_composition, only: cpairv
-
- type(physics_state), intent(in) :: phys_state
- type(physics_tend ), intent(inout) :: phys_tend
- integer, intent(in) :: ncols, pver, lchnk
-
- real(r8):: inv_cp(ncols,pver)
- !----------------------------------------------------------------------------
-
- if (lcp_moist.and.phys_dyn_cp==1) then
- !
- ! scale temperature tendency so that thermal energy increment from physics
- ! matches SE (not taking into account dme adjust)
- !
- ! note that if lcp_moist=.false. then there is thermal energy increment
- ! consistency (not taking into account dme adjust)
- !
- call get_cp(phys_state%q(1:ncols,1:pver,:), .true., inv_cp)
- phys_tend%dtdt(1:ncols,1:pver) = phys_tend%dtdt(1:ncols,1:pver) * cpairv(1:ncols,1:pver,lchnk) * inv_cp
- end if
-end subroutine thermodynamic_consistency
-
-!=========================================================================================
-
end module dp_coupling
diff --git a/src/dynamics/se/dycore/control_mod.F90 b/src/dynamics/se/dycore/control_mod.F90
index 0ecc2079d5..053f478c6a 100644
--- a/src/dynamics/se/dycore/control_mod.F90
+++ b/src/dynamics/se/dycore/control_mod.F90
@@ -23,9 +23,6 @@ module control_mod
! every rsplit tracer timesteps
logical, public :: variable_nsplit=.false.
- integer, public :: phys_dyn_cp = 1 !=0; no thermal energy scaling of T increment
- !=1; scale increment for cp consistency between dynamics and physics
-
logical, public :: refined_mesh
integer, public :: vert_remap_q_alg = 10
@@ -127,5 +124,7 @@ module control_mod
real(r8), public :: molecular_diff = -1.0_r8
integer, public :: vert_remap_uvTq_alg, vert_remap_tracer_alg
-
+
+
+ integer, public :: pgf_formulation = -1 !PGF formulation - see prim_advance_mod.F90
end module control_mod
diff --git a/src/dynamics/se/dycore/dimensions_mod.F90 b/src/dynamics/se/dycore/dimensions_mod.F90
index 8a41ea30c3..eb1564600c 100644
--- a/src/dynamics/se/dycore/dimensions_mod.F90
+++ b/src/dynamics/se/dycore/dimensions_mod.F90
@@ -15,7 +15,6 @@ module dimensions_mod
#else
integer, parameter :: ntrac_d = 0 ! No fvm tracers if CSLAM is off
#endif
-
!
! The variables below hold indices of water vapor and condensate loading tracers as well as
! associated heat capacities (initialized in dyn_init):
@@ -31,20 +30,14 @@ module dimensions_mod
!
character(len=16), allocatable, public :: cnst_name_gll(:) ! constituent names for SE tracers
character(len=128), allocatable, public :: cnst_longname_gll(:) ! long name of SE tracers
- !
- !moist cp in energy conversion term
- !
- ! .false.: force dycore to use cpd (cp dry) instead of moist cp
- ! .true. : use moist cp in dycore
- !
- logical , public :: lcp_moist = .true.
-
+
integer, parameter, public :: np = NP
integer, parameter, public :: nc = 3 !cslam resolution
integer , public :: fv_nphys !physics-grid resolution - the "MAX" is so that the code compiles with NC=0
- integer :: ntrac = 0 !ntrac is set in dyn_comp
- integer :: qsize = 0 !qsize is set in dyn_comp
+ integer :: ntrac = 0 !ntrac is set in dyn_comp
+ logical, public :: use_cslam = .false. !logical for CSLAM
+ integer :: qsize = 0 !qsize is set in dyn_comp
!
! fvm dimensions:
logical, public :: lprint!for debugging
diff --git a/src/dynamics/se/dycore/fvm_consistent_se_cslam.F90 b/src/dynamics/se/dycore/fvm_consistent_se_cslam.F90
index ede1f44059..5da18d76b8 100644
--- a/src/dynamics/se/dycore/fvm_consistent_se_cslam.F90
+++ b/src/dynamics/se/dycore/fvm_consistent_se_cslam.F90
@@ -6,7 +6,7 @@ module fvm_consistent_se_cslam
use cam_abortutils, only: endrun
use cam_logfile, only: iulog
- use time_mod, only: timelevel_t
+ use se_dyn_time_mod, only: timelevel_t
use element_mod, only: element_t
use fvm_control_volume_mod, only: fvm_struct
use hybrid_mod, only: hybrid_t, config_thread_region, get_loop_ranges, threadOwnsVertLevel
@@ -44,7 +44,7 @@ subroutine run_consistent_se_cslam(elem,fvm,hybrid,dt_fvm,tl,nets,nete,hvcoord,&
use thread_mod , only: vert_num_threads, omp_set_nested
implicit none
type (element_t) , intent(inout) :: elem(:)
- type (fvm_struct) , intent(inout) :: fvm(:)
+ type (fvm_struct), target , intent(inout) :: fvm(:)
type (hybrid_t) , intent(in) :: hybrid ! distributed parallel structure (shared)
type (TimeLevel_t) , intent(in) :: tl ! time level struct
type (hvcoord_t) , intent(in) :: hvcoord
@@ -71,7 +71,9 @@ subroutine run_consistent_se_cslam(elem,fvm,hybrid,dt_fvm,tl,nets,nete,hvcoord,&
integer :: region_num_threads
logical :: inJetCall
logical :: ActiveJetThread
-
+
+ real(r8), pointer :: fcube(:,:,:,:)
+ real(r8), pointer :: spherecentroid(:,:,:)
llimiter = .true.
@@ -152,22 +154,26 @@ subroutine run_consistent_se_cslam(elem,fvm,hybrid,dt_fvm,tl,nets,nete,hvcoord,&
!call t_stopf('fvm:orthogonal_swept_areas')
do ie=nets,nete
+ ! Intel compiler version 2023.0.0 on derecho had significant slowdown on subroutine interface without
+ ! these pointers.
+ fcube => fvm(ie)%c(:,:,:,:)
+ spherecentroid => fvm(ie)%spherecentroid(:,1-nhe:nc+nhe,1-nhe:nc+nhe)
do k=kmin,kmax
- !call t_startf('fvm:tracers_reconstruct')
- call reconstruction(fvm(ie)%c(:,:,:,:),nlev,k,&
+ !call t_startf('FVM:tracers_reconstruct')
+ call reconstruction(fcube,nlev,k,&
ctracer(:,:,:,:),irecons_tracer,llimiter,ntrac,&
nc,nhe,nhr,nhc,nht,ns,nhr+(nhe-1),&
fvm(ie)%jx_min,fvm(ie)%jx_max,fvm(ie)%jy_min,fvm(ie)%jy_max,&
fvm(ie)%cubeboundary,fvm(ie)%halo_interp_weight,fvm(ie)%ibase,&
- fvm(ie)%spherecentroid(:,1-nhe:nc+nhe,1-nhe:nc+nhe),&
+ spherecentroid,&
fvm(ie)%recons_metrics,fvm(ie)%recons_metrics_integral,&
fvm(ie)%rot_matrix,fvm(ie)%centroid_stretch,&
fvm(ie)%vertex_recons_weights,fvm(ie)%vtx_cart,&
irecons_tracer_lev(k))
- !call t_stopf('fvm:tracers_reconstruct')
- !call t_startf('fvm:swept_flux')
- call swept_flux(elem(ie),fvm(ie),k,ctracer,irecons_tracer_lev(k),gsweights,gspts)
- !call t_stopf('fvm:swept_flux')
+ !call t_stopf('FVM:tracers_reconstruct')
+ !call t_startf('fvm:swept_flux')
+ call swept_flux(elem(ie),fvm(ie),k,ctracer,irecons_tracer_lev(k),gsweights,gspts)
+ !call t_stopf('fvm:swept_flux')
end do
end do
!
diff --git a/src/dynamics/se/dycore/fvm_mapping.F90 b/src/dynamics/se/dycore/fvm_mapping.F90
index f8dbaabda0..f52d961be5 100644
--- a/src/dynamics/se/dycore/fvm_mapping.F90
+++ b/src/dynamics/se/dycore/fvm_mapping.F90
@@ -34,6 +34,12 @@ module fvm_mapping
real(kind=r8), allocatable, dimension(:,:,:,:) :: save_overlap_area
integer , allocatable, dimension(:,:,:,:,:) :: save_overlap_idx
integer , allocatable, dimension(:,:,:,:) :: save_num_overlap
+
+ interface fvm2dyn
+ module procedure fvm2dynt1
+ module procedure fvm2dyntn
+ end interface fvm2dyn
+
contains
!
! map all mass variables from gll to fvm
@@ -220,7 +226,8 @@ subroutine phys2dyn_forcings_fvm(elem, fvm, hybrid,nets,nete,no_cslam, tl_f, tl_
deallocate(fld_phys,llimiter,fld_gll,qgll)
end subroutine phys2dyn_forcings_fvm
- subroutine fvm2dyn(fld_fvm,fld_gll,hybrid,nets,nete,numlev,num_flds,fvm,llimiter)
+ ! for multiple fields
+ subroutine fvm2dyntn(fld_fvm,fld_gll,hybrid,nets,nete,numlev,num_flds,fvm,llimiter)
use dimensions_mod, only: np, nhc, nc
use hybrid_mod , only: hybrid_t
use bndry_mod , only: ghost_exchange
@@ -244,7 +251,7 @@ subroutine fvm2dyn(fld_fvm,fld_gll,hybrid,nets,nete,numlev,num_flds,fvm,llimiter
do ie=nets,nete
call ghostpack(ghostBufQnhc_s, fld_fvm(:,:,:,:,ie),numlev*num_flds,0,ie)
end do
- call ghost_exchange(hybrid,ghostbufQnhc_s,location='fvm2dyn')
+ call ghost_exchange(hybrid,ghostbufQnhc_s,location='fvm2dyntn')
do ie=nets,nete
call ghostunpack(ghostbufQnhc_s, fld_fvm(:,:,:,:,ie),numlev*num_flds,0,ie)
end do
@@ -257,7 +264,46 @@ subroutine fvm2dyn(fld_fvm,fld_gll,hybrid,nets,nete,numlev,num_flds,fvm,llimiter
call tensor_lagrange_interp(fvm(ie)%cubeboundary,np,nc,nhc,numlev,num_flds,fld_fvm(:,:,:,:,ie),&
fld_gll(:,:,:,:,ie),llimiter,iwidth,fvm(ie)%norm_elem_coord)
end do
- end subroutine fvm2dyn
+ end subroutine fvm2dyntn
+
+ ! for single field
+ subroutine fvm2dynt1(fld_fvm,fld_gll,hybrid,nets,nete,numlev,fvm,llimiter)
+ use dimensions_mod, only: np, nhc, nc
+ use hybrid_mod , only: hybrid_t
+ use bndry_mod , only: ghost_exchange
+ use edge_mod , only: ghostpack,ghostunpack
+ use fvm_mod , only: ghostBufQnhc_t1
+ !
+ integer , intent(in) :: nets,nete,numlev
+ real (kind=r8), intent(inout) :: fld_fvm(1-nhc:nc+nhc,1-nhc:nc+nhc,numlev,1,nets:nete)
+ real (kind=r8), intent(out) :: fld_gll(np,np,numlev,1,nets:nete)
+ type (hybrid_t) , intent(in) :: hybrid
+ type(fvm_struct) , intent(in) :: fvm(nets:nete)
+ logical , intent(in) :: llimiter(1)
+ integer :: ie, iwidth
+ !
+ !*********************************************
+ !
+ ! halo exchange
+ !
+ !*********************************************
+ !
+ do ie=nets,nete
+ call ghostpack(ghostBufQnhc_t1, fld_fvm(:,:,:,1,ie),numlev,0,ie)
+ end do
+ call ghost_exchange(hybrid,ghostbufQnhc_t1,location='fvm2dynt1')
+ do ie=nets,nete
+ call ghostunpack(ghostbufQnhc_t1, fld_fvm(:,:,:,1,ie),numlev,0,ie)
+ end do
+ !
+ ! mapping
+ !
+ iwidth=2
+ do ie=nets,nete
+ call tensor_lagrange_interp(fvm(ie)%cubeboundary,np,nc,nhc,numlev,1,fld_fvm(:,:,:,:,ie),&
+ fld_gll(:,:,:,:,ie),llimiter,iwidth,fvm(ie)%norm_elem_coord)
+ end do
+ end subroutine fvm2dynt1
subroutine fill_halo_phys(fld_phys,hybrid,nets,nete,num_lev,num_flds)
@@ -451,7 +497,7 @@ subroutine dyn2phys_all_vars(nets,nete,elem,fvm,&
tmp = 1.0_r8
inv_area = 1.0_r8/dyn2phys(tmp,elem(ie)%metdet(:,:))
phis_phys(:,ie) = RESHAPE(dyn2phys(elem(ie)%state%phis(:,:),elem(ie)%metdet(:,:),inv_area),SHAPE(phis_phys(:,ie)))
- ps_phys(:,ie) = ptop
+ ps_phys(:,ie) = ptop
if (nc.ne.fv_nphys) then
tmp = 1.0_r8
do k=1,nlev
diff --git a/src/dynamics/se/dycore/fvm_mod.F90 b/src/dynamics/se/dycore/fvm_mod.F90
index 93aa41a008..309a101ba2 100644
--- a/src/dynamics/se/dycore/fvm_mod.F90
+++ b/src/dynamics/se/dycore/fvm_mod.F90
@@ -26,6 +26,7 @@ module fvm_mod
type (EdgeBuffer_t) :: edgeveloc
type (EdgeBuffer_t), public :: ghostBufQnhc_s
+ type (EdgeBuffer_t), public :: ghostBufQnhc_t1
type (EdgeBuffer_t), public :: ghostBufQnhc_vh
type (EdgeBuffer_t), public :: ghostBufQnhc_h
type (EdgeBuffer_t), public :: ghostBufQ1_h
@@ -290,14 +291,14 @@ subroutine fvm_init1(par,elem)
use control_mod, only: rsplit
use dimensions_mod, only: qsize, qsize_d
use dimensions_mod, only: fvm_supercycling, fvm_supercycling_jet
- use dimensions_mod, only: nc,nhe, nhc, nlev,ntrac, ntrac_d,ns, nhr
+ use dimensions_mod, only: nc,nhe, nhc, nlev,ntrac, ntrac_d,ns, nhr, use_cslam
use dimensions_mod, only: large_Courant_incr
use dimensions_mod, only: kmin_jet,kmax_jet
type (parallel_t) :: par
type (element_t),intent(inout) :: elem(:)
!
- if (ntrac>0) then
+ if (use_cslam) then
if (par%masterproc) then
write(iulog,*) " "
write(iulog,*) "|-----------------------------------------|"
@@ -305,7 +306,7 @@ subroutine fvm_init1(par,elem)
write(iulog,*) "|-----------------------------------------|"
write(iulog,*) " "
end if
- if (ntrac>0) then
+ if (use_cslam) then
if (par%masterproc) then
write(iulog,*) "Running consistent SE-CSLAM, Lauritzen et al. (2017, MWR)."
write(iulog,*) "CSLAM = Conservative Semi-LAgrangian Multi-tracer scheme"
@@ -487,6 +488,7 @@ subroutine fvm_init2(elem,fvm,hybrid,nets,nete)
! changes the values for reverse
call initghostbuffer(hybrid%par,ghostBufQnhc_s,elem,nlev*(ntrac+1),nhc,nc,nthreads=1)
+ call initghostbuffer(hybrid%par,ghostBufQnhc_t1,elem,nlev, nhc,nc,nthreads=1)
call initghostbuffer(hybrid%par,ghostBufQnhc_h,elem,nlev*(ntrac+1),nhc,nc,nthreads=horz_num_threads)
call initghostbuffer(hybrid%par,ghostBufQnhc_vh,elem,nlev*(ntrac+1),nhc,nc,nthreads=vert_num_threads*horz_num_threads)
klev = kmax_jet-kmin_jet+1
@@ -517,8 +519,8 @@ end subroutine fvm_init2
subroutine fvm_init3(elem,fvm,hybrid,nets,nete,irecons)
use control_mod , only: neast, nwest, seast, swest
use fvm_analytic_mod, only: compute_reconstruct_matrix
- use dimensions_mod , only: fv_nphys
- use dimensions_mod, only: nlev, nc, nhe, nlev, ntrac, ntrac_d,nhc
+ use dimensions_mod , only: fv_nphys, use_cslam
+ use dimensions_mod, only: nlev, nc, nhe, nlev, nhc
use coordinate_systems_mod, only: cartesian2D_t,cartesian3D_t
use coordinate_systems_mod, only: cubedsphere2cart, cart2cubedsphere
implicit none
@@ -536,7 +538,7 @@ subroutine fvm_init3(elem,fvm,hybrid,nets,nete,irecons)
type (cartesian2D_t) :: gnom
type(cartesian3D_t) :: tmpcart3d
- if (ntrac>0.and.nc.ne.fv_nphys) then
+ if (use_cslam.and.nc.ne.fv_nphys) then
!
! fill the fvm halo for mapping in d_p_coupling if
! physics grid resolution is different than fvm resolution
@@ -728,7 +730,6 @@ subroutine fvm_pg_init(elem, fvm, hybrid, nets, nete,irecons)
use control_mod, only : neast, nwest, seast, swest
use coordinate_systems_mod, only : cubedsphere2cart, cart2cubedsphere
use dimensions_mod, only: fv_nphys, nhe_phys,nhc_phys
- use dimensions_mod, only: ntrac_d
use cube_mod ,only: dmap
use control_mod ,only: cubed_sphere_map
use fvm_analytic_mod, only: compute_reconstruct_matrix
diff --git a/src/dynamics/se/dycore/global_norms_mod.F90 b/src/dynamics/se/dycore/global_norms_mod.F90
index de295da01a..17e773d99c 100644
--- a/src/dynamics/se/dycore/global_norms_mod.F90
+++ b/src/dynamics/se/dycore/global_norms_mod.F90
@@ -24,26 +24,27 @@ module global_norms_mod
private :: global_maximum
type (EdgeBuffer_t), private :: edgebuf
+ interface global_integral
+ module procedure global_integral_elem
+ module procedure global_integral_fvm
+ end interface global_integral
+
contains
- subroutine global_integrals(elem, h,hybrid,npts,num_flds,nets,nete,I_sphere)
+ subroutine global_integrals(elem,fld,hybrid,npts,num_flds,nets,nete,I_sphere)
use hybrid_mod, only: hybrid_t
use element_mod, only: element_t
- use dimensions_mod, only: np, nelemd
+ use dimensions_mod, only: np
use physconst, only: pi
use parallel_mod, only: global_shared_buf, global_shared_sum
type(element_t) , intent(in) :: elem(:)
integer , intent(in) :: npts,nets,nete,num_flds
- real (kind=r8), intent(in) :: h(npts,npts,num_flds,nets:nete)
+ real (kind=r8), intent(in) :: fld(npts,npts,num_flds,nets:nete)
type (hybrid_t) , intent(in) :: hybrid
real (kind=r8) :: I_sphere(num_flds)
-
- real (kind=r8) :: I_priv
- real (kind=r8) :: I_shared
- common /gblintcom/I_shared
!
! Local variables
!
@@ -57,13 +58,12 @@ subroutine global_integrals(elem, h,hybrid,npts,num_flds,nets,nete,I_sphere)
!
J_tmp = 0.0_r8
-!JMD print *,'global_integral: before loop'
do ie=nets,nete
do q=1,num_flds
do j=1,np
do i=1,np
da = elem(ie)%mp(i,j)*elem(ie)%metdet(i,j)
- J_tmp(ie,q) = J_tmp(ie,q) + da*h(i,j,q,ie)
+ J_tmp(ie,q) = J_tmp(ie,q) + da*fld(i,j,q,ie)
end do
end do
end do
@@ -71,28 +71,21 @@ subroutine global_integrals(elem, h,hybrid,npts,num_flds,nets,nete,I_sphere)
do ie=nets,nete
global_shared_buf(ie,1:num_flds) = J_tmp(ie,:)
enddo
- !JMD print *,'global_integral: before wrap_repro_sum'
call wrap_repro_sum(nvars=num_flds, comm=hybrid%par%comm)
- !JMD print *,'global_integral: after wrap_repro_sum'
I_sphere(:) =global_shared_sum(1:num_flds) /(4.0_r8*PI)
end subroutine global_integrals
- subroutine global_integrals_general(h,hybrid,npts,da,num_flds,nets,nete,I_sphere)
+ subroutine global_integrals_general(fld,hybrid,npts,da,num_flds,nets,nete,I_sphere)
use hybrid_mod, only: hybrid_t
- use dimensions_mod, only: nc, nelemd
use physconst, only: pi
use parallel_mod, only: global_shared_buf, global_shared_sum
integer, intent(in) :: npts,nets,nete,num_flds
- real (kind=r8), intent(in) :: h(npts,npts,num_flds,nets:nete)
+ real (kind=r8), intent(in) :: fld(npts,npts,num_flds,nets:nete)
type (hybrid_t), intent(in) :: hybrid
real (kind=r8), intent(in) :: da(npts,npts,nets:nete)
real (kind=r8) :: I_sphere(num_flds)
-
- real (kind=r8) :: I_priv
- real (kind=r8) :: I_shared
- common /gblintcom/I_shared
!
! Local variables
!
@@ -105,12 +98,11 @@ subroutine global_integrals_general(h,hybrid,npts,da,num_flds,nets,nete,I_sphere
!
J_tmp = 0.0_r8
-!JMD print *,'global_integral: before loop'
do ie=nets,nete
do q=1,num_flds
do j=1,npts
do i=1,npts
- J_tmp(ie,q) = J_tmp(ie,q) + da(i,j,ie)*h(i,j,q,ie)
+ J_tmp(ie,q) = J_tmp(ie,q) + da(i,j,ie)*fld(i,j,q,ie)
end do
end do
end do
@@ -118,9 +110,7 @@ subroutine global_integrals_general(h,hybrid,npts,da,num_flds,nets,nete,I_sphere
do ie=nets,nete
global_shared_buf(ie,1:num_flds) = J_tmp(ie,:)
enddo
- !JMD print *,'global_integral: before wrap_repro_sum'
call wrap_repro_sum(nvars=num_flds, comm=hybrid%par%comm)
- !JMD print *,'global_integral: after wrap_repro_sum'
I_sphere(:) =global_shared_sum(1:num_flds) /(4.0_r8*PI)
end subroutine global_integrals_general
@@ -133,24 +123,20 @@ end subroutine global_integrals_general
!
! ================================
! --------------------------
- function global_integral(elem, h,hybrid,npts,nets,nete) result(I_sphere)
+ function global_integral_elem(elem,fld,hybrid,npts,nets,nete) result(I_sphere)
use hybrid_mod, only: hybrid_t
use element_mod, only: element_t
- use dimensions_mod, only: np, nelemd
+ use dimensions_mod, only: np
use physconst, only: pi
use parallel_mod, only: global_shared_buf, global_shared_sum
type(element_t) , intent(in) :: elem(:)
integer , intent(in) :: npts,nets,nete
- real (kind=r8), intent(in) :: h(npts,npts,nets:nete)
+ real (kind=r8), intent(in) :: fld(npts,npts,nets:nete)
type (hybrid_t) , intent(in) :: hybrid
real (kind=r8) :: I_sphere
- real (kind=r8) :: I_priv
- real (kind=r8) :: I_shared
- common /gblintcom/I_shared
-
! Local variables
integer :: ie,j,i
@@ -159,31 +145,69 @@ function global_integral(elem, h,hybrid,npts,nets,nete) result(I_sphere)
real (kind=r8) :: da
real (kind=r8) :: J_tmp(nets:nete)
!
-! This algorythm is independent of thread count and task count.
+! This algorithm is independent of thread count and task count.
! This is a requirement of consistancy checking in cam.
!
J_tmp = 0.0_r8
-!JMD print *,'global_integral: before loop'
do ie=nets,nete
do j=1,np
do i=1,np
da = elem(ie)%mp(i,j)*elem(ie)%metdet(i,j)
- J_tmp(ie) = J_tmp(ie) + da*h(i,j,ie)
+ J_tmp(ie) = J_tmp(ie) + da*fld(i,j,ie)
end do
end do
end do
do ie=nets,nete
global_shared_buf(ie,1) = J_tmp(ie)
enddo
-!JMD print *,'global_integral: before wrap_repro_sum'
call wrap_repro_sum(nvars=1, comm=hybrid%par%comm)
-!JMD print *,'global_integral: after wrap_repro_sum'
I_tmp = global_shared_sum(1)
-!JMD print *,'global_integral: after global_shared_sum'
I_sphere = I_tmp(1)/(4.0_r8*PI)
- end function global_integral
+ end function global_integral_elem
+
+ function global_integral_fvm(fvm,fld,hybrid,npts,nets,nete) result(I_sphere)
+ use hybrid_mod, only: hybrid_t
+ use fvm_control_volume_mod, only: fvm_struct
+ use physconst, only: pi
+ use parallel_mod, only: global_shared_buf, global_shared_sum
+
+ type (fvm_struct) , intent(in) :: fvm(:)
+ integer , intent(in) :: npts,nets,nete
+ real (kind=r8), intent(in) :: fld(npts,npts,nets:nete)
+ type (hybrid_t) , intent(in) :: hybrid
+
+ real (kind=r8) :: I_sphere
+
+ ! Local variables
+
+ integer :: ie,j,i
+ real(kind=r8) :: I_tmp(1)
+
+ real (kind=r8) :: da
+ real (kind=r8) :: J_tmp(nets:nete)
+!
+! This algorithm is independent of thread count and task count.
+! This is a requirement of consistancy checking in cam.
+!
+ J_tmp = 0.0_r8
+ do ie=nets,nete
+ do j=1,npts
+ do i=1,npts
+ da = fvm(ie)%area_sphere(i,j)
+ J_tmp(ie) = J_tmp(ie) + da*fld(i,j,ie)
+ end do
+ end do
+ end do
+ do ie=nets,nete
+ global_shared_buf(ie,1) = J_tmp(ie)
+ enddo
+ call wrap_repro_sum(nvars=1, comm=hybrid%par%comm)
+ I_tmp = global_shared_sum(1)
+ I_sphere = I_tmp(1)/(4.0_r8*PI)
+
+ end function global_integral_fvm
!------------------------------------------------------------------------------------
@@ -205,23 +229,22 @@ subroutine print_cfl(elem,hybrid,nets,nete,dtnu,ptop,pmid,&
! worse viscosity CFL (given by dtnu) is not violated by reducing
! viscosity coefficient in regions where CFL is violated
!
- use hybrid_mod, only: hybrid_t, PrintHybrid
+ use hybrid_mod, only: hybrid_t
use element_mod, only: element_t
- use dimensions_mod, only: np,ne,nelem,nelemd,nc,nhe,qsize,ntrac,nlev,large_Courant_incr
+ use dimensions_mod, only: np,ne,nelem,nc,nhe,use_cslam,nlev,large_Courant_incr
use dimensions_mod, only: nu_scale_top,nu_div_lev,nu_lev,nu_t_lev
use quadrature_mod, only: gausslobatto, quadrature_t
use reduction_mod, only: ParallelMin,ParallelMax
use physconst, only: ra, rearth, pi
- use control_mod, only: nu, nu_div, nu_q, nu_p, nu_t, nu_top, fine_ne, rk_stage_user, max_hypervis_courant
+ use control_mod, only: nu, nu_div, nu_q, nu_p, nu_t, nu_top, fine_ne, max_hypervis_courant
use control_mod, only: tstep_type, hypervis_power, hypervis_scaling
use control_mod, only: sponge_del4_nu_div_fac, sponge_del4_nu_fac, sponge_del4_lev
use cam_abortutils, only: endrun
use parallel_mod, only: global_shared_buf, global_shared_sum
use edge_mod, only: initedgebuffer, FreeEdgeBuffer, edgeVpack, edgeVunpack
use bndry_mod, only: bndry_exchange
- use time_mod, only: tstep
use mesh_mod, only: MeshUseMeshFile
use dimensions_mod, only: ksponge_end, kmvis_ref, kmcnd_ref,rho_ref
use physconst, only: cpair
@@ -241,14 +264,14 @@ subroutine print_cfl(elem,hybrid,nets,nete,dtnu,ptop,pmid,&
real (kind=r8) :: max_min_dx,min_min_dx,min_max_dx,max_unif_dx ! used for normalizing scalar HV
real (kind=r8) :: max_normDinv, min_normDinv ! used for CFL
real (kind=r8) :: min_area, max_area,max_ratio !min/max element area
- real (kind=r8) :: avg_area, avg_min_dx
+ real (kind=r8) :: avg_area, avg_min_dx,tot_area,tot_area_rad
real (kind=r8) :: min_hypervis, max_hypervis, avg_hypervis, stable_hv
real (kind=r8) :: normDinv_hypervis
real (kind=r8) :: x, y, noreast, nw, se, sw
real (kind=r8), dimension(np,np,nets:nete) :: zeta
real (kind=r8) :: lambda_max, lambda_vis, min_gw, lambda,umax, ugw
- real (kind=r8) :: scale1,scale2,scale3, max_laplace,z(nlev)
- integer :: ie,corner, i, j, rowind, colind, k
+ real (kind=r8) :: scale1, max_laplace,z(nlev)
+ integer :: ie, i, j, rowind, colind, k
type (quadrature_t) :: gp
character(LEN=256) :: rk_str
@@ -257,7 +280,7 @@ subroutine print_cfl(elem,hybrid,nets,nete,dtnu,ptop,pmid,&
real (kind=r8) :: dt_max_hypervis, dt_max_hypervis_tracer, dt_max_laplacian_top
real(kind=r8) :: I_sphere, nu_max, nu_div_max
- real(kind=r8) :: h(np,np,nets:nete)
+ real(kind=r8) :: fld(np,np,nets:nete)
logical :: top_000_032km, top_032_042km, top_042_090km, top_090_140km, top_140_600km ! model top location ranges
logical :: nu_set,div_set,lev_set
@@ -312,9 +335,9 @@ subroutine print_cfl(elem,hybrid,nets,nete,dtnu,ptop,pmid,&
!
!******************************************************************************************
!
- h(:,:,nets:nete)=1.0_r8
+ fld(:,:,nets:nete)=1.0_r8
! Calculate surface area by integrating 1.0_r8 over sphere and dividing by 4*PI (Should be 1)
- I_sphere = global_integral(elem, h(:,:,nets:nete),hybrid,np,nets,nete)
+ I_sphere = global_integral(elem, fld(:,:,nets:nete),hybrid,np,nets,nete)
min_normDinv = 1E99_r8
max_normDinv = 0
@@ -341,6 +364,7 @@ subroutine print_cfl(elem,hybrid,nets,nete,dtnu,ptop,pmid,&
enddo
call wrap_repro_sum(nvars=2, comm=hybrid%par%comm)
avg_area = global_shared_sum(1)/dble(nelem)
+ tot_area_rad = global_shared_sum(1)
avg_min_dx = global_shared_sum(2)/dble(nelem)
min_area = ParallelMin(min_area,hybrid)
@@ -351,16 +375,19 @@ subroutine print_cfl(elem,hybrid,nets,nete,dtnu,ptop,pmid,&
max_min_dx = ParallelMax(max_min_dx,hybrid)
min_max_dx = ParallelMin(min_max_dx,hybrid)
max_ratio = ParallelMax(max_ratio,hybrid)
- ! Physical units for area
- min_area = min_area*rearth*rearth/1000000._r8
- max_area = max_area*rearth*rearth/1000000._r8
- avg_area = avg_area*rearth*rearth/1000000._r8
+ ! Physical units for area (unit sphere to Earth sphere)
+ min_area = min_area*rearth*rearth/1000000._r8 !m2 (rearth is in units of km)
+ max_area = max_area*rearth*rearth/1000000._r8 !m2 (rearth is in units of km)
+ avg_area = avg_area*rearth*rearth/1000000._r8 !m2 (rearth is in units of km)
+ tot_area = tot_area_rad*rearth*rearth/1000000._r8!m2 (rearth is in units of km)
if (hybrid%masterthread) then
write(iulog,* )""
write(iulog,* )"Running Global Integral Diagnostic..."
write(iulog,*)"Area of unit sphere is",I_sphere
write(iulog,*)"Should be 1.0 to round off..."
write(iulog,'(a,f9.3)') 'Element area: max/min',(max_area/min_area)
+ write(iulog,'(a,E23.15)') 'Total Grid area: ',(tot_area)
+ write(iulog,'(a,E23.15)') 'Total Grid area rad^2: ',(tot_area_rad)
if (.not.MeshUseMeshFile) then
write(iulog,'(a,f6.3,f8.2)') "Average equatorial node spacing (deg, km) = ", &
dble(90)/dble(ne*(np-1)), PI*rearth/(2000.0_r8*dble(ne*(np-1)))
@@ -654,8 +681,10 @@ subroutine print_cfl(elem,hybrid,nets,nete,dtnu,ptop,pmid,&
do k=1,nlev
! Vertical profile from FV dycore (see Lauritzen et al. 2012 DOI:10.1177/1094342011410088)
scale1 = 0.5_r8*(1.0_r8+tanh(2.0_r8*log(pmid(sponge_del4_lev)/pmid(k))))
- nu_div_lev(k) = (1.0_r8-scale1)*nu_div+scale1*nu_div_max
- if (sponge_del4_nu_fac.ne.1.0_r8) then
+ if (sponge_del4_nu_div_fac /= 1.0_r8) then
+ nu_div_lev(k) = (1.0_r8-scale1)*nu_div+scale1*nu_div_max
+ end if
+ if (sponge_del4_nu_fac /= 1.0_r8) then
nu_lev(k) = (1.0_r8-scale1)*nu +scale1*nu_max
nu_t_lev(k) = (1.0_r8-scale1)*nu_p +scale1*nu_max
end if
@@ -708,15 +737,18 @@ subroutine print_cfl(elem,hybrid,nets,nete,dtnu,ptop,pmid,&
!
if (ptop>100.0_r8) then
umax = 120.0_r8
- else
+ else if (ptop>10.0_r8) then
umax = 400.0_r8
+ else
+ umax = 800.0_r8
end if
+
ugw = 342.0_r8 !max gravity wave speed
dt_max_adv = S_rk/(umax*max_normDinv*lambda_max*ra)
dt_max_gw = S_rk/(ugw*max_normDinv*lambda_max*ra)
dt_max_tracer_se = S_rk_tracer*min_gw/(umax*max_normDinv*ra)
- if (ntrac>0) then
+ if (use_cslam) then
if (large_Courant_incr) then
dt_max_tracer_fvm = dble(nhe)*(4.0_r8*pi*Rearth/dble(4.0_r8*ne*nc))/umax
else
@@ -753,7 +785,7 @@ subroutine print_cfl(elem,hybrid,nets,nete,dtnu,ptop,pmid,&
dt_tracer_visco_actual,'s'
if (dt_tracer_visco_actual>dt_max_hypervis_tracer) write(iulog,*) 'WARNING: dt_tracer_hypervis theoretically unstable'
- if (ntrac>0) then
+ if (use_cslam) then
write(iulog,'(a,f10.2,a,f10.2,a)') '* dt_tracer_fvm (time-stepping tracers ; q ) < ',dt_max_tracer_fvm,&
's ',dt_tracer_fvm_actual
if (dt_tracer_fvm_actual>dt_max_tracer_fvm) write(iulog,*) 'WARNING: dt_tracer_fvm theortically unstable'
@@ -792,13 +824,13 @@ end subroutine print_cfl
!
! ================================
- function global_maximum(h,hybrid,npts,nets,nete) result(Max_sphere)
+ function global_maximum(fld,hybrid,npts,nets,nete) result(Max_sphere)
use hybrid_mod, only : hybrid_t
use reduction_mod, only : red_max, pmax_mt
integer , intent(in) :: npts,nets,nete
- real (kind=r8), intent(in) :: h(npts,npts,nets:nete)
+ real (kind=r8), intent(in) :: fld(npts,npts,nets:nete)
type (hybrid_t) , intent(in) :: hybrid
real (kind=r8) :: Max_sphere
@@ -807,7 +839,7 @@ function global_maximum(h,hybrid,npts,nets,nete) result(Max_sphere)
real (kind=r8) :: redp(1)
- Max_sphere = MAXVAL(h(:,:,nets:nete))
+ Max_sphere = MAXVAL(fld(:,:,nets:nete))
redp(1) = Max_sphere
call pmax_mt(red_max,redp,1,hybrid)
@@ -822,39 +854,39 @@ end function global_maximum
! for a scalar quantity
! ===========================================================
- function l1_snorm(elem, h,ht,hybrid,npts,nets,nete) result(l1)
+ function l1_snorm(elem,fld,fld_exact,hybrid,npts,nets,nete) result(l1)
use element_mod, only : element_t
use hybrid_mod, only : hybrid_t
type(element_t) , intent(in) :: elem(:)
integer , intent(in) :: npts,nets,nete
- real (kind=r8), intent(in) :: h(npts,npts,nets:nete) ! computed soln
- real (kind=r8), intent(in) :: ht(npts,npts,nets:nete) ! true soln
+ real (kind=r8), intent(in) :: fld(npts,npts,nets:nete) ! computed soln
+ real (kind=r8), intent(in) :: fld_exact(npts,npts,nets:nete) ! true soln
type (hybrid_t) , intent(in) :: hybrid
real (kind=r8) :: l1
! Local variables
- real (kind=r8) :: dhabs(npts,npts,nets:nete)
- real (kind=r8) :: htabs(npts,npts,nets:nete)
- real (kind=r8) :: dhabs_int
- real (kind=r8) :: htabs_int
+ real (kind=r8) :: dfld_abs(npts,npts,nets:nete)
+ real (kind=r8) :: fld_exact_abs(npts,npts,nets:nete)
+ real (kind=r8) :: dfld_abs_int
+ real (kind=r8) :: fld_exact_abs_int
integer i,j,ie
do ie=nets,nete
do j=1,npts
do i=1,npts
- dhabs(i,j,ie) = ABS(h(i,j,ie)-ht(i,j,ie))
- htabs(i,j,ie) = ABS(ht(i,j,ie))
+ dfld_abs(i,j,ie) = ABS(fld(i,j,ie)-fld_exact(i,j,ie))
+ fld_exact_abs(i,j,ie) = ABS(fld_exact(i,j,ie))
end do
end do
end do
- dhabs_int = global_integral(elem, dhabs(:,:,nets:nete),hybrid,npts,nets,nete)
- htabs_int = global_integral(elem, htabs(:,:,nets:nete),hybrid,npts,nets,nete)
+ dfld_abs_int = global_integral(elem, dfld_abs(:,:,nets:nete),hybrid,npts,nets,nete)
+ fld_exact_abs_int = global_integral(elem, fld_exact_abs(:,:,nets:nete),hybrid,npts,nets,nete)
- l1 = dhabs_int/htabs_int
+ l1 = dfld_abs_int/fld_exact_abs_int
end function l1_snorm
@@ -930,38 +962,38 @@ end function l1_vnorm
!
! ===========================================================
- function l2_snorm(elem, h,ht,hybrid,npts,nets,nete) result(l2)
+ function l2_snorm(elem,fld,fld_exact,hybrid,npts,nets,nete) result(l2)
use element_mod, only : element_t
use hybrid_mod, only : hybrid_t
type(element_t), intent(in) :: elem(:)
integer , intent(in) :: npts,nets,nete
- real (kind=r8), intent(in) :: h(npts,npts,nets:nete) ! computed soln
- real (kind=r8), intent(in) :: ht(npts,npts,nets:nete) ! true soln
+ real (kind=r8), intent(in) :: fld(npts,npts,nets:nete) ! computed soln
+ real (kind=r8), intent(in) :: fld_exact(npts,npts,nets:nete) ! true soln
type (hybrid_t) , intent(in) :: hybrid
real (kind=r8) :: l2
! Local variables
real (kind=r8) :: dh2(npts,npts,nets:nete)
- real (kind=r8) :: ht2(npts,npts,nets:nete)
+ real (kind=r8) :: fld_exact2(npts,npts,nets:nete)
real (kind=r8) :: dh2_int
- real (kind=r8) :: ht2_int
+ real (kind=r8) :: fld_exact2_int
integer i,j,ie
do ie=nets,nete
do j=1,npts
do i=1,npts
- dh2(i,j,ie)=(h(i,j,ie)-ht(i,j,ie))**2
- ht2(i,j,ie)=ht(i,j,ie)**2
+ dh2(i,j,ie)=(fld(i,j,ie)-fld_exact(i,j,ie))**2
+ fld_exact2(i,j,ie)=fld_exact(i,j,ie)**2
end do
end do
end do
dh2_int = global_integral(elem,dh2(:,:,nets:nete),hybrid,npts,nets,nete)
- ht2_int = global_integral(elem,ht2(:,:,nets:nete),hybrid,npts,nets,nete)
+ fld_exact2_int = global_integral(elem,fld_exact2(:,:,nets:nete),hybrid,npts,nets,nete)
- l2 = SQRT(dh2_int)/SQRT(ht2_int)
+ l2 = SQRT(dh2_int)/SQRT(fld_exact2_int)
end function l2_snorm
@@ -1036,35 +1068,35 @@ end function l2_vnorm
!
! ===========================================================
- function linf_snorm(h,ht,hybrid,npts,nets,nete) result(linf)
+ function linf_snorm(fld,fld_exact,hybrid,npts,nets,nete) result(linf)
use hybrid_mod, only : hybrid_t
integer , intent(in) :: npts,nets,nete
- real (kind=r8), intent(in) :: h(npts,npts,nets:nete) ! computed soln
- real (kind=r8), intent(in) :: ht(npts,npts,nets:nete) ! true soln
+ real (kind=r8), intent(in) :: fld(npts,npts,nets:nete) ! computed soln
+ real (kind=r8), intent(in) :: fld_exact(npts,npts,nets:nete) ! true soln
type (hybrid_t) , intent(in) :: hybrid
real (kind=r8) :: linf
! Local variables
- real (kind=r8) :: dhabs(npts,npts,nets:nete)
- real (kind=r8) :: htabs(npts,npts,nets:nete)
- real (kind=r8) :: dhabs_max
- real (kind=r8) :: htabs_max
+ real (kind=r8) :: dfld_abs(npts,npts,nets:nete)
+ real (kind=r8) :: fld_exact_abs(npts,npts,nets:nete)
+ real (kind=r8) :: dfld_abs_max
+ real (kind=r8) :: fld_exact_abs_max
integer i,j,ie
do ie=nets,nete
do j=1,npts
do i=1,npts
- dhabs(i,j,ie)=ABS(h(i,j,ie)-ht(i,j,ie))
- htabs(i,j,ie)=ABS(ht(i,j,ie))
+ dfld_abs(i,j,ie)=ABS(fld(i,j,ie)-fld_exact(i,j,ie))
+ fld_exact_abs(i,j,ie)=ABS(fld_exact(i,j,ie))
end do
end do
end do
- dhabs_max = global_maximum(dhabs(:,:,nets:nete),hybrid,npts,nets,nete)
- htabs_max = global_maximum(htabs(:,:,nets:nete),hybrid,npts,nets,nete)
+ dfld_abs_max = global_maximum(dfld_abs(:,:,nets:nete),hybrid,npts,nets,nete)
+ fld_exact_abs_max = global_maximum(fld_exact_abs(:,:,nets:nete),hybrid,npts,nets,nete)
- linf = dhabs_max/htabs_max
+ linf = dfld_abs_max/fld_exact_abs_max
end function linf_snorm
diff --git a/src/dynamics/se/dycore/hybrid_mod.F90 b/src/dynamics/se/dycore/hybrid_mod.F90
index 19f1043a92..5e7b4208ca 100644
--- a/src/dynamics/se/dycore/hybrid_mod.F90
+++ b/src/dynamics/se/dycore/hybrid_mod.F90
@@ -7,7 +7,7 @@ module hybrid_mod
use parallel_mod , only : parallel_t, copy_par
use thread_mod , only : omp_set_num_threads, omp_get_thread_num
use thread_mod , only : horz_num_threads, vert_num_threads, tracer_num_threads
-use dimensions_mod, only : nlev, qsize, ntrac
+use dimensions_mod, only : nlev, qsize, ntrac, use_cslam
implicit none
private
@@ -241,7 +241,7 @@ subroutine init_loop_ranges(nelemd)
work_pool_trac(ith+1,2) = end_index
end do
- if(ntrac>0 .and. ntrac0) then
+ if ((cubed_sphere_map /= 0) .AND. use_cslam) then
if (par%masterproc) then
write(iulog, *) subname, 'fvm transport and require equi-angle gnomonic cube sphere mapping.'
write(iulog, *) ' Set cubed_sphere_map = 0 or comment it out all together. '
diff --git a/src/dynamics/se/dycore/prim_advance_mod.F90 b/src/dynamics/se/dycore/prim_advance_mod.F90
index 7f3ee98d68..ed7a627ec4 100644
--- a/src/dynamics/se/dycore/prim_advance_mod.F90
+++ b/src/dynamics/se/dycore/prim_advance_mod.F90
@@ -10,7 +10,7 @@ module prim_advance_mod
private
save
- public :: prim_advance_exp, prim_advance_init, applyCAMforcing, calc_tot_energy_dynamics, compute_omega
+ public :: prim_advance_exp, prim_advance_init, applyCAMforcing, tot_energy_dyn, compute_omega
type (EdgeBuffer_t) :: edge3,edgeOmega,edgeSponge
real (kind=r8), allocatable :: ur_weights(:)
@@ -53,17 +53,16 @@ subroutine prim_advance_exp(elem, fvm, deriv, hvcoord, hybrid,dt, tl, nets, net
use element_mod, only: element_t
use hybvcoord_mod, only: hvcoord_t
use hybrid_mod, only: hybrid_t
- use time_mod, only: TimeLevel_t, timelevel_qdp, tevolve
- use dimensions_mod, only: lcp_moist
+ use se_dyn_time_mod, only: TimeLevel_t, timelevel_qdp, tevolve
use fvm_control_volume_mod, only: fvm_struct
use cam_thermo, only: get_kappa_dry
- use air_composition, only: thermodynamic_active_species_num, dry_air_species_num
+ use air_composition, only: thermodynamic_active_species_num
use air_composition, only: thermodynamic_active_species_idx_dycore, get_cp
- use physconst, only: cpair, rair
+ use physconst, only: cpair
implicit none
type (element_t), intent(inout), target :: elem(:)
- type(fvm_struct) , intent(in) :: fvm(:)
+ type(fvm_struct) , intent(inout) :: fvm(:)
type (derivative_t) , intent(in) :: deriv
type (hvcoord_t) :: hvcoord
type (hybrid_t) , intent(in) :: hybrid
@@ -74,13 +73,12 @@ subroutine prim_advance_exp(elem, fvm, deriv, hvcoord, hybrid,dt, tl, nets, net
! Local
real (kind=r8) :: dt_vis, eta_ave_w
- real (kind=r8) :: dp(np,np)
integer :: ie,nm1,n0,np1,k,qn0,m_cnst, nq
real (kind=r8) :: inv_cp_full(np,np,nlev,nets:nete)
real (kind=r8) :: qwater(np,np,nlev,thermodynamic_active_species_num,nets:nete)
integer :: qidx(thermodynamic_active_species_num)
real (kind=r8) :: kappa(np,np,nlev,nets:nete)
- call t_startf('prim_advance_exp')
+
nm1 = tl%nm1
n0 = tl%n0
np1 = tl%np1
@@ -123,22 +121,16 @@ subroutine prim_advance_exp(elem, fvm, deriv, hvcoord, hybrid,dt, tl, nets, net
!
! make sure Q is updated
!
- qwater(:,:,:,nq,ie) = elem(ie)%state%Qdp(:,:,:,m_cnst,qn0)/elem(ie)%state%dp3d(:,:,:,n0)
+ qwater(:,:,:,nq,ie) = elem(ie)%state%Qdp(:,:,:,m_cnst,qn0)/elem(ie)%state%dp3d(:,:,:,n0)
end do
end do
!
- ! compute Cp and kappa=Rdry/cpdry here and not in RK-stages since Q stays constant => Cp and kappa also stays constant
+ ! compute Cp and kappa=Rdry/cpdry here and not in RK-stages since Q stays constant
!
- if (lcp_moist) then
- do ie=nets,nete
- call get_cp(qwater(:,:,:,:,ie),&
- .true., inv_cp_full(:,:,:,ie), active_species_idx_dycore=qidx)
- end do
- else
- do ie=nets,nete
- inv_cp_full(:,:,:,ie) = 1.0_r8/cpair
- end do
- end if
+ do ie=nets,nete
+ call get_cp(qwater(:,:,:,:,ie),.true.,&
+ inv_cp_full(:,:,:,ie), active_species_idx_dycore=qidx)
+ end do
do ie=nets,nete
call get_kappa_dry(qwater(:,:,:,:,ie), qidx, kappa(:,:,:,ie))
end do
@@ -265,12 +257,11 @@ subroutine prim_advance_exp(elem, fvm, deriv, hvcoord, hybrid,dt, tl, nets, net
call omp_set_nested(.false.)
- call t_stopf('prim_advance_exp')
end subroutine prim_advance_exp
subroutine applyCAMforcing(elem,fvm,np1,np1_qdp,dt_dribble,dt_phys,nets,nete,nsubstep)
- use dimensions_mod, only: np, nc, nlev, qsize, ntrac
+ use dimensions_mod, only: np, nc, nlev, qsize, ntrac, use_cslam
use element_mod, only: element_t
use control_mod, only: ftype, ftype_conserve
use fvm_control_volume_mod, only: fvm_struct
@@ -290,7 +281,7 @@ subroutine applyCAMforcing(elem,fvm,np1,np1_qdp,dt_dribble,dt_phys,nets,nete,nsu
real (kind=r8), allocatable :: ftmp_fvm(:,:,:,:,:) !diagnostics
- if (ntrac>0) allocate(ftmp_fvm(nc,nc,nlev,ntrac,nets:nete))
+ if (use_cslam) allocate(ftmp_fvm(nc,nc,nlev,ntrac,nets:nete))
if (ftype==0) then
!
@@ -322,7 +313,7 @@ subroutine applyCAMforcing(elem,fvm,np1,np1_qdp,dt_dribble,dt_phys,nets,nete,nsu
! do state-update for tracers and "dribbling" forcing for u,v,T
!
dt_local = dt_dribble
- if (ntrac>0) then
+ if (use_cslam) then
dt_local_tracer = dt_dribble
dt_local_tracer_fvm = dt_phys
if (nsubstep.ne.1) then
@@ -371,7 +362,7 @@ subroutine applyCAMforcing(elem,fvm,np1,np1_qdp,dt_dribble,dt_phys,nets,nete,nsu
else
ftmp(:,:,:,:,ie) = 0.0_r8
end if
- if (ntrac>0.and.dt_local_tracer_fvm>0) then
+ if (use_cslam.and.dt_local_tracer_fvm>0) then
!
! Repeat for the fvm tracers: fc holds tendency (fc_new-fc_old)/dt_physics
!
@@ -395,18 +386,16 @@ subroutine applyCAMforcing(elem,fvm,np1,np1_qdp,dt_dribble,dt_phys,nets,nete,nsu
end do
end do
else
- if (ntrac>0) ftmp_fvm(:,:,:,:,ie) = 0.0_r8
+ if (use_cslam) ftmp_fvm(:,:,:,:,ie) = 0.0_r8
end if
-
if (ftype_conserve==1) then
call get_dp(elem(ie)%state%Qdp(:,:,:,1:qsize,np1_qdp), MASS_MIXING_RATIO, &
- thermodynamic_active_species_idx_dycore, elem(ie)%state%dp3d(:,:,:,np1), pdel)
+ thermodynamic_active_species_idx_dycore, elem(ie)%state%dp3d(:,:,:,np1), pdel)
do k=1,nlev
do j=1,np
do i = 1,np
pdel(i,j,k)=elem(ie)%derived%FDP(i,j,k)/pdel(i,j,k)
-
elem(ie)%state%T(i,j,k,np1) = elem(ie)%state%T(i,j,k,np1) + &
dt_local*elem(ie)%derived%FT(i,j,k)*pdel(i,j,k)
!
@@ -426,13 +415,13 @@ subroutine applyCAMforcing(elem,fvm,np1,np1_qdp,dt_dribble,dt_phys,nets,nete,nsu
dt_local*elem(ie)%derived%FM(:,:,:,:)
end if
end do
- if (ntrac>0) then
+ if (use_cslam) then
call output_qdp_var_dynamics(ftmp_fvm(:,:,:,:,:),nc,ntrac,nets,nete,'PDC')
else
call output_qdp_var_dynamics(ftmp(:,:,:,:,:),np,qsize,nets,nete,'PDC')
end if
- if (ftype==1.and.nsubstep==1) call calc_tot_energy_dynamics(elem,fvm,nets,nete,np1,np1_qdp,'p2d')
- if (ntrac>0) deallocate(ftmp_fvm)
+ if (ftype==1.and.nsubstep==1) call tot_energy_dyn(elem,fvm,nets,nete,np1,np1_qdp,'p2d')
+ if (use_cslam) deallocate(ftmp_fvm)
end subroutine applyCAMforcing
@@ -446,11 +435,11 @@ subroutine advance_hypervis_dp(edge3,elem,fvm,hybrid,deriv,nt,qn0,nets,nete,dt2,
! For correct scaling, dt2 should be the same 'dt2' used in the leapfrog advace
!
!
- use physconst, only: gravit, cappa, cpair, tref, lapse_rate
+ use physconst, only: cappa, cpair
use cam_thermo, only: get_molecular_diff_coef, get_rho_dry
- use dimensions_mod, only: np, nlev, nc, ntrac, npsq, qsize, ksponge_end
+ use dimensions_mod, only: np, nlev, nc, use_cslam, npsq, qsize, ksponge_end
use dimensions_mod, only: nu_scale_top,nu_lev,kmvis_ref,kmcnd_ref,rho_ref,km_sponge_factor
- use dimensions_mod, only: kmvisi_ref,kmcndi_ref,nu_t_lev
+ use dimensions_mod, only: nu_t_lev
use control_mod, only: nu, nu_t, hypervis_subcycle,hypervis_subcycle_sponge, nu_p, nu_top
use control_mod, only: molecular_diff
use hybrid_mod, only: hybrid_t!, get_loop_ranges
@@ -468,7 +457,7 @@ subroutine advance_hypervis_dp(edge3,elem,fvm,hybrid,deriv,nt,qn0,nets,nete,dt2,
type (hybrid_t) , intent(in) :: hybrid
type (element_t) , intent(inout), target :: elem(:)
- type(fvm_struct) , intent(in) :: fvm(:)
+ type(fvm_struct) , intent(inout) :: fvm(:)
type (EdgeBuffer_t), intent(inout):: edge3
type (derivative_t), intent(in ) :: deriv
integer , intent(in) :: nets,nete, nt, qn0
@@ -489,16 +478,13 @@ subroutine advance_hypervis_dp(edge3,elem,fvm,hybrid,deriv,nt,qn0,nets,nete,dt2,
type (EdgeDescriptor_t) :: desc
real (kind=r8), dimension(np,np) :: lap_t,lap_dp
- real (kind=r8), dimension(np,np) :: tmp, tmp2
real (kind=r8), dimension(np,np,ksponge_end,nets:nete):: kmvis,kmcnd,rho_dry
- real (kind=r8), dimension(np,np,ksponge_end+1):: kmvisi,kmcndi
real (kind=r8), dimension(np,np,nlev) :: tmp_kmvis,tmp_kmcnd
real (kind=r8), dimension(np,np,2) :: lap_v
- real (kind=r8) :: v1,v2,v1new,v2new,dt,heating,T0,T1
+ real (kind=r8) :: v1,v2,v1new,v2new,dt,heating
real (kind=r8) :: laplace_fluxes(nc,nc,4)
real (kind=r8) :: rhypervis_subcycle
real (kind=r8) :: nu_ratio1, ptop, inv_rho
- real (kind=r8), dimension(ksponge_end) :: dtemp,du,dv
real (kind=r8) :: nu_temp, nu_dp, nu_velo
if (nu_t == 0 .and. nu == 0 .and. nu_p==0 ) return;
@@ -516,7 +502,7 @@ subroutine advance_hypervis_dp(edge3,elem,fvm,hybrid,deriv,nt,qn0,nets,nete,dt2,
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
do ic=1,hypervis_subcycle
- call calc_tot_energy_dynamics(elem,fvm,nets,nete,nt,qn0,'dBH')
+ call tot_energy_dyn(elem,fvm,nets,nete,nt,qn0,'dBH')
rhypervis_subcycle=1.0_r8/real(hypervis_subcycle,kind=r8)
call biharmonic_wk_dp3d(elem,dptens,dpflux,ttens,vtens,deriv,edge3,hybrid,nt,nets,nete,kbeg,kend,hvcoord)
@@ -554,7 +540,7 @@ subroutine advance_hypervis_dp(edge3,elem,fvm,hybrid,deriv,nt,qn0,nets,nete,dt2,
enddo
enddo
- if (ntrac>0) then
+ if (use_cslam) then
!OMP_COLLAPSE_SIMD
!DIR_VECTOR_ALIGNED
do j=1,nc
@@ -606,7 +592,7 @@ subroutine advance_hypervis_dp(edge3,elem,fvm,hybrid,deriv,nt,qn0,nets,nete,dt2,
kptr = kbeg - 1 + 2*nlev
call edgeVunpack(edge3,vtens(:,:,2,kbeg:kend,ie),kblk,kptr,ie)
- if (ntrac>0) then
+ if (use_cslam) then
do k=kbeg,kend
temp(:,:,k) = elem(ie)%state%dp3d(:,:,k,nt) / elem(ie)%spheremp ! STATE before DSS
corners(0:np+1,0:np+1,k) = 0.0_r8
@@ -616,7 +602,7 @@ subroutine advance_hypervis_dp(edge3,elem,fvm,hybrid,deriv,nt,qn0,nets,nete,dt2,
kptr = kbeg - 1 + 3*nlev
call edgeVunpack(edge3,elem(ie)%state%dp3d(:,:,kbeg:kend,nt),kblk,kptr,ie)
- if (ntrac>0) then
+ if (use_cslam) then
desc = elem(ie)%desc
kptr = kbeg - 1 + 3*nlev
@@ -676,10 +662,13 @@ subroutine advance_hypervis_dp(edge3,elem,fvm,hybrid,deriv,nt,qn0,nets,nete,dt2,
enddo
end do
- call calc_tot_energy_dynamics(elem,fvm,nets,nete,nt,qn0,'dCH')
+ call tot_energy_dyn(elem,fvm,nets,nete,nt,qn0,'dCH')
do ie=nets,nete
!$omp parallel do num_threads(vert_num_threads), private(k,i,j,v1,v2,heating)
- do k=kbeg,kend
+ do k=ksponge_end,nlev
+ !
+ ! only do "frictional heating" away from sponge
+ !
!OMP_COLLAPSE_SIMD
!DIR_VECTOR_ALIGNED
do j=1,np
@@ -696,7 +685,7 @@ subroutine advance_hypervis_dp(edge3,elem,fvm,hybrid,deriv,nt,qn0,nets,nete,dt2,
enddo
enddo
enddo
- call calc_tot_energy_dynamics(elem,fvm,nets,nete,nt,qn0,'dAH')
+ call tot_energy_dyn(elem,fvm,nets,nete,nt,qn0,'dAH')
end do
!
@@ -771,7 +760,7 @@ subroutine advance_hypervis_dp(edge3,elem,fvm,hybrid,deriv,nt,qn0,nets,nete,dt2,
! Horizontal Laplacian diffusion
!
dt=dt2/hypervis_subcycle_sponge
- call calc_tot_energy_dynamics(elem,fvm,nets,nete,nt,qn0,'dBS')
+ call tot_energy_dyn(elem,fvm,nets,nete,nt,qn0,'dBS')
kblk = ksponge_end
do ic=1,hypervis_subcycle_sponge
rhypervis_subcycle=1.0_r8/real(hypervis_subcycle_sponge,kind=r8)
@@ -828,7 +817,7 @@ subroutine advance_hypervis_dp(edge3,elem,fvm,hybrid,deriv,nt,qn0,nets,nete,dt2,
end do
end if
- if (ntrac>0.and.nu_dp>0) then
+ if (use_cslam.and.nu_dp>0) then
!
! mass flux for CSLAM due to sponge layer diffusion on dp
!
@@ -876,7 +865,7 @@ subroutine advance_hypervis_dp(edge3,elem,fvm,hybrid,deriv,nt,qn0,nets,nete,dt2,
kptr = 2*ksponge_end
call edgeVunpack(edgeSponge,vtens(:,:,2,1:ksponge_end,ie),kblk,kptr,ie)
- if (ntrac>0.and.nu_dp>0.0_r8) then
+ if (use_cslam.and.nu_dp>0.0_r8) then
do k=1,ksponge_end
temp(:,:,k) = elem(ie)%state%dp3d(:,:,k,nt) / elem(ie)%spheremp ! STATE before DSS
corners(0:np+1,0:np+1,k) = 0.0_r8
@@ -886,7 +875,7 @@ subroutine advance_hypervis_dp(edge3,elem,fvm,hybrid,deriv,nt,qn0,nets,nete,dt2,
kptr = 3*ksponge_end
call edgeVunpack(edgeSponge,elem(ie)%state%dp3d(:,:,1:ksponge_end,nt),kblk,kptr,ie)
- if (ntrac>0.and.nu_dp>0.0_r8) then
+ if (use_cslam.and.nu_dp>0.0_r8) then
desc = elem(ie)%desc
kptr = 3*ksponge_end
@@ -926,38 +915,40 @@ subroutine advance_hypervis_dp(edge3,elem,fvm,hybrid,deriv,nt,qn0,nets,nete,dt2,
vtens(i,j,2,k,ie)=dt*vtens(i,j,2,k,ie)*elem(ie)%rspheremp(i,j)
ttens(i,j,k,ie)=dt*ttens(i,j,k,ie)*elem(ie)%rspheremp(i,j)
elem(ie)%state%dp3d(i,j,k,nt)=elem(ie)%state%dp3d(i,j,k,nt)*elem(ie)%rspheremp(i,j)
+ ! update v first (gives better results than updating v after heating)
+ elem(ie)%state%v(i,j,:,k,nt)=elem(ie)%state%v(i,j,:,k,nt) + vtens(i,j,:,k,ie)
+ elem(ie)%state%T(i,j, k,nt)=elem(ie)%state%T(i,j, k,nt) + ttens(i,j, k,ie)
enddo
enddo
enddo
- !$omp parallel do num_threads(vert_num_threads) private(k,i,j,v1,v2,v1new,v2new)
- do k=1,ksponge_end
- !OMP_COLLAPSE_SIMD
- !DIR_VECTOR_ALIGNED
- do j=1,np
- do i=1,np
- ! update v first (gives better results than updating v after heating)
- elem(ie)%state%v(i,j,:,k,nt)=elem(ie)%state%v(i,j,:,k,nt) + &
- vtens(i,j,:,k,ie)
- elem(ie)%state%T(i,j,k,nt)=elem(ie)%state%T(i,j,k,nt) &
- +ttens(i,j,k,ie)
-
- v1new=elem(ie)%state%v(i,j,1,k,nt)
- v2new=elem(ie)%state%v(i,j,2,k,nt)
- v1 =elem(ie)%state%v(i,j,1,k,nt)- vtens(i,j,1,k,ie)
- v2 =elem(ie)%state%v(i,j,2,k,nt)- vtens(i,j,2,k,ie)
- !
- ! frictional heating
- !
- heating = 0.5_r8*(v1new*v1new+v2new*v2new-(v1*v1+v2*v2))
- elem(ie)%state%T(i,j,k,nt)=elem(ie)%state%T(i,j,k,nt) &
- -heating*inv_cp_full(i,j,k,ie)
+ if (molecular_diff>0) then
+ !
+ ! no frictional heating for artificial sponge
+ !
+ !$omp parallel do num_threads(vert_num_threads) private(k,i,j,v1,v2,v1new,v2new)
+ do k=1,ksponge_end
+ !OMP_COLLAPSE_SIMD
+ !DIR_VECTOR_ALIGNED
+ do j=1,np
+ do i=1,np
+ v1new=elem(ie)%state%v(i,j,1,k,nt)
+ v2new=elem(ie)%state%v(i,j,2,k,nt)
+ v1 =elem(ie)%state%v(i,j,1,k,nt)- vtens(i,j,1,k,ie)
+ v2 =elem(ie)%state%v(i,j,2,k,nt)- vtens(i,j,2,k,ie)
+ !
+ ! frictional heating
+ !
+ heating = 0.5_r8*(v1new*v1new+v2new*v2new-(v1*v1+v2*v2))
+ elem(ie)%state%T(i,j,k,nt)=elem(ie)%state%T(i,j,k,nt) &
+ -heating*inv_cp_full(i,j,k,ie)
+ enddo
enddo
enddo
- enddo
+ end if
end do
end do
call t_stopf('sponge_diff')
- call calc_tot_energy_dynamics(elem,fvm,nets,nete,nt,qn0,'dAS')
+ call tot_energy_dyn(elem,fvm,nets,nete,nt,qn0,'dAS')
end subroutine advance_hypervis_dp
@@ -983,7 +974,8 @@ subroutine compute_and_apply_rhs(np1,nm1,n0,dt2,elem,hvcoord,hybrid,&
! allows us to fuse these two loops for more cache reuse
!
! ===================================
- use dimensions_mod, only: np, nc, nlev, ntrac, ksponge_end
+ use dimensions_mod, only: np, nc, nlev, use_cslam
+ use control_mod, only: pgf_formulation
use hybrid_mod, only: hybrid_t
use element_mod, only: element_t
use derivative_mod, only: derivative_t, divergence_sphere, gradient_sphere, vorticity_sphere
@@ -992,12 +984,10 @@ subroutine compute_and_apply_rhs(np1,nm1,n0,dt2,elem,hvcoord,hybrid,&
use edgetype_mod, only: edgedescriptor_t
use bndry_mod, only: bndry_exchange
use hybvcoord_mod, only: hvcoord_t
- use physconst, only: epsilo
use cam_thermo, only: get_gz, get_virtual_temp
use air_composition, only: thermodynamic_active_species_num, dry_air_species_num
- use air_composition, only: thermodynamic_active_species_idx_dycore, get_cp_dry, get_R_dry
- use physconst, only: tref,cpair,gravit,lapse_rate
- use time_mod, only : tevolve
+ use air_composition, only: get_cp_dry, get_R_dry
+ use physconst, only: tref,cpair,rga,lapse_rate
implicit none
integer, intent(in) :: np1,nm1,n0,nets,nete
@@ -1028,9 +1018,7 @@ subroutine compute_and_apply_rhs(np1,nm1,n0,dt2,elem,hvcoord,hybrid,&
real (kind=r8), dimension(np,np) :: vgrad_T ! v.grad(T)
real (kind=r8), dimension(np,np) :: Ephi ! kinetic energy + PHI term
real (kind=r8), dimension(np,np,2,nlev) :: grad_p_full
- real (kind=r8), dimension(np,np,2,nlev) :: grad_p_m_pmet! gradient(p - p_met)
real (kind=r8), dimension(np,np,nlev) :: vort ! vorticity
- real (kind=r8), dimension(np,np,nlev) :: p_dry ! pressure dry
real (kind=r8), dimension(np,np,nlev) :: dp_dry ! delta pressure dry
real (kind=r8), dimension(np,np,nlev) :: R_dry, cp_dry!
real (kind=r8), dimension(np,np,nlev) :: p_full ! pressure
@@ -1042,9 +1030,8 @@ subroutine compute_and_apply_rhs(np1,nm1,n0,dt2,elem,hvcoord,hybrid,&
real (kind=r8) :: vtens1(np,np,nlev),vtens2(np,np,nlev),ttens(np,np,nlev)
real (kind=r8) :: stashdp3d (np,np,nlev),tempdp3d(np,np), tempflux(nc,nc,4)
real (kind=r8) :: ckk, term, T_v(np,np,nlev)
- real (kind=r8), dimension(np,np,2) :: grad_exner
- real (kind=r8), dimension(np,np,2) :: grad_exner_term
- real (kind=r8), dimension(np,np,2) :: grad_logexner
+ real (kind=r8), dimension(np,np,2) :: pgf_term
+ real (kind=r8), dimension(np,np,2) :: grad_exner,grad_logexner
real (kind=r8) :: T0,T1
real (kind=r8), dimension(np,np) :: theta_v
@@ -1053,7 +1040,7 @@ subroutine compute_and_apply_rhs(np1,nm1,n0,dt2,elem,hvcoord,hybrid,&
real (kind=r8) :: sum_water(np,np,nlev), density_inv(np,np)
real (kind=r8) :: E,v1,v2,glnps1,glnps2
integer :: i,j,k,kptr,ie
- real (kind=r8) :: u_m_umet, v_m_vmet, t_m_tmet, ptop
+ real (kind=r8) :: ptop
!JMD call t_barrierf('sync_compute_and_apply_rhs', hybrid%par%comm)
call t_adj_detailf(+1)
@@ -1188,52 +1175,52 @@ subroutine compute_and_apply_rhs(np1,nm1,n0,dt2,elem,hvcoord,hybrid,&
! vtemp = gradient_sphere(Ephi(:,:),deriv,elem(ie)%Dinv)
call gradient_sphere(Ephi(:,:),deriv,elem(ie)%Dinv,vtemp)
density_inv(:,:) = R_dry(:,:,k)*T_v(:,:,k)/p_full(:,:,k)
-
- if (dry_air_species_num==0) then
- exner(:,:)=(p_full(:,:,k)/hvcoord%ps0)**kappa(:,:,k,ie)
- theta_v(:,:)=T_v(:,:,k)/exner(:,:)
- call gradient_sphere(exner(:,:),deriv,elem(ie)%Dinv,grad_exner)
-
- grad_exner_term(:,:,1) = cp_dry(:,:,k)*theta_v(:,:)*grad_exner(:,:,1)
- grad_exner_term(:,:,2) = cp_dry(:,:,k)*theta_v(:,:)*grad_exner(:,:,2)
+ if (pgf_formulation==1.or.(pgf_formulation==3.and.hvcoord%hybm(k)>0._r8)) then
+ if (dry_air_species_num==0) then
+ exner(:,:)=(p_full(:,:,k)/hvcoord%ps0)**kappa(:,:,k,ie)
+ theta_v(:,:)=T_v(:,:,k)/exner(:,:)
+ call gradient_sphere(exner(:,:),deriv,elem(ie)%Dinv,grad_exner)
+ pgf_term(:,:,1) = cp_dry(:,:,k)*theta_v(:,:)*grad_exner(:,:,1)
+ pgf_term(:,:,2) = cp_dry(:,:,k)*theta_v(:,:)*grad_exner(:,:,2)
+ else
+ exner(:,:)=(p_full(:,:,k)/hvcoord%ps0)**kappa(:,:,k,ie)
+ theta_v(:,:)=T_v(:,:,k)/exner(:,:)
+ call gradient_sphere(exner(:,:),deriv,elem(ie)%Dinv,grad_exner)
+ call gradient_sphere(kappa(:,:,k,ie),deriv,elem(ie)%Dinv,grad_kappa_term)
+ suml = exner(:,:)*LOG(p_full(:,:,k)/hvcoord%ps0)
+ grad_kappa_term(:,:,1)=-suml*grad_kappa_term(:,:,1)
+ grad_kappa_term(:,:,2)=-suml*grad_kappa_term(:,:,2)
+ pgf_term(:,:,1) = cp_dry(:,:,k)*theta_v(:,:)*(grad_exner(:,:,1)+grad_kappa_term(:,:,1))
+ pgf_term(:,:,2) = cp_dry(:,:,k)*theta_v(:,:)*(grad_exner(:,:,2)+grad_kappa_term(:,:,2))
+ end if
+ ! balanced ref profile correction:
+ ! reference temperature profile (Simmons and Jiabin, 1991, QJRMS, Section 2a)
+ !
+ ! Tref = T0+T1*Exner
+ ! T1 = .0065*Tref*Cp/g ! = ~191
+ ! T0 = Tref-T1 ! = ~97
+ !
+ T1 = lapse_rate*Tref*cpair*rga
+ T0 = Tref-T1
+ if (hvcoord%hybm(k)>0) then
+ !only apply away from constant pressure levels
+ call gradient_sphere(log(exner(:,:)),deriv,elem(ie)%Dinv,grad_logexner)
+ pgf_term(:,:,1)=pgf_term(:,:,1) + &
+ cpair*T0*(grad_logexner(:,:,1)-grad_exner(:,:,1)/exner(:,:))
+ pgf_term(:,:,2)=pgf_term(:,:,2) + &
+ cpair*T0*(grad_logexner(:,:,2)-grad_exner(:,:,2)/exner(:,:))
+ end if
+ elseif (pgf_formulation==2.or.pgf_formulation==3) then
+ pgf_term(:,:,1) = density_inv(:,:)*grad_p_full(:,:,1,k)
+ pgf_term(:,:,2) = density_inv(:,:)*grad_p_full(:,:,2,k)
else
- exner(:,:)=(p_full(:,:,k)/hvcoord%ps0)**kappa(:,:,k,ie)
- theta_v(:,:)=T_v(:,:,k)/exner(:,:)
- call gradient_sphere(exner(:,:),deriv,elem(ie)%Dinv,grad_exner)
-
- call gradient_sphere(kappa(:,:,k,ie),deriv,elem(ie)%Dinv,grad_kappa_term)
- suml = exner(:,:)*LOG(p_full(:,:,k)/hvcoord%ps0)
- grad_kappa_term(:,:,1)=-suml*grad_kappa_term(:,:,1)
- grad_kappa_term(:,:,2)=-suml*grad_kappa_term(:,:,2)
-
- grad_exner_term(:,:,1) = cp_dry(:,:,k)*theta_v(:,:)*(grad_exner(:,:,1)+grad_kappa_term(:,:,1))
- grad_exner_term(:,:,2) = cp_dry(:,:,k)*theta_v(:,:)*(grad_exner(:,:,2)+grad_kappa_term(:,:,2))
- end if
-
- ! balanced ref profile correction:
- ! reference temperature profile (Simmons and Jiabin, 1991, QJRMS, Section 2a)
- !
- ! Tref = T0+T1*Exner
- ! T1 = .0065*Tref*Cp/g ! = ~191
- ! T0 = Tref-T1 ! = ~97
- !
- T1 = lapse_rate*Tref*cpair/gravit
- T0 = Tref-T1
-
- if (hvcoord%hybm(k)>0) then
- call gradient_sphere(log(exner(:,:)),deriv,elem(ie)%Dinv,grad_logexner)
- grad_exner_term(:,:,1)=grad_exner_term(:,:,1) + &
- cpair*T0*(grad_logexner(:,:,1)-grad_exner(:,:,1)/exner(:,:))
- grad_exner_term(:,:,2)=grad_exner_term(:,:,2) + &
- cpair*T0*(grad_logexner(:,:,2)-grad_exner(:,:,2)/exner(:,:))
+ call endrun('ERROR: bad choice of pgf_formulation (must be 1, 2, or 3)')
end if
-
-
do j=1,np
do i=1,np
- glnps1 = grad_exner_term(i,j,1)
- glnps2 = grad_exner_term(i,j,2)
+ glnps1 = pgf_term(i,j,1)
+ glnps2 = pgf_term(i,j,2)
v1 = elem(ie)%state%v(i,j,1,k,n0)
v2 = elem(ie)%state%v(i,j,2,k,n0)
@@ -1274,7 +1261,7 @@ subroutine compute_and_apply_rhs(np1,nm1,n0,dt2,elem,hvcoord,hybrid,&
enddo
- if (ntrac>0.and.eta_ave_w.ne.0._r8) then
+ if (use_cslam.and.eta_ave_w.ne.0._r8) then
!OMP_COLLAPSE_SIMD
!DIR_VECTOR_ALIGNED
do j=1,np
@@ -1317,7 +1304,7 @@ subroutine compute_and_apply_rhs(np1,nm1,n0,dt2,elem,hvcoord,hybrid,&
kptr=nlev
call edgeVunpack(edge3, elem(ie)%state%v(:,:,:,:,np1), 2*nlev, kptr, ie)
- if (ntrac>0.and.eta_ave_w.ne.0._r8) then
+ if (use_cslam.and.eta_ave_w.ne.0._r8) then
do k=1,nlev
stashdp3d(:,:,k) = elem(ie)%state%dp3d(:,:,k,np1)/elem(ie)%spheremp(:,:)
end do
@@ -1328,7 +1315,7 @@ subroutine compute_and_apply_rhs(np1,nm1,n0,dt2,elem,hvcoord,hybrid,&
kptr=kptr+2*nlev
call edgeVunpack(edge3, elem(ie)%state%dp3d(:,:,:,np1),nlev,kptr,ie)
- if (ntrac>0.and.eta_ave_w.ne.0._r8) then
+ if (use_cslam.and.eta_ave_w.ne.0._r8) then
desc = elem(ie)%desc
call edgeDGVunpack(edge3, corners, nlev, kptr, ie)
@@ -1447,35 +1434,50 @@ subroutine distribute_flux_at_corners(cflux, corners, getmapP)
endif
end subroutine distribute_flux_at_corners
- subroutine calc_tot_energy_dynamics(elem,fvm,nets,nete,tl,tl_qdp,outfld_name_suffix)
- use dimensions_mod, only: npsq,nlev,np,lcp_moist,nc,ntrac,qsize
- use physconst, only: gravit, cpair, rearth, omega
+ subroutine tot_energy_dyn(elem,fvm,nets,nete,tl,tl_qdp,outfld_name_suffix)
+ use dimensions_mod, only: npsq,nlev,np,nc,use_cslam,qsize
+ use physconst, only: rga, cpair, rearth, omega
use element_mod, only: element_t
- use cam_history, only: outfld, hist_fld_active
+ use cam_history, only: outfld
+ use cam_history_support, only: max_fieldname_len
use constituents, only: cnst_get_ind
use string_utils, only: strlist_get_ind
use hycoef, only: hyai, ps0
use fvm_control_volume_mod, only: fvm_struct
- use cam_thermo, only: get_dp, MASS_MIXING_RATIO
+ use cam_thermo, only: get_dp, MASS_MIXING_RATIO,wvidx,wlidx,wiidx,seidx,keidx,moidx,mridx,ttidx,teidx, &
+ poidx,thermo_budget_num_vars,thermo_budget_vars
+ use cam_thermo, only: get_hydrostatic_energy
use air_composition, only: thermodynamic_active_species_idx_dycore, get_cp
+ use air_composition, only: thermodynamic_active_species_num, thermodynamic_active_species_idx_dycore
+ use air_composition, only: thermodynamic_active_species_liq_num,thermodynamic_active_species_liq_idx
+ use air_composition, only: thermodynamic_active_species_ice_num,thermodynamic_active_species_ice_idx
use dimensions_mod, only: cnst_name_gll
+ use dyn_tests_utils, only: vcoord=>vc_dry_pressure
+ use cam_budget, only: thermo_budget_history
!------------------------------Arguments--------------------------------
- type (element_t) , intent(in) :: elem(:)
- type(fvm_struct) , intent(in) :: fvm(:)
+ type (element_t) , intent(inout) :: elem(:)
+ type(fvm_struct) , intent(inout) :: fvm(:)
integer , intent(in) :: tl, tl_qdp,nets,nete
character*(*) , intent(in) :: outfld_name_suffix ! suffix for "outfld" names
!---------------------------Local storage-------------------------------
- real(kind=r8) :: se(npsq) ! Dry Static energy (J/m2)
- real(kind=r8) :: ke(npsq) ! kinetic energy (J/m2)
+ real(kind=r8) :: se(np,np) ! Enthalpy energy (J/m2)
+ real(kind=r8) :: ke(np,np) ! kinetic energy (J/m2)
+ real(kind=r8) :: po(np,np) ! PHIS term in energy equation (J/m2)
+ real(kind=r8) :: wv(np,np) ! water vapor
+ real(kind=r8) :: liq(np,np) ! liquid
+ real(kind=r8) :: ice(np,np) ! ice
+ real(kind=r8) :: q(np,nlev,qsize)
+ integer :: qidx(thermodynamic_active_species_num)
real(kind=r8) :: cdp_fvm(nc,nc,nlev)
- real(kind=r8) :: se_tmp
- real(kind=r8) :: ke_tmp
- real(kind=r8) :: ps(np,np)
+ real(kind=r8) :: cdp(np,np,nlev)
+ real(kind=r8) :: ptop(np,np)
real(kind=r8) :: pdel(np,np,nlev)
+ real(kind=r8) :: cp(np,np,nlev)
+
!
! global axial angular momentum (AAM) can be separated into one part (mr) associatedwith the relative motion
! of the atmosphere with respect to the planets surface (also known as wind AAM) and another part (mo)
@@ -1485,25 +1487,19 @@ subroutine calc_tot_energy_dynamics(elem,fvm,nets,nete,tl,tl_qdp,outfld_name_suf
real(kind=r8) :: mr(npsq) ! wind AAM
real(kind=r8) :: mo(npsq) ! mass AAM
real(kind=r8) :: mr_cnst, mo_cnst, cos_lat, mr_tmp, mo_tmp
- real(kind=r8) :: cp(np,np,nlev)
- integer :: ie,i,j,k
+ integer :: ie,i,j,k,m_cnst,nq,idx
integer :: ixwv,ixcldice, ixcldliq, ixtt ! CLDICE, CLDLIQ and test tracer indices
- character(len=16) :: name_out1,name_out2,name_out3,name_out4,name_out5,name_out6
+ character(len=max_fieldname_len) :: name_out(thermo_budget_num_vars)
!-----------------------------------------------------------------------
- name_out1 = 'SE_' //trim(outfld_name_suffix)
- name_out2 = 'KE_' //trim(outfld_name_suffix)
- name_out3 = 'WV_' //trim(outfld_name_suffix)
- name_out4 = 'WL_' //trim(outfld_name_suffix)
- name_out5 = 'WI_' //trim(outfld_name_suffix)
- name_out6 = 'TT_' //trim(outfld_name_suffix)
-
- if ( hist_fld_active(name_out1).or.hist_fld_active(name_out2).or.hist_fld_active(name_out3).or.&
- hist_fld_active(name_out4).or.hist_fld_active(name_out5).or.hist_fld_active(name_out6)) then
+ if (thermo_budget_history) then
+ do i=1,thermo_budget_num_vars
+ name_out(i)=trim(thermo_budget_vars(i))//'_'//trim(outfld_name_suffix)
+ end do
- if (ntrac>0) then
+ if (use_cslam) then
ixwv = 1
call cnst_get_ind('CLDLIQ' , ixcldliq, abort=.false.)
call cnst_get_ind('CLDICE' , ixcldice, abort=.false.)
@@ -1519,79 +1515,104 @@ subroutine calc_tot_energy_dynamics(elem,fvm,nets,nete,tl,tl_qdp,outfld_name_suf
!
! Compute frozen static energy in 3 parts: KE, SE, and energy associated with vapor and liquid
!
+ do nq=1,thermodynamic_active_species_num
+ qidx(nq) = nq
+ end do
do ie=nets,nete
- se = 0.0_r8
- ke = 0.0_r8
- call get_dp(elem(ie)%state%Qdp(:,:,:,1:qsize,tl_qdp), MASS_MIXING_RATIO, thermodynamic_active_species_idx_dycore,&
- elem(ie)%state%dp3d(:,:,:,tl), pdel, ps=ps, ptop=hyai(1)*ps0)
call get_cp(elem(ie)%state%Qdp(:,:,:,1:qsize,tl_qdp),&
- .false., cp, dp_dry=elem(ie)%state%dp3d(:,:,:,tl),&
+ .false., cp, factor=1.0_r8/elem(ie)%state%dp3d(:,:,:,tl),&
active_species_idx_dycore=thermodynamic_active_species_idx_dycore)
- do k = 1, nlev
- do j=1,np
- do i = 1, np
- !
- ! kinetic energy
- !
- ke_tmp = 0.5_r8*(elem(ie)%state%v(i,j,1,k,tl)**2+ elem(ie)%state%v(i,j,2,k,tl)**2)*pdel(i,j,k)/gravit
- if (lcp_moist) then
- se_tmp = cp(i,j,k)*elem(ie)%state%T(i,j,k,tl)*pdel(i,j,k)/gravit
- else
- !
- ! using CAM physics definition of internal energy
- !
- se_tmp = cpair*elem(ie)%state%T(i,j,k,tl)*pdel(i,j,k)/gravit
- end if
- se (i+(j-1)*np) = se (i+(j-1)*np) + se_tmp
- ke (i+(j-1)*np) = ke (i+(j-1)*np) + ke_tmp
- end do
- end do
- end do
-
+ ptop = hyai(1)*ps0
do j=1,np
- do i = 1, np
- se(i+(j-1)*np) = se(i+(j-1)*np) + elem(ie)%state%phis(i,j)*ps(i,j)/gravit
+ !get mixing ratio of thermodynamic active species only
+ !(other tracers not used in get_hydrostatic_energy)
+ do nq=1,thermodynamic_active_species_num
+ m_cnst = thermodynamic_active_species_idx_dycore(nq)
+ q(:,:,m_cnst) = elem(ie)%state%Qdp(:,j,:,m_cnst,tl_qdp)/&
+ elem(ie)%state%dp3d(:,j,:,tl)
end do
+ call get_hydrostatic_energy(q, &
+ .false., elem(ie)%state%dp3d(:,j,:,tl), cp(:,j,:), elem(ie)%state%v(:,j,1,:,tl), &
+ elem(ie)%state%v(:,j,2,:,tl), elem(ie)%state%T(:,j,:,tl), vcoord, ptop=ptop(:,j),&
+ phis=elem(ie)%state%phis(:,j), dycore_idx=.true., &
+ se=se(:,j), po=po(:,j), ke=ke(:,j), wv=wv(:,j), liq=liq(:,j), ice=ice(:,j))
end do
!
! Output energy diagnostics on GLL grid
!
- call outfld(name_out1 ,se ,npsq,ie)
- call outfld(name_out2 ,ke ,npsq,ie)
+ call outfld(name_out(poidx) ,po ,npsq,ie)
+ call outfld(name_out(seidx) ,se ,npsq,ie)
+ call outfld(name_out(keidx) ,ke ,npsq,ie)
+ call outfld(name_out(teidx) ,ke+se+po ,npsq,ie)
!
! mass variables are output on CSLAM grid if using CSLAM else GLL grid
!
- if (ntrac>0) then
- if (ixwv>0) then
- cdp_fvm = fvm(ie)%c(1:nc,1:nc,:,ixwv)*fvm(ie)%dp_fvm(1:nc,1:nc,:)
- call util_function(cdp_fvm,nc,nlev,name_out3,ie)
- end if
- if (ixcldliq>0) then
- cdp_fvm = fvm(ie)%c(1:nc,1:nc,:,ixcldliq)*fvm(ie)%dp_fvm(1:nc,1:nc,:)
- call util_function(cdp_fvm,nc,nlev,name_out4,ie)
- end if
- if (ixcldice>0) then
- cdp_fvm = fvm(ie)%c(1:nc,1:nc,:,ixcldice)*fvm(ie)%dp_fvm(1:nc,1:nc,:)
- call util_function(cdp_fvm,nc,nlev,name_out5,ie)
- end if
- if (ixtt>0) then
- cdp_fvm = fvm(ie)%c(1:nc,1:nc,:,ixtt)*fvm(ie)%dp_fvm(1:nc,1:nc,:)
- call util_function(cdp_fvm,nc,nlev,name_out6,ie)
- end if
+ if (use_cslam) then
+ if (ixwv>0) then
+ cdp_fvm = fvm(ie)%c(1:nc,1:nc,:,ixwv)*fvm(ie)%dp_fvm(1:nc,1:nc,:)
+ call util_function(cdp_fvm,nc,nlev,name_out(wvidx),ie)
+ end if
+ !
+ ! sum over liquid water
+ !
+ if (thermodynamic_active_species_liq_num>0) then
+ cdp_fvm = 0.0_r8
+ do nq = 1,thermodynamic_active_species_liq_num
+ cdp_fvm = cdp_fvm + fvm(ie)%c(1:nc,1:nc,:,thermodynamic_active_species_liq_idx(nq))&
+ *fvm(ie)%dp_fvm(1:nc,1:nc,:)
+ end do
+ call util_function(cdp_fvm,nc,nlev,name_out(wlidx),ie)
+ end if
+ !
+ ! sum over ice water
+ !
+ if (thermodynamic_active_species_ice_num>0) then
+ cdp_fvm = 0.0_r8
+ do nq = 1,thermodynamic_active_species_ice_num
+ cdp_fvm = cdp_fvm + fvm(ie)%c(1:nc,1:nc,:,thermodynamic_active_species_ice_idx(nq))&
+ *fvm(ie)%dp_fvm(1:nc,1:nc,:)
+ end do
+ call util_function(cdp_fvm,nc,nlev,name_out(wiidx),ie)
+ end if
+ if (ixtt>0) then
+ cdp_fvm = fvm(ie)%c(1:nc,1:nc,:,ixtt)*fvm(ie)%dp_fvm(1:nc,1:nc,:)
+ call util_function(cdp_fvm,nc,nlev,name_out(ttidx),ie)
+ end if
else
- call util_function(elem(ie)%state%qdp(:,:,:,1 ,tl_qdp),np,nlev,name_out3,ie)
- if (ixcldliq>0) call util_function(elem(ie)%state%qdp(:,:,:,ixcldliq,tl_qdp),np,nlev,name_out4,ie)
- if (ixcldice>0) call util_function(elem(ie)%state%qdp(:,:,:,ixcldice,tl_qdp),np,nlev,name_out5,ie)
- if (ixtt>0 ) call util_function(elem(ie)%state%qdp(:,:,:,ixtt ,tl_qdp),np,nlev,name_out6,ie)
+ cdp = elem(ie)%state%qdp(:,:,:,1,tl_qdp)
+ call util_function(cdp,np,nlev,name_out(wvidx),ie)
+ !
+ ! sum over liquid water
+ !
+ if (thermodynamic_active_species_liq_num>0) then
+ cdp = 0.0_r8
+ do idx = 1,thermodynamic_active_species_liq_num
+ cdp = cdp + elem(ie)%state%qdp(:,:,:,thermodynamic_active_species_liq_idx(idx),tl_qdp)
+ end do
+ call util_function(cdp,np,nlev,name_out(wlidx),ie)
+ end if
+ !
+ ! sum over ice water
+ !
+ if (thermodynamic_active_species_ice_num>0) then
+ cdp = 0.0_r8
+ do idx = 1,thermodynamic_active_species_ice_num
+ cdp = cdp + elem(ie)%state%qdp(:,:,:,thermodynamic_active_species_ice_idx(idx),tl_qdp)
+ end do
+ call util_function(cdp,np,nlev,name_out(wiidx),ie)
+ end if
+ if (ixtt>0) then
+ cdp = elem(ie)%state%qdp(:,:,:,ixtt ,tl_qdp)
+ call util_function(cdp,np,nlev,name_out(ttidx),ie)
+ end if
end if
- end do
- end if
- !
- ! Axial angular momentum diagnostics
- !
- ! Code follows
- !
- ! Lauritzen et al., (2014): Held-Suarez simulations with the Community Atmosphere Model
+ end do
+ !
+ ! Axial angular momentum diagnostics
+ !
+ ! Code follows
+ !
+ ! Lauritzen et al., (2014): Held-Suarez simulations with the Community Atmosphere Model
! Spectral Element (CAM-SE) dynamical core: A global axial angularmomentum analysis using Eulerian
! and floating Lagrangian vertical coordinates. J. Adv. Model. Earth Syst. 6,129-140,
! doi:10.1002/2013MS000268
@@ -1599,19 +1620,16 @@ subroutine calc_tot_energy_dynamics(elem,fvm,nets,nete,tl,tl_qdp,outfld_name_suf
! MR is equation (6) without \Delta A and sum over areas (areas are in units of radians**2)
! MO is equation (7) without \Delta A and sum over areas (areas are in units of radians**2)
!
- name_out1 = 'MR_' //trim(outfld_name_suffix)
- name_out2 = 'MO_' //trim(outfld_name_suffix)
- if ( hist_fld_active(name_out1).or.hist_fld_active(name_out2)) then
call strlist_get_ind(cnst_name_gll, 'CLDLIQ', ixcldliq, abort=.false.)
call strlist_get_ind(cnst_name_gll, 'CLDICE', ixcldice, abort=.false.)
- mr_cnst = rearth**3/gravit
- mo_cnst = omega*rearth**4/gravit
+ mr_cnst = rga*rearth**3
+ mo_cnst = rga*omega*rearth**4
do ie=nets,nete
mr = 0.0_r8
mo = 0.0_r8
call get_dp(elem(ie)%state%Qdp(:,:,:,1:qsize,tl_qdp), MASS_MIXING_RATIO, thermodynamic_active_species_idx_dycore,&
- elem(ie)%state%dp3d(:,:,:,tl), pdel, ps=ps, ptop=hyai(1)*ps0)
+ elem(ie)%state%dp3d(:,:,:,tl), pdel)
do k = 1, nlev
do j=1,np
do i = 1, np
@@ -1624,17 +1642,17 @@ subroutine calc_tot_energy_dynamics(elem,fvm,nets,nete,tl,tl_qdp,outfld_name_suf
end do
end do
end do
- call outfld(name_out1 ,mr ,npsq,ie)
- call outfld(name_out2 ,mo ,npsq,ie)
+ call outfld(name_out(mridx) ,mr ,npsq,ie)
+ call outfld(name_out(moidx) ,mo ,npsq,ie)
end do
- end if
+ endif ! if thermo budget history
+ end subroutine tot_energy_dyn
- end subroutine calc_tot_energy_dynamics
subroutine output_qdp_var_dynamics(qdp,nx,num_trac,nets,nete,outfld_name)
- use dimensions_mod, only: nlev,ntrac
- use cam_history , only: outfld, hist_fld_active
+ use dimensions_mod, only: nlev
+ use cam_history , only: hist_fld_active
use constituents , only: cnst_get_ind
!------------------------------Arguments--------------------------------
@@ -1674,17 +1692,15 @@ end subroutine output_qdp_var_dynamics
! column integrate mass-variable and outfld
!
subroutine util_function(f_in,nx,nz,name_out,ie)
- use physconst, only: gravit
+ use physconst, only: rga
use cam_history, only: outfld, hist_fld_active
integer, intent(in) :: nx,nz,ie
real(kind=r8), intent(in) :: f_in(nx,nx,nz)
character(len=16), intent(in) :: name_out
real(kind=r8) :: f_out(nx*nx)
integer :: i,j,k
- real(kind=r8) :: inv_g
if (hist_fld_active(name_out)) then
f_out = 0.0_r8
- inv_g = 1.0_r8/gravit
do k = 1, nz
do j = 1, nx
do i = 1, nx
@@ -1692,7 +1708,7 @@ subroutine util_function(f_in,nx,nz,name_out,ie)
end do
end do
end do
- f_out = f_out*inv_g
+ f_out = f_out*rga
call outfld(name_out,f_out,nx*nx,ie)
end if
end subroutine util_function
@@ -1708,7 +1724,6 @@ subroutine compute_omega(hybrid,n0,qn0,elem,deriv,nets,nete,dt,hvcoord)
use bndry_mod, only: bndry_exchange
use viscosity_mod, only: biharmonic_wk_omega
use cam_thermo, only: get_dp, MASS_MIXING_RATIO
- use air_composition,only: thermodynamic_active_species_num
use air_composition,only: thermodynamic_active_species_idx_dycore
implicit none
type (hybrid_t) , intent(in) :: hybrid
@@ -1723,7 +1738,7 @@ subroutine compute_omega(hybrid,n0,qn0,elem,deriv,nets,nete,dt,hvcoord)
real (kind=r8) :: dp_full(np,np,nlev)
real (kind=r8) :: p_full(np,np,nlev),grad_p_full(np,np,2),vgrad_p_full(np,np,nlev)
real (kind=r8) :: divdp_full(np,np,nlev),vdp_full(np,np,2)
- real(kind=r8) :: Otens(np,np ,nlev,nets:nete), dt_hyper, sum_water(np,np,nlev)
+ real(kind=r8) :: Otens(np,np ,nlev,nets:nete), dt_hyper
logical, parameter :: del4omega = .true.
diff --git a/src/dynamics/se/dycore/prim_advection_mod.F90 b/src/dynamics/se/dycore/prim_advection_mod.F90
index 0391762cb5..17ad85ba61 100644
--- a/src/dynamics/se/dycore/prim_advection_mod.F90
+++ b/src/dynamics/se/dycore/prim_advection_mod.F90
@@ -23,7 +23,7 @@ module prim_advection_mod
use element_mod, only: element_t
use fvm_control_volume_mod, only: fvm_struct
use hybvcoord_mod, only: hvcoord_t
- use time_mod, only: TimeLevel_t, TimeLevel_Qdp
+ use se_dyn_time_mod, only: TimeLevel_t, TimeLevel_Qdp
use control_mod, only: nu_q, nu_p, limiter_option, hypervis_subcycle_q, rsplit
use edge_mod, only: edgevpack, edgevunpack, initedgebuffer, initedgesbuffer
@@ -949,7 +949,7 @@ subroutine vertical_remap(hybrid,elem,fvm,hvcoord,np1,np1_qdp,nets,nete)
use hybrid_mod, only: hybrid_t, config_thread_region,get_loop_ranges, PrintHybrid
use fvm_control_volume_mod, only: fvm_struct
use dimensions_mod, only: ntrac
- use dimensions_mod, only: lcp_moist, kord_tr,kord_tr_cslam
+ use dimensions_mod, only: kord_tr,kord_tr_cslam
use cam_logfile, only: iulog
use physconst, only: pi
use air_composition, only: thermodynamic_active_species_idx_dycore
@@ -965,7 +965,7 @@ subroutine vertical_remap(hybrid,elem,fvm,hvcoord,np1,np1_qdp,nets,nete)
type (hvcoord_t) :: hvcoord
integer :: ie,i,j,k,np1,nets,nete,np1_qdp,q, m_cnst
real (kind=r8), dimension(np,np,nlev) :: dp_moist,dp_star_moist, dp_dry,dp_star_dry
- real (kind=r8), dimension(np,np,nlev) :: internal_energy_star
+ real (kind=r8), dimension(np,np,nlev) :: enthalpy_star
real (kind=r8), dimension(np,np,nlev,2):: ttmp
real(r8), parameter :: rad2deg = 180.0_r8/pi
integer :: region_num_threads,qbeg,qend,kord_uvT(1)
@@ -980,22 +980,20 @@ subroutine vertical_remap(hybrid,elem,fvm,hvcoord,np1,np1_qdp,nets,nete)
! prepare for mapping of temperature
!
if (vert_remap_uvTq_alg>-20) then
- if (lcp_moist) then
- !
- ! compute internal energy on Lagrangian levels
- ! (do it here since qdp is overwritten by remap1)
- !
- call get_enthalpy(elem(ie)%state%qdp(:,:,:,1:qsize,np1_qdp), &
- elem(ie)%state%t(:,:,:,np1), elem(ie)%state%dp3d(:,:,:,np1), internal_energy_star, &
- active_species_idx_dycore=thermodynamic_active_species_idx_dycore)
- end if
+ !
+ ! compute enthalpy on Lagrangian levels
+ ! (do it here since qdp is overwritten by remap1)
+ !
+ call get_enthalpy(elem(ie)%state%qdp(:,:,:,1:qsize,np1_qdp), &
+ elem(ie)%state%t(:,:,:,np1), elem(ie)%state%dp3d(:,:,:,np1), enthalpy_star, &
+ active_species_idx_dycore=thermodynamic_active_species_idx_dycore)
else
!
! map Tv over log(p) following FV and FV3
!
- call get_virtual_temp(elem(ie)%state%qdp(:,:,:,1:qsize,np1_qdp), internal_energy_star, &
+ call get_virtual_temp(elem(ie)%state%qdp(:,:,:,1:qsize,np1_qdp), enthalpy_star, &
dp_dry=elem(ie)%state%dp3d(:,:,:,np1), active_species_idx_dycore=thermodynamic_active_species_idx_dycore)
- internal_energy_star = internal_energy_star*elem(ie)%state%t(:,:,:,np1)
+ enthalpy_star = enthalpy_star*elem(ie)%state%t(:,:,:,np1)
end if
!
! update final psdry
@@ -1048,34 +1046,28 @@ subroutine vertical_remap(hybrid,elem,fvm,hvcoord,np1,np1_qdp,nets,nete)
!
if (vert_remap_uvTq_alg>-20) then
!
- ! remap internal energy and back out temperature
+ ! remap enthalpy energy and back out temperature
!
- if (lcp_moist) then
- call remap1(internal_energy_star,np,1,1,1,dp_star_dry,dp_dry,ptop,1,.true.,kord_uvT)
- !
- ! compute sum c^(l)_p*m^(l)*dp on arrival (Eulerian) grid
- !
- ttmp(:,:,:,1) = 1.0_r8
- call get_enthalpy(elem(ie)%state%qdp(:,:,:,1:qsize,np1_qdp), &
- ttmp(:,:,:,1), dp_dry,ttmp(:,:,:,2), &
- active_species_idx_dycore=thermodynamic_active_species_idx_dycore)
- elem(ie)%state%t(:,:,:,np1)=internal_energy_star/ttmp(:,:,:,2)
- else
- internal_energy_star(:,:,:)=elem(ie)%state%t(:,:,:,np1)*dp_star_moist
- call remap1(internal_energy_star,np,1,1,1,dp_star_moist,dp_moist,ptop,1,.true.,kord_uvT)
- elem(ie)%state%t(:,:,:,np1)=internal_energy_star/dp_moist
- end if
+ call remap1(enthalpy_star,np,1,1,1,dp_star_dry,dp_dry,ptop,1,.true.,kord_uvT)
+ !
+ ! compute sum c^(l)_p*m^(l)*dp on arrival (Eulerian) grid
+ !
+ ttmp(:,:,:,1) = 1.0_r8
+ call get_enthalpy(elem(ie)%state%qdp(:,:,:,1:qsize,np1_qdp), &
+ ttmp(:,:,:,1), dp_dry,ttmp(:,:,:,2), &
+ active_species_idx_dycore=thermodynamic_active_species_idx_dycore)
+ elem(ie)%state%t(:,:,:,np1)=enthalpy_star/ttmp(:,:,:,2)
else
!
! map Tv over log(p); following FV and FV3
!
- call remap1(internal_energy_star,np,1,1,1,dp_star_moist,dp_moist,ptop,1,.false.,kord_uvT)
+ call remap1(enthalpy_star,np,1,1,1,dp_star_moist,dp_moist,ptop,1,.false.,kord_uvT)
call get_virtual_temp(elem(ie)%state%qdp(:,:,:,1:qsize,np1_qdp), ttmp(:,:,:,1), &
dp_dry=dp_dry, active_species_idx_dycore=thermodynamic_active_species_idx_dycore)
!
! convert new Tv to T
!
- elem(ie)%state%t(:,:,:,np1)=internal_energy_star/ttmp(:,:,:,1)
+ elem(ie)%state%t(:,:,:,np1)=enthalpy_star/ttmp(:,:,:,1)
end if
!
! remap velocity components
diff --git a/src/dynamics/se/dycore/prim_driver_mod.F90 b/src/dynamics/se/dycore/prim_driver_mod.F90
index 5ea869b53c..6cfb52e356 100644
--- a/src/dynamics/se/dycore/prim_driver_mod.F90
+++ b/src/dynamics/se/dycore/prim_driver_mod.F90
@@ -26,10 +26,10 @@ module prim_driver_mod
subroutine prim_init2(elem, fvm, hybrid, nets, nete, tl, hvcoord)
use dimensions_mod, only: irecons_tracer, fvm_supercycling
- use dimensions_mod, only: fv_nphys, ntrac, nc
+ use dimensions_mod, only: fv_nphys, nc
use parallel_mod, only: syncmp
- use time_mod, only: timelevel_t, tstep, phys_tscale, nsplit, TimeLevel_Qdp
- use time_mod, only: nsplit_baseline,rsplit_baseline
+ use se_dyn_time_mod, only: timelevel_t, tstep, phys_tscale, nsplit, TimeLevel_Qdp
+ use se_dyn_time_mod, only: nsplit_baseline,rsplit_baseline
use prim_state_mod, only: prim_printstate
use control_mod, only: runtype, topology, rsplit, qsplit, rk_stage_user, &
nu, nu_q, nu_div, hypervis_subcycle, hypervis_subcycle_q, &
@@ -40,7 +40,7 @@ subroutine prim_init2(elem, fvm, hybrid, nets, nete, tl, hvcoord)
use hybvcoord_mod, only: hvcoord_t
use prim_advection_mod, only: prim_advec_init2,deriv
use prim_advance_mod, only: compute_omega
- use physconst, only: gravit, cappa, cpair, tref, lapse_rate
+ use physconst, only: rga, cappa, cpair, tref, lapse_rate
use cam_thermo, only: get_dp_ref
use physconst, only: pstd
@@ -157,7 +157,7 @@ subroutine prim_init2(elem, fvm, hybrid, nets, nete, tl, hvcoord)
! T1 = .0065*Tref*Cp/g ! = ~191
! T0 = Tref-T1 ! = ~97
!
- T1 = lapse_rate*Tref*cpair/gravit
+ T1 = lapse_rate*Tref*cpair*rga
T0 = Tref-T1
do ie=nets,nete
do k=1,nlev
@@ -218,16 +218,16 @@ subroutine prim_run_subcycle(elem, fvm, hybrid,nets,nete, dt, tl, hvcoord,nsubst
!
!
use hybvcoord_mod, only : hvcoord_t
- use time_mod, only: TimeLevel_t, timelevel_update, timelevel_qdp, nsplit
+ use se_dyn_time_mod, only: TimeLevel_t, timelevel_update, timelevel_qdp, nsplit
use control_mod, only: statefreq,qsplit, rsplit, variable_nsplit
use prim_advance_mod, only: applycamforcing
- use prim_advance_mod, only: calc_tot_energy_dynamics,compute_omega
+ use prim_advance_mod, only: tot_energy_dyn,compute_omega
use prim_state_mod, only: prim_printstate, adjust_nsplit
use prim_advection_mod, only: vertical_remap, deriv
use thread_mod, only: omp_get_thread_num
use perf_mod , only: t_startf, t_stopf
use fvm_mod , only: fill_halo_fvm, ghostBufQnhc_h
- use dimensions_mod, only: ntrac,fv_nphys, ksponge_end
+ use dimensions_mod, only: use_cslam,fv_nphys, ksponge_end
type (element_t) , intent(inout) :: elem(:)
type(fvm_struct), intent(inout) :: fvm(:)
@@ -282,9 +282,9 @@ subroutine prim_run_subcycle(elem, fvm, hybrid,nets,nete, dt, tl, hvcoord,nsubst
call TimeLevel_Qdp( tl, qsplit, n0_qdp)
- call calc_tot_energy_dynamics(elem,fvm,nets,nete,tl%n0,n0_qdp,'dAF')
+ call tot_energy_dyn(elem,fvm,nets,nete,tl%n0,n0_qdp,'dAF')
call ApplyCAMForcing(elem,fvm,tl%n0,n0_qdp,dt_remap,dt_phys,nets,nete,nsubstep)
- call calc_tot_energy_dynamics(elem,fvm,nets,nete,tl%n0,n0_qdp,'dBD')
+ call tot_energy_dyn(elem,fvm,nets,nete,tl%n0,n0_qdp,'dBD')
do r=1,rsplit
if (r.ne.1) call TimeLevel_update(tl,"leapfrog")
call prim_step(elem, fvm, hybrid,nets,nete, dt, tl, hvcoord,r)
@@ -300,7 +300,7 @@ subroutine prim_run_subcycle(elem, fvm, hybrid,nets,nete, dt, tl, hvcoord,nsubst
! always for tracers
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- call calc_tot_energy_dynamics(elem,fvm,nets,nete,tl%np1,np1_qdp,'dAD')
+ call tot_energy_dyn(elem,fvm,nets,nete,tl%np1,np1_qdp,'dAD')
if (variable_nsplit.or.compute_diagnostics) then
!
@@ -317,7 +317,7 @@ subroutine prim_run_subcycle(elem, fvm, hybrid,nets,nete, dt, tl, hvcoord,nsubst
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! time step is complete.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- call calc_tot_energy_dynamics(elem,fvm,nets,nete,tl%np1,np1_qdp,'dAR')
+ call tot_energy_dyn(elem,fvm,nets,nete,tl%np1,np1_qdp,'dAR')
if (nsubstep==nsplit) then
call compute_omega(hybrid,tl%np1,np1_qdp,elem,deriv,nets,nete,dt_remap,hvcoord)
@@ -378,7 +378,7 @@ subroutine prim_run_subcycle(elem, fvm, hybrid,nets,nete, dt, tl, hvcoord,nsubst
call prim_printstate(elem, tl, hybrid,nets,nete, fvm, omega_cn)
end if
- if (ntrac>0.and.nsubstep==nsplit.and.nc.ne.fv_nphys) then
+ if (use_cslam.and.nsubstep==nsplit.and.nc.ne.fv_nphys) then
!
! fill the fvm halo for mapping in d_p_coupling if
! physics grid resolution is different than fvm resolution
@@ -407,14 +407,14 @@ subroutine prim_step(elem, fvm, hybrid,nets,nete, dt, tl, hvcoord, rstep)
! tl%n0 time t + dt_q
!
use hybvcoord_mod, only: hvcoord_t
- use time_mod, only: TimeLevel_t, timelevel_update
+ use se_dyn_time_mod, only: TimeLevel_t, timelevel_update
use control_mod, only: statefreq, qsplit, nu_p
use thread_mod, only: omp_get_thread_num
use prim_advance_mod, only: prim_advance_exp
use prim_advection_mod, only: prim_advec_tracers_remap, prim_advec_tracers_fvm, deriv
use derivative_mod, only: subcell_integration
use hybrid_mod, only: set_region_num_threads, config_thread_region, get_loop_ranges
- use dimensions_mod, only: ntrac,fvm_supercycling,fvm_supercycling_jet
+ use dimensions_mod, only: use_cslam,fvm_supercycling,fvm_supercycling_jet
use dimensions_mod, only: kmin_jet, kmax_jet
use fvm_mod, only: ghostBufQnhc_vh,ghostBufQ1_vh, ghostBufFlux_vh
use fvm_mod, only: ghostBufQ1_h,ghostBufQnhcJet_h, ghostBufFluxJet_h
@@ -493,7 +493,7 @@ subroutine prim_step(elem, fvm, hybrid,nets,nete, dt, tl, hvcoord, rstep)
! defer final timelevel update until after Q update.
enddo
#ifdef HOMME_TEST_SUB_ELEMENT_MASS_FLUX
- if (ntrac>0.and.rstep==1) then
+ if (use_cslam.and.rstep==1) then
do ie=nets,nete
do k=1,nlev
tempdp3d = elem(ie)%state%dp3d(:,:,k,tl%np1) - &
@@ -540,7 +540,7 @@ subroutine prim_step(elem, fvm, hybrid,nets,nete, dt, tl, hvcoord, rstep)
if (qsize > 0) then
call t_startf('prim_advec_tracers_remap')
- if(ntrac>0) then
+ if(use_cslam) then
! Deactivate threading in the tracer dimension if this is a CSLAM run
region_num_threads = 1
else
@@ -548,7 +548,7 @@ subroutine prim_step(elem, fvm, hybrid,nets,nete, dt, tl, hvcoord, rstep)
endif
call omp_set_nested(.true.)
!$OMP PARALLEL NUM_THREADS(region_num_threads), DEFAULT(SHARED), PRIVATE(hybridnew)
- if(ntrac>0) then
+ if(use_cslam) then
! Deactivate threading in the tracer dimension if this is a CSLAM run
hybridnew = config_thread_region(hybrid,'serial')
else
@@ -562,7 +562,7 @@ subroutine prim_step(elem, fvm, hybrid,nets,nete, dt, tl, hvcoord, rstep)
!
! only run fvm transport every fvm_supercycling rstep
!
- if (ntrac>0) then
+ if (use_cslam) then
!
! FVM transport
!
diff --git a/src/dynamics/se/dycore/prim_init.F90 b/src/dynamics/se/dycore/prim_init.F90
index afbd94869e..42a336f65c 100644
--- a/src/dynamics/se/dycore/prim_init.F90
+++ b/src/dynamics/se/dycore/prim_init.F90
@@ -28,7 +28,7 @@ subroutine prim_init1(elem, fvm, par, Tl)
use element_mod, only: element_t, allocate_element_desc
use fvm_mod, only: fvm_init1
use mesh_mod, only: MeshUseMeshFile
- use time_mod, only: timelevel_init, timelevel_t
+ use se_dyn_time_mod, only: timelevel_init, timelevel_t
use mass_matrix_mod, only: mass_matrix
use derivative_mod, only: allocate_subcell_integration_matrix_cslam
use derivative_mod, only: allocate_subcell_integration_matrix_physgrid
diff --git a/src/dynamics/se/dycore/prim_state_mod.F90 b/src/dynamics/se/dycore/prim_state_mod.F90
index f01ffbd049..3075c0e125 100644
--- a/src/dynamics/se/dycore/prim_state_mod.F90
+++ b/src/dynamics/se/dycore/prim_state_mod.F90
@@ -4,7 +4,7 @@ module prim_state_mod
use dimensions_mod, only: nlev, np, nc, qsize_d, ntrac_d
use parallel_mod, only: ordered
use hybrid_mod, only: hybrid_t
- use time_mod, only: timelevel_t, TimeLevel_Qdp, time_at
+ use se_dyn_time_mod, only: timelevel_t, TimeLevel_Qdp, time_at
use control_mod, only: qsplit, statediag_numtrac
use global_norms_mod, only: global_integrals_general
use element_mod, only: element_t
@@ -19,12 +19,12 @@ module prim_state_mod
CONTAINS
subroutine prim_printstate(elem, tl,hybrid,nets,nete, fvm, omega_cn)
- use dimensions_mod, only: ntrac
+ use dimensions_mod, only: use_cslam
use constituents, only: cnst_name
use air_composition, only: thermodynamic_active_species_idx_dycore, dry_air_species_num
use air_composition, only: thermodynamic_active_species_num,thermodynamic_active_species_idx
use cam_control_mod, only: initial_run
- use time_mod, only: tstep
+ use se_dyn_time_mod, only: tstep
use control_mod, only: rsplit, qsplit
use perf_mod, only: t_startf, t_stopf
type (element_t), intent(inout) :: elem(:)
@@ -60,7 +60,7 @@ subroutine prim_printstate(elem, tl,hybrid,nets,nete, fvm, omega_cn)
n0=tl%n0
call TimeLevel_Qdp( tl, qsplit, n0_qdp)
! moist surface pressure
- if (ntrac>0) then
+ if (use_cslam) then
do ie=nets,nete
moist_ps_fvm(:,:,ie)=SUM(fvm(ie)%dp_fvm(1:nc,1:nc,:),DIM=3)
do q=dry_air_species_num+1,thermodynamic_active_species_num
@@ -86,7 +86,7 @@ subroutine prim_printstate(elem, tl,hybrid,nets,nete, fvm, omega_cn)
do ie=nets,nete
da_gll(:,:,ie) = elem(ie)%mp(:,:)*elem(ie)%metdet(:,:)
enddo
- if (ntrac>0) then
+ if (use_cslam) then
do ie=nets,nete
da_fvm(:,:,ie) = fvm(ie)%area_sphere(:,:)
enddo
@@ -103,7 +103,7 @@ subroutine prim_printstate(elem, tl,hybrid,nets,nete, fvm, omega_cn)
varname(3) = 'T '
varname(4) = 'OMEGA '
varname(5) = 'OMEGA CN '
- if (ntrac>0) then
+ if (use_cslam) then
varname(6) = 'PSDRY(fvm)'
varname(7) = 'PS(fvm) '
varname(8) = 'PSDRY(gll)'
@@ -133,7 +133,7 @@ subroutine prim_printstate(elem, tl,hybrid,nets,nete, fvm, omega_cn)
min_local(ie,5) = 0.0_r8
max_local(ie,5) = 0.0_r8
end if
- if (ntrac>0) then
+ if (use_cslam) then
min_local(ie,6) = MINVAL(SUM(fvm(ie)%dp_fvm(1:nc,1:nc,:),DIM=3))
max_local(ie,6) = MAXVAL(SUM(fvm(ie)%dp_fvm(1:nc,1:nc,:),DIM=3))
min_local(ie,7) = MINVAL(moist_ps_fvm(:,:,ie))
@@ -168,7 +168,7 @@ subroutine prim_printstate(elem, tl,hybrid,nets,nete, fvm, omega_cn)
max_local(ie,nm2+1) = MAXVAL(elem(ie)%derived%FT(:,:,:))
min_local(ie,nm2+2) = MINVAL(elem(ie)%derived%FM(:,:,:,:))
max_local(ie,nm2+2) = MAXVAL(elem(ie)%derived%FM(:,:,:,:))
- if (ntrac>0) then
+ if (use_cslam) then
do q=1,statediag_numtrac
varname(nm2+2+q) = TRIM('F'//TRIM(cnst_name(q)))
min_local(ie,nm2+2+q) = MINVAL(fvm(ie)%fc(1:nc,1:nc,:,q))
@@ -201,7 +201,7 @@ subroutine prim_printstate(elem, tl,hybrid,nets,nete, fvm, omega_cn)
! tracers
!
mass = -1.0_r8
- if (ntrac>0) then
+ if (use_cslam) then
do ie=nets,nete
do q=1,statediag_numtrac
tmp_fvm(:,:,q,ie) = SUM(fvm(ie)%c(1:nc,1:nc,:,q)*fvm(ie)%dp_fvm(1:nc,1:nc,:),DIM=3)
@@ -243,7 +243,7 @@ subroutine prim_printstate(elem, tl,hybrid,nets,nete, fvm, omega_cn)
if (tl%nstep==0.or..not. initial_run) then
mass_chg(:) = 0.0_R8
elem(nets)%derived%mass(nm+1:nm+statediag_numtrac) = mass(nm+1:nm+statediag_numtrac)
- if (ntrac>0) then
+ if (use_cslam) then
elem(nets)%derived%mass(6:9) = mass(6:9)
else
elem(nets)%derived%mass(6:7) = mass(6:7)
@@ -345,10 +345,10 @@ end subroutine prim_printstate_cslam_gamma
subroutine adjust_nsplit(elem, tl,hybrid,nets,nete, fvm, omega_cn)
use dimensions_mod, only: ksponge_end
use dimensions_mod, only: fvm_supercycling, fvm_supercycling_jet
- use time_mod, only: tstep
+ use se_dyn_time_mod, only: tstep
use control_mod, only: rsplit, qsplit
use perf_mod, only: t_startf, t_stopf
- use time_mod, only: nsplit, nsplit_baseline,rsplit_baseline
+ use se_dyn_time_mod, only: nsplit, nsplit_baseline,rsplit_baseline
use control_mod, only: qsplit, rsplit
use time_manager, only: get_step_size
use cam_abortutils, only: endrun
diff --git a/src/dynamics/se/dycore/time_mod.F90 b/src/dynamics/se/dycore/se_dyn_time_mod.F90
similarity index 98%
rename from src/dynamics/se/dycore/time_mod.F90
rename to src/dynamics/se/dycore/se_dyn_time_mod.F90
index fdd68af06a..4dfd981661 100644
--- a/src/dynamics/se/dycore/time_mod.F90
+++ b/src/dynamics/se/dycore/se_dyn_time_mod.F90
@@ -1,4 +1,4 @@
-module time_mod
+module se_dyn_time_mod
!------------------
use shr_kind_mod, only: r8=>shr_kind_r8
!------------------
@@ -132,4 +132,4 @@ subroutine TimeLevel_update(tl,uptype)
!$OMP BARRIER
end subroutine TimeLevel_update
-end module time_mod
+end module se_dyn_time_mod
diff --git a/src/dynamics/se/dycore/viscosity_mod.F90 b/src/dynamics/se/dycore/viscosity_mod.F90
index 1240d4a15f..04b0a1a91d 100644
--- a/src/dynamics/se/dycore/viscosity_mod.F90
+++ b/src/dynamics/se/dycore/viscosity_mod.F90
@@ -52,7 +52,7 @@ module viscosity_mod
subroutine biharmonic_wk_dp3d(elem,dptens,dpflux,ttens,vtens,deriv,edge3,hybrid,nt,nets,nete,kbeg,kend,hvcoord)
use derivative_mod, only : subcell_Laplace_fluxes
- use dimensions_mod, only : ntrac, nu_div_lev,nu_lev
+ use dimensions_mod, only : use_cslam, nu_div_lev,nu_lev
use hybvcoord_mod, only : hvcoord_t
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! compute weak biharmonic operator
@@ -86,7 +86,7 @@ subroutine biharmonic_wk_dp3d(elem,dptens,dpflux,ttens,vtens,deriv,edge3,hybrid,
kblk = kend - kbeg + 1
- if (ntrac>0) dpflux = 0
+ if (use_cslam) dpflux = 0
!if tensor hyperviscosity with tensor V is used, then biharmonic operator is (\grad\cdot V\grad) (\grad \cdot \grad)
!so tensor is only used on second call to laplace_sphere_wk
var_coef1 = .true.
@@ -150,7 +150,7 @@ subroutine biharmonic_wk_dp3d(elem,dptens,dpflux,ttens,vtens,deriv,edge3,hybrid,
kptr = kbeg - 1 + 3*nlev
call edgeVunpack(edge3,dptens(:,:,kbeg:kend,ie),kblk,kptr,ie)
- if (ntrac>0) then
+ if (use_cslam) then
do k=1,nlev
!CLEAN tmp(:,:)= rspheremv(:,:)*dptens(:,:,k,ie)
tmp(:,:)= elem(ie)%rspheremp(:,:)*dptens(:,:,k,ie)
diff --git a/src/dynamics/se/dycore_budget.F90 b/src/dynamics/se/dycore_budget.F90
new file mode 100644
index 0000000000..d2bfe0fceb
--- /dev/null
+++ b/src/dynamics/se/dycore_budget.F90
@@ -0,0 +1,528 @@
+module dycore_budget
+use shr_kind_mod, only: r8=>shr_kind_r8
+implicit none
+
+public :: print_budget
+real(r8), parameter :: eps = 1.0E-7_r8
+real(r8), parameter :: eps_mass = 1.0E-12_r8
+
+real(r8), save :: previous_dEdt_adiabatic_dycore = 0.0_r8
+real(r8), save :: previous_dEdt_dry_mass_adjust = 0.0_r8
+real(r8), save :: previous_dEdt_phys_dyn_coupl_err = 0.0_r8
+!=========================================================================================
+contains
+!=========================================================================================
+
+subroutine print_budget(hstwr)
+
+ use spmd_utils, only: masterproc
+ use cam_abortutils, only: endrun
+ use cam_logfile, only: iulog
+ use cam_budget, only: cam_budget_get_global, is_cam_budget, thermo_budget_histfile_num, thermo_budget_history
+ use cam_thermo, only: thermo_budget_vars_descriptor, thermo_budget_num_vars, thermo_budget_vars_massv, &
+ teidx, seidx, keidx, poidx
+ use dimensions_mod, only: use_cslam
+ use control_mod, only: ftype
+
+ ! arguments
+ logical, intent(in) :: hstwr(:)
+
+ ! Local variables
+ character(len=*), parameter :: subname = 'dycore_budget:print_budgets:'
+ !
+ ! physics energy tendencies
+ !
+ integer :: idx(4)
+ real(r8) :: dEdt_param_physE(4) ! dE/dt CAM physics using physics E formula (phAP-phBP)
+ real(r8) :: dEdt_param_dynE(4) ! dE/dt CAM physics using dycore E (dyAP-dyBP)
+
+ real(r8) :: dEdt_efix_physE(4) ! dE/dt energy fixer using physics E formula (phBP-phBF)
+ real(r8) :: dEdt_efix_dynE(4) ! dE/dt energy fixer using dycore E formula (dyBP-dyBF)
+
+ real(r8) :: dEdt_dme_adjust_physE(4) ! dE/dt dry mass adjustment using physics E formula (phAM-phAP)
+ real(r8) :: dEdt_dme_adjust_dynE(4) ! dE/dt dry mass adjustment using dycore E (dyAM-dyAP)
+
+ real(r8) :: dEdt_param_efix_physE(4) ! dE/dt CAM physics + energy fixer using physics E formula (phAP-phBF)
+ real(r8) :: dEdt_param_efix_dynE(4) ! dE/dt CAM physics + energy fixer using dycore E formula (dyAP-dyBF)
+
+ real(r8) :: dEdt_phys_total_dynE(4) ! dE/dt physics total using dycore E (dyAM-dyBF)
+ ! physics total = parameterizations + efix + dry-mass adjustment
+ !
+ ! SE dycore specific energy tendencies
+ !
+ real(r8) :: dEdt_phys_total_in_dyn(4) ! dEdt of physics total in dynamical core
+ ! physics total = parameterizations + efix + dry-mass adjustment
+ real(r8) :: dEdt_dycore_phys ! dEdt dycore (estimated in physics)
+ !
+ ! mass budgets physics
+ !
+ real(r8) :: dMdt_efix ! mass tendency energy fixer
+ real(r8) :: dMdt_parameterizations ! mass tendency physics paramterizations
+ real(r8) :: dMdt_dme_adjust ! mass tendency dry-mass adjustment
+ real(r8) :: dMdt_phys_total ! mass tendency physics total (energy fixer + parameterizations + dry-mass adjustment)
+ !
+ ! mass budgets dynamics
+ !
+ real(r8) :: dMdt_floating_dyn ! mass tendency floating dynamics (dAD-dBD)
+ real(r8) :: dMdt_vert_remap ! mass tendency vertical remapping (dAR-dAD)
+ real(r8) :: dMdt_del4_fric_heat ! mass tendency del4 frictional heating (dAH-dCH)
+ real(r8) :: dMdt_del4_tot ! mass tendency del4 + del4 frictional heating (dAH-dBH)
+ real(r8) :: dMdt_residual ! mass tendency residual (time truncation errors)
+ real(r8) :: dMdt_phys_total_in_dyn ! mass tendency physics total in dycore
+ real(r8) :: dMdt_PDC ! mass tendency physics-dynamics coupling
+ !
+ ! energy budgets dynamics
+ !
+ real(r8) :: dEdt_floating_dyn ! dE/dt floating dynamics (dAD-dBD)
+ real(r8) :: dEdt_vert_remap ! dE/dt vertical remapping (dAR-dAD)
+ real(r8) :: dEdt_del4 ! dE/dt del4 (dCH-dBH)
+ real(r8) :: dEdt_del4_fric_heat ! dE/dt del4 frictional heating (dAH-dCH)
+ real(r8) :: dEdt_del4_tot ! dE/dt del4 + del4 fricitional heating (dAH-dBH)
+ real(r8) :: dEdt_del2_sponge ! dE/dt del2 sponge (dAS-dBS)
+ real(r8) :: dEdt_del2_del4_tot ! dE/dt explicit diffusion total
+ real(r8) :: dEdt_residual ! dE/dt residual (dEdt_floating_dyn-dEdt_del2_del4_tot)
+ real(r8) :: dEdt_dycore_dyn ! dE/dt adiabatic dynamical core (calculated in dycore)
+ !
+ ! physics-dynamics coupling variables
+ !
+ real(r8) :: E_dBF(4) ! E of dynamics state at the end of dycore integration (on dycore deomposition)
+ real(r8) :: E_dyBF(4) ! E of physics state using dycore E
+
+
+ real(r8) :: diff, tmp ! dummy variables
+ integer :: m_cnst, i
+ character(LEN=*), parameter :: fmt = "(a40,a15,a1,F6.2,a1,F6.2,a1,E10.2,a5)"
+ character(LEN=*), parameter :: fmtf = "(a48,F8.4,a6)"
+ character(LEN=*), parameter :: fmtm = "(a48,E8.2,a9)"
+ character(LEN=15) :: str(4)
+ character(LEN=5) :: pf ! pass or fail identifier
+ !--------------------------------------------------------------------------------------
+
+ if (masterproc .and. thermo_budget_history .and. hstwr(thermo_budget_histfile_num)) then
+ idx(1) = teidx !total energy index
+ idx(2) = seidx !enthaly index
+ idx(3) = keidx !kinetic energy index
+ idx(4) = poidx !surface potential energy index
+ str(1) = "(total )"
+ str(2) = "(enthalpy )"
+ str(3) = "(kinetic )"
+ str(4) = "(srf potential)"
+ do i=1,4
+ !
+ ! CAM physics energy tendencies
+ !
+ call cam_budget_get_global('phAP-phBP',idx(i),dEdt_param_physE(i))
+ call cam_budget_get_global('phBP-phBF',idx(i),dEdt_efix_physE(i))
+ call cam_budget_get_global('phAM-phAP',idx(i),dEdt_dme_adjust_physE(i))
+ call cam_budget_get_global('phAP-phBF',idx(i),dEdt_param_efix_physE(i))
+ !
+ ! CAM physics energy tendencies using dycore energy formula scaling
+ ! temperature tendencies for consistency with CAM physics
+ !
+ call cam_budget_get_global('dyAP-dyBP',idx(i),dEdt_param_dynE(i))
+ call cam_budget_get_global('dyBP-dyBF',idx(i),dEdt_efix_dynE(i))
+ call cam_budget_get_global('dyAM-dyAP',idx(i),dEdt_dme_adjust_dynE(i))
+ call cam_budget_get_global('dyAP-dyBF',idx(i),dEdt_param_efix_dynE(i))
+ call cam_budget_get_global('dyAM-dyBF',idx(i),dEdt_phys_total_dynE(i))
+ call cam_budget_get_global('dyBF' ,idx(i),E_dyBF(i))!state beginning physics
+ !
+ ! CAM physics energy tendencies in dynamical core
+ !
+ call cam_budget_get_global('dBD-dAF',idx(i),dEdt_phys_total_in_dyn(i))
+ call cam_budget_get_global('dBF' ,idx(i),E_dBF(i)) !state passed to physics
+ end do
+
+ call cam_budget_get_global('dAD-dBD',teidx,dEdt_floating_dyn)
+ call cam_budget_get_global('dAR-dAD',teidx,dEdt_vert_remap)
+ dEdt_dycore_dyn = dEdt_floating_dyn+dEdt_vert_remap
+
+ call cam_budget_get_global('dCH-dBH',teidx,dEdt_del4)
+ call cam_budget_get_global('dAH-dCH',teidx,dEdt_del4_fric_heat)
+ call cam_budget_get_global('dAH-dBH',teidx,dEdt_del4_tot)
+ call cam_budget_get_global('dAS-dBS',teidx,dEdt_del2_sponge)
+ dEdt_del2_del4_tot = dEdt_del4_tot+dEdt_del2_sponge
+ dEdt_residual = dEdt_floating_dyn-dEdt_del2_del4_tot
+
+ write(iulog,*)" "
+ write(iulog,*)"======================================================================"
+ write(iulog,*)"Total energy diagnostics introduced in Lauritzen and Williamson (2019)"
+ write(iulog,*)"(DOI:10.1029/2018MS001549)"
+ write(iulog,*)"======================================================================"
+ write(iulog,*)" "
+ write(iulog,*)"Globally and vertically integrated total energy (E) diagnostics are"
+ write(iulog,*)"computed at various points in the physics and dynamics loops to compute"
+ write(iulog,*)"energy tendencies (dE/dt) and check for consistency (e.g., is E of"
+ write(iulog,*)"state passed to physics computed using dycore state variables the same"
+ write(iulog,*)"E of the state in the beginning of physics computed using the physics"
+ write(iulog,*)"representation of the state)"
+ write(iulog,*)" "
+ write(iulog,*)"Energy stages in physics:"
+ write(iulog,*)"-------------------------"
+ write(iulog,*)" "
+ write(iulog,*)" xxBF: state passed to parameterizations, before energy fixer"
+ write(iulog,*)" xxBP: after energy fixer, before parameterizations"
+ write(iulog,*)" xxAP: after last phys_update in parameterizations and state "
+ write(iulog,*)" saved for energy fixer"
+ write(iulog,*)" xxAM: after dry mass adjustment"
+ write(iulog,*)" history files saved off here"
+ write(iulog,*)" "
+ write(iulog,*)"where xx='ph','dy' "
+ write(iulog,*)" "
+ write(iulog,*)"Suffix ph is CAM physics total energy"
+ write(iulog,*)"(eq. 111 in Lauritzen et al. 2022; 10.1029/2022MS003117)"
+ write(iulog,*)" "
+ write(iulog,*)"Suffix dy is dycore energy computed in CAM physics using"
+ write(iulog,*)"CAM physics state variables"
+ write(iulog,*)" "
+ write(iulog,*)" "
+ write(iulog,*)"Energy stages in dynamics (specific to the SE dycore)"
+ write(iulog,*)"-----------------------------------------------------"
+ write(iulog,*)" "
+ write(iulog,*)"suffix (d)"
+ write(iulog,*)"dED: state from end of previous dynamics (= pBF + time sampling)"
+ write(iulog,*)" loop over vertical remapping and physics dribbling -------- (nsplit) -------"
+ write(iulog,*)" (dribbling and remapping always done together) |"
+ write(iulog,*)" dAF: state from previous remapping |"
+ write(iulog,*)" dBD: state after physics dribble, before dynamics |"
+ write(iulog,*)" loop over vertical Lagrangian dynamics --------rsplit------------- |"
+ write(iulog,*)" dynamics here | |"
+ write(iulog,*)" loop over hyperviscosity ----------hypervis_sub------------ | |"
+ write(iulog,*)" dBH state before hyperviscosity | | |"
+ write(iulog,*)" dCH state after hyperviscosity | | |"
+ write(iulog,*)" dAH state after hyperviscosity momentum heating | | |"
+ write(iulog,*)" end hyperviscosity loop ----------------------------------- | |"
+ write(iulog,*)" dBS state before del2 sponge | | |"
+ write(iulog,*)" dAS state after del2+mom heating sponge | | |"
+ write(iulog,*)" end of vertical Lagrangian dynamics loop ------------------------- |"
+ write(iulog,*)" dAD state after dynamics, before vertical remapping |"
+ write(iulog,*)" dAR state after vertical remapping |"
+ write(iulog,*)" end of remapping loop ------------------------------------------------------"
+ write(iulog,*)"dBF state passed to parameterizations = state after last remapping "
+ write(iulog,*)" "
+ write(iulog,*)" "
+ write(iulog,*)"FYI: all difference (diff) below are absolute normalized differences"
+ write(iulog,*)" "
+ write(iulog,*)"Consistency check 0:"
+ write(iulog,*)"--------------------"
+ write(iulog,*)" "
+ write(iulog,*)"For energetic consistency we require that dE/dt [W/m^2] from energy "
+ write(iulog,*)"fixer and all parameterizations computed using physics E and"
+ write(iulog,*)"dycore in physics E are the same! Checking:"
+ write(iulog,*)" "
+ write(iulog,*) " xx=ph xx=dy norm. diff."
+ write(iulog,*) " ----- ----- -----------"
+ do i=1,4
+ diff = abs_diff(dEdt_efix_physE(i),dEdt_efix_dynE(i),pf=pf)
+ write(iulog,fmt)"dE/dt energy fixer (xxBP-xxBF) ",str(i)," ",dEdt_efix_physE(i), " ", &
+ dEdt_efix_dynE(i)," ",diff,pf
+ diff = abs_diff(dEdt_param_physE(i),dEdt_param_dynE(i),pf=pf)
+ write(iulog,fmt)"dE/dt all parameterizations (xxAP-xxBP) ",str(i)," ",dEdt_param_physE(i)," ", &
+ dEdt_param_dynE(i)," ",diff,pf
+ write(iulog,*) " "
+ if (diff>eps) then
+ write(iulog,*)"FAIL"
+ call endrun(subname//"dE/dt's in physics inconsistent")
+ end if
+ end do
+ write(iulog,*)" "
+ write(iulog,*)" "
+ write(iulog,*)"dE/dt from dry-mass adjustment will differ if dynamics and physics use"
+ write(iulog,*)"different energy definitions! Checking:"
+ write(iulog,*)" "
+ write(iulog,*) " xx=ph xx=dy diff"
+ write(iulog,*) " ----- ----- ----"
+ do i=1,4
+ diff = dEdt_dme_adjust_physE(i)-dEdt_dme_adjust_dynE(i)
+ write(iulog,fmt)"dE/dt dry mass adjustment (xxAM-xxAP) ",str(i)," ",dEdt_dme_adjust_physE(i)," ", &
+ dEdt_dme_adjust_dynE(i)," ",diff
+ end do
+ write(iulog,*)" "
+ write(iulog,*)" "
+ !
+ ! these diagnostics only make sense time-step to time-step
+ !
+ write(iulog,*)" "
+ write(iulog,*)"Some energy budget observations:"
+ write(iulog,*)"--------------------------------"
+ write(iulog,*)" "
+ write(iulog,*)"Note that total energy fixer fixes:"
+ write(iulog,*) " "
+ write(iulog,*) "-dE/dt energy fixer(t=n) = dE/dt dry mass adjustment (t=n-1) +"
+ write(iulog,*) " dE/dt adiabatic dycore (t=n-1) +"
+ write(iulog,*) " dE/dt physics-dynamics coupling errors (t=n-1)"
+ write(iulog,*) " "
+ write(iulog,*) "(equation 23 in Lauritzen and Williamson (2019))"
+ write(iulog,*) " "
+
+ tmp = previous_dEdt_phys_dyn_coupl_err+previous_dEdt_adiabatic_dycore+previous_dEdt_dry_mass_adjust
+ diff = abs_diff(-dEdt_efix_dynE(1),tmp,pf)
+ if (.not.use_cslam) then
+ write(iulog,*) "Check if that is the case:", pf, diff
+ write(iulog,*) " "
+ if (abs(diff)>eps) then
+ write(iulog,*) "dE/dt energy fixer(t=n) = ",dEdt_efix_dynE(1)
+ write(iulog,*) "dE/dt dry mass adjustment (t=n-1) = ",previous_dEdt_dry_mass_adjust
+ write(iulog,*) "dE/dt adiabatic dycore (t=n-1) = ",previous_dEdt_adiabatic_dycore
+ write(iulog,*) "dE/dt physics-dynamics coupling errors (t=n-1) = ",previous_dEdt_phys_dyn_coupl_err
+ end if
+ else
+ previous_dEdt_phys_dyn_coupl_err = dEdt_efix_dynE(1)+previous_dEdt_dry_mass_adjust+previous_dEdt_adiabatic_dycore
+ write(iulog,*) "dE/dt energy fixer(t=n) = ",dEdt_efix_dynE(1)
+ write(iulog,*) "dE/dt dry mass adjustment (t=n-1) = ",previous_dEdt_dry_mass_adjust
+ write(iulog,*) "dE/dt adiabatic dycore (t=n-1) = ",previous_dEdt_adiabatic_dycore
+ write(iulog,*) "dE/dt physics-dynamics coupling errors (t=n-1) = ",previous_dEdt_phys_dyn_coupl_err
+ write(iulog,*) " "
+ write(iulog,*) "Note: when running CSLAM the physics-dynamics coupling error is diagnosed"
+ write(iulog,*) " (using equation above) rather than explicitly computed"
+ write(iulog,*) " "
+ write(iulog,*) " "
+ write(iulog,*) "Physics-dynamics coupling errors include: "
+ write(iulog,*) " "
+ write(iulog,*) " -dE/dt adiabatic dycore is computed on GLL grid;"
+ write(iulog,*) " error in mapping to physics grid"
+ write(iulog,*) " -dE/dt physics tendencies mapped to GLL grid"
+ write(iulog,*) " (tracer tendencies mapped non-conservatively!)"
+ write(iulog,*) " -dE/dt dynamics state mapped to GLL grid"
+ end if
+ write(iulog,*) ""
+ if (.not.use_cslam) then
+ dEdt_dycore_phys = -dEdt_efix_dynE(1)-previous_dEdt_phys_dyn_coupl_err-previous_dEdt_dry_mass_adjust
+ write(iulog,*) "Hence the dycore E dissipation estimated from energy fixer "
+ write(iulog,'(A39,F6.2,A6)') "based on previous time-step values is ",dEdt_dycore_phys," W/M^2"
+ write(iulog,*) " "
+ end if
+ write(iulog,*) " "
+ write(iulog,*) "-------------------------------------------------------------------"
+ write(iulog,*) " Consistency check 1: state passed to physics same as end dynamics?"
+ write(iulog,*) "-------------------------------------------------------------------"
+ write(iulog,*) " "
+ write(iulog,*) "Is globally integrated total energy of state at the end of dynamics (dBF)"
+ write(iulog,*) "and beginning of physics (using dynamics in physics energy; dyBF) the same?"
+ write(iulog,*) ""
+ if (.not.use_cslam) then
+ if (abs(E_dyBF(1))>eps) then
+ diff = abs_diff(E_dBF(1),E_dyBF(1))
+ if (abs(diff)eps) then
+ !
+ ! if errors print details
+ !
+ if (ftype==1) then
+ write(iulog,*) ""
+ write(iulog,*) " You are using ftype==1 so physics-dynamics coupling errors should be round-off!"
+ write(iulog,*) ""
+ write(iulog,*) " Because of failure provide detailed diagnostics below:"
+ write(iulog,*) ""
+ else
+ write(iulog,*) ""
+ write(iulog,*) " Since ftype<>1 there are physics dynamics coupling errors"
+ write(iulog,*) ""
+ write(iulog,*) " Break-down below:"
+ write(iulog,*) ""
+ end if
+
+ do i=1,4
+ write(iulog,*) str(i),":"
+ write(iulog,*) "======"
+ diff = abs_diff(dEdt_phys_total_dynE(i),dEdt_phys_total_in_dyn(i),pf=pf)
+ write(iulog,*) "dE/dt physics-dynamics coupling errors (diff) ",diff
+ write(iulog,*) "dE/dt physics total in dynamics (dBD-dAF) ",dEdt_phys_total_in_dyn(i)
+ write(iulog,*) "dE/dt physics total in physics (dyAM-dyBF) ",dEdt_phys_total_dynE(i)
+ write(iulog,*) " "
+ write(iulog,*) " physics total = parameterizations + efix + dry-mass adjustment"
+ write(iulog,*) " "
+ end do
+! Temporarily disable endrun until energy bias for consistancy check 2 is better understood.
+! if (ftype==1) then
+! call endrun(subname//"Physics-dynamics coupling error. See atm.log")
+! end if
+ end if
+ else
+ write(iulog,'(a47,F6.2,a6)')" dE/dt physics tendency in dynamics (dBD-dAF) ",dEdt_phys_total_in_dyn(1)," W/M^2"
+ write(iulog,'(a47,F6.2,a6)')" dE/dt physics tendency in physics (dyAM-dyBF) ",dEdt_phys_total_dynE(1)," W/M^2"
+ write(iulog,*)" "
+ write(iulog,*) " When runnig with a physics grid this consistency check does not make sense"
+ write(iulog,*) " since it is computed on the GLL grid whereas we enforce energy conservation"
+ write(iulog,*) " on the physics grid. To assess the errors of running dynamics on GLL"
+ write(iulog,*) " grid, tracers on CSLAM grid and physics on physics grid we use the energy"
+ write(iulog,*) " fixer check from above:"
+ write(iulog,*) " "
+ write(iulog,*) " dE/dt physics-dynamics coupling errors (t=n-1) =",previous_dEdt_phys_dyn_coupl_err
+ write(iulog,*) ""
+ end if
+ write(iulog,*)" "
+ write(iulog,*)"------------------------------------------------------------"
+ write(iulog,*)" SE dycore energy tendencies"
+ write(iulog,*)"------------------------------------------------------------"
+ write(iulog,*)" "
+ write(iulog,fmtf)" dE/dt dycore ",dEdt_dycore_dyn," W/M^2"
+ write(iulog,*)" "
+ write(iulog,*)"Adiabatic dynamics can be divided into quasi-horizontal and vertical remapping: "
+ write(iulog,*)" "
+ write(iulog,fmtf)" dE/dt floating dynamics (dAD-dBD) ",dEdt_floating_dyn," W/M^2"
+ write(iulog,fmtf)" dE/dt vertical remapping (dAR-dAD) ",dEdt_vert_remap," W/M^2"
+
+ write(iulog,*) " "
+ write(iulog,*) "Breakdown of floating dynamics:"
+ write(iulog,*) " "
+ write(iulog,fmtf)" dE/dt hypervis del4 (dCH-dBH) ",dEdt_del4, " W/M^2"
+ write(iulog,fmtf)" dE/dt hypervis frictional heating (dAH-dCH) ",dEdt_del4_fric_heat," W/M^2"
+ write(iulog,fmtf)" dE/dt hypervis del4 total (dAH-dBH) ",dEdt_del4_tot, " W/M^2"
+ write(iulog,fmtf)" dE/dt hypervis sponge del2 (dAS-dBS) ",dEdt_del2_sponge, " W/M^2"
+ write(iulog,fmtf)" dE/dt explicit diffusion total ",dEdt_del2_del4_tot, " W/M^2"
+ write(iulog,*) " "
+ write(iulog,fmtf)" dE/dt residual (time-truncation errors,...) ",dEdt_residual, " W/M^2"
+ write(iulog,*)" "
+ write(iulog,*)" "
+ write(iulog,*)"------------------------------------------------------------"
+ write(iulog,*)"Tracer mass budgets"
+ write(iulog,*)"------------------------------------------------------------"
+ write(iulog,*)" "
+ write(iulog,*)"Below the physics-dynamics coupling error is computed as "
+ write(iulog,*)"dMASS/dt physics tendency in dycore (dBD-dAF) minus"
+ write(iulog,*)"dMASS/dt total physics (pAM-pBF)"
+ write(iulog,*)" "
+ write(iulog,*)" "
+ do m_cnst=1,thermo_budget_num_vars
+ if (thermo_budget_vars_massv(m_cnst)) then
+ write(iulog,*)thermo_budget_vars_descriptor(m_cnst)
+ write(iulog,*)"------------------------------"
+ call cam_budget_get_global('phBP-phBF',m_cnst,dMdt_efix)
+ call cam_budget_get_global('phAM-phAP',m_cnst,dMdt_dme_adjust)
+ call cam_budget_get_global('phAP-phBP',m_cnst,dMdt_parameterizations)
+ call cam_budget_get_global('phAM-phBF',m_cnst,dMdt_phys_total)
+ !
+ ! total energy fixer should not affect mass - checking
+ !
+ if (abs(dMdt_efix)>eps_mass) then
+ write(iulog,*) "dMASS/dt energy fixer (pBP-pBF) ",dMdt_efix," Pa/m^2/s"
+ write(iulog,*) "ERROR: Mass not conserved in energy fixer. ABORT"
+ call endrun(subname//"Mass not conserved in energy fixer. See atm.log")
+ endif
+ !
+ ! dry-mass adjustmnt should not affect mass - checking
+ !
+ if (abs(dMdt_dme_adjust)>eps_mass) then
+ write(iulog,*)"dMASS/dt dry mass adjustment (pAM-pAP) ",dMdt_dme_adjust," Pa/m^2/s"
+ write(iulog,*) "ERROR: Mass not conserved in dry mass adjustment. ABORT"
+ call endrun(subname//"Mass not conserved in dry mass adjustment. See atm.log")
+ end if
+ !
+ ! all of the mass-tendency should come from parameterization - checking
+ !
+ if (abs(dMdt_parameterizations-dMdt_phys_total)>eps_mass) then
+ write(iulog,*) "Error: dMASS/dt parameterizations (pAP-pBP) .ne. dMASS/dt physics total (pAM-pBF)"
+ write(iulog,*) "dMASS/dt parameterizations (pAP-pBP) ",dMdt_parameterizations," Pa/m^2/s"
+ write(iulog,*) "dMASS/dt physics total (pAM-pBF) ",dMdt_phys_total," Pa/m^2/s"
+ call endrun(subname//"mass change not only due to parameterizations. See atm.log")
+ end if
+ write(iulog,*)" "
+ !
+ ! detailed mass budget in dynamical core
+ !
+ if (is_cam_budget('dAD').and.is_cam_budget('dBD').and.is_cam_budget('dAR').and.is_cam_budget('dCH')) then
+ call cam_budget_get_global('dAD-dBD',m_cnst,dMdt_floating_dyn)
+ call cam_budget_get_global('dAR-dAD',m_cnst,dMdt_vert_remap)
+ tmp = dMdt_floating_dyn+dMdt_vert_remap
+ diff = abs_diff(tmp,0.0_r8,pf=pf)
+ write(iulog,fmtm)" dMASS/dt total adiabatic dynamics ",diff,pf
+ !
+ ! check for mass-conservation in the adiabatic dynamical core -
+ ! if not conserved provide detailed break-down
+ !
+ if (abs(diff)>eps_mass) then
+ write(iulog,*) "Error: mass non-conservation in dynamical core"
+ write(iulog,*) "(detailed budget below)"
+ write(iulog,*) " "
+ write(iulog,*)"dMASS/dt 2D dynamics (dAD-dBD) ",dMdt_floating_dyn," Pa/m^2/s"
+ write(iulog,*)"dE/dt vertical remapping (dAR-dAD) ",dMdt_vert_remap
+ write(iulog,*)" "
+ write(iulog,*)"Breakdown of 2D dynamics:"
+ write(iulog,*)" "
+ call cam_budget_get_global('dAH-dCH',m_cnst,dMdt_del4_fric_heat)
+ call cam_budget_get_global('dAH-dBH',m_cnst,dMdt_del4_tot)
+ write(iulog,*)"dMASS/dt hypervis (dAH-dBH) ",dMdt_del4_tot," Pa/m^2/s"
+ write(iulog,*)"dMASS/dt frictional heating (dAH-dCH) ",dMdt_del4_fric_heat," Pa/m^2/s"
+ dMdt_residual = dMdt_floating_dyn-dMdt_del4_tot
+ write(iulog,*)"dMASS/dt residual (time truncation errors)",dMdt_residual," Pa/m^2/s"
+ end if
+ end if
+ if (is_cam_budget('dBD').and.is_cam_budget('dAF')) then
+ !
+ ! check if mass change in physics is the same as dynamical core
+ !
+ call cam_budget_get_global('dBD-dAF',m_cnst,dMdt_phys_total_in_dyn)
+ dMdt_PDC = dMdt_phys_total-dMdt_phys_total_in_dyn
+ write(iulog,fmtm)" Mass physics-dynamics coupling error ",dMdt_PDC," Pa/m^2/s"
+ write(iulog,*)" "
+ if (abs(dMdt_PDC)>eps_mass) then
+ write(iulog,fmtm)" dMASS/dt physics tendency in dycore (dBD-dAF) ",dMdt_phys_total_in_dyn," Pa/m^2/s"
+ write(iulog,fmtm)" dMASS/dt total physics ",dMdt_phys_total," Pa/m^2/s"
+ end if
+ end if
+ end if
+ end do
+ !
+ ! save adiabatic dycore dE/dt and dry-mass adjustment to avoid samping error
+ !
+ previous_dEdt_adiabatic_dycore = dEdt_dycore_dyn
+ previous_dEdt_dry_mass_adjust = dEdt_dme_adjust_dynE(1)
+ end if
+end subroutine print_budget
+!=========================================================================================
+function abs_diff(a,b,pf)
+ real(r8), intent(in) :: a,b
+ character(LEN=5), optional, intent(out):: pf
+ real(r8) :: abs_diff
+ if (abs(b)>eps) then
+ abs_diff = abs((b-a)/b)
+ else
+ abs_diff = abs(b-a)
+ end if
+ If (present(pf)) then
+ if (abs_diff>eps) then
+ pf = ' FAIL'
+ else
+ pf = ' PASS'
+ end if
+ end if
+end function abs_diff
+end module dycore_budget
diff --git a/src/dynamics/se/dyn_comp.F90 b/src/dynamics/se/dyn_comp.F90
index f0d42d6ed2..312349eb44 100644
--- a/src/dynamics/se/dyn_comp.F90
+++ b/src/dynamics/se/dyn_comp.F90
@@ -15,7 +15,7 @@ module dyn_comp
ini_grid_hdim_name
use cam_grid_support, only: cam_grid_id, cam_grid_get_gcid, &
- cam_grid_dimensions, cam_grid_get_dim_names, &
+ cam_grid_dimensions, &
cam_grid_get_latvals, cam_grid_get_lonvals, &
max_hcoordname_len
use cam_map_utils, only: iMap
@@ -38,11 +38,11 @@ module dyn_comp
use parallel_mod, only: par
use hybrid_mod, only: hybrid_t
-use dimensions_mod, only: nelemd, nlev, np, npsq, ntrac, nc, fv_nphys, &
- qsize
+use dimensions_mod, only: nelemd, nlev, np, npsq, ntrac, nc, fv_nphys
+use dimensions_mod, only: qsize, use_cslam
use element_mod, only: element_t, elem_state_t
use fvm_control_volume_mod, only: fvm_struct
-use time_mod, only: nsplit
+use se_dyn_time_mod, only: nsplit
use edge_mod, only: initEdgeBuffer, edgeVpack, edgeVunpack, FreeEdgeBuffer
use edgetype_mod, only: EdgeBuffer_t
use bndry_mod, only: bndry_exchange
@@ -84,6 +84,7 @@ module dyn_comp
real(r8), parameter :: rad2deg = 180.0_r8 / pi
real(r8), parameter :: deg2rad = pi / 180.0_r8
+real(r8), parameter :: rarea_sphere = 1.0_r8 / (4.0_r8*PI)
!===============================================================================
contains
@@ -106,13 +107,12 @@ subroutine dyn_readnl(NLFileName)
use control_mod, only: vert_remap_uvTq_alg, vert_remap_tracer_alg
use control_mod, only: tstep_type, rk_stage_user
use control_mod, only: ftype, limiter_option, partmethod
- use control_mod, only: topology, phys_dyn_cp, variable_nsplit
+ use control_mod, only: topology, variable_nsplit
use control_mod, only: fine_ne, hypervis_power, hypervis_scaling
use control_mod, only: max_hypervis_courant, statediag_numtrac,refined_mesh
- use control_mod, only: molecular_diff
+ use control_mod, only: molecular_diff, pgf_formulation
use control_mod, only: sponge_del4_nu_div_fac, sponge_del4_nu_fac, sponge_del4_lev
use dimensions_mod, only: ne, npart
- use dimensions_mod, only: lcp_moist
use dimensions_mod, only: large_Courant_incr
use dimensions_mod, only: fvm_supercycling, fvm_supercycling_jet
use dimensions_mod, only: kmin_jet, kmax_jet
@@ -120,13 +120,11 @@ subroutine dyn_readnl(NLFileName)
use parallel_mod, only: initmpi
use thread_mod, only: initomp, max_num_threads
use thread_mod, only: horz_num_threads, vert_num_threads, tracer_num_threads
- use physconst, only: rearth
! Dummy argument
character(len=*), intent(in) :: NLFileName
! Local variables
integer :: unitn, ierr,k
- real(r8) :: uniform_res_hypervis_scaling,nu_fac
! SE Namelist variables
integer :: se_fine_ne
@@ -162,15 +160,14 @@ subroutine dyn_readnl(NLFileName)
integer :: se_horz_num_threads
integer :: se_vert_num_threads
integer :: se_tracer_num_threads
- logical :: se_lcp_moist
logical :: se_write_restart_unstruct
logical :: se_large_Courant_incr
integer :: se_fvm_supercycling
integer :: se_fvm_supercycling_jet
integer :: se_kmin_jet
integer :: se_kmax_jet
- integer :: se_phys_dyn_cp
real(r8) :: se_molecular_diff
+ integer :: se_pgf_formulation
namelist /dyn_se_inparm/ &
se_fine_ne, & ! For refined meshes
@@ -209,15 +206,14 @@ subroutine dyn_readnl(NLFileName)
se_horz_num_threads, &
se_vert_num_threads, &
se_tracer_num_threads, &
- se_lcp_moist, &
se_write_restart_unstruct, &
se_large_Courant_incr, &
se_fvm_supercycling, &
se_fvm_supercycling_jet, &
se_kmin_jet, &
se_kmax_jet, &
- se_phys_dyn_cp, &
- se_molecular_diff
+ se_molecular_diff, &
+ se_pgf_formulation
!--------------------------------------------------------------------------
@@ -284,15 +280,14 @@ subroutine dyn_readnl(NLFileName)
call MPI_bcast(se_horz_num_threads, 1, MPI_integer, masterprocid, mpicom,ierr)
call MPI_bcast(se_vert_num_threads, 1, MPI_integer, masterprocid, mpicom,ierr)
call MPI_bcast(se_tracer_num_threads, 1, MPI_integer, masterprocid, mpicom,ierr)
- call MPI_bcast(se_lcp_moist, 1, mpi_logical, masterprocid, mpicom, ierr)
call MPI_bcast(se_write_restart_unstruct, 1, mpi_logical, masterprocid, mpicom, ierr)
call MPI_bcast(se_large_Courant_incr, 1, mpi_logical, masterprocid, mpicom, ierr)
call MPI_bcast(se_fvm_supercycling, 1, mpi_integer, masterprocid, mpicom, ierr)
call MPI_bcast(se_fvm_supercycling_jet, 1, mpi_integer, masterprocid, mpicom, ierr)
call MPI_bcast(se_kmin_jet, 1, mpi_integer, masterprocid, mpicom, ierr)
call MPI_bcast(se_kmax_jet, 1, mpi_integer, masterprocid, mpicom, ierr)
- call MPI_bcast(se_phys_dyn_cp, 1, mpi_integer, masterprocid, mpicom, ierr)
call MPI_bcast(se_molecular_diff, 1, mpi_real8, masterprocid, mpicom, ierr)
+ call MPI_bcast(se_pgf_formulation, 1, mpi_integer, masterprocid, mpicom, ierr)
if (se_npes <= 0) then
call endrun('dyn_readnl: ERROR: se_npes must be > 0')
@@ -353,26 +348,27 @@ subroutine dyn_readnl(NLFileName)
vert_remap_uvTq_alg = set_vert_remap(se_vert_remap_T, se_vert_remap_uvTq_alg)
vert_remap_tracer_alg = set_vert_remap(se_vert_remap_T, se_vert_remap_tracer_alg)
fv_nphys = se_fv_nphys
- lcp_moist = se_lcp_moist
large_Courant_incr = se_large_Courant_incr
fvm_supercycling = se_fvm_supercycling
fvm_supercycling_jet = se_fvm_supercycling_jet
kmin_jet = se_kmin_jet
kmax_jet = se_kmax_jet
variable_nsplit = .false.
- phys_dyn_cp = se_phys_dyn_cp
molecular_diff = se_molecular_diff
+ pgf_formulation = se_pgf_formulation
if (fv_nphys > 0) then
! Use finite volume physics grid and CSLAM for tracer advection
nphys_pts = fv_nphys*fv_nphys
qsize = thermodynamic_active_species_num ! number tracers advected by GLL
- ntrac = pcnst ! number tracers advected by CSLAM
+ ntrac = pcnst ! number tracers advected by CSLAM
+ use_cslam = .true.
else
! Use GLL grid for physics and tracer advection
nphys_pts = npsq
qsize = pcnst
ntrac = 0
+ use_cslam = .false.
end if
if (rsplit < 1) then
@@ -431,7 +427,6 @@ subroutine dyn_readnl(NLFileName)
end if
write(iulog, '(a,i0)') 'dyn_readnl: se_npes = ',se_npes
write(iulog, '(a,i0)') 'dyn_readnl: se_nsplit = ',se_nsplit
- write(iulog, '(a,i0)') 'dyn_readnl: se_phys_dyn_cp = ',se_phys_dyn_cp
!
! se_nu<0 then coefficients are set automatically in module global_norms_mod
!
@@ -451,7 +446,6 @@ subroutine dyn_readnl(NLFileName)
write(iulog, '(a,a)') 'dyn_readnl: se_vert_remap_T = ',trim(se_vert_remap_T)
write(iulog, '(a,a)') 'dyn_readnl: se_vert_remap_uvTq_alg = ',trim(se_vert_remap_uvTq_alg)
write(iulog, '(a,a)') 'dyn_readnl: se_vert_remap_tracer_alg = ',trim(se_vert_remap_tracer_alg)
- write(iulog, '(a,l4)') 'dyn_readnl: lcp_moist = ',lcp_moist
write(iulog, '(a,i0)') 'dyn_readnl: se_fvm_supercycling = ',fvm_supercycling
write(iulog, '(a,i0)') 'dyn_readnl: se_fvm_supercycling_jet = ',fvm_supercycling_jet
write(iulog, '(a,i0)') 'dyn_readnl: se_kmin_jet = ',kmin_jet
@@ -584,7 +578,7 @@ subroutine dyn_init(dyn_in, dyn_out)
use prim_advance_mod, only: prim_advance_init
use dyn_grid, only: elem, fvm
use cam_pio_utils, only: clean_iodesc_list
- use physconst, only: rair, cpair, pstd
+ use physconst, only: cpair, pstd
use air_composition, only: thermodynamic_active_species_num, thermodynamic_active_species_idx
use air_composition, only: thermodynamic_active_species_idx_dycore
use air_composition, only: thermodynamic_active_species_liq_idx,thermodynamic_active_species_ice_idx
@@ -595,36 +589,37 @@ subroutine dyn_init(dyn_in, dyn_out)
use thread_mod, only: horz_num_threads
use hybrid_mod, only: get_loop_ranges, config_thread_region
- use dimensions_mod, only: nu_scale_top, nu_lev, nu_div_lev
+ use dimensions_mod, only: nu_scale_top
use dimensions_mod, only: ksponge_end, kmvis_ref, kmcnd_ref,rho_ref,km_sponge_factor
use dimensions_mod, only: cnst_name_gll, cnst_longname_gll
use dimensions_mod, only: irecons_tracer_lev, irecons_tracer, kord_tr, kord_tr_cslam
use prim_driver_mod, only: prim_init2
- use time_mod, only: time_at
- use control_mod, only: runtype, molecular_diff, nu_top
+ use control_mod, only: molecular_diff, nu_top
use test_fvm_mapping, only: test_mapping_addfld
use phys_control, only: phys_getopts
use cam_thermo, only: get_molecular_diff_coef_reference
use control_mod, only: vert_remap_uvTq_alg, vert_remap_tracer_alg
use std_atm_profile, only: std_atm_height
use dyn_tests_utils, only: vc_dycore, vc_dry_pressure, string_vc, vc_str_lgth
+ use cam_budget, only: cam_budget_em_snapshot, cam_budget_em_register, thermo_budget_history
+
! Dummy arguments:
type(dyn_import_t), intent(out) :: dyn_in
type(dyn_export_t), intent(out) :: dyn_out
! Local variables
- integer :: ithr, nets, nete, ie, k, kmol_end, mfound
+ integer :: nets, nete, ie, k, kmol_end, mfound
real(r8), parameter :: Tinit = 300.0_r8
real(r8) :: press(1), ptop, tref,z(1)
type(hybrid_t) :: hybrid
- integer :: ixcldice, ixcldliq, ixrain, ixsnow, ixgraupel
+ integer :: ixcldice, ixcldliq
integer :: m_cnst, m
! variables for initializing energy and axial angular momentum diagnostics
- integer, parameter :: num_stages = 12, num_vars = 8
- character (len = 3), dimension(num_stages) :: stage = (/"dED","dAF","dBD","dAD","dAR","dBF","dBH","dCH","dAH",'dBS','dAS','p2d'/)
+ integer, parameter :: num_stages = 12
+ character (len = 4), dimension(num_stages) :: stage = (/"dED","dAF","dBD","dAD","dAR","dBF","dBH","dCH","dAH","dBS","dAS","p2d"/)
character (len = 70),dimension(num_stages) :: stage_txt = (/&
" end of previous dynamics ",& !dED
" from previous remapping or state passed to dynamics",& !dAF - state in beginning of nsplit loop
@@ -639,28 +634,11 @@ subroutine dyn_init(dyn_in, dyn_out)
" state after sponge layer diffusion ",& !dAS - state after sponge del2
" phys2dyn mapping errors (requires ftype-1) " & !p2d - for assessing phys2dyn mapping errors
/)
- character (len = 2) , dimension(num_vars) :: vars = (/"WV" ,"WL" ,"WI" ,"SE" ,"KE" ,"MR" ,"MO" ,"TT" /)
- !if ntrac>0 then tracers should be output on fvm grid but not energy (SE+KE) and AAM diags
- logical , dimension(num_vars) :: massv = (/.true.,.true.,.true.,.false.,.false.,.false.,.false.,.false./)
- character (len = 70) , dimension(num_vars) :: vars_descriptor = (/&
- "Total column water vapor ",&
- "Total column cloud water ",&
- "Total column cloud ice ",&
- "Total column static energy ",&
- "Total column kinetic energy ",&
- "Total column wind axial angular momentum",&
- "Total column mass axial angular momentum",&
- "Total column test tracer "/)
- character (len = 14), dimension(num_vars) :: &
- vars_unit = (/&
- "kg/m2 ","kg/m2 ","kg/m2 ","J/m2 ",&
- "J/m2 ","kg*m2/s*rad2 ","kg*m2/s*rad2 ","kg/m2 "/)
-
- integer :: istage, ivars
- character (len=108) :: str1, str2, str3
+
+ integer :: istage
character (len=vc_str_lgth) :: vc_str
- logical :: history_budget ! output tendencies and state variables for budgets
+ logical :: history_budget ! output tendencies and state variables for budgets
integer :: budget_hfile_num
character(len=*), parameter :: sub = 'dyn_init'
@@ -678,7 +656,7 @@ subroutine dyn_init(dyn_in, dyn_out)
allocate(kord_tr(qsize))
kord_tr(:) = vert_remap_tracer_alg
- if (ntrac>0) then
+ if (use_cslam) then
allocate(kord_tr_cslam(ntrac))
kord_tr_cslam(:) = vert_remap_tracer_alg
end if
@@ -696,7 +674,7 @@ subroutine dyn_init(dyn_in, dyn_out)
! CSLAM tracers are always indexed as in physics
! of no CSLAM then SE tracers are always indexed as in physics
!
- if (ntrac>0) then
+ if (use_cslam) then
!
! note that in this case qsize = thermodynamic_active_species_num
!
@@ -720,7 +698,7 @@ subroutine dyn_init(dyn_in, dyn_out)
end do
do m=1,thermodynamic_active_species_liq_num
- if (ntrac>0) then
+ if (use_cslam) then
do mfound=1,qsize
if (TRIM(cnst_name(thermodynamic_active_species_liq_idx(m)))==TRIM(cnst_name_gll(mfound))) then
thermodynamic_active_species_liq_idx_dycore(m) = mfound
@@ -734,7 +712,7 @@ subroutine dyn_init(dyn_in, dyn_out)
end if
end do
do m=1,thermodynamic_active_species_ice_num
- if (ntrac>0) then
+ if (use_cslam) then
do mfound=1,qsize
if (TRIM(cnst_name(thermodynamic_active_species_ice_idx(m)))==TRIM(cnst_name_gll(mfound))) then
thermodynamic_active_species_ice_idx_dycore(m) = mfound
@@ -789,8 +767,10 @@ subroutine dyn_init(dyn_in, dyn_out)
(hvcoord%hyam(:)+hvcoord%hybm(:))*hvcoord%ps0,km_sponge_factor,&
kmvis_ref,kmcnd_ref,rho_ref)
- write(iulog,*) "Molecular viscoity and thermal conductivity reference profile"
- write(iulog,*) "k, p, z, km_sponge_factor, kmvis_ref/rho_ref, kmcnd_ref/(cp*rho_ref):"
+ if (masterproc) then
+ write(iulog,*) "Molecular viscosity and thermal conductivity reference profile"
+ write(iulog,*) "k, p, z, km_sponge_factor, kmvis_ref/rho_ref, kmcnd_ref/(cp*rho_ref):"
+ end if
do k=1,nlev
! only apply molecular viscosity where viscosity is > 1000 m/s^2
if (MIN(kmvis_ref(k)/rho_ref(k),kmcnd_ref(k)/(cpair*rho_ref(k)))>1000.0_r8) then
@@ -880,7 +860,7 @@ subroutine dyn_init(dyn_in, dyn_out)
call addfld ('FT', (/ 'lev' /), 'A', 'K/s', 'Temperature forcing term on GLL grid',gridname='GLL')
! Tracer forcing on fvm (CSLAM) grid and internal CSLAM pressure fields
- if (ntrac>0) then
+ if (use_cslam) then
do m = 1, ntrac
call addfld (trim(cnst_name(m))//'_fvm', (/ 'lev' /), 'I', 'kg/kg', &
trim(cnst_longname(m)), gridname='FVM')
@@ -902,7 +882,7 @@ subroutine dyn_init(dyn_in, dyn_out)
! Energy diagnostics and axial angular momentum diagnostics
call addfld ('ABS_dPSdt', horiz_only, 'A', 'Pa/s', 'Absolute surface pressure tendency',gridname='GLL')
- if (ntrac>0) then
+ if (use_cslam) then
#ifdef waccm_debug
call addfld ('CSLAM_gamma', (/ 'lev' /), 'A', '', 'Courant number from CSLAM', gridname='FVM')
#endif
@@ -917,23 +897,43 @@ subroutine dyn_init(dyn_in, dyn_out)
call addfld ('TT_PDC', horiz_only, 'A', 'kg/m2','Total column test tracer lost in physics-dynamics coupling',gridname='GLL')
end if
- do istage = 1, num_stages
- do ivars=1, num_vars
- write(str1,*) TRIM(ADJUSTL(vars(ivars))),"_",TRIM(ADJUSTL(stage(istage)))
- write(str2,*) TRIM(ADJUSTL(vars_descriptor(ivars)))," ", &
- TRIM(ADJUSTL(stage_txt(istage)))
- write(str3,*) TRIM(ADJUSTL(vars_unit(ivars)))
- if (ntrac>0.and.massv(ivars)) then
- call addfld (TRIM(ADJUSTL(str1)), horiz_only, 'A', TRIM(ADJUSTL(str3)),TRIM(ADJUSTL(str2)),gridname='FVM')
- else
- call addfld (TRIM(ADJUSTL(str1)), horiz_only, 'A', TRIM(ADJUSTL(str3)),TRIM(ADJUSTL(str2)),gridname='GLL')
- end if
+ if (thermo_budget_history) then
+ ! Register stages for budgets
+ do istage = 1, num_stages
+ call cam_budget_em_snapshot(TRIM(ADJUSTL(stage(istage))), 'dyn', &
+ longname=TRIM(ADJUSTL(stage_txt(istage))))
end do
- end do
+ !
+ ! Register tendency (difference) budgets
+ !
+ call cam_budget_em_register('dEdt_floating_dyn' ,'dAD','dBD','dyn','dif', &
+ longname="dE/dt floating dynamics (dAD-dBD)" )
+ call cam_budget_em_register('dEdt_vert_remap' ,'dAR','dAD','dyn','dif', &
+ longname="dE/dt vertical remapping (dAR-dAD)" )
+ call cam_budget_em_register('dEdt_phys_tot_in_dyn','dBD','dAF','dyn','dif', &
+ longname="dE/dt physics tendency in dynamics (dBD-dAF)" )
+ call cam_budget_em_register('dEdt_del4' ,'dCH','dBH','dyn','dif', &
+ longname="dE/dt del4 (dCH-dBH)" )
+ call cam_budget_em_register('dEdt_del4_fric_heat','dAH','dCH','dyn','dif', &
+ longname="dE/dt del4 frictional heating (dAH-dCH)" )
+ call cam_budget_em_register('dEdt_del4_tot' ,'dAH','dBH','dyn','dif', &
+ longname="dE/dt del4 + del4 frictional heating (dAH-dBH)" )
+ call cam_budget_em_register('dEdt_del2_sponge' ,'dAS','dBS','dyn','dif', &
+ longname="dE/dt del2 sponge (dAS-dBS)" )
+ !
+ ! Register derived budgets
+ !
+ call cam_budget_em_register('dEdt_dycore' ,'dEdt_floating_dyn','dEdt_vert_remap' ,'dyn','sum', &
+ longname="dE/dt adiabatic dynamics" )
+ call cam_budget_em_register('dEdt_del2_del4_tot' ,'dEdt_del4_tot' ,'dEdt_del2_sponge' ,'dyn','sum', &
+ longname="dE/dt explicit diffusion total" )
+ call cam_budget_em_register('dEdt_residual' ,'dEdt_floating_dyn','dEdt_del2_del4_tot','dyn','dif',&
+ longname="dE/dt residual (dEdt_floating_dyn-dEdt_del2_del4_tot)" )
+ end if
!
! add dynamical core tracer tendency output
!
- if (ntrac>0) then
+ if (use_cslam) then
do m = 1, pcnst
call addfld(tottnam(m),(/ 'lev' /),'A','kg/kg/s',trim(cnst_name(m))//' horz + vert', &
gridname='FVM')
@@ -961,21 +961,20 @@ end subroutine dyn_init
subroutine dyn_run(dyn_state)
use air_composition, only: thermodynamic_active_species_num, dry_air_species_num
use air_composition, only: thermodynamic_active_species_idx_dycore
- use prim_advance_mod, only: calc_tot_energy_dynamics
use prim_driver_mod, only: prim_run_subcycle
use dimensions_mod, only: cnst_name_gll
- use time_mod, only: tstep, nsplit, timelevel_qdp
+ use se_dyn_time_mod, only: tstep, nsplit, timelevel_qdp
use hybrid_mod, only: config_thread_region, get_loop_ranges
use control_mod, only: qsplit, rsplit, ftype_conserve
use thread_mod, only: horz_num_threads
- use time_mod, only: tevolve
+ use se_dyn_time_mod, only: tevolve
type(dyn_export_t), intent(inout) :: dyn_state
type(hybrid_t) :: hybrid
integer :: tl_f
integer :: n
- integer :: nets, nete, ithr
+ integer :: nets, nete
integer :: i, ie, j, k, m, nq, m_cnst
integer :: n0_qdp, nsplit_local
logical :: ldiag
@@ -1078,7 +1077,7 @@ subroutine dyn_run(dyn_state)
end if
- if (ntrac > 0) then
+ if (use_cslam) then
do ie = nets, nete
do m = 1, ntrac
do k = 1, nlev
@@ -1126,8 +1125,6 @@ subroutine dyn_run(dyn_state)
end do
end if
-
- call calc_tot_energy_dynamics(dyn_state%elem,dyn_state%fvm, nets, nete, TimeLevel%n0, n0_qdp,'dBF')
!$OMP END PARALLEL
if (ldiag) then
@@ -1157,7 +1154,7 @@ subroutine read_inidat(dyn_in)
use element_mod, only: timelevels
use fvm_mapping, only: dyn2fvm_mass_vars
- use control_mod, only: runtype,initial_global_ave_dry_ps
+ use control_mod, only: runtype
use prim_driver_mod, only: prim_set_dry_mass
use air_composition, only: thermodynamic_active_species_idx
use cam_initfiles, only: scale_dry_air_mass
@@ -1180,8 +1177,8 @@ subroutine read_inidat(dyn_in)
logical, allocatable :: pmask(:) ! (npsq*nelemd) unique grid vals
character(len=max_hcoordname_len):: grid_name
- real(r8), allocatable :: latvals(:),latvals_phys(:)
- real(r8), allocatable :: lonvals(:),lonvals_phys(:)
+ real(r8), allocatable :: latvals(:)
+ real(r8), allocatable :: lonvals(:)
real(r8), pointer :: latvals_deg(:)
real(r8), pointer :: lonvals_deg(:)
@@ -1193,9 +1190,6 @@ subroutine read_inidat(dyn_in)
integer :: kptr, m_cnst
type(EdgeBuffer_t) :: edge
- character(len=max_fieldname_len) :: varname
- integer :: ierr
-
integer :: rndm_seed_sz
integer, allocatable :: rndm_seed(:)
integer :: dims(2)
@@ -1206,10 +1200,6 @@ subroutine read_inidat(dyn_in)
character(len=128) :: errmsg
character(len=*), parameter :: sub='READ_INIDAT'
- ! fvm vars
- real(r8), allocatable :: inv_dp_darea_fvm(:,:,:)
- real(r8) :: min_val, max_val
-
real(r8) :: dp_tmp, pstmp(np,np)
! Variables for analytic initial conditions
@@ -1701,7 +1691,7 @@ subroutine read_inidat(dyn_in)
! if CSLAM active then we only advect water vapor and condensate
! loading tracers in state%qdp
- if (ntrac > 0) then
+ if (use_cslam) then
do ie = 1, nelemd
do nq = 1, thermodynamic_active_species_num
m_cnst = thermodynamic_active_species_idx(nq)
@@ -1732,7 +1722,7 @@ subroutine read_inidat(dyn_in)
! interpolate fvm tracers and fvm pressure variables
- if (ntrac > 0) then
+ if (use_cslam) then
if (par%masterproc) then
write(iulog,*) 'Initializing dp_fvm from spectral element dp'
end if
@@ -1754,7 +1744,7 @@ subroutine read_inidat(dyn_in)
write(iulog,*) 'FVM tracers, FVM pressure variables and se_area_sphere initialized.'
end if
- end if ! (ntrac > 0)
+ end if ! (use_cslam)
! Cleanup
deallocate(qtmp)
@@ -2021,7 +2011,6 @@ subroutine check_file_layout(file, elem, dyn_cols, file_desc, dyn_ok)
integer :: ncol_did, ncol_size
integer :: ierr
integer :: ie, i, j
- integer :: grid_id
integer :: indx
real(r8) :: dbuf2(npsq, nelemd)
logical :: found
@@ -2300,7 +2289,7 @@ subroutine write_dyn_vars(dyn_out)
integer :: ie, m
!----------------------------------------------------------------------------
- if (ntrac > 0) then
+ if (use_cslam) then
do ie = 1, nelemd
call outfld('dp_fvm', RESHAPE(dyn_out%fvm(ie)%dp_fvm(1:nc,1:nc,:), &
(/nc*nc,nlev/)), nc*nc, ie)
diff --git a/src/dynamics/se/dyn_grid.F90 b/src/dynamics/se/dyn_grid.F90
index 77f3a27f2f..293f7402dd 100644
--- a/src/dynamics/se/dyn_grid.F90
+++ b/src/dynamics/se/dyn_grid.F90
@@ -41,14 +41,14 @@ module dyn_grid
use pio, only: file_desc_t
use dimensions_mod, only: globaluniquecols, nelem, nelemd, nelemdmax
-use dimensions_mod, only: ne, np, npsq, fv_nphys, nlev, ntrac
+use dimensions_mod, only: ne, np, npsq, fv_nphys, nlev, use_cslam
use element_mod, only: element_t
use fvm_control_volume_mod, only: fvm_struct
use hybvcoord_mod, only: hvcoord_t
use prim_init, only: prim_init1
use edge_mod, only: initEdgeBuffer
use edgetype_mod, only: EdgeBuffer_t
-use time_mod, only: TimeLevel_t
+use se_dyn_time_mod, only: TimeLevel_t
use dof_mod, only: UniqueCoords, UniquePoints
implicit none
@@ -59,7 +59,6 @@ module dyn_grid
integer, parameter :: fvm_decomp = 102 ! The FVM (CSLAM) grid
integer, parameter :: physgrid_d = 103 ! physics grid on dynamics decomp
integer, parameter :: ini_decomp = 104 ! alternate dynamics grid for reading initial file
-
character(len=3), protected :: ini_grid_name
! Name of horizontal grid dimension in initial file.
@@ -134,7 +133,7 @@ subroutine dyn_grid_init()
use hybrid_mod, only: hybrid_t, init_loop_ranges, &
get_loop_ranges, config_thread_region
use control_mod, only: qsplit, rsplit
- use time_mod, only: tstep, nsplit
+ use se_dyn_time_mod, only: tstep, nsplit
use fvm_mod, only: fvm_init2, fvm_init3, fvm_pg_init
use dimensions_mod, only: irecons_tracer
use comp_gll_ctr_vol, only: gll_grid_write
@@ -733,6 +732,7 @@ subroutine define_cam_grids()
use cam_grid_support, only: horiz_coord_t, horiz_coord_create
use cam_grid_support, only: cam_grid_register, cam_grid_attribute_register
use dimensions_mod, only: nc
+ use shr_const_mod, only: PI => SHR_CONST_PI
! Local variables
integer :: i, ii, j, k, ie, mapind
@@ -744,22 +744,40 @@ subroutine define_cam_grids()
real(r8), allocatable :: pelat_deg(:) ! pe-local latitudes (degrees)
real(r8), allocatable :: pelon_deg(:) ! pe-local longitudes (degrees)
- real(r8), pointer :: pearea(:) => null() ! pe-local areas
- real(r8) :: areaw(np,np)
+ real(r8), pointer :: pearea(:) ! pe-local areas
+ real(r8), pointer :: pearea_wt(:) ! pe-local areas normalized for unit sphere
integer(iMap) :: fdofP_local(npsq,nelemd) ! pe-local map for dynamics decomp
integer(iMap), allocatable :: pemap(:) ! pe-local map for PIO decomp
integer :: ncols_fvm, ngcols_fvm
real(r8), allocatable :: fvm_coord(:)
real(r8), pointer :: fvm_area(:)
+ real(r8), pointer :: fvm_areawt(:)
integer(iMap), pointer :: fvm_map(:)
integer :: ncols_physgrid, ngcols_physgrid
real(r8), allocatable :: physgrid_coord(:)
real(r8), pointer :: physgrid_area(:)
+ real(r8), pointer :: physgrid_areawt(:)
integer(iMap), pointer :: physgrid_map(:)
+
+ real(r8), parameter :: rarea_unit_sphere = 1.0_r8 / (4.0_r8*PI)
+
!----------------------------------------------------------------------------
+ !-----------------------
+ ! initialize pointers to null
+ !-----------------------
+ nullify(pearea_wt)
+ nullify(pearea)
+ nullify(fvm_area)
+ nullify(fvm_areawt)
+ nullify(fvm_map)
+ nullify(physgrid_area)
+ nullify(physgrid_areawt)
+ nullify(physgrid_map)
+ nullify(grid_map)
+
!-----------------------
! Create GLL grid object
!-----------------------
@@ -777,16 +795,17 @@ subroutine define_cam_grids()
allocate(pelat_deg(np*np*nelemd))
allocate(pelon_deg(np*np*nelemd))
allocate(pearea(np*np*nelemd))
+ allocate(pearea_wt(np*np*nelemd))
allocate(pemap(np*np*nelemd))
pemap = 0_iMap
ii = 1
do ie = 1, nelemd
- areaw = 1.0_r8 / elem(ie)%rspheremp(:,:)
- pearea(ii:ii+npsq-1) = reshape(areaw, (/ np*np /))
pemap(ii:ii+npsq-1) = fdofp_local(:,ie)
do j = 1, np
do i = 1, np
+ pearea(ii) = elem(ie)%mp(i,j)*elem(ie)%metdet(i,j)
+ pearea_wt(ii) = pearea(ii)*rarea_unit_sphere
pelat_deg(ii) = elem(ie)%spherep(i,j)%lat * rad2deg
pelon_deg(ii) = elem(ie)%spherep(i,j)%lon * rad2deg
ii = ii + 1
@@ -832,6 +851,8 @@ subroutine define_cam_grids()
grid_map, block_indexed=.false., unstruct=.true.)
call cam_grid_attribute_register('GLL', 'area_d', 'gll grid areas', &
'ncol_d', pearea, map=pemap)
+ call cam_grid_attribute_register('GLL', 'area_weight_gll', 'gll grid area weights', &
+ 'ncol_d', pearea_wt, map=pemap)
call cam_grid_attribute_register('GLL', 'np', '', np)
call cam_grid_attribute_register('GLL', 'ne', '', ne)
@@ -848,6 +869,8 @@ subroutine define_cam_grids()
grid_map, block_indexed=.false., unstruct=.true.)
call cam_grid_attribute_register('INI', 'area', 'ini grid areas', &
'ncol', pearea, map=pemap)
+ call cam_grid_attribute_register('INI', 'area_weight_ini', 'ini grid area weights', &
+ 'ncol', pearea_wt, map=pemap)
ini_grid_name = 'INI'
else
@@ -865,6 +888,7 @@ subroutine define_cam_grids()
! to that memory. It can be nullified since the attribute object has
! the reference.
nullify(pearea)
+ nullify(pearea_wt)
! grid_map cannot be deallocated as the cam_filemap_t object just points
! to it. It can be nullified.
@@ -874,13 +898,14 @@ subroutine define_cam_grids()
! Create FVM grid object for CSLAM
!---------------------------------
- if (ntrac > 0) then
+ if (use_cslam) then
ncols_fvm = nc * nc * nelemd
ngcols_fvm = nc * nc * nelem_d
allocate(fvm_coord(ncols_fvm))
allocate(fvm_map(ncols_fvm))
allocate(fvm_area(ncols_fvm))
+ allocate(fvm_areawt(ncols_fvm))
do ie = 1, nelemd
k = 1
@@ -890,6 +915,7 @@ subroutine define_cam_grids()
fvm_coord(mapind) = fvm(ie)%center_cart(i,j)%lon*rad2deg
fvm_map(mapind) = k + ((elem(ie)%GlobalId-1) * nc * nc)
fvm_area(mapind) = fvm(ie)%area_sphere(i,j)
+ fvm_areawt(mapind) = fvm_area(mapind)*rarea_unit_sphere
k = k + 1
end do
end do
@@ -930,12 +956,15 @@ subroutine define_cam_grids()
grid_map, block_indexed=.false., unstruct=.true.)
call cam_grid_attribute_register('FVM', 'area_fvm', 'fvm grid areas', &
'ncol_fvm', fvm_area, map=fvm_map)
+ call cam_grid_attribute_register('FVM', 'area_weight_fvm', 'fvm grid area weights', &
+ 'ncol_fvm', fvm_areawt, map=fvm_map)
call cam_grid_attribute_register('FVM', 'nc', '', nc)
call cam_grid_attribute_register('FVM', 'ne', '', ne)
deallocate(fvm_coord)
deallocate(fvm_map)
nullify(fvm_area)
+ nullify(fvm_areawt)
nullify(grid_map)
end if
@@ -951,6 +980,7 @@ subroutine define_cam_grids()
allocate(physgrid_coord(ncols_physgrid))
allocate(physgrid_map(ncols_physgrid))
allocate(physgrid_area(ncols_physgrid))
+ allocate(physgrid_areawt(ncols_physgrid))
do ie = 1, nelemd
k = 1
@@ -960,6 +990,7 @@ subroutine define_cam_grids()
physgrid_coord(mapind) = fvm(ie)%center_cart_physgrid(i,j)%lon*rad2deg
physgrid_map(mapind) = k + ((elem(ie)%GlobalId-1) * fv_nphys * fv_nphys)
physgrid_area(mapind) = fvm(ie)%area_sphere_physgrid(i,j)
+ physgrid_areawt(mapind) = physgrid_area(mapind)*rarea_unit_sphere
k = k + 1
end do
end do
@@ -1000,12 +1031,15 @@ subroutine define_cam_grids()
grid_map, block_indexed=.false., unstruct=.true.)
call cam_grid_attribute_register('physgrid_d', 'area_physgrid', 'physics grid areas', &
'ncol', physgrid_area, map=physgrid_map)
+ call cam_grid_attribute_register('physgrid_d', 'area_weight_physgrid', 'physics grid area weight', &
+ 'ncol', physgrid_areawt, map=physgrid_map)
call cam_grid_attribute_register('physgrid_d', 'fv_nphys', '', fv_nphys)
call cam_grid_attribute_register('physgrid_d', 'ne', '', ne)
deallocate(physgrid_coord)
deallocate(physgrid_map)
nullify(physgrid_area)
+ nullify(physgrid_areawt)
nullify(grid_map)
end if
diff --git a/src/dynamics/se/restart_dynamics.F90 b/src/dynamics/se/restart_dynamics.F90
index d3b1aa28fa..0c630c9336 100644
--- a/src/dynamics/se/restart_dynamics.F90
+++ b/src/dynamics/se/restart_dynamics.F90
@@ -43,10 +43,10 @@ module restart_dynamics
use parallel_mod, only: par
use thread_mod, only: horz_num_threads
-use dimensions_mod, only: np, npsq, ne, nlev, qsize, nelemd, nc, ntrac
+use dimensions_mod, only: np, npsq, ne, nlev, qsize, nelemd, nc, ntrac, use_cslam
use dof_mod, only: UniquePoints
use element_mod, only: element_t
-use time_mod, only: tstep, TimeLevel_Qdp
+use se_dyn_time_mod, only: tstep, TimeLevel_Qdp
use edge_mod, only: initEdgeBuffer, edgeVpack, edgeVunpack, FreeEdgeBuffer
use edgetype_mod, only: EdgeBuffer_t
@@ -148,7 +148,7 @@ subroutine init_restart_dynamics(file, dyn_out)
! CSLAM restart fields
- if (ntrac > 0) then
+ if (use_cslam) then
grid_id = cam_grid_id('FVM')
call cam_grid_write_attr(File, grid_id, info)
@@ -223,7 +223,7 @@ subroutine write_restart_dynamics(File, dyn_out)
! write CSLAM fields
- if (ntrac > 0) then
+ if (use_cslam) then
grid_id = cam_grid_id('FVM')
@@ -621,7 +621,7 @@ subroutine read_restart_dynamics(File, dyn_in, dyn_out)
! read cslam fields
- if (ntrac > 0) then
+ if (use_cslam) then
! Checks that file and model dimensions agree.
diff --git a/src/dynamics/se/stepon.F90 b/src/dynamics/se/stepon.F90
index febda50539..82f6ec03e2 100644
--- a/src/dynamics/se/stepon.F90
+++ b/src/dynamics/se/stepon.F90
@@ -99,7 +99,7 @@ subroutine stepon_run1( dtime_out, phys_state, phys_tend, &
use dp_coupling, only: d_p_coupling
use physics_buffer, only: physics_buffer_desc
- use time_mod, only: tstep ! dynamics timestep
+ use se_dyn_time_mod,only: tstep ! dynamics timestep
real(r8), intent(out) :: dtime_out ! Time-step
type(physics_state), intent(inout) :: phys_state(begchunk:endchunk)
@@ -152,9 +152,9 @@ subroutine stepon_run2(phys_state, phys_tend, dyn_in, dyn_out)
use dp_coupling, only: p_d_coupling
use dyn_grid, only: TimeLevel
- use time_mod, only: TimeLevel_Qdp
+ use se_dyn_time_mod, only: TimeLevel_Qdp
use control_mod, only: qsplit
- use prim_advance_mod, only: calc_tot_energy_dynamics
+ use prim_advance_mod, only: tot_energy_dyn
! arguments
@@ -194,7 +194,7 @@ subroutine stepon_run2(phys_state, phys_tend, dyn_in, dyn_out)
call t_stopf('p_d_coupling')
if (iam < par%nprocs) then
- call calc_tot_energy_dynamics(dyn_in%elem,dyn_in%fvm, 1, nelemd, tl_f, tl_fQdp,'dED')
+ call tot_energy_dyn(dyn_in%elem,dyn_in%fvm, 1, nelemd, tl_f, tl_fQdp,'dED')
end if
end subroutine stepon_run2
@@ -207,7 +207,7 @@ subroutine stepon_run3(dtime, cam_out, phys_state, dyn_in, dyn_out)
use dyn_comp, only: dyn_run
use advect_tend, only: compute_adv_tends_xyz
use dyn_grid, only: TimeLevel
- use time_mod, only: TimeLevel_Qdp
+ use se_dyn_time_mod,only: TimeLevel_Qdp
use control_mod, only: qsplit
! arguments
real(r8), intent(in) :: dtime ! Time-step
@@ -254,7 +254,7 @@ subroutine diag_dynvar_ic(elem, fvm)
use cam_history, only: write_inithist, outfld, hist_fld_active, fieldname_len
use dyn_grid, only: TimeLevel
- use time_mod, only: TimeLevel_Qdp ! dynamics typestep
+ use se_dyn_time_mod, only: TimeLevel_Qdp ! dynamics typestep
use control_mod, only: qsplit
use hybrid_mod, only: config_thread_region, get_loop_ranges
use hybrid_mod, only: hybrid_t
@@ -282,9 +282,11 @@ subroutine diag_dynvar_ic(elem, fvm)
real(r8), allocatable :: ftmp(:,:,:)
real(r8), allocatable :: fld_fvm(:,:,:,:,:), fld_gll(:,:,:,:,:)
real(r8), allocatable :: fld_2d(:,:)
- logical, allocatable :: llimiter(:)
+ logical :: llimiter(1)
real(r8) :: qtmp(np,np,nlev), dp_ref(np,np,nlev), ps_ref(np,np)
real(r8), allocatable :: factor_array(:,:,:)
+ integer :: astat
+ character(len=*), parameter :: prefix = 'diag_dynvar_ic: '
!----------------------------------------------------------------------------
tl_f = timelevel%n0
@@ -393,19 +395,28 @@ subroutine diag_dynvar_ic(elem, fvm)
end if
if (write_inithist()) then
- allocate(fld_2d(np,np))
- do ie = 1, nelemd
- call get_ps(elem(ie)%state%Qdp(:,:,:,:,tl_Qdp), thermodynamic_active_species_idx_dycore,&
- elem(ie)%state%dp3d(:,:,:,tl_f),fld_2d,hyai(1)*ps0)
- do j = 1, np
- do i = 1, np
- ftmp(i+(j-1)*np,1,1) = fld_2d(i,j)
+ allocate(fld_2d(np,np))
+ do ie = 1, nelemd
+ call get_ps(elem(ie)%state%Qdp(:,:,:,:,tl_Qdp), thermodynamic_active_species_idx_dycore,&
+ elem(ie)%state%dp3d(:,:,:,tl_f),fld_2d,hyai(1)*ps0)
+ do j = 1, np
+ do i = 1, np
+ ftmp(i+(j-1)*np,1,1) = fld_2d(i,j)
+ end do
end do
- end do
- call outfld('PS&IC', ftmp(:,1,1), npsq, ie)
- end do
- deallocate(fld_2d)
- if (fv_nphys < 1) allocate(factor_array(np,np,nlev))
+ call outfld('PS&IC', ftmp(:,1,1), npsq, ie)
+ end do
+ deallocate(fld_2d)
+ endif
+
+ deallocate(ftmp)
+
+ if (write_inithist()) then
+
+ if (fv_nphys < 1) then
+ allocate(factor_array(np,np,nlev),stat=astat)
+ if (astat /= 0) call endrun(prefix//"Allocate factor_array failed")
+ endif
do ie = 1, nelemd
call outfld('T&IC', RESHAPE(elem(ie)%state%T(:,:,:,tl_f), (/npsq,nlev/)), npsq, ie)
@@ -414,7 +425,7 @@ subroutine diag_dynvar_ic(elem, fvm)
if (fv_nphys < 1) then
call get_sum_species(elem(ie)%state%Qdp(:,:,:,:,tl_qdp), &
- thermodynamic_active_species_idx_dycore, factor_array,dp_dry=elem(ie)%state%dp3d(:,:,:,tl_f))
+ thermodynamic_active_species_idx_dycore, factor_array,dp_dry=elem(ie)%state%dp3d(:,:,:,tl_f))
factor_array(:,:,:) = 1.0_r8/factor_array(:,:,:)
do m_cnst = 1, qsize
if (cnst_type(m_cnst) == 'wet') then
@@ -436,40 +447,43 @@ subroutine diag_dynvar_ic(elem, fvm)
hybrid = config_thread_region(par,'serial')
call get_loop_ranges(hybrid, ibeg=nets, iend=nete)
- allocate(fld_fvm(1-nhc:nc+nhc,1-nhc:nc+nhc,nlev,ntrac,nets:nete))
- allocate(fld_gll(np,np,nlev,ntrac,nets:nete))
- allocate(llimiter(ntrac))
- allocate(factor_array(nc,nc,nlev))
+ allocate(fld_fvm(1-nhc:nc+nhc,1-nhc:nc+nhc,nlev,1,nets:nete),stat=astat)
+ if (astat /= 0) call endrun(prefix//"Allocate fld_fvm failed")
+ allocate(fld_gll(np,np,nlev,1,nets:nete),stat=astat)
+ if (astat /= 0) call endrun(prefix//"Allocate fld_gll failed")
+ allocate(factor_array(nc,nc,nlev),stat=astat)
+ if (astat /= 0) call endrun(prefix//"Allocate factor_array failed")
+
llimiter = .true.
- do ie = nets, nete
- call get_sum_species(fvm(ie)%c(1:nc,1:nc,:,:),thermodynamic_active_species_idx,factor_array)
- factor_array(:,:,:) = 1.0_r8/factor_array(:,:,:)
- do m_cnst = 1, ntrac
- if (cnst_type(m_cnst) == 'wet') then
- fld_fvm(1:nc,1:nc,:,m_cnst,ie) = fvm(ie)%c(1:nc,1:nc,:,m_cnst)*factor_array(:,:,:)
- else
- fld_fvm(1:nc,1:nc,:,m_cnst,ie) = fvm(ie)%c(1:nc,1:nc,:,m_cnst)
- end if
- end do
- end do
- call fvm2dyn(fld_fvm, fld_gll, hybrid, nets, nete, nlev, ntrac, fvm(nets:nete), llimiter)
+ do m_cnst = 1, ntrac
+ do ie = nets, nete
+
+ call get_sum_species(fvm(ie)%c(1:nc,1:nc,:,:),thermodynamic_active_species_idx,factor_array)
+ factor_array(:,:,:) = 1.0_r8/factor_array(:,:,:)
+
+ if (cnst_type(m_cnst) == 'wet') then
+ fld_fvm(1:nc,1:nc,:,1,ie) = fvm(ie)%c(1:nc,1:nc,:,m_cnst)*factor_array(:,:,:)
+ else
+ fld_fvm(1:nc,1:nc,:,1,ie) = fvm(ie)%c(1:nc,1:nc,:,m_cnst)
+ end if
+ end do
+
+ call fvm2dyn(fld_fvm, fld_gll, hybrid, nets, nete, nlev, fvm(nets:nete), llimiter)
- do ie = nets, nete
- do m_cnst = 1, ntrac
+ do ie = nets, nete
call outfld(trim(cnst_name(m_cnst))//'&IC', &
- RESHAPE(fld_gll(:,:,:,m_cnst,ie), (/npsq,nlev/)), npsq, ie)
+ RESHAPE(fld_gll(:,:,:,:,ie), (/npsq,nlev/)), npsq, ie)
end do
end do
deallocate(fld_fvm)
deallocate(fld_gll)
- deallocate(llimiter)
end if
+
deallocate(factor_array)
- end if ! if (write_inithist)
- deallocate(ftmp)
+ end if ! if (write_inithist)
end subroutine diag_dynvar_ic
diff --git a/src/dynamics/se/test_fvm_mapping.F90 b/src/dynamics/se/test_fvm_mapping.F90
index ef0481b5e0..4a26484854 100644
--- a/src/dynamics/se/test_fvm_mapping.F90
+++ b/src/dynamics/se/test_fvm_mapping.F90
@@ -3,7 +3,7 @@ module test_fvm_mapping
use fvm_control_volume_mod, only: fvm_struct
use cam_history, only: outfld
use physconst, only: pi
- use dimensions_mod, only: np, nelemd, nlev, npsq, ntrac
+ use dimensions_mod, only: np, nelemd, nlev, npsq, ntrac, use_cslam
use element_mod, only: element_t
implicit none
private
@@ -147,10 +147,6 @@ subroutine test_mapping_overwrite_tendencies(phys_state,phys_tend,ncols,lchnk,q_
integer :: m_cnst, nq, ie
q_prev(:,:,ntrac) = 0.0_r8
- do ie=1,nelemd
-!xxx fvm(ie)%c(:,:,:,ntrac) = 0.0_r8
- end do
-
phys_state%pdel(1:ncols,:) = phys_state%pdeldry(1:ncols,:) !make sure there is no conversion from wet to dry
do nq=ntrac,ntrac
m_cnst = nq
@@ -243,7 +239,7 @@ subroutine test_mapping_output_mapped_tendencies(fvm,elem,nets,nete,tl_f,tl_qdp)
name = 'p2d_'//trim(cnst_name(m_cnst))//'_err_gll'
call outfld(TRIM(name), RESHAPE(elem(ie)%derived%fq(:,:,:,nq),(/npsq,nlev/)), npsq, ie)
end do
- if (ntrac>0) then
+ if (use_cslam) then
do nq=ntrac,ntrac
m_cnst = nq
name = 'p2f_'//trim(cnst_name(m_cnst))//'_fvm'
@@ -356,7 +352,6 @@ subroutine test_mapping_overwrite_dyn_state(elem,fvm)
end do
end if
end do
-! call fill_halo_fvm_noprealloc(elem,fvm,hybrid,nets,nete,nhc,1,nlev)!xxx nhr chould be a function of interp_method
#endif
end subroutine test_mapping_overwrite_dyn_state
@@ -370,15 +365,11 @@ subroutine test_mapping_output_phys_state(phys_state,fvm)
integer :: lchnk, ncol,k,icol,m_cnst,nq,ie
character(LEN=128) :: name
- do ie=1,nelemd
-!xxx fvm(ie)%c(:,:,:,ntrac) = 0.0_r8
- end do
-
do lchnk = begchunk, endchunk
call outfld('d2p_scalar', phys_state(lchnk)%omega(1:pcols,1:pver), pcols, lchnk)
call outfld('d2p_u', phys_state(lchnk)%U(1:pcols,1:pver), pcols, lchnk)
call outfld('d2p_v', phys_state(lchnk)%V(1:pcols,1:pver), pcols, lchnk)
- if (ntrac>0) then
+ if (use_cslam) then
do nq=ntrac,ntrac
m_cnst = nq
name = 'f2p_'//trim(cnst_name(m_cnst))
diff --git a/src/infrastructure/phys_grid.F90 b/src/infrastructure/phys_grid.F90
index 505fdb0c26..3426c86f27 100644
--- a/src/infrastructure/phys_grid.F90
+++ b/src/infrastructure/phys_grid.F90
@@ -190,6 +190,7 @@ subroutine phys_grid_init()
use cam_grid_support, only: iMap, hclen => max_hcoordname_len
use cam_grid_support, only: horiz_coord_t, horiz_coord_create
use cam_grid_support, only: cam_grid_attribute_copy, cam_grid_attr_exists
+ use shr_const_mod, only: PI => SHR_CONST_PI
! Local variables
integer :: index
@@ -206,6 +207,7 @@ subroutine phys_grid_init()
type(horiz_coord_t), pointer :: lat_coord
type(horiz_coord_t), pointer :: lon_coord
real(r8), pointer :: area_d(:)
+ real(r8), pointer :: areawt_d(:)
real(r8) :: mem_hw_beg, mem_hw_end
real(r8) :: mem_beg, mem_end
logical :: unstructured
@@ -214,6 +216,7 @@ subroutine phys_grid_init()
character(len=hclen), pointer :: copy_attributes(:)
character(len=hclen) :: copy_gridname
character(len=*), parameter :: subname = 'phys_grid_init: '
+ real(r8), parameter :: rarea_sphere = 1.0_r8 / (4.0_r8*PI)
nullify(lonvals)
nullify(latvals)
@@ -221,6 +224,7 @@ subroutine phys_grid_init()
nullify(lat_coord)
nullify(lon_coord)
nullify(area_d)
+ nullify(areawt_d)
nullify(copy_attributes)
if (calc_memory_increase) then
@@ -416,6 +420,14 @@ subroutine phys_grid_init()
call cam_grid_attribute_register('physgrid', 'area', &
'physics column areas', 'ncol', area_d, map=grid_map(3,:))
nullify(area_d) ! Belongs to attribute now
+
+ allocate(areawt_d(size(grid_map, 2)))
+ do col_index = 1, columns_on_task
+ areawt_d(col_index) = phys_columns(col_index)%weight*rarea_sphere
+ end do
+ call cam_grid_attribute_register('physgrid', 'areawt', &
+ 'physics column area weight', 'ncol', areawt_d, map=grid_map(3,:))
+ nullify(areawt_d) ! Belongs to attribute now
else
call endrun(subname//"No 'area' attribute from dycore")
end if
diff --git a/src/ionosphere/waccmx/edyn_init.F90 b/src/ionosphere/waccmx/edyn_init.F90
index ee096b8df3..074fbe7e85 100644
--- a/src/ionosphere/waccmx/edyn_init.F90
+++ b/src/ionosphere/waccmx/edyn_init.F90
@@ -62,6 +62,7 @@ subroutine add_fields
call addfld ('PED_MAG' ,(/ 'lev' /), 'I', 'S/m ','Pedersen Conductivity' ,gridname='gmag_grid')
call addfld ('HAL_MAG' ,(/ 'lev' /), 'I', 'S/m ','Hall Conductivity' ,gridname='gmag_grid')
+ call addfld ('PHIHM' , horiz_only, 'I', 'VOLTS','High Latitude Electric Potential' ,gridname='gmag_grid')
call addfld ('PHIM2D' , horiz_only, 'I', 'VOLTS','PHIM2D: Electric Potential' ,gridname='gmag_grid')
call addfld ('ED1' , horiz_only, 'I', 'V/m ','ED1: Eastward Electric Field' ,gridname='gmag_grid')
call addfld ('ED2' , horiz_only, 'I', 'V/m ','ED2: Equatorward Electric Field' ,gridname='gmag_grid')
diff --git a/src/ionosphere/waccmx/edynamo.F90 b/src/ionosphere/waccmx/edynamo.F90
index 7f79dc715f..be99c7dff9 100644
--- a/src/ionosphere/waccmx/edynamo.F90
+++ b/src/ionosphere/waccmx/edynamo.F90
@@ -1231,6 +1231,7 @@ subroutine highlat_poten()
enddo
do j=mlat0,mlat1
+ call outfld('PHIHM',phihm(mlon0:omlon1,j),omlon1-mlon0+1,j)
call outfld('PHIM2D',phim2d(mlon0:omlon1,j),omlon1-mlon0+1,j)
enddo
diff --git a/src/ionosphere/waccmx/ionosphere_interface.F90 b/src/ionosphere/waccmx/ionosphere_interface.F90
index 69c28739dd..7579dfcde3 100644
--- a/src/ionosphere/waccmx/ionosphere_interface.F90
+++ b/src/ionosphere/waccmx/ionosphere_interface.F90
@@ -14,7 +14,7 @@ module ionosphere_interface
use physics_buffer, only: pbuf_get_index
use constituents, only: cnst_get_ind, cnst_mw
- use physconst, only: gravit
+ use physconst, only: rga
use oplus, only: oplus_init
use edyn_init, only: edynamo_init
use pio, only: var_desc_t
@@ -740,11 +740,11 @@ subroutine ionosphere_run2(phys_state, pbuf2d)
! Might need geometric height on midpoints for output
!------------------------------------------------------------
if (hist_fld_active('Z3GM')) then
- r8tmp = phys_state(lchnk)%zm(i, k)
+ r8tmp = phys_state(lchnk)%zm(i, k) + phis(i)*rga
tempm(i, k) = r8tmp * (1._r8 + (r8tmp * rearth_inv))
end if
! physics state fields on interfaces (but only to pver)
- zi_blck(k, j) = phys_state(lchnk)%zi(i, k) + phis(i)/gravit
+ zi_blck(k, j) = phys_state(lchnk)%zi(i, k) + phis(i)*rga
!------------------------------------------------------------
! Convert geopotential to geometric height at interfaces:
!------------------------------------------------------------
diff --git a/src/physics/.clubb_sparse_checkout b/src/physics/.clubb_sparse_checkout
new file mode 100644
index 0000000000..1299233a5e
--- /dev/null
+++ b/src/physics/.clubb_sparse_checkout
@@ -0,0 +1,2 @@
+src/CLUBB_core
+src/SILHS
diff --git a/src/physics/cam/aer_rad_props.F90 b/src/physics/cam/aer_rad_props.F90
index 058f53f784..3d46fe9ba8 100644
--- a/src/physics/cam/aer_rad_props.F90
+++ b/src/physics/cam/aer_rad_props.F90
@@ -2,7 +2,7 @@ module aer_rad_props
!------------------------------------------------------------------------------------------------
! Converts aerosol masses to bulk optical properties for sw and lw radiation
-! computations.
+! computations.
!------------------------------------------------------------------------------------------------
use shr_kind_mod, only: r8 => shr_kind_r8
@@ -15,7 +15,7 @@ module aer_rad_props
use rad_constituents, only: rad_cnst_get_info, rad_cnst_get_aer_mmr, &
rad_cnst_get_aer_props
use wv_saturation, only: qsat
-use modal_aer_opt, only: modal_aero_sw, modal_aero_lw
+use aerosol_optics_cam,only: aerosol_optics_cam_init, aerosol_optics_cam_sw, aerosol_optics_cam_lw
use cam_history, only: fieldname_len, addfld, outfld, add_default, horiz_only
use cam_history_support, only : fillvalue
! Placed here due to PGI bug.
@@ -53,6 +53,7 @@ subroutine aer_rad_props_init()
logical :: history_aero_optics ! Output aerosol optics diagnostics
logical :: history_dust ! Output dust diagnostics
logical :: prog_modal_aero ! Prognostic modal aerosols present
+ integer :: nmodes ! number of aerosol modes
!----------------------------------------------------------------------------
@@ -77,7 +78,7 @@ subroutine aer_rad_props_init()
! get names of bulk aerosols
allocate(aernames(numaerosols))
- call rad_cnst_get_info(0, aernames=aernames)
+ call rad_cnst_get_info(0, aernames=aernames, nmodes=nmodes)
! diagnostic output for bulk aerosols
! create outfld names for visible OD
@@ -89,11 +90,11 @@ subroutine aer_rad_props_init()
end do
! Determine default fields
- if (history_amwg .or. history_dust ) then
+ if (history_amwg .or. history_dust ) then
call add_default ('AEROD_v', 1, ' ')
- endif
-
- if ( history_aero_optics ) then
+ endif
+
+ if ( history_aero_optics ) then
call add_default ('AEROD_v', 1, ' ')
do i = 1, numaerosols
odv_names(i) = 'ODV_'//trim(aernames(i))
@@ -101,6 +102,9 @@ subroutine aer_rad_props_init()
end do
endif
+ if (nmodes > 0) then
+ call aerosol_optics_cam_init()
+ end if
deallocate(aernames)
@@ -118,7 +122,7 @@ subroutine aer_rad_props_sw(list_idx, state, pbuf, nnite, idxnite, &
! Arguments
integer, intent(in) :: list_idx ! index of the climate or a diagnostic list
type(physics_state), intent(in), target :: state
-
+
type(physics_buffer_desc), pointer :: pbuf(:)
integer, intent(in) :: nnite ! number of night columns
integer, intent(in) :: idxnite(:) ! local column indices of night columns
@@ -170,7 +174,7 @@ subroutine aer_rad_props_sw(list_idx, state, pbuf, nnite, idxnite, &
real(r8) :: rhtrunc(pcols,pver)
real(r8) :: wrh(pcols,pver)
integer :: krh(pcols,pver)
-
+
integer :: numaerosols ! number of bulk aerosols in climate/diagnostic list
integer :: nmodes ! number of aerosol modes in climate/diagnostic list
integer :: iaerosol ! index into bulk aerosol list
@@ -215,15 +219,15 @@ subroutine aer_rad_props_sw(list_idx, state, pbuf, nnite, idxnite, &
! Contributions from modal aerosols.
if (nmodes > 0) then
- call modal_aero_sw(list_idx, state, pbuf, nnite, idxnite, &
- tau, tau_w, tau_w_g, tau_w_f)
+ call aerosol_optics_cam_sw(list_idx, state, pbuf, nnite, idxnite, &
+ tau, tau_w, tau_w_g, tau_w_f)
else
tau (1:ncol,:,:) = 0._r8
tau_w (1:ncol,:,:) = 0._r8
tau_w_g(1:ncol,:,:) = 0._r8
tau_w_f(1:ncol,:,:) = 0._r8
end if
-
+
call tropopause_find(state, troplev)
! Contributions from bulk aerosols.
@@ -310,14 +314,14 @@ subroutine aer_rad_props_lw(list_idx, state, pbuf, odap_aer)
! Purpose: Compute aerosol transmissions needed in absorptivity/
! emissivity calculations
- ! lw extinction is the same representation for all
+ ! lw extinction is the same representation for all
! species. If this changes, this routine will need to do something
! similar to the sw with routines like get_hygro_lw_abs
! Arguments
integer, intent(in) :: list_idx ! index of the climate or a diagnostic list
type(physics_state), intent(in), target :: state
-
+
type(physics_buffer_desc), pointer :: pbuf(:)
real(r8), intent(out) :: odap_aer(pcols,pver,nlwbands) ! [fraction] absorption optical depth, per layer
@@ -336,7 +340,7 @@ subroutine aer_rad_props_lw(list_idx, state, pbuf, odap_aer)
real(r8), pointer :: lw_abs(:)
real(r8), pointer :: lw_hygro_abs(:,:)
real(r8), pointer :: geometric_radius(:,:)
-
+
! volcanic lookup table
real(r8), pointer :: r_lw_abs(:,:) ! radius dependent mass-specific absorption coefficient
real(r8), pointer :: r_mu(:) ! log(geometric_mean_radius) domain samples of r_lw_abs(:,:)
@@ -369,7 +373,7 @@ subroutine aer_rad_props_lw(list_idx, state, pbuf, odap_aer)
! Contributions from modal aerosols.
if (nmodes > 0) then
- call modal_aero_lw(list_idx, state, pbuf, odap_aer)
+ call aerosol_optics_cam_lw(list_idx, state, pbuf, odap_aer)
else
odap_aer = 0._r8
end if
@@ -422,13 +426,13 @@ subroutine aer_rad_props_lw(list_idx, state, pbuf, odap_aer)
! get optical properties for hygroscopic aerosols
call rad_cnst_get_aer_props(list_idx, iaerosol, lw_ext=lw_abs)
do bnd_idx = 1, nlwbands
- do k = 1, pver
+ do k = 1, pver
do i = 1, ncol
odap_aer(i,k,bnd_idx) = odap_aer(i,k,bnd_idx) + lw_abs(bnd_idx)*aermass(i,k)
end do
end do
end do
-
+
case('volcanic_radius','volcanic_radius1','volcanic_radius2','volcanic_radius3')
pbuf_fld = 'VOLC_RAD_GEOM '
if (len_trim(opticstype)>15) then
@@ -440,7 +444,7 @@ subroutine aer_rad_props_lw(list_idx, state, pbuf, odap_aer)
! get microphysical properties for volcanic aerosols
idx = pbuf_get_index(pbuf_fld)
call pbuf_get_field(pbuf, idx, geometric_radius )
-
+
! interpolate in radius
! caution: clip the table with no warning when outside bounds
nmu = size(r_mu)
@@ -509,7 +513,7 @@ subroutine get_hygro_rad_props(ncol, krh, wrh, mass, ext, ssa, asm, &
- wrh(icol,ilev) * ssa(krh(icol,ilev), iswband)
asm1 = (1 + wrh(icol,ilev)) * asm(krh(icol,ilev)+1,iswband) &
- wrh(icol,ilev) * asm(krh(icol,ilev), iswband)
-
+
tau (icol, ilev, iswband) = mass(icol, ilev) * ext1
tau_w (icol, ilev, iswband) = mass(icol, ilev) * ext1 * ssa1
tau_w_g(icol, ilev, iswband) = mass(icol, ilev) * ext1 * ssa1 * asm1
@@ -518,10 +522,10 @@ subroutine get_hygro_rad_props(ncol, krh, wrh, mass, ext, ssa, asm, &
enddo
enddo
-end subroutine get_hygro_rad_props
+end subroutine get_hygro_rad_props
!==============================================================================
-
+
subroutine get_nonhygro_rad_props(ncol, mass, ext, ssa, asm, &
tau, tau_w, tau_w_g, tau_w_f)
@@ -535,13 +539,13 @@ subroutine get_nonhygro_rad_props(ncol, mass, ext, ssa, asm, &
real(r8), intent(out) :: tau (pcols, pver, nswbands)
real(r8), intent(out) :: tau_w (pcols, pver, nswbands)
real(r8), intent(out) :: tau_w_g(pcols, pver, nswbands)
- real(r8), intent(out) :: tau_w_f(pcols, pver, nswbands)
+ real(r8), intent(out) :: tau_w_f(pcols, pver, nswbands)
! Local variables
integer :: iswband
real(r8) :: ext1, ssa1, asm1
!-----------------------------------------------------------------------------
-
+
do iswband = 1, nswbands
ext1 = ext(iswband)
ssa1 = ssa(iswband)
@@ -555,11 +559,11 @@ subroutine get_nonhygro_rad_props(ncol, mass, ext, ssa, asm, &
end subroutine get_nonhygro_rad_props
!==============================================================================
-
+
subroutine get_volcanic_radius_rad_props(ncol, mass, pbuf_radius_name, pbuf, r_ext, r_scat, r_ascat, r_mu, &
tau, tau_w, tau_w_g, tau_w_f)
-
+
use physics_buffer, only : pbuf_get_field, pbuf_get_index
! Arguments
@@ -575,7 +579,7 @@ subroutine get_volcanic_radius_rad_props(ncol, mass, pbuf_radius_name, pbuf, r_
real(r8), intent(out) :: tau (pcols, pver, nswbands)
real(r8), intent(out) :: tau_w (pcols, pver, nswbands)
real(r8), intent(out) :: tau_w_g(pcols, pver, nswbands)
- real(r8), intent(out) :: tau_w_f(pcols, pver, nswbands)
+ real(r8), intent(out) :: tau_w_f(pcols, pver, nswbands)
! Local variables
integer :: iswband
@@ -586,7 +590,7 @@ subroutine get_volcanic_radius_rad_props(ncol, mass, pbuf_radius_name, pbuf, r_
real(r8) :: mu(pcols,pver) ! log(geometric mean radius of volcanic aerosol)
integer :: kmu, nmu
real(r8) :: wmu, mutrunc, r_mu_max, r_mu_min
-
+
! interpolated values from table
real(r8) :: ext(nswbands)
real(r8) :: scat(nswbands)
@@ -595,10 +599,10 @@ subroutine get_volcanic_radius_rad_props(ncol, mass, pbuf_radius_name, pbuf, r_
integer :: i, k ! column level iterator
!-----------------------------------------------------------------------------
- tau =0._r8
- tau_w =0._r8
- tau_w_g=0._r8
- tau_w_f=0._r8
+ tau =0._r8
+ tau_w =0._r8
+ tau_w_g=0._r8
+ tau_w_f=0._r8
! get microphysical properties for volcanic aerosols
idx = pbuf_get_index(pbuf_radius_name)
@@ -634,10 +638,10 @@ subroutine get_volcanic_radius_rad_props(ncol, mass, pbuf_radius_name, pbuf, r_
else
g=0._r8
endif
- tau (i,k,iswband) = mass(i,k) * ext(iswband)
- tau_w (i,k,iswband) = mass(i,k) * scat(iswband)
- tau_w_g(i,k,iswband) = mass(i,k) * ascat(iswband)
- tau_w_f(i,k,iswband) = mass(i,k) * g * ascat(iswband)
+ tau (i,k,iswband) = mass(i,k) * ext(iswband)
+ tau_w (i,k,iswband) = mass(i,k) * scat(iswband)
+ tau_w_g(i,k,iswband) = mass(i,k) * ascat(iswband)
+ tau_w_f(i,k,iswband) = mass(i,k) * g * ascat(iswband)
end do
enddo
enddo
@@ -645,7 +649,7 @@ subroutine get_volcanic_radius_rad_props(ncol, mass, pbuf_radius_name, pbuf, r_
end subroutine get_volcanic_radius_rad_props
!==============================================================================
-
+
subroutine get_volcanic_rad_props(ncol, mass, ext, scat, ascat, &
tau, tau_w, tau_w_g, tau_w_f)
@@ -659,23 +663,23 @@ subroutine get_volcanic_rad_props(ncol, mass, ext, scat, ascat, &
real(r8), intent(out) :: tau (pcols, pver, nswbands)
real(r8), intent(out) :: tau_w (pcols, pver, nswbands)
real(r8), intent(out) :: tau_w_g(pcols, pver, nswbands)
- real(r8), intent(out) :: tau_w_f(pcols, pver, nswbands)
+ real(r8), intent(out) :: tau_w_f(pcols, pver, nswbands)
! Local variables
integer :: iswband
real(r8) :: g
!-----------------------------------------------------------------------------
-
+
do iswband = 1, nswbands
if (scat(iswband).gt.0._r8) then
g = ascat(iswband)/scat(iswband)
else
g=0._r8
endif
- tau (1:ncol,1:pver,iswband) = mass(1:ncol,1:pver) * ext(iswband)
- tau_w (1:ncol,1:pver,iswband) = mass(1:ncol,1:pver) * scat(iswband)
- tau_w_g(1:ncol,1:pver,iswband) = mass(1:ncol,1:pver) * ascat(iswband)
- tau_w_f(1:ncol,1:pver,iswband) = mass(1:ncol,1:pver) * g * ascat(iswband)
+ tau (1:ncol,1:pver,iswband) = mass(1:ncol,1:pver) * ext(iswband)
+ tau_w (1:ncol,1:pver,iswband) = mass(1:ncol,1:pver) * scat(iswband)
+ tau_w_g(1:ncol,1:pver,iswband) = mass(1:ncol,1:pver) * ascat(iswband)
+ tau_w_f(1:ncol,1:pver,iswband) = mass(1:ncol,1:pver) * g * ascat(iswband)
enddo
end subroutine get_volcanic_rad_props
@@ -695,7 +699,7 @@ subroutine aer_vis_diag_out(lchnk, ncol, nnite, idxnite, iaer, tau, diag_idx, tr
integer, intent(in) :: diag_idx ! identifies whether the aerosol optics
! is for the climate calc or a diagnostic calc
integer, intent(in) :: troplev(:) ! tropopause level
-
+
! Local variables
integer :: i
real(r8) :: tmp(pcols), tmp2(pcols)
@@ -718,7 +722,7 @@ subroutine aer_vis_diag_out(lchnk, ncol, nnite, idxnite, iaer, tau, diag_idx, tr
do i = 1, ncol
tmp2(i) = sum(tau(i,:troplev(i)))
end do
- call outfld('AODvstrt', tmp2, pcols, lchnk)
+ call outfld('AODvstrt', tmp2, pcols, lchnk)
end if
end subroutine aer_vis_diag_out
diff --git a/src/physics/cam/aerosol_optics_cam.F90 b/src/physics/cam/aerosol_optics_cam.F90
new file mode 100644
index 0000000000..eb094446c8
--- /dev/null
+++ b/src/physics/cam/aerosol_optics_cam.F90
@@ -0,0 +1,1339 @@
+module aerosol_optics_cam
+ use shr_kind_mod, only: r8 => shr_kind_r8
+ use shr_kind_mod, only: cl => shr_kind_cl
+ use cam_logfile, only: iulog
+ use radconstants, only: nswbands, nlwbands, idx_sw_diag, idx_uv_diag, idx_nir_diag
+ use radconstants, only: ot_length, get_lw_spectral_boundaries
+ use physics_types,only: physics_state
+ use physics_buffer,only: physics_buffer_desc
+ use ppgrid, only: pcols, pver
+ use physconst, only: rga, rair
+ use cam_abortutils, only: endrun
+ use spmd_utils, only: masterproc
+ use rad_constituents, only: n_diag, rad_cnst_get_call_list
+ use cam_history, only: addfld, add_default, outfld, horiz_only, fieldname_len
+ use cam_history_support, only: fillvalue
+
+ use tropopause, only : tropopause_findChemTrop
+
+ use aerosol_properties_mod, only: aerosol_properties
+ use modal_aerosol_properties_mod, only: modal_aerosol_properties
+
+ use aerosol_state_mod, only: aerosol_state
+ use modal_aerosol_state_mod,only: modal_aerosol_state
+
+ use aerosol_optics_mod, only: aerosol_optics
+ use refractive_aerosol_optics_mod, only: refractive_aerosol_optics
+
+ implicit none
+
+ private
+
+ public :: aerosol_optics_cam_readnl
+ public :: aerosol_optics_cam_init
+ public :: aerosol_optics_cam_final
+ public :: aerosol_optics_cam_sw
+ public :: aerosol_optics_cam_lw
+
+ type aero_props_t
+ class(aerosol_properties), pointer :: obj => null()
+ end type aero_props_t
+ type aero_state_t
+ class(aerosol_state), pointer :: obj => null()
+ end type aero_state_t
+
+ type(aero_props_t), allocatable :: aero_props(:) ! array of aerosol properties objects to allow for
+ ! multiple aerosol representations in the same sim
+ ! such as MAM and CARMA
+
+ ! refractive index for water read in read_water_refindex
+ complex(r8) :: crefwsw(nswbands) = -huge(1._r8) ! complex refractive index for water visible
+ complex(r8) :: crefwlw(nlwbands) = -huge(1._r8) ! complex refractive index for water infrared
+ character(len=cl) :: water_refindex_file = 'NONE' ! full pathname for water refractive index dataset
+
+ logical :: modal_active = .false.
+ integer :: num_aero_models = 0
+ integer :: lw10um_indx = -1 ! wavelength index corresponding to 10 microns
+ real(r8), parameter :: lw10um = 10._r8 ! microns
+
+ character(len=4) :: diag(0:n_diag) = (/' ','_d1 ','_d2 ','_d3 ','_d4 ','_d5 ', '_d6 ','_d7 ','_d8 ','_d9 ','_d10'/)
+
+ type out_name
+ character(len=fieldname_len), allocatable :: name(:) ! nbins
+ end type out_name
+
+ type(out_name), allocatable :: burden_fields(:) ! num_aero_models
+ type(out_name), allocatable :: aodbin_fields(:)
+ type(out_name), allocatable :: aoddust_fields(:)
+ type(out_name), allocatable :: burdendn_fields(:) ! num_aero_models
+ type(out_name), allocatable :: aodbindn_fields(:)
+ type(out_name), allocatable :: aoddustdn_fields(:)
+
+contains
+
+ !===============================================================================
+ subroutine aerosol_optics_cam_readnl(nlfile)
+ use namelist_utils, only : find_group_name
+ use spmd_utils, only : mpicom, masterprocid, mpi_character, mpi_success
+
+ character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input
+
+ integer :: unitn, ierr
+ character(len=cl) :: errmsg
+ character(len=*), parameter :: subname = 'aerosol_optics_cam_readnl'
+
+ ! ===================
+ ! Namelist definition
+ ! ===================
+ namelist /aerosol_optics_nl/ water_refindex_file
+
+ ! =============
+ ! Read namelist
+ ! =============
+ if (masterproc) then
+ open( newunit=unitn, file=trim(nlfile), status='old' )
+ call find_group_name(unitn, 'aerosol_optics_nl', status=ierr)
+ if (ierr == 0) then
+ read(unitn, aerosol_optics_nl, iostat=ierr)
+ if (ierr /= 0) then
+ write(errmsg,'(2a,i10)') subname,':: ERROR reading namelist, error code: ',ierr
+ call endrun(errmsg)
+ end if
+ end if
+ close(unitn)
+ end if
+
+ ! ============================
+ ! Broadcast namelist variables
+ ! ============================
+ call mpi_bcast(water_refindex_file, len(water_refindex_file), mpi_character, masterprocid, mpicom, ierr)
+ if (ierr/=mpi_success) then
+ call endrun(subname // ':: ERROR mpi_bcast '//trim(water_refindex_file))
+ end if
+
+ if (masterproc) then
+ write(iulog,*) subname,': water_refindex_file = ',trim(water_refindex_file)
+ end if
+
+ end subroutine aerosol_optics_cam_readnl
+
+ !===============================================================================
+ subroutine aerosol_optics_cam_init
+ use rad_constituents, only: rad_cnst_get_info
+ use phys_control, only: phys_getopts
+ use ioFileMod, only: getfil
+
+ character(len=*), parameter :: prefix = 'aerosol_optics_cam_init: '
+ integer :: nmodes=0, iaermod, istat, ilist, i
+
+ logical :: call_list(0:n_diag)
+ real(r8) :: lwavlen_lo(nlwbands), lwavlen_hi(nlwbands)
+ integer :: m, n
+
+ character(len=fieldname_len) :: fldname
+ character(len=128) :: lngname
+ logical :: history_aero_optics ! output aerosol optics diagnostics
+ logical :: history_amwg ! output the variables used by the AMWG diag package
+ logical :: history_dust ! output dust diagnostics
+
+ character(len=cl) :: locfile
+
+ call phys_getopts(history_amwg_out = history_amwg, &
+ history_aero_optics_out = history_aero_optics, &
+ history_dust_out = history_dust )
+
+ num_aero_models = 0
+
+ call rad_cnst_get_info(0, nmodes=nmodes)
+ modal_active = nmodes>0
+
+ if (modal_active) then
+ num_aero_models = num_aero_models+1 ! count aerosol models
+ end if
+
+ if (num_aero_models>0) then
+ allocate(aero_props(num_aero_models), stat=istat)
+ if (istat/=0) then
+ call endrun(prefix//'array allocation error: aero_props')
+ end if
+ end if
+
+ iaermod = 0
+
+ if (modal_active) then
+ iaermod = iaermod+1
+ aero_props(iaermod)%obj => modal_aerosol_properties()
+ end if
+
+ if (water_refindex_file=='NONE') then
+ call endrun(prefix//'water_refindex_file must be specified')
+ else
+ call getfil(water_refindex_file, locfile)
+ call read_water_refindex(locfile)
+ end if
+
+ call get_lw_spectral_boundaries(lwavlen_lo, lwavlen_hi, units='um')
+ do i = 1,nlwbands
+ if ((lwavlen_lo(i)<=lw10um) .and. (lwavlen_hi(i)>=lw10um)) then
+ lw10um_indx = i ! index corresponding to 10 microns
+ end if
+ end do
+ call rad_cnst_get_call_list(call_list)
+
+ do ilist = 0, n_diag
+ if (call_list(ilist)) then
+ call addfld ('EXTINCT'//diag(ilist), (/ 'lev' /), 'A','/m',&
+ 'Aerosol extinction 550 nm, day only', flag_xyfill=.true.)
+ call addfld ('EXTINCTUV'//diag(ilist), (/ 'lev' /), 'A','/m',&
+ 'Aerosol extinction 350 nm, day only', flag_xyfill=.true.)
+ call addfld ('EXTINCTNIR'//diag(ilist), (/ 'lev' /), 'A','/m',&
+ 'Aerosol extinction 1020 nm, day only', flag_xyfill=.true.)
+ call addfld ('ABSORB'//diag(ilist), (/ 'lev' /), 'A','/m',&
+ 'Aerosol absorption, day only', flag_xyfill=.true.)
+ call addfld ('AODVIS'//diag(ilist), horiz_only, 'A',' ', &
+ 'Aerosol optical depth 550 nm', flag_xyfill=.true.)
+ call addfld ('AODVISst'//diag(ilist), horiz_only, 'A',' ', &
+ 'Stratospheric aerosol optical depth 550 nm, day only', flag_xyfill=.true.)
+ call addfld ('AODNIRst'//diag(ilist), horiz_only, 'A',' ', &
+ 'Stratospheric aerosol optical depth 1020 nm, day only',flag_xyfill=.true.)
+ call addfld ('AODUVst'//diag(ilist), horiz_only, 'A',' ', &
+ 'Stratospheric aerosol optical depth 350 nm, day only', flag_xyfill=.true.)
+ call addfld ('AODUV'//diag(ilist), horiz_only, 'A',' ', &
+ 'Aerosol optical depth 350 nm, day only', flag_xyfill=.true.)
+ call addfld ('AODNIR'//diag(ilist), horiz_only, 'A',' ', &
+ 'Aerosol optical depth 1020 nm, day only',flag_xyfill=.true.)
+ call addfld ('AODABS'//diag(ilist), horiz_only, 'A',' ', &
+ 'Aerosol absorption optical depth 550 nm, day only', flag_xyfill=.true.)
+ call addfld ('AODxASYM'//diag(ilist), horiz_only, 'A',' ', &
+ 'Aerosol optical depth 550 * asymmetry factor, day only', flag_xyfill=.true.)
+ call addfld ('EXTxASYM'//diag(ilist), (/ 'lev' /), 'A',' ', &
+ 'extinction 550 nm * asymmetry factor, day only', flag_xyfill=.true.)
+ call addfld ('AODTOT'//diag(ilist), horiz_only, 'A','1',&
+ 'Aerosol optical depth summed over all sw wavelengths', flag_xyfill=.true.)
+
+ call addfld ('EXTINCTdn'//diag(ilist), (/ 'lev' /), 'A','/m',&
+ 'Aerosol extinction 550 nm, day only', flag_xyfill=.true.)
+ call addfld ('EXTINCTUVdn'//diag(ilist), (/ 'lev' /), 'A','/m',&
+ 'Aerosol extinction 350 nm, day only', flag_xyfill=.true.)
+ call addfld ('EXTINCTNIRdn'//diag(ilist), (/ 'lev' /), 'A','/m',&
+ 'Aerosol extinction 1020 nm, day only', flag_xyfill=.true.)
+ call addfld ('ABSORBdn'//diag(ilist), (/ 'lev' /), 'A','/m',&
+ 'Aerosol absorption, day only', flag_xyfill=.true.)
+ call addfld ('AODVISdn'//diag(ilist), horiz_only, 'A',' ', &
+ 'Aerosol optical depth 550 nm', flag_xyfill=.true.)
+ call addfld ('AODVISstdn'//diag(ilist), horiz_only, 'A',' ', &
+ 'Stratospheric aerosol optical depth 550 nm, day only', flag_xyfill=.true.)
+ call addfld ('AODNIRstdn'//diag(ilist), horiz_only, 'A',' ', &
+ 'Stratospheric aerosol optical depth 1020 nm, day only', flag_xyfill=.true.)
+ call addfld ('AODUVstdn'//diag(ilist), horiz_only, 'A',' ', &
+ 'Stratospheric aerosol optical depth 350 nm, day only', flag_xyfill=.true.)
+ call addfld ('AODUVdn'//diag(ilist), horiz_only, 'A',' ', &
+ 'Aerosol optical depth 350 nm, day only', flag_xyfill=.true.)
+ call addfld ('AODNIRdn'//diag(ilist), horiz_only, 'A',' ', &
+ 'Aerosol optical depth 1020 nm, day only', flag_xyfill=.true.)
+ call addfld ('AODABSdn'//diag(ilist), horiz_only, 'A',' ', &
+ 'Aerosol absorption optical depth 550 nm, day only', flag_xyfill=.true.)
+ call addfld ('AODxASYMdn'//diag(ilist), horiz_only, 'A',' ', &
+ 'Aerosol optical depth 550 * asymmetry factor, day only', flag_xyfill=.true.)
+ call addfld ('EXTxASYMdn'//diag(ilist), (/ 'lev' /), 'A',' ', &
+ 'extinction 550 nm * asymmetry factor, day only', flag_xyfill=.true.)
+ call addfld ('AODTOTdn'//diag(ilist), horiz_only, 'A','1',&
+ 'Aerosol optical depth summed over all sw wavelengths, day only')
+
+ if (lw10um_indx>0) then
+ call addfld('AODABSLW'//diag(ilist), (/ 'lev' /), 'A','/m',&
+ 'Aerosol long-wave absorption optical depth at 10 microns')
+ end if
+ call addfld ('TOTABSLW'//diag(ilist), (/ 'lev' /), 'A',' ', &
+ 'LW Aero total abs')
+
+ if (ilist>0 .and. history_aero_optics) then
+ call add_default ('EXTINCT'//diag(ilist), 1, ' ')
+ call add_default ('ABSORB'//diag(ilist), 1, ' ')
+ call add_default ('AODVIS'//diag(ilist), 1, ' ')
+ call add_default ('AODVISst'//diag(ilist), 1, ' ')
+ call add_default ('AODABS'//diag(ilist), 1, ' ')
+ end if
+
+ end if
+ end do
+
+ if (num_aero_models>0) then
+
+ allocate(burden_fields(num_aero_models), stat=istat)
+ if (istat/=0) then
+ call endrun(prefix//'array allocation error: burden_fields')
+ end if
+ allocate(aodbin_fields(num_aero_models), stat=istat)
+ if (istat/=0) then
+ call endrun(prefix//'array allocation error: aodbin_fields')
+ end if
+ allocate(aoddust_fields(num_aero_models), stat=istat)
+ if (istat/=0) then
+ call endrun(prefix//'array allocation error: aoddust_fields')
+ end if
+
+ allocate(burdendn_fields(num_aero_models), stat=istat)
+ if (istat/=0) then
+ call endrun(prefix//'array allocation error: burdendn_fields')
+ end if
+ allocate(aodbindn_fields(num_aero_models), stat=istat)
+ if (istat/=0) then
+ call endrun(prefix//'array allocation error: aodbindn_fields')
+ end if
+ allocate(aoddustdn_fields(num_aero_models), stat=istat)
+ if (istat/=0) then
+ call endrun(prefix//'array allocation error: aoddustdn_fields')
+ end if
+
+ do n = 1,num_aero_models
+
+ allocate(burden_fields(n)%name(aero_props(n)%obj%nbins()), stat=istat)
+ if (istat/=0) then
+ call endrun(prefix//'array allocation error: burden_fields(n)%name')
+ end if
+ allocate(aodbin_fields(n)%name(aero_props(n)%obj%nbins()), stat=istat)
+ if (istat/=0) then
+ call endrun(prefix//'array allocation error: aodbin_fields(n)%name')
+ end if
+ allocate(aoddust_fields(n)%name(aero_props(n)%obj%nbins()), stat=istat)
+ if (istat/=0) then
+ call endrun(prefix//'array allocation error: aoddust_fields(n)%name')
+ end if
+
+ allocate(burdendn_fields(n)%name(aero_props(n)%obj%nbins()), stat=istat)
+ if (istat/=0) then
+ call endrun(prefix//'array allocation error: burdendn_fields(n)%name')
+ end if
+ allocate(aodbindn_fields(n)%name(aero_props(n)%obj%nbins()), stat=istat)
+ if (istat/=0) then
+ call endrun(prefix//'array allocation error: aodbindn_fields(n)%name')
+ end if
+ allocate(aoddustdn_fields(n)%name(aero_props(n)%obj%nbins()), stat=istat)
+ if (istat/=0) then
+ call endrun(prefix//'array allocation error: aoddustdn_fields(n)%name')
+ end if
+
+ do m = 1, aero_props(n)%obj%nbins()
+
+ write(fldname,'(a,i2.2)') 'BURDEN', m
+ burden_fields(n)%name(m) = fldname
+ write(lngname,'(a,i2.2)') 'Aerosol burden bin ', m
+ call addfld (fldname, horiz_only, 'A', 'kg/m2', lngname, flag_xyfill=.true.)
+ if (history_aero_optics) then
+ call add_default (fldname, 1, ' ')
+ end if
+
+ fldname = 'AOD_'//trim(aero_props(n)%obj%bin_name(0,m))
+ aodbin_fields(n)%name(m) = fldname
+ lngname = 'Aerosol optical depth, day only, 550 nm, '//trim(aero_props(n)%obj%bin_name(0,m))
+ call addfld (aodbin_fields(n)%name(m), horiz_only, 'A', ' ', lngname, flag_xyfill=.true.)
+ if (history_aero_optics) then
+ call add_default (fldname, 1, ' ')
+ end if
+
+ write(fldname,'(a,i2.2)') 'AODDUST', m
+ aoddust_fields(n)%name(m) = fldname
+ write(lngname,'(a,i2,a)') 'Aerosol optical depth, day only, 550 nm mode ',m,' from dust'
+ call addfld (aoddust_fields(n)%name(m), horiz_only, 'A', ' ', lngname, flag_xyfill=.true.)
+ if (history_aero_optics) then
+ call add_default (fldname, 1, ' ')
+ end if
+
+ write(fldname,'(a,i2.2)') 'BURDENdn', m
+ burdendn_fields(n)%name(m) = fldname
+ write(lngname,'(a,i2)') 'Aerosol burden, day night, bin ', m
+ call addfld (burdendn_fields(n)%name(m), horiz_only, 'A', 'kg/m2', lngname, flag_xyfill=.true.)
+ if (history_aero_optics) then
+ call add_default (fldname, 1, ' ')
+ end if
+
+ fldname = 'AODdn_'//trim(aero_props(n)%obj%bin_name(0,m))
+ aodbindn_fields(n)%name(m) = fldname
+ lngname = 'Aerosol optical depth 550 nm, day night, '//trim(aero_props(n)%obj%bin_name(0,m))
+ call addfld (aodbindn_fields(n)%name(m), horiz_only, 'A', ' ', lngname, flag_xyfill=.true.)
+ if (history_aero_optics) then
+ call add_default (fldname, 1, ' ')
+ end if
+
+ write(fldname,'(a,i2.2)') 'AODdnDUST', m
+ aoddustdn_fields(n)%name(m) = fldname
+ write(lngname,'(a,i2,a)') 'Aerosol optical depth 550 nm, day night, bin ',m,' from dust'
+ call addfld (aoddustdn_fields(n)%name(m), horiz_only, 'A', ' ', lngname, flag_xyfill=.true.)
+ if (history_aero_optics) then
+ call add_default (fldname, 1, ' ')
+ end if
+
+ end do
+
+ end do
+
+ end if
+
+ call addfld ('AODDUST', horiz_only, 'A',' ', 'Aerosol optical depth 550 nm from dust, day only', &
+ flag_xyfill=.true.)
+ call addfld ('AODSO4', horiz_only, 'A',' ', 'Aerosol optical depth 550 nm from SO4, day only', &
+ flag_xyfill=.true.)
+ call addfld ('AODPOM', horiz_only, 'A',' ', 'Aerosol optical depth 550 nm from POM, day only', &
+ flag_xyfill=.true.)
+ call addfld ('AODSOA', horiz_only, 'A',' ', 'Aerosol optical depth 550 nm from SOA, day only', &
+ flag_xyfill=.true.)
+ call addfld ('AODBC', horiz_only, 'A',' ', 'Aerosol optical depth 550 nm from BC, day only', &
+ flag_xyfill=.true.)
+ call addfld ('AODSS', horiz_only, 'A',' ', 'Aerosol optical depth 550 nm from seasalt, day only', &
+ flag_xyfill=.true.)
+ call addfld ('AODABSBC', horiz_only, 'A',' ', 'Aerosol absorption optical depth 550 nm from BC, day only',&
+ flag_xyfill=.true.)
+ call addfld ('BURDENDUST', horiz_only, 'A','kg/m2', 'Dust aerosol burden, day only' , &
+ flag_xyfill=.true.)
+ call addfld ('BURDENSO4', horiz_only, 'A','kg/m2', 'Sulfate aerosol burden, day only' , &
+ flag_xyfill=.true.)
+ call addfld ('BURDENPOM', horiz_only, 'A','kg/m2', 'POM aerosol burden, day only' , &
+ flag_xyfill=.true.)
+ call addfld ('BURDENSOA', horiz_only, 'A','kg/m2', 'SOA aerosol burden, day only' , &
+ flag_xyfill=.true.)
+ call addfld ('BURDENBC', horiz_only, 'A','kg/m2', 'Black carbon aerosol burden, day only', &
+ flag_xyfill=.true.)
+ call addfld ('BURDENSEASALT', horiz_only, 'A','kg/m2', 'Seasalt aerosol burden, day only' , &
+ flag_xyfill=.true.)
+ call addfld ('SSAVIS', horiz_only, 'A',' ', 'Aerosol single-scatter albedo, day only', &
+ flag_xyfill=.true.)
+
+ call addfld ('AODDUSTdn', horiz_only, 'A',' ', 'Aerosol optical depth 550 nm from dust, day night', &
+ flag_xyfill=.true.)
+ call addfld ('AODSO4dn', horiz_only, 'A',' ', 'Aerosol optical depth 550 nm from SO4, day night', &
+ flag_xyfill=.true.)
+ call addfld ('AODPOMdn', horiz_only, 'A',' ', 'Aerosol optical depth 550 nm from POM, day night', &
+ flag_xyfill=.true.)
+ call addfld ('AODSOAdn', horiz_only, 'A',' ', 'Aerosol optical depth 550 nm from SOA, day night', &
+ flag_xyfill=.true.)
+ call addfld ('AODBCdn', horiz_only, 'A',' ', 'Aerosol optical depth 550 nm from BC, day night', &
+ flag_xyfill=.true.)
+ call addfld ('AODSSdn', horiz_only, 'A',' ', 'Aerosol optical depth 550 nm from seasalt, day night', &
+ flag_xyfill=.true.)
+ call addfld ('AODABSBCdn', horiz_only, 'A',' ', 'Aerosol absorption optical depth 550 nm from BC, day night',&
+ flag_xyfill=.true.)
+ call addfld ('BURDENDUSTdn', horiz_only, 'A','kg/m2', 'Dust aerosol burden, day night' , &
+ flag_xyfill=.true.)
+ call addfld ('BURDENSO4dn', horiz_only, 'A','kg/m2', 'Sulfate aerosol burden, day night' , &
+ flag_xyfill=.true.)
+ call addfld ('BURDENPOMdn', horiz_only, 'A','kg/m2', 'POM aerosol burden, day night' , &
+ flag_xyfill=.true.)
+ call addfld ('BURDENSOAdn', horiz_only, 'A','kg/m2', 'SOA aerosol burden, day night' , &
+ flag_xyfill=.true.)
+ call addfld ('BURDENBCdn', horiz_only, 'A','kg/m2', 'Black carbon aerosol burden, day night', &
+ flag_xyfill=.true.)
+ call addfld ('BURDENSEASALTdn', horiz_only, 'A','kg/m2', 'Seasalt aerosol burden, day night' , &
+ flag_xyfill=.true.)
+ call addfld ('SSAVISdn', horiz_only, 'A',' ', 'Aerosol single-scatter albedo, day night', &
+ flag_xyfill=.true.)
+
+ if (history_amwg) then
+ call add_default ('AODDUST01' , 1, ' ')
+ call add_default ('AODDUST03' , 1, ' ')
+ call add_default ('AODDUST' , 1, ' ')
+ call add_default ('AODVIS' , 1, ' ')
+ end if
+
+ if (history_dust) then
+ call add_default ('AODDUST01' , 1, ' ')
+ call add_default ('AODDUST02' , 1, ' ')
+ call add_default ('AODDUST03' , 1, ' ')
+ end if
+
+ if (history_aero_optics) then
+ call add_default ('AODDUST01' , 1, ' ')
+ call add_default ('AODDUST03' , 1, ' ')
+ call add_default ('ABSORB' , 1, ' ')
+ call add_default ('AODVIS' , 1, ' ')
+ call add_default ('AODUV' , 1, ' ')
+ call add_default ('AODNIR' , 1, ' ')
+ call add_default ('AODABS' , 1, ' ')
+ call add_default ('AODABSBC' , 1, ' ')
+ call add_default ('AODDUST' , 1, ' ')
+ call add_default ('AODSO4' , 1, ' ')
+ call add_default ('AODPOM' , 1, ' ')
+ call add_default ('AODSOA' , 1, ' ')
+ call add_default ('AODBC' , 1, ' ')
+ call add_default ('AODSS' , 1, ' ')
+ call add_default ('BURDEN01' , 1, ' ')
+ call add_default ('BURDEN02' , 1, ' ')
+ call add_default ('BURDEN03' , 1, ' ')
+ call add_default ('BURDENDUST' , 1, ' ')
+ call add_default ('BURDENSO4' , 1, ' ')
+ call add_default ('BURDENPOM' , 1, ' ')
+ call add_default ('BURDENSOA' , 1, ' ')
+ call add_default ('BURDENBC' , 1, ' ')
+ call add_default ('BURDENSEASALT', 1, ' ')
+ call add_default ('SSAVIS' , 1, ' ')
+ call add_default ('EXTINCT' , 1, ' ')
+ call add_default ('AODxASYM' , 1, ' ')
+ call add_default ('EXTxASYM' , 1, ' ')
+
+ call add_default ('AODdnDUST01' , 1, ' ')
+ call add_default ('AODdnDUST03' , 1, ' ')
+ call add_default ('ABSORBdn' , 1, ' ')
+ call add_default ('AODVISdn' , 1, ' ')
+ call add_default ('AODUVdn' , 1, ' ')
+ call add_default ('AODNIRdn' , 1, ' ')
+ call add_default ('AODABSdn' , 1, ' ')
+ call add_default ('AODABSBCdn' , 1, ' ')
+ call add_default ('AODDUSTdn' , 1, ' ')
+ call add_default ('AODSO4dn' , 1, ' ')
+ call add_default ('AODPOMdn' , 1, ' ')
+ call add_default ('AODSOAdn' , 1, ' ')
+ call add_default ('AODBCdn' , 1, ' ')
+ call add_default ('AODSSdn' , 1, ' ')
+ call add_default ('BURDENdn01' , 1, ' ')
+ call add_default ('BURDENdn02' , 1, ' ')
+ call add_default ('BURDENdn03' , 1, ' ')
+ call add_default ('BURDENDUSTdn' , 1, ' ')
+ call add_default ('BURDENSO4dn' , 1, ' ')
+ call add_default ('BURDENPOMdn' , 1, ' ')
+ call add_default ('BURDENSOAdn' , 1, ' ')
+ call add_default ('BURDENBCdn' , 1, ' ')
+ call add_default ('BURDENSEASALTdn', 1, ' ')
+ call add_default ('SSAVISdn' , 1, ' ')
+ call add_default ('EXTINCTdn' , 1, ' ')
+ call add_default ('AODxASYMdn' , 1, ' ')
+ call add_default ('EXTxASYMdn' , 1, ' ')
+ end if
+
+ end subroutine aerosol_optics_cam_init
+
+ !===============================================================================
+ subroutine aerosol_optics_cam_final
+
+ integer :: iaermod
+
+ do iaermod = 1,num_aero_models
+ if (associated(aero_props(iaermod)%obj)) then
+ deallocate(aero_props(iaermod)%obj)
+ nullify(aero_props(iaermod)%obj)
+ end if
+ end do
+
+ if (allocated(aero_props)) then
+ deallocate(aero_props)
+ endif
+
+ end subroutine aerosol_optics_cam_final
+
+ !===============================================================================
+ subroutine aerosol_optics_cam_sw(list_idx, state, pbuf, nnite, idxnite, tauxar, wa, ga, fa)
+
+ ! calculates aerosol sw radiative properties
+
+ integer, intent(in) :: list_idx ! index of the climate or a diagnostic list
+ type(physics_state), intent(in), target :: state ! state variables
+
+ type(physics_buffer_desc), pointer :: pbuf(:)
+ integer, intent(in) :: nnite ! number of night columns
+ integer, intent(in) :: idxnite(nnite) ! local column indices of night columns
+
+ real(r8), intent(inout) :: tauxar(pcols,0:pver,nswbands) ! layer extinction optical depth
+ real(r8), intent(inout) :: wa(pcols,0:pver,nswbands) ! layer single-scatter albedo
+ real(r8), intent(inout) :: ga(pcols,0:pver,nswbands) ! asymmetry factor
+ real(r8), intent(inout) :: fa(pcols,0:pver,nswbands) ! forward scattered fraction
+
+ character(len=*), parameter :: prefix = 'aerosol_optics_cam_sw: '
+
+ integer :: ibin, nbins
+ integer :: iwav, ilev
+ integer :: icol, istat
+ integer :: lchnk, ncol
+
+ type(aero_state_t), allocatable :: aero_state(:) ! array of aerosol state objects to allow for
+ ! multiple aerosol representations in the same sim
+ ! such as MAM and CARMA
+
+ class(aerosol_optics), pointer :: aero_optics
+
+ real(r8) :: dopaer(pcols)
+ real(r8) :: mass(pcols,pver)
+ real(r8) :: air_density(pcols,pver)
+
+ real(r8), allocatable :: pext(:) ! parameterized specific extinction (m2/kg)
+ real(r8), allocatable :: pabs(:) ! parameterized specific absorption (m2/kg)
+ real(r8), allocatable :: palb(:) ! parameterized single scattering albedo
+ real(r8), allocatable :: pasm(:) ! parameterized asymmetry factor
+
+ character(len=ot_length) :: opticstype
+ integer :: iaermod
+
+ real(r8) :: aodvis(pcols) ! extinction optical depth in vis
+ real(r8) :: aoduv(pcols) ! extinction optical depth in uv
+ real(r8) :: aodnir(pcols) ! extinction optical depth in nir
+ real(r8) :: absorb(pcols,pver)
+ real(r8) :: aodabs(pcols) ! absorption optical depth
+
+ real(r8) :: aodabsbc(pcols) ! absorption optical depth of BC
+
+ real(r8) :: aodtot(pcols)
+
+ real(r8) :: extinct(pcols,pver)
+ real(r8) :: extinctnir(pcols,pver)
+ real(r8) :: extinctuv(pcols,pver)
+
+ real(r8) :: asymvis(pcols) ! asymmetry factor * optical depth
+ real(r8) :: asymext(pcols,pver) ! asymmetry factor * extinction
+
+ real(r8) :: wetvol(pcols,pver)
+ real(r8) :: watervol(pcols,pver)
+
+ real(r8) :: vol(pcols)
+ real(r8) :: dustvol(pcols)
+
+ real(r8) :: scatdust(pcols)
+ real(r8) :: absdust(pcols)
+ real(r8) :: dustaodbin(pcols)
+
+ real(r8) :: scatbc(pcols)
+ real(r8) :: absbc(pcols)
+
+ real(r8) :: scatpom(pcols)
+ real(r8) :: abspom(pcols)
+
+ real(r8) :: scatsslt(pcols)
+ real(r8) :: abssslt(pcols)
+
+ real(r8) :: scatsoa(pcols)
+ real(r8) :: abssoa(pcols)
+
+ real(r8) :: scatsulf(pcols)
+ real(r8) :: abssulf(pcols)
+
+ real(r8) :: burden(pcols)
+ real(r8) :: burdendust(pcols), burdenso4(pcols), burdenbc(pcols), &
+ burdenpom(pcols), burdensoa(pcols), burdenseasalt(pcols)
+
+ real(r8) :: hygrodust(pcols), hygrosulf(pcols), hygrobc(pcols), &
+ hygropom(pcols), hygrosoa(pcols), hygrosslt(pcols)
+
+ real(r8) :: aodbin(pcols)
+
+ complex(r8), pointer :: specrefindex(:) ! species refractive index
+
+ class(aerosol_state), pointer :: aerostate
+ class(aerosol_properties), pointer :: aeroprops
+
+ real(r8) :: specdens
+ character(len=32) :: spectype ! species type
+ real(r8), pointer :: specmmr(:,:)
+ real(r8) :: hygro_aer !
+
+ real(r8) :: scath2o, absh2o, sumscat, sumabs, sumhygro
+
+ real(r8) :: aodc ! aod of component
+
+ ! total species AOD
+ real(r8) :: dustaod(pcols), sulfaod(pcols), bcaod(pcols), &
+ pomaod(pcols), soaaod(pcols), ssltaod(pcols)
+
+ real(r8) :: aodvisst(pcols) ! stratospheric extinction optical depth
+ real(r8) :: aoduvst(pcols) ! stratospheric extinction optical depth in uv
+ real(r8) :: aodnirst(pcols) ! stratospheric extinction optical depth in nir
+ real(r8) :: ssavis(pcols)
+ integer :: troplev(pcols)
+
+ nullify(aero_optics)
+
+ call tropopause_findChemTrop(state, troplev)
+
+ lchnk = state%lchnk
+ ncol = state%ncol
+
+ mass(:ncol,:) = state%pdeldry(:ncol,:)*rga
+ air_density(:ncol,:) = state%pmid(:ncol,:)/(rair*state%t(:ncol,:))
+
+ aodvis = 0._r8
+ aodnir = 0._r8
+ aoduv = 0._r8
+ aodabs = 0._r8
+ absorb = 0._r8
+ aodtot = 0._r8
+ tauxar = 0._r8
+ extinct = 0._r8
+ extinctnir = 0._r8
+ extinctuv = 0._r8
+ asymvis = 0.0_r8
+ asymext = 0.0_r8
+ ssavis = 0.0_r8
+ aodvisst = 0.0_r8
+ aoduvst = 0.0_r8
+ aodnirst = 0.0_r8
+
+ burdendust = 0.0_r8
+ burdenso4 = 0.0_r8
+ burdenbc = 0.0_r8
+ burdenpom = 0.0_r8
+ burdensoa = 0.0_r8
+ burdenseasalt = 0.0_r8
+
+ aodabsbc = 0.0_r8
+ dustaod = 0.0_r8
+ sulfaod = 0.0_r8
+ pomaod = 0.0_r8
+ soaaod = 0.0_r8
+ bcaod = 0.0_r8
+ ssltaod = 0.0_r8
+
+ if (num_aero_models<1) return
+
+ allocate(aero_state(num_aero_models), stat=istat)
+ if (istat/=0) then
+ call endrun(prefix//'array allocation error: aero_state')
+ end if
+
+ iaermod = 0
+ if (modal_active) then
+ iaermod = iaermod+1
+ aero_state(iaermod)%obj => modal_aerosol_state( state, pbuf )
+ end if
+
+ allocate(pext(ncol), stat=istat)
+ if (istat/=0) then
+ call endrun(prefix//'array allocation error: pext')
+ end if
+ allocate(pabs(ncol), stat=istat)
+ if (istat/=0) then
+ call endrun(prefix//'array allocation error: pabs')
+ end if
+ allocate(palb(ncol), stat=istat)
+ if (istat/=0) then
+ call endrun(prefix//'array allocation error: palb')
+ end if
+ allocate(pasm(ncol), stat=istat)
+ if (istat/=0) then
+ call endrun(prefix//'array allocation error: pasm')
+ end if
+
+ aeromodel: do iaermod = 1,num_aero_models
+
+ aeroprops => aero_props(iaermod)%obj
+ aerostate => aero_state(iaermod)%obj
+
+ nbins=aeroprops%nbins(list_idx)
+
+ binloop: do ibin = 1, nbins
+
+ dustaodbin(:) = 0._r8
+ burden(:) = 0._r8
+ aodbin(:) = 0.0_r8
+
+ call aeroprops%optics_params(list_idx, ibin, opticstype=opticstype)
+
+ select case (trim(opticstype))
+ case('modal') ! refractive method
+ aero_optics=>refractive_aerosol_optics(aeroprops, aerostate, list_idx, ibin, &
+ ncol, pver, nswbands, nlwbands, crefwsw, crefwlw)
+ case default
+ call endrun(prefix//'optics method not recognized')
+ end select
+
+ if (associated(aero_optics)) then
+
+ wetvol(:ncol,:pver) = aerostate%wet_volume(aeroprops, list_idx, ibin, ncol, pver)
+ watervol(:ncol,:pver) = aerostate%water_volume(aeroprops, list_idx, ibin, ncol, pver)
+
+ wavelength: do iwav = 1, nswbands
+
+ vertical: do ilev = 1, pver
+
+ call aero_optics%sw_props(ncol, ilev, iwav, pext, pabs, palb, pasm )
+
+ call init_diags
+
+ column: do icol = 1,ncol
+ dopaer(icol) = pext(icol)*mass(icol,ilev)
+ tauxar(icol,ilev,iwav) = tauxar(icol,ilev,iwav) + dopaer(icol)
+ wa(icol,ilev,iwav) = wa(icol,ilev,iwav) + dopaer(icol)*palb(icol)
+ ga(icol,ilev,iwav) = ga(icol,ilev,iwav) + dopaer(icol)*palb(icol)*pasm(icol)
+ fa(icol,ilev,iwav) = fa(icol,ilev,iwav) + dopaer(icol)*palb(icol)*pasm(icol)*pasm(icol)
+
+ call update_diags
+
+ end do column
+
+ end do vertical
+ end do wavelength
+
+ else
+ call endrun(prefix//'aero_optics object pointer not associated')
+ end if
+
+ deallocate(aero_optics)
+ nullify(aero_optics)
+
+ call output_bin_diags
+
+ end do binloop
+ end do aeromodel
+
+ call output_tot_diags
+
+ deallocate(pext)
+ deallocate(pabs)
+ deallocate(palb)
+ deallocate(pasm)
+
+ do iaermod = 1,num_aero_models
+ deallocate(aero_state(iaermod)%obj)
+ nullify(aero_state(iaermod)%obj)
+ end do
+
+ deallocate(aero_state)
+
+ contains
+
+ !===============================================================================
+ subroutine init_diags
+ dustvol(:ncol) = 0._r8
+ scatdust(:ncol) = 0._r8
+ absdust(:ncol) = 0._r8
+ hygrodust(:ncol) = 0._r8
+ scatsulf(:ncol) = 0._r8
+ abssulf(:ncol) = 0._r8
+ hygrosulf(:ncol) = 0._r8
+ scatbc(:ncol) = 0._r8
+ absbc(:ncol) = 0._r8
+ hygrobc(:ncol) = 0._r8
+ scatpom(:ncol) = 0._r8
+ abspom(:ncol) = 0._r8
+ hygropom(:ncol) = 0._r8
+ scatsoa(:ncol) = 0._r8
+ abssoa(:ncol) = 0._r8
+ hygrosoa(:ncol) = 0._r8
+ scatsslt(:ncol) = 0._r8
+ abssslt(:ncol) = 0._r8
+ hygrosslt(:ncol) = 0._r8
+ end subroutine init_diags
+
+ !===============================================================================
+ subroutine update_diags
+
+ integer :: ispec
+
+ if (iwav==idx_uv_diag) then
+ aoduv(icol) = aoduv(icol) + dopaer(icol)
+ extinctuv(icol,ilev) = extinctuv(icol,ilev) + dopaer(icol)*air_density(icol,ilev)/mass(icol,ilev)
+ if (ilev<=troplev(icol)) then
+ aoduvst(icol) = aoduvst(icol) + dopaer(icol)
+ end if
+
+ else if (iwav==idx_sw_diag) then ! vis
+ aodvis(icol) = aodvis(icol) + dopaer(icol)
+ aodabs(icol) = aodabs(icol) + pabs(icol)*mass(icol,ilev)
+ extinct(icol,ilev) = extinct(icol,ilev) + dopaer(icol)*air_density(icol,ilev)/mass(icol,ilev)
+ absorb(icol,ilev) = absorb(icol,ilev) + pabs(icol)*air_density(icol,ilev)
+ ssavis(icol) = ssavis(icol) + dopaer(icol)*palb(icol)
+ asymvis(icol) = asymvis(icol) + dopaer(icol)*pasm(icol)
+ asymext(icol,ilev) = asymext(icol,ilev) + dopaer(icol)*pasm(icol)*air_density(icol,ilev)/mass(icol,ilev)
+
+ aodbin(icol) = aodbin(icol) + dopaer(icol)
+
+ if (ilev<=troplev(icol)) then
+ aodvisst(icol) = aodvisst(icol) + dopaer(icol)
+ end if
+
+ ! loop over species ...
+
+ do ispec = 1, aeroprops%nspecies(list_idx,ibin)
+ call aeroprops%get(ibin, ispec, list_ndx=list_idx, density=specdens, &
+ spectype=spectype, refindex_sw=specrefindex, hygro=hygro_aer)
+ call aerostate%get_ambient_mmr(list_idx, ispec, ibin, specmmr)
+
+ burden(icol) = burden(icol) + specmmr(icol,ilev)*mass(icol,ilev)
+
+ vol(icol) = specmmr(icol,ilev)/specdens
+
+ select case ( trim(spectype) )
+ case('dust')
+ dustvol(icol) = vol(icol)
+ burdendust(icol) = burdendust(icol) + specmmr(icol,ilev)*mass(icol,ilev)
+ scatdust(icol) = vol(icol) * specrefindex(iwav)%re
+ absdust(icol) =-vol(icol) * specrefindex(iwav)%im
+ hygrodust(icol)= vol(icol)*hygro_aer
+ case('black-c')
+ burdenbc(icol) = burdenbc(icol) + specmmr(icol,ilev)*mass(icol,ilev)
+ scatbc(icol) = vol(icol) * specrefindex(iwav)%re
+ absbc(icol) =-vol(icol) * specrefindex(iwav)%im
+ hygrobc(icol)= vol(icol)*hygro_aer
+ case('sulfate')
+ burdenso4(icol) = burdenso4(icol) + specmmr(icol,ilev)*mass(icol,ilev)
+ scatsulf(icol) = vol(icol) * specrefindex(iwav)%re
+ abssulf(icol) =-vol(icol) * specrefindex(iwav)%im
+ hygrosulf(icol)= vol(icol)*hygro_aer
+ case('p-organic')
+ burdenpom(icol) = burdenpom(icol) + specmmr(icol,ilev)*mass(icol,ilev)
+ scatpom(icol) = vol(icol) * specrefindex(iwav)%re
+ abspom(icol) =-vol(icol) * specrefindex(iwav)%im
+ hygropom(icol)= vol(icol)*hygro_aer
+ case('s-organic')
+ burdensoa(icol) = burdensoa(icol) + specmmr(icol,ilev)*mass(icol,ilev)
+ scatsoa(icol) = vol(icol) * specrefindex(iwav)%re
+ abssoa(icol) = -vol(icol) * specrefindex(iwav)%im
+ hygrosoa(icol)= vol(icol)*hygro_aer
+ case('seasalt')
+ burdenseasalt(icol) = burdenseasalt(icol) + specmmr(icol,ilev)*mass(icol,ilev)
+ scatsslt(icol) = vol(icol) * specrefindex(iwav)%re
+ abssslt(icol) = -vol(icol) * specrefindex(iwav)%im
+ hygrosslt(icol)= vol(icol)*hygro_aer
+ end select
+ end do
+
+ if (wetvol(icol,ilev)>1.e-40_r8 .and. vol(icol)>0._r8) then
+
+ dustaodbin(icol) = dustaodbin(icol) + dopaer(icol)*dustvol(icol)/wetvol(icol,ilev)
+
+ ! partition optical depth into contributions from each constituent
+ ! assume contribution is proportional to refractive index X volume
+
+ scath2o = watervol(icol,ilev)*crefwsw(iwav)%re
+ absh2o = -watervol(icol,ilev)*crefwsw(iwav)%im
+ sumscat = scatsulf(icol) + scatpom(icol) + scatsoa(icol) + scatbc(icol) + &
+ scatdust(icol) + scatsslt(icol) + scath2o
+ sumabs = abssulf(icol) + abspom(icol) + abssoa(icol) + absbc(icol) + &
+ absdust(icol) + abssslt(icol) + absh2o
+ sumhygro = hygrosulf(icol) + hygropom(icol) + hygrosoa(icol) + hygrobc(icol) + &
+ hygrodust(icol) + hygrosslt(icol)
+
+ scatdust(icol) = (scatdust(icol) + scath2o*hygrodust(icol)/sumhygro)/sumscat
+ absdust(icol) = (absdust(icol) + absh2o*hygrodust(icol)/sumhygro)/sumabs
+
+ scatsulf(icol) = (scatsulf(icol) + scath2o*hygrosulf(icol)/sumhygro)/sumscat
+ abssulf(icol) = (abssulf(icol) + absh2o*hygrosulf(icol)/sumhygro)/sumabs
+
+ scatpom(icol) = (scatpom(icol) + scath2o*hygropom(icol)/sumhygro)/sumscat
+ abspom(icol) = (abspom(icol) + absh2o*hygropom(icol)/sumhygro)/sumabs
+
+ scatsoa(icol) = (scatsoa(icol) + scath2o*hygrosoa(icol)/sumhygro)/sumscat
+ abssoa(icol) = (abssoa(icol) + absh2o*hygrosoa(icol)/sumhygro)/sumabs
+
+ scatbc(icol)= (scatbc(icol) + scath2o*hygrobc(icol)/sumhygro)/sumscat
+ absbc(icol) = (absbc(icol) + absh2o*hygrobc(icol)/sumhygro)/sumabs
+
+ scatsslt(icol) = (scatsslt(icol) + scath2o*hygrosslt(icol)/sumhygro)/sumscat
+ abssslt(icol) = (abssslt(icol) + absh2o*hygrosslt(icol)/sumhygro)/sumabs
+
+
+ aodabsbc(icol) = aodabsbc(icol) + absbc(icol)*dopaer(icol)*(1.0_r8-palb(icol))
+
+
+
+ aodc = (absdust(icol)*(1.0_r8 - palb(icol)) + palb(icol)*scatdust(icol))*dopaer(icol)
+ dustaod(icol) = dustaod(icol) + aodc
+
+ aodc = (abssulf(icol)*(1.0_r8 - palb(icol)) + palb(icol)*scatsulf(icol))*dopaer(icol)
+ sulfaod(icol) = sulfaod(icol) + aodc
+
+ aodc = (abspom(icol)*(1.0_r8 - palb(icol)) + palb(icol)*scatpom(icol))*dopaer(icol)
+ pomaod(icol) = pomaod(icol) + aodc
+
+ aodc = (abssoa(icol)*(1.0_r8 - palb(icol)) + palb(icol)*scatsoa(icol))*dopaer(icol)
+ soaaod(icol) = soaaod(icol) + aodc
+
+ aodc = (absbc(icol)*(1.0_r8 - palb(icol)) + palb(icol)*scatbc(icol))*dopaer(icol)
+ bcaod(icol) = bcaod(icol) + aodc
+
+ aodc = (abssslt(icol)*(1.0_r8 - palb(icol)) + palb(icol)*scatsslt(icol))*dopaer(icol)
+ ssltaod(icol) = ssltaod(icol) + aodc
+
+ end if
+ else if (iwav==idx_nir_diag) then
+ aodnir(icol) = aodnir(icol) + dopaer(icol)
+ extinctnir(icol,ilev) = extinctnir(icol,ilev) + dopaer(icol)*air_density(icol,ilev)/mass(icol,ilev)
+
+ if (ilev<=troplev(icol)) then
+ aodnirst(icol) = aodnirst(icol) + dopaer(icol)
+ end if
+
+ end if
+
+ aodtot(icol) = aodtot(icol) + dopaer(icol)
+
+ end subroutine update_diags
+
+ !===============================================================================
+ subroutine output_bin_diags
+
+ integer :: icol
+
+ if (list_idx == 0) then
+
+ call outfld(burdendn_fields(iaermod)%name(ibin), burden, pcols, lchnk)
+ call outfld(aoddustdn_fields(iaermod)%name(ibin), dustaodbin, pcols, lchnk)
+ call outfld(aodbindn_fields(iaermod)%name(ibin), aodbin, pcols, lchnk)
+
+ do icol = 1, nnite
+ burden(idxnite(icol)) = fillvalue
+ aodbin(idxnite(icol)) = fillvalue
+ dustaodbin(idxnite(icol)) = fillvalue
+ end do
+
+ call outfld(burden_fields(iaermod)%name(ibin), burden, pcols, lchnk)
+ call outfld(aoddust_fields(iaermod)%name(ibin), dustaodbin, pcols, lchnk)
+ call outfld(aodbin_fields(iaermod)%name(ibin), aodbin, pcols, lchnk)
+
+ endif
+
+ end subroutine output_bin_diags
+
+ !===============================================================================
+ subroutine output_tot_diags
+
+ integer :: icol
+
+ call outfld('AODUVdn'//diag(list_idx), aoduv, pcols, lchnk)
+ call outfld('AODVISdn'//diag(list_idx), aodvis, pcols, lchnk)
+ call outfld('AODABSdn'//diag(list_idx), aodabs, pcols, lchnk)
+ call outfld('AODNIRdn'//diag(list_idx), aodnir, pcols, lchnk)
+ call outfld('AODTOTdn'//diag(list_idx), aodtot, pcols, lchnk)
+ call outfld('EXTINCTUVdn'//diag(list_idx), extinctuv, pcols, lchnk)
+ call outfld('EXTINCTNIRdn'//diag(list_idx), extinctnir, pcols, lchnk)
+ call outfld('EXTINCTdn'//diag(list_idx), extinct, pcols, lchnk)
+ call outfld('ABSORBdn'//diag(list_idx), absorb, pcols, lchnk)
+ call outfld('EXTxASYMdn'//diag(list_idx), asymext, pcols, lchnk)
+ call outfld('AODxASYMdn'//diag(list_idx), asymvis, pcols, lchnk)
+
+ call outfld('AODVISstdn'//diag(list_idx), aodvisst,pcols, lchnk)
+ call outfld('AODUVstdn'//diag(list_idx), aoduvst, pcols, lchnk)
+ call outfld('AODNIRstdn'//diag(list_idx), aodnirst,pcols, lchnk)
+
+ do icol = 1, nnite
+ aodvis(idxnite(icol)) = fillvalue
+ aodnir(idxnite(icol)) = fillvalue
+ aoduv(idxnite(icol)) = fillvalue
+ aodabs(idxnite(icol)) = fillvalue
+ aodtot(idxnite(icol)) = fillvalue
+ extinct(idxnite(icol),:) = fillvalue
+ extinctnir(idxnite(icol),:) = fillvalue
+ extinctuv(idxnite(icol),:) = fillvalue
+ absorb(idxnite(icol),:) = fillvalue
+ asymext(idxnite(icol),:) = fillvalue
+ asymvis(idxnite(icol)) = fillvalue
+ aodabs(idxnite(icol)) = fillvalue
+ aodvisst(idxnite(icol)) = fillvalue
+ aoduvst(idxnite(icol)) = fillvalue
+ aodnirst(idxnite(icol)) = fillvalue
+ end do
+
+ call outfld('AODUV'//diag(list_idx), aoduv, pcols, lchnk)
+ call outfld('AODVIS'//diag(list_idx), aodvis, pcols, lchnk)
+ call outfld('AODABS'//diag(list_idx), aodabs, pcols, lchnk)
+ call outfld('AODNIR'//diag(list_idx), aodnir, pcols, lchnk)
+ call outfld('AODTOT'//diag(list_idx), aodtot, pcols, lchnk)
+ call outfld('EXTINCTUV'//diag(list_idx), extinctuv, pcols, lchnk)
+ call outfld('EXTINCTNIR'//diag(list_idx), extinctnir, pcols, lchnk)
+ call outfld('EXTINCT'//diag(list_idx), extinct, pcols, lchnk)
+ call outfld('ABSORB'//diag(list_idx), absorb, pcols, lchnk)
+ call outfld('EXTxASYM'//diag(list_idx), asymext, pcols, lchnk)
+ call outfld('AODxASYM'//diag(list_idx), asymvis, pcols, lchnk)
+ call outfld('AODVISst'//diag(list_idx), aodvisst,pcols, lchnk)
+ call outfld('AODUVst'//diag(list_idx), aoduvst, pcols, lchnk)
+ call outfld('AODNIRst'//diag(list_idx), aodnirst,pcols, lchnk)
+
+ ! These diagnostics are output only for climate list
+ if (list_idx == 0) then
+ do icol = 1, ncol
+ if (aodvis(icol) > 1.e-10_r8) then
+ ssavis(icol) = ssavis(icol)/aodvis(icol)
+ else
+ ssavis(icol) = 0.925_r8
+ endif
+ end do
+ call outfld('SSAVISdn', ssavis, pcols, lchnk)
+
+ call outfld('BURDENDUSTdn', burdendust, pcols, lchnk)
+ call outfld('BURDENSO4dn' , burdenso4, pcols, lchnk)
+ call outfld('BURDENPOMdn' , burdenpom, pcols, lchnk)
+ call outfld('BURDENSOAdn' , burdensoa, pcols, lchnk)
+ call outfld('BURDENBCdn' , burdenbc, pcols, lchnk)
+ call outfld('BURDENSEASALTdn', burdenseasalt, pcols, lchnk)
+
+ call outfld('AODABSBCdn', aodabsbc, pcols, lchnk)
+
+ call outfld('AODDUSTdn', dustaod, pcols, lchnk)
+ call outfld('AODSO4dn', sulfaod, pcols, lchnk)
+ call outfld('AODPOMdn', pomaod, pcols, lchnk)
+ call outfld('AODSOAdn', soaaod, pcols, lchnk)
+ call outfld('AODBCdn', bcaod, pcols, lchnk)
+ call outfld('AODSSdn', ssltaod, pcols, lchnk)
+
+
+ do icol = 1, nnite
+
+ ssavis(idxnite(icol)) = fillvalue
+ asymvis(idxnite(icol)) = fillvalue
+
+ burdendust(idxnite(icol)) = fillvalue
+ burdenso4(idxnite(icol)) = fillvalue
+ burdenpom(idxnite(icol)) = fillvalue
+ burdensoa(idxnite(icol)) = fillvalue
+ burdenbc(idxnite(icol)) = fillvalue
+ burdenseasalt(idxnite(icol)) = fillvalue
+ aodabsbc(idxnite(icol)) = fillvalue
+
+ dustaod(idxnite(icol)) = fillvalue
+ sulfaod(idxnite(icol)) = fillvalue
+ pomaod(idxnite(icol)) = fillvalue
+ soaaod(idxnite(icol)) = fillvalue
+ bcaod(idxnite(icol)) = fillvalue
+ ssltaod(idxnite(icol)) = fillvalue
+
+ end do
+
+ call outfld('SSAVIS', ssavis, pcols, lchnk)
+ call outfld('AODxASYM', asymvis, pcols, lchnk)
+ call outfld('BURDENDUST', burdendust, pcols, lchnk)
+ call outfld('BURDENSO4' , burdenso4, pcols, lchnk)
+ call outfld('BURDENPOM' , burdenpom, pcols, lchnk)
+ call outfld('BURDENSOA' , burdensoa, pcols, lchnk)
+ call outfld('BURDENBC' , burdenbc, pcols, lchnk)
+ call outfld('BURDENSEASALT', burdenseasalt, pcols, lchnk)
+ call outfld('AODABSBC', aodabsbc, pcols, lchnk)
+ call outfld('AODDUST', dustaod, pcols, lchnk)
+ call outfld('AODSO4', sulfaod, pcols, lchnk)
+ call outfld('AODPOM', pomaod, pcols, lchnk)
+ call outfld('AODSOA', soaaod, pcols, lchnk)
+ call outfld('AODBC', bcaod, pcols, lchnk)
+ call outfld('AODSS', ssltaod, pcols, lchnk)
+
+ end if
+
+ end subroutine output_tot_diags
+
+ end subroutine aerosol_optics_cam_sw
+
+ !===============================================================================
+ subroutine aerosol_optics_cam_lw(list_idx, state, pbuf, tauxar)
+
+ ! calculates aerosol lw radiative properties
+
+ integer, intent(in) :: list_idx ! index of the climate or a diagnostic list
+ type(physics_state), intent(in), target :: state ! state variables
+
+ type(physics_buffer_desc), pointer :: pbuf(:)
+
+ real(r8), intent(inout) :: tauxar(pcols,pver,nlwbands) ! layer absorption optical depth
+
+
+ real(r8) :: dopaer(pcols)
+ real(r8) :: mass(pcols,pver)
+
+ character(len=*), parameter :: prefix = 'aerosol_optics_cam_lw: '
+
+ integer :: ibin, nbins
+ integer :: iwav, ilev
+ integer :: ncol, icol, istat
+
+ type(aero_state_t), allocatable :: aero_state(:) ! array of aerosol state objects to allow for
+ ! multiple aerosol representations in the same sim
+ ! such as MAM and CARMA
+
+ class(aerosol_optics), pointer :: aero_optics
+ class(aerosol_state), pointer :: aerostate
+ class(aerosol_properties), pointer :: aeroprops
+
+ real(r8), allocatable :: pabs(:)
+
+ character(len=32) :: opticstype
+ integer :: iaermod
+
+ real(r8) :: lwabs(pcols,pver)
+ lwabs = 0._r8
+ tauxar = 0._r8
+
+ nullify(aero_optics)
+
+ allocate(aero_state(num_aero_models), stat=istat)
+ if (istat/=0) then
+ call endrun(prefix//'array allocation error: aero_state')
+ end if
+
+ iaermod = 0
+ if (modal_active) then
+ iaermod = iaermod+1
+ aero_state(iaermod)%obj => modal_aerosol_state( state, pbuf )
+ end if
+
+ ncol = state%ncol
+
+ mass(:ncol,:) = state%pdeldry(:ncol,:)*rga
+
+ allocate(pabs(ncol), stat=istat)
+ if (istat/=0) then
+ call endrun(prefix//'array allocation error: pabs')
+ end if
+
+ aeromodel: do iaermod = 1,num_aero_models
+
+ aeroprops => aero_props(iaermod)%obj
+ aerostate => aero_state(iaermod)%obj
+
+ nbins=aero_props(iaermod)%obj%nbins(list_idx)
+
+ binloop: do ibin = 1, nbins
+
+ call aeroprops%optics_params(list_idx, ibin, opticstype=opticstype)
+
+ select case (trim(opticstype))
+ case('modal') ! refractive method
+ aero_optics=>refractive_aerosol_optics(aeroprops, aerostate, list_idx, ibin, &
+ ncol, pver, nswbands, nlwbands, crefwsw, crefwlw)
+ case default
+ call endrun(prefix//'optics method not recognized')
+ end select
+
+ if (associated(aero_optics)) then
+
+ wavelength: do iwav = 1, nlwbands
+
+ vertical: do ilev = 1, pver
+ call aero_optics%lw_props(ncol, ilev, iwav, pabs )
+
+ column: do icol = 1, ncol
+ dopaer(icol) = pabs(icol)*mass(icol,ilev)
+ tauxar(icol,ilev,iwav) = tauxar(icol,ilev,iwav) + dopaer(icol)
+ lwabs(icol,ilev) = lwabs(icol,ilev) + pabs(icol)
+ end do column
+
+ end do vertical
+
+ end do wavelength
+
+ else
+ call endrun(prefix//'aero_optics object pointer not associated')
+ end if
+
+ deallocate(aero_optics)
+ nullify(aero_optics)
+
+ end do binloop
+ end do aeromodel
+
+ call outfld('TOTABSLW'//diag(list_idx), lwabs(:,:), pcols, state%lchnk)
+
+ if (lw10um_indx>0) then
+ call outfld('AODABSLW'//diag(list_idx), tauxar(:,:,lw10um_indx), pcols, state%lchnk)
+ end if
+
+ deallocate(pabs)
+
+ do iaermod = 1,num_aero_models
+ deallocate(aero_state(iaermod)%obj)
+ nullify(aero_state(iaermod)%obj)
+ end do
+
+ deallocate(aero_state)
+
+ end subroutine aerosol_optics_cam_lw
+
+ !===============================================================================
+ ! Private routines
+ !===============================================================================
+
+ subroutine read_water_refindex(infilename)
+ use cam_pio_utils, only: cam_pio_openfile
+ use pio, only: file_desc_t, var_desc_t, pio_inq_dimlen, pio_inq_dimid, pio_inq_varid, &
+ pio_get_var, PIO_NOWRITE, pio_closefile, pio_noerr
+
+
+ ! read water refractive index file and set module data
+
+ character*(*), intent(in) :: infilename ! modal optics filename
+
+ ! Local variables
+
+ integer :: i, ierr
+ type(file_desc_t) :: ncid ! pio file handle
+ integer :: did ! dimension ids
+ integer :: dimlen ! dimension lengths
+ type(var_desc_t) :: vid ! variable ids
+ real(r8) :: refrwsw(nswbands), refiwsw(nswbands) ! real, imaginary ref index for water visible
+ real(r8) :: refrwlw(nlwbands), refiwlw(nlwbands) ! real, imaginary ref index for water infrared
+
+ character(len=*), parameter :: prefix = 'read_water_refindex: '
+ !----------------------------------------------------------------------------
+
+ ! open file
+ call cam_pio_openfile(ncid, infilename, PIO_NOWRITE)
+
+ ! inquire dimensions. Check that file values match parameter values.
+
+ ierr = pio_inq_dimid(ncid, 'lw_band', did)
+ if (ierr /= pio_noerr ) then
+ call endrun(prefix//'pio_inq_dimid lw_band')
+ end if
+ ierr = pio_inq_dimlen(ncid, did, dimlen)
+ if (ierr /= pio_noerr ) then
+ call endrun(prefix//'pio_inq_dimlen lw_band')
+ end if
+ if (dimlen /= nlwbands) then
+ write(iulog,*) 'lw_band len=', dimlen, ' from ', infilename, ' ne nlwbands=', nlwbands
+ call endrun(prefix//'bad lw_band value')
+ endif
+
+ ierr = pio_inq_dimid(ncid, 'sw_band', did)
+ if (ierr /= pio_noerr ) then
+ call endrun(prefix//'pio_inq_dimid sw_band')
+ end if
+ ierr = pio_inq_dimlen(ncid, did, dimlen)
+ if (ierr /= pio_noerr ) then
+ call endrun(prefix//'pio_inq_dimlen sw_band')
+ end if
+ if (dimlen /= nswbands) then
+ write(iulog,*) 'sw_band len=', dimlen, ' from ', infilename, ' ne nswbands=', nswbands
+ call endrun(prefix//'bad sw_band value')
+ endif
+
+ ! read variables
+ ierr = pio_inq_varid(ncid, 'refindex_real_water_sw', vid)
+ if (ierr /= pio_noerr ) then
+ call endrun(prefix//'pio_inq_varid refindex_real_water_sw')
+ end if
+ ierr = pio_get_var(ncid, vid, refrwsw)
+ if (ierr /= pio_noerr ) then
+ call endrun(prefix//'pio_get_var refrwsw')
+ end if
+
+ ierr = pio_inq_varid(ncid, 'refindex_im_water_sw', vid)
+ if (ierr /= pio_noerr ) then
+ call endrun(prefix//'pio_inq_varid refindex_im_water_sw')
+ end if
+ ierr = pio_get_var(ncid, vid, refiwsw)
+ if (ierr /= pio_noerr ) then
+ call endrun(prefix//'pio_get_var refiwsw')
+ end if
+
+ ierr = pio_inq_varid(ncid, 'refindex_real_water_lw', vid)
+ if (ierr /= pio_noerr ) then
+ call endrun(prefix//'pio_inq_varid refindex_real_water_lw')
+ end if
+ ierr = pio_get_var(ncid, vid, refrwlw)
+ if (ierr /= pio_noerr ) then
+ call endrun(prefix//'pio_get_var refrwlw')
+ end if
+
+ ierr = pio_inq_varid(ncid, 'refindex_im_water_lw', vid)
+ if (ierr /= pio_noerr ) then
+ call endrun(prefix//'pio_inq_varid refindex_im_water_lw')
+ end if
+ ierr = pio_get_var(ncid, vid, refiwlw)
+ if (ierr /= pio_noerr ) then
+ call endrun(prefix//'pio_get_var refiwlw')
+ end if
+
+ ! set complex representation of refractive indices as module data
+ do i = 1, nswbands
+ crefwsw(i) = cmplx(refrwsw(i), abs(refiwsw(i)), kind=r8)
+ end do
+ do i = 1, nlwbands
+ crefwlw(i) = cmplx(refrwlw(i), abs(refiwlw(i)), kind=r8)
+ end do
+
+ call pio_closefile(ncid)
+
+ end subroutine read_water_refindex
+
+end module aerosol_optics_cam
diff --git a/src/physics/cam/cam_diagnostics.F90 b/src/physics/cam/cam_diagnostics.F90
index f0131dab0e..392c7a285c 100644
--- a/src/physics/cam/cam_diagnostics.F90
+++ b/src/physics/cam/cam_diagnostics.F90
@@ -13,8 +13,9 @@ module cam_diagnostics
use physics_buffer, only: dyn_time_lvls, pbuf_get_field, pbuf_get_index, pbuf_old_tim_idx
use cam_history, only: outfld, write_inithist, hist_fld_active, inithist_all
+use cam_history_support, only: max_fieldname_len
use constituents, only: pcnst, cnst_name, cnst_longname, cnst_cam_outfld
-use constituents, only: ptendnam, dmetendnam, apcnst, bpcnst, cnst_get_ind
+use constituents, only: ptendnam, apcnst, bpcnst, cnst_get_ind
use dycore, only: dycore_is
use phys_control, only: phys_getopts
use wv_saturation, only: qsat, qsat_water, svp_ice_vect
@@ -46,6 +47,18 @@ module cam_diagnostics
diag_physvar_ic, &
nsurf
+integer, public, parameter :: num_stages = 8
+character (len = max_fieldname_len), dimension(num_stages) :: stage = (/"phBF","phBP","phAP","phAM","dyBF","dyBP","dyAP","dyAM"/)
+character (len = 45),dimension(num_stages) :: stage_txt = (/&
+ " before energy fixer ",& !phBF - physics energy
+ " before parameterizations ",& !phBF - physics energy
+ " after parameterizations ",& !phAP - physics energy
+ " after dry mass correction ",& !phAM - physics energy
+ " before energy fixer (dycore) ",& !dyBF - dynamics energy
+ " before parameterizations (dycore) ",& !dyBF - dynamics energy
+ " after parameterizations (dycore) ",& !dyAP - dynamics energy
+ " after dry mass correction (dycore) " & !dyAM - dynamics energy
+ /)
! Private data
@@ -176,46 +189,12 @@ subroutine diag_init_dry(pbuf2d)
use cam_history, only: addfld, add_default, horiz_only
use cam_history, only: register_vector_field
- use constituent_burden, only: constituent_burden_init
- use physics_buffer, only: pbuf_set_field
use tidal_diag, only: tidal_diag_init
+ use cam_budget, only: cam_budget_em_snapshot, cam_budget_em_register, thermo_budget_history
type(physics_buffer_desc), pointer, intent(in) :: pbuf2d(:,:)
- integer :: k, m
- integer :: ierr
- !
- ! variables for energy diagnostics
- !
- integer :: istage, ivars
- character (len=108) :: str1, str2, str3
- integer, parameter :: num_stages = 8, num_vars = 8
- character (len = 4), dimension(num_stages) :: stage = (/"phBF","phBP","phAP","phAM","dyBF","dyBP","dyAP","dyAM"/)
- character (len = 45),dimension(num_stages) :: stage_txt = (/&
- " before energy fixer ",& !phBF - physics energy
- " before parameterizations ",& !phBF - physics energy
- " after parameterizations ",& !phAP - physics energy
- " after dry mass correction ",& !phAM - physics energy
- " before energy fixer (dycore) ",& !dyBF - dynamics energy
- " before parameterizations (dycore) ",& !dyBF - dynamics energy
- " after parameterizations (dycore) ",& !dyAP - dynamics energy
- " after dry mass correction (dycore) " & !dyAM - dynamics energy
- /)
- character (len = 2) , dimension(num_vars) :: vars = (/"WV" ,"WL" ,"WI" ,"SE" ,"KE" ,"MR" ,"MO" ,"TT" /)
- character (len = 45) , dimension(num_vars) :: vars_descriptor = (/&
- "Total column water vapor ",&
- "Total column liquid water ",&
- "Total column frozen water ",&
- "Total column dry static energy ",&
- "Total column kinetic energy ",&
- "Total column wind axial angular momentum",&
- "Total column mass axial angular momentum",&
- "Total column test tracer "/)
- character (len = 14), dimension(num_vars) :: &
- vars_unit = (/&
- "kg/m2 ","kg/m2 ","kg/m2 ","J/m2 ",&
- "J/m2 ","kg*m2/s*rad2 ","kg*m2/s*rad2 ","kg/m2 "/)
-
+ integer :: istage
! outfld calls in diag_phys_writeout
call addfld (cnst_name(1), (/ 'lev' /), 'A', 'kg/kg', cnst_longname(1))
call addfld ('NSTEP', horiz_only, 'A', 'timestep', 'Model timestep')
@@ -242,7 +221,7 @@ subroutine diag_init_dry(pbuf2d)
call register_vector_field('UAP','VAP')
call addfld (apcnst(1), (/ 'lev' /), 'A','kg/kg', trim(cnst_longname(1))//' (after physics)')
- if ( dycore_is('LR') .or. dycore_is('SE') .or. dycore_is('FV3') ) then
+ if (.not.dycore_is('EUL')) then
call addfld ('TFIX', horiz_only, 'A', 'K/s', 'T fixer (T equivalent of Energy correction)')
end if
call addfld ('TTEND_TOT', (/ 'lev' /), 'A', 'K/s', 'Total temperature tendency')
@@ -276,8 +255,8 @@ subroutine diag_init_dry(pbuf2d)
call addfld ('UU', (/ 'lev' /), 'A', 'm2/s2', 'Zonal velocity squared' )
call addfld ('WSPEED', (/ 'lev' /), 'X', 'm/s', 'Horizontal total wind speed maximum' )
- call addfld ('WSPDSRFMX', horiz_only, 'X', 'm/s', 'Horizontal total wind speed maximum at the surface' )
- call addfld ('WSPDSRFAV', horiz_only, 'A', 'm/s', 'Horizontal total wind speed average at the surface' )
+ call addfld ('WSPDSRFMX', horiz_only, 'X', 'm/s', 'Horizontal total wind speed maximum at surface layer midpoint' )
+ call addfld ('WSPDSRFAV', horiz_only, 'A', 'm/s', 'Horizontal total wind speed average at surface layer midpoint' )
call addfld ('OMEGA', (/ 'lev' /), 'A', 'Pa/s', 'Vertical velocity (pressure)')
call addfld ('OMEGAT', (/ 'lev' /), 'A', 'K Pa/s ', 'Vertical heat flux' )
@@ -386,7 +365,7 @@ subroutine diag_init_dry(pbuf2d)
call add_default ('UAP ' , history_budget_histfile_num, ' ')
call add_default ('VAP ' , history_budget_histfile_num, ' ')
call add_default (apcnst(1) , history_budget_histfile_num, ' ')
- if ( dycore_is('LR') .or. dycore_is('SE') .or. dycore_is('FV3') ) then
+ if (.not.dycore_is('EUL')) then
call add_default ('TFIX ' , history_budget_histfile_num, ' ')
end if
end if
@@ -412,22 +391,30 @@ subroutine diag_init_dry(pbuf2d)
! and semidiurnal tide in T, U, V, and Z3
call tidal_diag_init()
- !
- ! energy diagnostics
- !
- do istage = 1, num_stages
- do ivars=1, num_vars
- write(str1,*) TRIM(ADJUSTL(vars(ivars))),"_",TRIM(ADJUSTL(stage(istage)))
- write(str2,*) TRIM(ADJUSTL(vars_descriptor(ivars)))," ", &
- TRIM(ADJUSTL(stage_txt(istage)))
- write(str3,*) TRIM(ADJUSTL(vars_unit(ivars)))
- call addfld (TRIM(ADJUSTL(str1)), horiz_only, 'A', TRIM(ADJUSTL(str3)),TRIM(ADJUSTL(str2)))
- end do
- end do
-
call addfld( 'CPAIRV', (/ 'lev' /), 'I', 'J/K/kg', 'Variable specific heat cap air' )
call addfld( 'RAIRV', (/ 'lev' /), 'I', 'J/K/kg', 'Variable dry air gas constant' )
+ if (thermo_budget_history) then
+ !
+ ! energy diagnostics addflds for vars_stage combinations plus e_m_snapshots
+ !
+ do istage = 1, num_stages
+ call cam_budget_em_snapshot(TRIM(ADJUSTL(stage(istage))),'phy',longname=TRIM(ADJUSTL(stage_txt(istage))))
+ end do
+
+ ! Create budgets that are a sum/dif of 2 stages
+
+ call cam_budget_em_register('dEdt_param_efix_physE','phAP','phBF','phy','dif',longname='dE/dt CAM physics + energy fixer using physics E formula (phAP-phBF)')
+ call cam_budget_em_register('dEdt_param_efix_dynE' ,'dyAP','dyBF','phy','dif',longname='dE/dt CAM physics + energy fixer using dycore E formula (dyAP-dyBF)')
+ call cam_budget_em_register('dEdt_param_physE' ,'phAP','phBP','phy','dif',longname='dE/dt CAM physics using physics E formula (phAP-phBP)')
+ call cam_budget_em_register('dEdt_param_dynE' ,'dyAP','dyBP','phy','dif',longname='dE/dt CAM physics using dycore E (dyAP-dyBP)')
+ call cam_budget_em_register('dEdt_dme_adjust_physE','phAM','phAP','phy','dif',longname='dE/dt dry mass adjustment using physics E formula (phAM-phAP)')
+ call cam_budget_em_register('dEdt_dme_adjust_dynE' ,'dyAM','dyAP','phy','dif',longname='dE/dt dry mass adjustment using dycore E (dyAM-dyAP)')
+ call cam_budget_em_register('dEdt_efix_physE' ,'phBP','phBF','phy','dif',longname='dE/dt energy fixer using physics E formula (phBP-phBF)')
+ call cam_budget_em_register('dEdt_efix_dynE' ,'dyBP','dyBF','phy','dif',longname='dE/dt energy fixer using dycore E formula (dyBP-dyBF)')
+ call cam_budget_em_register('dEdt_phys_tot_physE' ,'phAM','phBF','phy','dif',longname='dE/dt physics total using physics E formula (phAM-phBF)')
+ call cam_budget_em_register('dEdt_phys_tot_dynE' ,'dyAM','dyBF','phy','dif',longname='dE/dt physics total using dycore E (dyAM-dyBF)')
+ endif
end subroutine diag_init_dry
subroutine diag_init_moist(pbuf2d)
@@ -440,7 +427,7 @@ subroutine diag_init_moist(pbuf2d)
type(physics_buffer_desc), pointer, intent(in) :: pbuf2d(:,:)
- integer :: k, m
+ integer :: m
integer :: ixcldice, ixcldliq ! constituent indices for cloud liquid and ice water.
integer :: ierr
! column burdens for all constituents except water vapor
@@ -547,18 +534,6 @@ subroutine diag_init_moist(pbuf2d)
if (ixcldice > 0) then
call addfld (ptendnam(ixcldice),(/ 'lev' /), 'A', 'kg/kg/s',trim(cnst_name(ixcldice))//' total physics tendency ')
end if
- if ( dycore_is('LR') .or. dycore_is('FV3') )then
- call addfld (dmetendnam( 1),(/ 'lev' /), 'A','kg/kg/s', &
- trim(cnst_name( 1))//' dme adjustment tendency (FV) ')
- if (ixcldliq > 0) then
- call addfld (dmetendnam(ixcldliq),(/ 'lev' /), 'A','kg/kg/s', &
- trim(cnst_name(ixcldliq))//' dme adjustment tendency (FV) ')
- end if
- if (ixcldice > 0) then
- call addfld (dmetendnam(ixcldice),(/ 'lev' /), 'A','kg/kg/s', &
- trim(cnst_name(ixcldice))//' dme adjustment tendency (FV) ')
- end if
- end if
! outfld calls in diag_physvar_ic
@@ -649,15 +624,6 @@ subroutine diag_init_moist(pbuf2d)
if (ixcldice > 0) then
call add_default (ptendnam(ixcldice), history_budget_histfile_num, ' ')
end if
- if ( dycore_is('LR') .or. dycore_is('FV3') )then
- call add_default(dmetendnam(1) , history_budget_histfile_num, ' ')
- if (ixcldliq > 0) then
- call add_default(dmetendnam(ixcldliq), history_budget_histfile_num, ' ')
- end if
- if (ixcldice > 0) then
- call add_default(dmetendnam(ixcldice), history_budget_histfile_num, ' ')
- end if
- end if
if( history_budget_histfile_num > 1 ) then
call add_default ('DTCOND ' , history_budget_histfile_num, ' ')
end if
@@ -753,7 +719,6 @@ subroutine diag_init_moist(pbuf2d)
end subroutine diag_init_moist
subroutine diag_init(pbuf2d)
- use cam_history, only: addfld
! Declare the history fields for which this module contains outfld calls.
@@ -934,15 +899,11 @@ subroutine diag_phys_writeout_dry(state, pbuf, p_surf_t)
! Purpose: output dry physics diagnostics
!
!-----------------------------------------------------------------------
- use physconst, only: gravit, rga, rair, cpair, latvap, rearth, pi, cappa
+ use physconst, only: gravit, rga, rair, cappa
use time_manager, only: get_nstep
use interpolate_data, only: vertinterp
- use constituent_burden, only: constituent_burden_comp
- use co2_cycle, only: c_i, co2_transport
-
use tidal_diag, only: tidal_diag_write
use air_composition, only: cpairv, rairv
-
!-----------------------------------------------------------------------
!
! Arguments
@@ -954,15 +915,9 @@ subroutine diag_phys_writeout_dry(state, pbuf, p_surf_t)
!---------------------------Local workspace-----------------------------
!
real(r8) :: ftem(pcols,pver) ! temporary workspace
- real(r8) :: ftem1(pcols,pver) ! another temporary workspace
- real(r8) :: ftem2(pcols,pver) ! another temporary workspace
real(r8) :: z3(pcols,pver) ! geo-potential height
real(r8) :: p_surf(pcols) ! data interpolated to a pressure surface
- real(r8) :: tem2(pcols,pver) ! temporary workspace
real(r8) :: timestep(pcols) ! used for outfld call
- real(r8) :: esl(pcols,pver) ! saturation vapor pressures
- real(r8) :: esi(pcols,pver) !
- real(r8) :: dlon(pcols) ! width of grid cell (meters)
real(r8), pointer :: psl(:) ! Sea Level Pressure
@@ -1276,8 +1231,7 @@ subroutine diag_phys_writeout_moist(state, pbuf, p_surf_t)
! Purpose: record dynamics variables on physics grid
!
!-----------------------------------------------------------------------
- use physconst, only: gravit, rga, rair, cpair, latvap, rearth, pi, cappa, &
- epsilo, rh2o
+ use physconst, only: gravit, rga, rair, cpair, latvap, rearth, cappa
use interpolate_data, only: vertinterp
use constituent_burden, only: constituent_burden_comp
use co2_cycle, only: c_i, co2_transport
@@ -1294,7 +1248,6 @@ subroutine diag_phys_writeout_moist(state, pbuf, p_surf_t)
real(r8) :: ftem(pcols,pver) ! temporary workspace
real(r8) :: ftem1(pcols,pver) ! another temporary workspace
real(r8) :: ftem2(pcols,pver) ! another temporary workspace
- real(r8) :: z3(pcols,pver) ! geo-potential height
real(r8) :: p_surf(pcols) ! data interpolated to a pressure surface
real(r8) :: p_surf_q1(pcols) ! data interpolated to a pressure surface
real(r8) :: p_surf_q2(pcols) ! data interpolated to a pressure surface
@@ -1454,7 +1407,7 @@ subroutine diag_phys_writeout_moist(state, pbuf, p_surf_t)
do k=2,pver
ftem(:ncol,1) = ftem(:ncol,1) + ftem(:ncol,k)
end do
- call outfld ('ATMEINT ',ftem(:ncol,1) ,pcols ,lchnk )
+ call outfld ('ATMEINT ', ftem(:ncol,1), ncol, lchnk)
!! Boundary layer atmospheric stability, temperature, water vapor diagnostics
@@ -1611,7 +1564,6 @@ subroutine diag_conv(state, ztodt, pbuf)
! Output diagnostics associated with all convective processes.
!
!-----------------------------------------------------------------------
- use physconst, only: cpair
use tidal_diag, only: get_tidal_coeffs
! Arguments:
@@ -1973,7 +1925,6 @@ subroutine diag_physvar_ic (lchnk, pbuf, cam_out, cam_in)
!
!---------------------------Local workspace-----------------------------
!
- integer :: k ! indices
integer :: itim_old ! indices
real(r8), pointer, dimension(:,:) :: cwat_var
@@ -2104,7 +2055,7 @@ subroutine diag_phys_tend_writeout_dry(state, pbuf, tend, ztodt)
! Total physics tendency for Temperature
! (remove global fixer tendency from total for FV and SE dycores)
- if (dycore_is('LR') .or. dycore_is('SE') .or. dycore_is('FV3') ) then
+ if (.not.dycore_is('EUL')) then
call check_energy_get_integrals( heat_glob_out=heat_glob )
ftem2(:ncol) = heat_glob/cpair
call outfld('TFIX', ftem2, pcols, lchnk )
@@ -2144,7 +2095,7 @@ end subroutine diag_phys_tend_writeout_dry
!#######################################################################
subroutine diag_phys_tend_writeout_moist(state, pbuf, tend, ztodt, &
- tmp_q, tmp_cldliq, tmp_cldice, qini, cldliqini, cldiceini)
+ qini, cldliqini, cldiceini)
!---------------------------------------------------------------
!
@@ -2159,9 +2110,6 @@ subroutine diag_phys_tend_writeout_moist(state, pbuf, tend, ztodt, &
type(physics_buffer_desc), pointer :: pbuf(:)
type(physics_tend ), intent(in) :: tend
real(r8), intent(in) :: ztodt ! physics timestep
- real(r8), intent(inout) :: tmp_q (pcols,pver) ! As input, holds pre-adjusted tracers (FV)
- real(r8), intent(inout) :: tmp_cldliq(pcols,pver) ! As input, holds pre-adjusted tracers (FV)
- real(r8), intent(inout) :: tmp_cldice(pcols,pver) ! As input, holds pre-adjusted tracers (FV)
real(r8), intent(in) :: qini (pcols,pver) ! tracer fields at beginning of physics
real(r8), intent(in) :: cldliqini (pcols,pver) ! tracer fields at beginning of physics
real(r8), intent(in) :: cldiceini (pcols,pver) ! tracer fields at beginning of physics
@@ -2194,35 +2142,6 @@ subroutine diag_phys_tend_writeout_moist(state, pbuf, tend, ztodt, &
end if
end if
- ! Tendency for dry mass adjustment of q (FV only)
-
- if (dycore_is('LR') .or. dycore_is('FV3') ) then
- tmp_q (:ncol,:pver) = (state%q(:ncol,:pver, 1) - tmp_q (:ncol,:pver))*rtdt
- if (ixcldliq > 0) then
- tmp_cldliq(:ncol,:pver) = (state%q(:ncol,:pver,ixcldliq) - tmp_cldliq(:ncol,:pver))*rtdt
- else
- tmp_cldliq(:ncol,:pver) = 0.0_r8
- end if
- if (ixcldice > 0) then
- tmp_cldice(:ncol,:pver) = (state%q(:ncol,:pver,ixcldice) - tmp_cldice(:ncol,:pver))*rtdt
- else
- tmp_cldice(:ncol,:pver) = 0.0_r8
- end if
- if ( cnst_cam_outfld( 1) ) then
- call outfld (dmetendnam( 1), tmp_q , pcols, lchnk)
- end if
- if (ixcldliq > 0) then
- if ( cnst_cam_outfld(ixcldliq) ) then
- call outfld (dmetendnam(ixcldliq), tmp_cldliq, pcols, lchnk)
- end if
- end if
- if (ixcldice > 0) then
- if ( cnst_cam_outfld(ixcldice) ) then
- call outfld (dmetendnam(ixcldice), tmp_cldice, pcols, lchnk)
- end if
- end if
- end if
-
! Total physics tendency for moisture and other tracers
if ( cnst_cam_outfld( 1) ) then
@@ -2247,7 +2166,7 @@ end subroutine diag_phys_tend_writeout_moist
!#######################################################################
subroutine diag_phys_tend_writeout(state, pbuf, tend, ztodt, &
- tmp_q, tmp_cldliq, tmp_cldice, qini, cldliqini, cldiceini)
+ qini, cldliqini, cldiceini)
!---------------------------------------------------------------
!
@@ -2262,9 +2181,6 @@ subroutine diag_phys_tend_writeout(state, pbuf, tend, ztodt, &
type(physics_buffer_desc), pointer :: pbuf(:)
type(physics_tend ), intent(in) :: tend
real(r8), intent(in) :: ztodt ! physics timestep
- real(r8) , intent(inout) :: tmp_q (pcols,pver) ! As input, holds pre-adjusted tracers (FV)
- real(r8), intent(inout) :: tmp_cldliq(pcols,pver) ! As input, holds pre-adjusted tracers (FV)
- real(r8), intent(inout) :: tmp_cldice(pcols,pver) ! As input, holds pre-adjusted tracers (FV)
real(r8), intent(in) :: qini (pcols,pver) ! tracer fields at beginning of physics
real(r8), intent(in) :: cldliqini (pcols,pver) ! tracer fields at beginning of physics
real(r8), intent(in) :: cldiceini (pcols,pver) ! tracer fields at beginning of physics
@@ -2274,7 +2190,7 @@ subroutine diag_phys_tend_writeout(state, pbuf, tend, ztodt, &
call diag_phys_tend_writeout_dry(state, pbuf, tend, ztodt)
if (moist_physics) then
call diag_phys_tend_writeout_moist(state, pbuf, tend, ztodt, &
- tmp_q, tmp_cldliq, tmp_cldice, qini, cldliqini, cldiceini)
+ qini, cldliqini, cldiceini)
end if
end subroutine diag_phys_tend_writeout
diff --git a/src/physics/cam/check_energy.F90 b/src/physics/cam/check_energy.F90
index 4e55c3de58..7615f0e432 100644
--- a/src/physics/cam/check_energy.F90
+++ b/src/physics/cam/check_energy.F90
@@ -25,8 +25,8 @@ module check_energy
use spmd_utils, only: masterproc
use gmean_mod, only: gmean
- use physconst, only: gravit, latvap, latice, cpair, rair
- use air_composition, only: cpairv, rairv
+ use physconst, only: gravit, rga, latvap, latice, cpair, rair
+ use air_composition, only: cpairv, rairv, cp_or_cv_dycore
use physics_types, only: physics_state, physics_tend, physics_ptend, physics_ptend_init
use constituents, only: cnst_get_ind, pcnst, cnst_name, cnst_get_type_byind
use time_manager, only: is_first_step
@@ -50,7 +50,7 @@ module check_energy
public :: check_tracers_init ! initialize tracer integrals and cumulative boundary fluxes
public :: check_tracers_chng ! check changes in integrals against cumulative boundary fluxes
- public :: calc_te_and_aam_budgets ! calculate and output total energy and axial angular momentum diagnostics
+ public :: tot_energy_phys ! calculate and output total energy and axial angular momentum diagnostics
! Private module data
@@ -221,7 +221,7 @@ subroutine check_energy_timestep_init(state, tend, pbuf, col_type)
use cam_thermo, only: get_hydrostatic_energy
use physics_buffer, only: physics_buffer_desc, pbuf_set_field
use cam_abortutils, only: endrun
- use dyn_tests_utils, only: vc_physics, vc_dycore, vc_height
+ use dyn_tests_utils, only: vc_physics, vc_dycore, vc_height, vc_dry_pressure
use physics_types, only: phys_te_idx, dyn_te_idx
!-----------------------------------------------------------------------
! Compute initial values of energy and water integrals,
@@ -237,7 +237,6 @@ subroutine check_energy_timestep_init(state, tend, pbuf, col_type)
real(r8) :: cp_or_cv(state%psetcols,pver)
integer lchnk ! chunk identifier
integer ncol ! number of atmospheric columns
- integer i,k ! column, level indices
!-----------------------------------------------------------------------
lchnk = state%lchnk
@@ -250,17 +249,17 @@ subroutine check_energy_timestep_init(state, tend, pbuf, col_type)
if (state%psetcols == pcols) then
cp_or_cv(:,:) = cpairv(:,:,lchnk)
else if (state%psetcols > pcols .and. all(cpairv(:,:,lchnk) == cpair)) then
- cp_or_cv(:,:) = cpair
+ cp_or_cv(1:ncol,:) = cpair
else
call endrun('check_energy_timestep_init: cpairv is not allowed to vary when subcolumns are turned on')
end if
!
! CAM physics total energy
!
- call get_hydrostatic_energy(state%q(1:ncol,1:pver,1:pcnst),&
+ call get_hydrostatic_energy(state%q(1:ncol,1:pver,1:pcnst),.true., &
state%pdel(1:ncol,1:pver), cp_or_cv(1:ncol,1:pver), &
state%u(1:ncol,1:pver), state%v(1:ncol,1:pver), state%T(1:ncol,1:pver), &
- vc_physics, ps = state%ps(1:ncol), phis = state%phis(1:ncol), &
+ vc_physics, ptop=state%pintdry(1:ncol,1), phis = state%phis(1:ncol),&
te = state%te_ini(1:ncol,phys_te_idx), H2O = state%tw_ini(1:ncol,phys_te_idx))
!
! Dynamical core total energy
@@ -269,25 +268,41 @@ subroutine check_energy_timestep_init(state, tend, pbuf, col_type)
state%z_ini(:ncol,:) = state%zm(:ncol,:)
if (vc_dycore == vc_height) then
!
- ! compute cv if vertical coordinate is height: cv = cp - R
+ ! MPAS specific hydrostatic energy computation (internal energy)
!
if (state%psetcols == pcols) then
- cp_or_cv(:,:) = cpairv(:,:,lchnk)-rairv(:,:,lchnk)
+ cp_or_cv(:ncol,:) = cp_or_cv_dycore(:ncol,:,lchnk)
else
- cp_or_cv(:,:) = cpair-rair
+ cp_or_cv(:ncol,:) = cpair-rair
endif
- call get_hydrostatic_energy(state%q(1:ncol,1:pver,1:pcnst),&
+ call get_hydrostatic_energy(state%q(1:ncol,1:pver,1:pcnst),.true., &
+ state%pdel(1:ncol,1:pver), cp_or_cv(1:ncol,1:pver), &
+ state%u(1:ncol,1:pver), state%v(1:ncol,1:pver), state%T(1:ncol,1:pver), &
+ vc_dycore, ptop=state%pintdry(1:ncol,1), phis = state%phis(1:ncol), &
+ z_mid = state%z_ini(1:ncol,:), &
+ te = state%te_ini(1:ncol,dyn_te_idx), H2O = state%tw_ini(1:ncol,dyn_te_idx))
+ else if (vc_dycore == vc_dry_pressure) then
+ !
+ ! SE specific hydrostatic energy (enthalpy)
+ !
+ if (state%psetcols == pcols) then
+ cp_or_cv(:ncol,:) = cp_or_cv_dycore(:ncol,:,lchnk)
+ else
+ cp_or_cv(:ncol,:) = cpair
+ endif
+ call get_hydrostatic_energy(state%q(1:ncol,1:pver,1:pcnst),.true., &
state%pdel(1:ncol,1:pver), cp_or_cv(1:ncol,1:pver), &
state%u(1:ncol,1:pver), state%v(1:ncol,1:pver), state%T(1:ncol,1:pver), &
- vc_dycore, ps = state%ps(1:ncol), phis = state%phis(1:ncol), &
- z_mid = state%z_ini(1:ncol,:), &
+ vc_dry_pressure, ptop=state%pintdry(1:ncol,1), phis = state%phis(1:ncol), &
te = state%te_ini(1:ncol,dyn_te_idx), H2O = state%tw_ini(1:ncol,dyn_te_idx))
else
+ !
+ ! dycore energy is the same as physics
+ !
state%te_ini(1:ncol,dyn_te_idx) = state%te_ini(1:ncol,phys_te_idx)
state%tw_ini(1:ncol,dyn_te_idx) = state%tw_ini(1:ncol,phys_te_idx)
end if
-
state%te_cur(:ncol,:) = state%te_ini(:ncol,:)
state%tw_cur(:ncol,:) = state%tw_ini(:ncol,:)
@@ -309,7 +324,7 @@ end subroutine check_energy_timestep_init
subroutine check_energy_chng(state, tend, name, nstep, ztodt, &
flx_vap, flx_cnd, flx_ice, flx_sen)
use cam_thermo, only: get_hydrostatic_energy
- use dyn_tests_utils, only: vc_physics, vc_dycore, vc_height
+ use dyn_tests_utils, only: vc_physics, vc_dycore, vc_height, vc_dry_pressure
use cam_abortutils, only: endrun
use physics_types, only: phys_te_idx, dyn_te_idx
!-----------------------------------------------------------------------
@@ -351,12 +366,16 @@ subroutine check_energy_chng(state, tend, name, nstep, ztodt, &
real(r8) :: scaling(state%psetcols,pver) ! scaling for conversion of temperature increment
real(r8) :: temp(state%ncol,pver) ! temperature
+ real(r8) :: se(state%ncol) ! enthalpy or internal energy (J/m2)
+ real(r8) :: po(state%ncol) ! surface potential or potential energy (J/m2)
+ real(r8) :: ke(state%ncol) ! kinetic energy (J/m2)
+ real(r8) :: wv(state%ncol) ! column integrated vapor (kg/m2)
+ real(r8) :: liq(state%ncol) ! column integrated liquid (kg/m2)
+ real(r8) :: ice(state%ncol) ! column integrated ice (kg/m2)
+
integer lchnk ! chunk identifier
integer ncol ! number of atmospheric columns
- integer i,k ! column, level indices
- integer :: ixcldice, ixcldliq ! CLDICE and CLDLIQ indices
- integer :: ixrain, ixsnow ! RAINQM and SNOWQM indices
- integer :: ixgrau ! GRAUQM index
+ integer i ! column index
!-----------------------------------------------------------------------
lchnk = state%lchnk
@@ -373,12 +392,12 @@ subroutine check_energy_chng(state, tend, name, nstep, ztodt, &
call endrun('check_energy_chng: cpairv is not allowed to vary when subcolumns are turned on')
end if
- call get_hydrostatic_energy(state%q(1:ncol,1:pver,1:pcnst),&
+ call get_hydrostatic_energy(state%q(1:ncol,1:pver,1:pcnst),.true., &
state%pdel(1:ncol,1:pver), cp_or_cv(1:ncol,1:pver), &
state%u(1:ncol,1:pver), state%v(1:ncol,1:pver), state%T(1:ncol,1:pver), &
- vc_physics, ps = state%ps(1:ncol), phis = state%phis(1:ncol), &
- te = te, H2O = tw)
-
+ vc_physics, ptop=state%pintdry(1:ncol,1), phis = state%phis(1:ncol), &
+ te = te(1:ncol), H2O = tw(1:ncol), se=se(1:ncol),po=po(1:ncol), &
+ ke=ke(1:ncol),wv=wv(1:ncol),liq=liq(1:ncol),ice=ice(1:ncol))
! compute expected values and tendencies
do i = 1, ncol
! change in static energy and total water
@@ -447,20 +466,37 @@ subroutine check_energy_chng(state, tend, name, nstep, ztodt, &
! compute cv if vertical coordinate is height: cv = cp - R
!
! Note: cp_or_cv set above for pressure coordinate
- !
if (state%psetcols == pcols) then
- cp_or_cv(:,:) = cpairv(:,:,lchnk)-rairv(:,:,lchnk)
+ cp_or_cv(:ncol,:) = cp_or_cv_dycore(:ncol,:,lchnk)
else
- cp_or_cv(:,:) = cpair-rair
+ cp_or_cv(:ncol,:) = cpair-rair
endif
- scaling(:,:) = cpairv(:,:,lchnk)/cp_or_cv(:,:) !cp/cv scaling
-
+ scaling(:,:) = cpairv(:,:,lchnk)/cp_or_cv(:,:) !cp/cv scaling
temp(1:ncol,:) = state%temp_ini(1:ncol,:)+scaling(1:ncol,:)*(state%T(1:ncol,:)-state%temp_ini(1:ncol,:))
- call get_hydrostatic_energy(state%q(1:ncol,1:pver,1:pcnst),&
+ call get_hydrostatic_energy(state%q(1:ncol,1:pver,1:pcnst),.true., &
+ state%pdel(1:ncol,1:pver), cp_or_cv(1:ncol,1:pver), &
+ state%u(1:ncol,1:pver), state%v(1:ncol,1:pver), temp(1:ncol,1:pver), &
+ vc_dycore, ptop=state%pintdry(1:ncol,1), phis = state%phis(1:ncol), &
+ z_mid = state%z_ini(1:ncol,:), &
+ te = state%te_cur(1:ncol,dyn_te_idx), H2O = state%tw_cur(1:ncol,dyn_te_idx))
+ else if (vc_dycore == vc_dry_pressure) then
+ !
+ ! SE specific hydrostatic energy
+ !
+ if (state%psetcols == pcols) then
+ cp_or_cv(:ncol,:) = cp_or_cv_dycore(:ncol,:,lchnk)
+ else
+ cp_or_cv(:ncol,:) = cpair
+ endif
+ !
+ ! enthalpy scaling for energy consistency
+ !
+ scaling(:ncol,:) = cpairv(:ncol,:,lchnk)/cp_or_cv_dycore(:ncol,:,lchnk)
+ temp(1:ncol,:) = state%temp_ini(1:ncol,:)+scaling(1:ncol,:)*(state%T(1:ncol,:)-state%temp_ini(1:ncol,:))
+ call get_hydrostatic_energy(state%q(1:ncol,1:pver,1:pcnst),.true., &
state%pdel(1:ncol,1:pver), cp_or_cv(1:ncol,1:pver), &
state%u(1:ncol,1:pver), state%v(1:ncol,1:pver), temp(1:ncol,1:pver), &
- vc_dycore, ps = state%ps(1:ncol), phis = state%phis(1:ncol), &
- z_mid = state%z_ini(1:ncol,:), &
+ vc_dry_pressure, ptop=state%pintdry(1:ncol,1), phis = state%phis(1:ncol), &
te = state%te_cur(1:ncol,dyn_te_idx), H2O = state%tw_cur(1:ncol,dyn_te_idx))
else
state%te_cur(1:ncol,dyn_te_idx) = te(1:ncol)
@@ -472,7 +508,6 @@ end subroutine check_energy_chng
subroutine check_energy_gmean(state, pbuf2d, dtime, nstep)
use physics_buffer, only : physics_buffer_desc, pbuf_get_field, pbuf_get_chunk
- use dyn_tests_utils, only: vc_dycore, vc_height
use physics_types, only: dyn_te_idx
!-----------------------------------------------------------------------
! Compute global mean total energy of physics input and output states
@@ -563,13 +598,11 @@ subroutine check_energy_fix(state, ptend, nstep, eshflx)
#endif
! add (-) global mean total energy difference as heating
ptend%s(:ncol,:pver) = heat_glob
-!!$ write(iulog,*) "chk_fix: heat", state%lchnk, ncol, heat_glob
! compute effective sensible heat flux
do i = 1, ncol
- eshflx(i) = heat_glob * (state%pint(i,pver+1) - state%pint(i,1)) / gravit
+ eshflx(i) = heat_glob * (state%pint(i,pver+1) - state%pint(i,1)) * rga
end do
-!!! if (nstep > 0) write(iulog,*) "heat", heat_glob, eshflx(1)
return
end subroutine check_energy_fix
@@ -624,7 +657,7 @@ subroutine check_tracers_init(state, tracerint)
tr = 0._r8
do k = 1, pver
do i = 1, ncol
- tr(i) = tr(i) + state%q(i,k,m)*trpdel(i,k)/gravit
+ tr(i) = tr(i) + state%q(i,k,m)*trpdel(i,k)*rga
end do
end do
@@ -687,7 +720,6 @@ subroutine check_tracers_chng(state, tracerint, name, nstep, ztodt, cflx)
integer :: m ! tracer index
character(len=8) :: tracname ! tracername
!-----------------------------------------------------------------------
-!!$ if (.true.) return
lchnk = state%lchnk
ncol = state%ncol
@@ -713,7 +745,7 @@ subroutine check_tracers_chng(state, tracerint, name, nstep, ztodt, cflx)
tr = 0._r8
do k = 1, pver
do i = 1, ncol
- tr(i) = tr(i) + state%q(i,k,m)*trpdel(i,k)/gravit
+ tr(i) = tr(i) + state%q(i,k,m)*trpdel(i,k)*rga
end do
end do
@@ -785,12 +817,16 @@ end subroutine check_tracers_chng
!#######################################################################
- subroutine calc_te_and_aam_budgets(state, outfld_name_suffix,vc)
- use physconst, only: gravit,cpair,pi,rearth,omega
- use cam_thermo, only: get_hydrostatic_energy
- use cam_history, only: hist_fld_active, outfld
- use dyn_tests_utils, only: vc_physics, vc_height
+ subroutine tot_energy_phys(state, outfld_name_suffix,vc)
+ use physconst, only: rga,rearth,omega
+ use cam_thermo, only: get_hydrostatic_energy,thermo_budget_num_vars,thermo_budget_vars, &
+ wvidx,wlidx,wiidx,seidx,poidx,keidx,moidx,mridx,ttidx,teidx
+ use cam_history, only: outfld
+ use dyn_tests_utils, only: vc_physics, vc_height, vc_dry_pressure
+
use cam_abortutils, only: endrun
+ use cam_history_support, only: max_fieldname_len
+ use cam_budget, only: thermo_budget_history
!------------------------------Arguments--------------------------------
type(physics_state), intent(inout) :: state
@@ -799,6 +835,7 @@ subroutine calc_te_and_aam_budgets(state, outfld_name_suffix,vc)
!---------------------------Local storage-------------------------------
real(r8) :: se(pcols) ! Dry Static energy (J/m2)
+ real(r8) :: po(pcols) ! surface potential or potential energy (J/m2)
real(r8) :: ke(pcols) ! kinetic energy (J/m2)
real(r8) :: wv(pcols) ! column integrated vapor (kg/m2)
real(r8) :: liq(pcols) ! column integrated liquid (kg/m2)
@@ -817,88 +854,81 @@ subroutine calc_te_and_aam_budgets(state, outfld_name_suffix,vc)
integer :: i,k ! column, level indices
integer :: vc_loc ! local vertical coordinate variable
integer :: ixtt ! test tracer index
- character(len=16) :: name_out1,name_out2,name_out3,name_out4,name_out5,name_out6
-!-----------------------------------------------------------------------
+ character(len=max_fieldname_len) :: name_out(thermo_budget_num_vars)
- name_out1 = 'SE_' //trim(outfld_name_suffix)
- name_out2 = 'KE_' //trim(outfld_name_suffix)
- name_out3 = 'WV_' //trim(outfld_name_suffix)
- name_out4 = 'WL_' //trim(outfld_name_suffix)
- name_out5 = 'WI_' //trim(outfld_name_suffix)
- name_out6 = 'TT_' //trim(outfld_name_suffix)
+!-----------------------------------------------------------------------
- if ( hist_fld_active(name_out1).or.hist_fld_active(name_out2).or.hist_fld_active(name_out3).or.&
- hist_fld_active(name_out4).or.hist_fld_active(name_out5).or.hist_fld_active(name_out6)) then
+ if (.not.thermo_budget_history) return
- lchnk = state%lchnk
- ncol = state%ncol
+ do i=1,thermo_budget_num_vars
+ name_out(i)=trim(thermo_budget_vars(i))//'_'//trim(outfld_name_suffix)
+ end do
- if (present(vc)) then
- vc_loc = vc
- else
- vc_loc = vc_physics
- end if
+ lchnk = state%lchnk
+ ncol = state%ncol
- if (state%psetcols == pcols) then
- if (vc_loc == vc_height) then
- !
- ! compute cv if vertical coordinate is height: cv = cp - R
- !
- cp_or_cv(:,:) = cpairv(:,:,lchnk)-rairv(:,:,lchnk)!cv
- else
- cp_or_cv(:,:) = cpairv(:,:,lchnk) !cp
- end if
- else
- call endrun('calc_te_and_aam_budgets: energy diagnostics not implemented/tested for subcolumns')
- end if
+ if (present(vc)) then
+ vc_loc = vc
+ else
+ vc_loc = vc_physics
+ end if
- if (vc_loc == vc_height) then
- scaling(:,:) = cpairv(:,:,lchnk)/cp_or_cv(:,:) !cp/cv scaling for temperature increment under constant volume
+ if (state%psetcols == pcols) then
+ if (vc_loc == vc_height .or. vc_loc == vc_dry_pressure) then
+ cp_or_cv(:ncol,:) = cp_or_cv_dycore(:ncol,:,lchnk)
else
- scaling(:,:) = 1.0_r8
+ cp_or_cv(:ncol,:) = cpairv(:ncol,:,lchnk)
end if
- ! scale accumulated temperature increment for constant volume (otherwise effectively do nothing)
- temp(1:ncol,:) = state%temp_ini(1:ncol,:)+scaling(1:ncol,:)*(state%T(1:ncol,:)- state%temp_ini(1:ncol,:))
+ else
+ call endrun('tot_energy_phys: energy diagnostics not implemented/tested for subcolumns')
+ end if
- call get_hydrostatic_energy(state%q(1:ncol,1:pver,1:pcnst),&
- state%pdel(1:ncol,1:pver), cp_or_cv, &
- state%u(1:ncol,1:pver), state%v(1:ncol,1:pver), temp(1:ncol,1:pver), &
- vc_loc, ps = state%ps(1:ncol), phis = state%phis(1:ncol), &
- z_mid = state%z_ini(1:ncol,:), se = se, ke = ke, wv = wv, liq = liq, ice = ice)
-
- call cnst_get_ind('TT_LW' , ixtt , abort=.false.)
-
- tt = 0._r8
- if (ixtt > 1) then
- if (name_out6 == 'TT_pAM'.or.name_out6 == 'TT_zAM') then
- !
- ! after dme_adjust mixing ratios are all wet
- !
- do k = 1, pver
- do i = 1, ncol
- tt_tmp = state%q(i,k,ixtt)*state%pdel(i,k)/gravit
- tt (i) = tt(i) + tt_tmp
- end do
+ if (vc_loc == vc_height .or. vc_loc == vc_dry_pressure) then
+ scaling(:ncol,:) = cpairv(:ncol,:,lchnk)/cp_or_cv(:ncol,:)!scaling for energy consistency
+ else
+ scaling(:ncol,:) = 1.0_r8 !internal energy / enthalpy same as CAM physics
+ end if
+ ! scale accumulated temperature increment for internal energy / enthalpy consistency
+ temp(1:ncol,:) = state%temp_ini(1:ncol,:)+scaling(1:ncol,:)*(state%T(1:ncol,:)- state%temp_ini(1:ncol,:))
+ call get_hydrostatic_energy(state%q(1:ncol,1:pver,1:pcnst),.true., &
+ state%pdel(1:ncol,1:pver), cp_or_cv(1:ncol,1:pver), &
+ state%u(1:ncol,1:pver), state%v(1:ncol,1:pver), temp(1:ncol,1:pver), &
+ vc_loc, ptop=state%pintdry(1:ncol,1), phis = state%phis(1:ncol), &
+ z_mid = state%z_ini(1:ncol,:), se = se(1:ncol), &
+ po = po(1:ncol), ke = ke(1:ncol), wv = wv(1:ncol), liq = liq(1:ncol), &
+ ice = ice(1:ncol))
+
+ call cnst_get_ind('TT_LW' , ixtt , abort=.false.)
+ tt = 0._r8
+ if (ixtt > 1) then
+ if (name_out(ttidx) == 'TT_pAM'.or.name_out(ttidx) == 'TT_zAM') then
+ !
+ ! after dme_adjust mixing ratios are all wet
+ !
+ do k = 1, pver
+ do i = 1, ncol
+ tt_tmp = state%q(i,k,ixtt)*state%pdel(i,k)*rga
+ tt (i) = tt(i) + tt_tmp
end do
- else
- do k = 1, pver
- do i = 1, ncol
- tt_tmp = state%q(i,k,ixtt)*state%pdeldry(i,k)/gravit
- tt (i) = tt(i) + tt_tmp
- end do
+ end do
+ else
+ do k = 1, pver
+ do i = 1, ncol
+ tt_tmp = state%q(i,k,ixtt)*state%pdeldry(i,k)*rga
+ tt (i) = tt(i) + tt_tmp
end do
- end if
+ end do
end if
-
- ! Output energy diagnostics
-
- call outfld(name_out1 ,se , pcols ,lchnk )
- call outfld(name_out2 ,ke , pcols ,lchnk )
- call outfld(name_out3 ,wv , pcols ,lchnk )
- call outfld(name_out4 ,liq , pcols ,lchnk )
- call outfld(name_out5 ,ice , pcols ,lchnk )
- call outfld(name_out6 ,tt , pcols ,lchnk )
end if
+
+ call outfld(name_out(seidx) ,se , pcols ,lchnk )
+ call outfld(name_out(poidx) ,po , pcols ,lchnk )
+ call outfld(name_out(keidx) ,ke , pcols ,lchnk )
+ call outfld(name_out(wvidx) ,wv , pcols ,lchnk )
+ call outfld(name_out(wlidx) ,liq , pcols ,lchnk )
+ call outfld(name_out(wiidx) ,ice , pcols ,lchnk )
+ call outfld(name_out(ttidx) ,tt , pcols ,lchnk )
+ call outfld(name_out(teidx) ,se+ke+po, pcols ,lchnk )
!
! Axial angular momentum diagnostics
!
@@ -912,32 +942,27 @@ subroutine calc_te_and_aam_budgets(state, outfld_name_suffix,vc)
! MR is equation (6) without \Delta A and sum over areas (areas are in units of radians**2)
! MO is equation (7) without \Delta A and sum over areas (areas are in units of radians**2)
!
- name_out1 = 'MR_' //trim(outfld_name_suffix)
- name_out2 = 'MO_' //trim(outfld_name_suffix)
-
- if ( hist_fld_active(name_out1).or.hist_fld_active(name_out2)) then
- lchnk = state%lchnk
- ncol = state%ncol
-
- mr_cnst = rearth**3/gravit
- mo_cnst = omega*rearth**4/gravit
-
- mr = 0.0_r8
- mo = 0.0_r8
- do k = 1, pver
- do i = 1, ncol
+
+ mr_cnst = rga*rearth**3
+ mo_cnst = rga*omega*rearth**4
+
+ mr = 0.0_r8
+ mo = 0.0_r8
+ do k = 1, pver
+ do i = 1, ncol
cos_lat = cos(state%lat(i))
mr_tmp = mr_cnst*state%u(i,k)*state%pdel(i,k)*cos_lat
mo_tmp = mo_cnst*state%pdel(i,k)*cos_lat**2
-
+
mr(i) = mr(i) + mr_tmp
mo(i) = mo(i) + mo_tmp
- end do
- end do
- call outfld(name_out1 ,mr, pcols,lchnk )
- call outfld(name_out2 ,mo, pcols,lchnk )
- end if
- end subroutine calc_te_and_aam_budgets
+ end do
+ end do
+
+ call outfld(name_out(mridx) ,mr, pcols,lchnk )
+ call outfld(name_out(moidx) ,mo, pcols,lchnk )
+
+ end subroutine tot_energy_phys
end module check_energy
diff --git a/src/physics/cam/cldfrc2m.F90 b/src/physics/cam/cldfrc2m.F90
index 28a19ca07a..77a391fd35 100644
--- a/src/physics/cam/cldfrc2m.F90
+++ b/src/physics/cam/cldfrc2m.F90
@@ -35,18 +35,18 @@ module cldfrc2m
real(r8) :: cldfrc2m_rhmaxi
real(r8) :: cldfrc2m_rhminis ! Minimum rh for ice cloud fraction > 0 in the stratsophere.
real(r8) :: cldfrc2m_rhmaxis
+real(r8) :: cldfrc2m_qist_min ! Minimum in-stratus IWC constraint [ kg/kg ]
+real(r8) :: cldfrc2m_qist_max ! Maximum in-stratus IWC constraint [ kg/kg ]
logical :: cldfrc2m_do_subgrid_growth = .false.
+logical :: cldfrc2m_do_avg_aist_algs = .false.
! -------------------------- !
! Parameters for Ice Stratus !
! -------------------------- !
real(r8), protected :: rhmini_const ! Minimum rh for ice cloud fraction > 0.
real(r8), protected :: rhmaxi_const
-real(r8), protected :: rhminis_const ! Minimum rh for ice cloud fraction > 0.
+real(r8), protected :: rhminis_const ! Minimum rh for ice cloud fraction > 0.
real(r8), protected :: rhmaxis_const
-real(r8), parameter :: qist_min = 1.e-7_r8 ! Minimum in-stratus ice IWC constraint [ kg/kg ]
-real(r8), parameter :: qist_max = 5.e-3_r8 ! Maximum in-stratus ice IWC constraint [ kg/kg ]
-
! ----------------------------- !
! Parameters for Liquid Stratus !
! ----------------------------- !
@@ -59,10 +59,10 @@ module cldfrc2m
real(r8) :: rhminh_const ! Critical RH for high-level liquid stratus clouds
real(r8) :: premit ! Top height for mid-level liquid stratus fraction
real(r8) :: premib ! Bottom height for mid-level liquid stratus fraction
-integer :: iceopt ! option for ice cloud closure
- ! 1=wang & sassen 2=schiller (iciwc)
+integer :: iceopt ! option for ice cloud closure
+ ! 1=wang & sassen 2=schiller (iciwc)
! 3=wood & field, 4=Wilson (based on smith)
- ! 5=modified slingo (ssat & empyt cloud)
+ ! 5=modified slingo (ssat & empyt cloud)
real(r8) :: icecrit ! Critical RH for ice clouds in Wilson & Ballard closure
! ( smaller = more ice clouds )
@@ -82,7 +82,8 @@ subroutine cldfrc2m_readnl(nlfile)
integer :: unitn, ierr
character(len=*), parameter :: subname = 'cldfrc2m_readnl'
- namelist /cldfrc2m_nl/ cldfrc2m_rhmini, cldfrc2m_rhmaxi, cldfrc2m_rhminis, cldfrc2m_rhmaxis, cldfrc2m_do_subgrid_growth
+ namelist /cldfrc2m_nl/ cldfrc2m_rhmini, cldfrc2m_rhmaxi, cldfrc2m_rhminis, cldfrc2m_rhmaxis, cldfrc2m_do_subgrid_growth, &
+ cldfrc2m_qist_min, cldfrc2m_qist_max, cldfrc2m_do_avg_aist_algs
!-----------------------------------------------------------------------------
if (masterproc) then
@@ -103,7 +104,6 @@ subroutine cldfrc2m_readnl(nlfile)
rhmaxi_const = cldfrc2m_rhmaxi
rhminis_const = cldfrc2m_rhminis
rhmaxis_const = cldfrc2m_rhmaxis
-
end if
! Broadcast namelist variables
@@ -111,7 +111,10 @@ subroutine cldfrc2m_readnl(nlfile)
call mpi_bcast(rhmaxi_const, 1, mpi_real8, masterprocid, mpicom, ierr)
call mpi_bcast(rhminis_const, 1, mpi_real8, masterprocid, mpicom, ierr)
call mpi_bcast(rhmaxis_const, 1, mpi_real8, masterprocid, mpicom, ierr)
+ call mpi_bcast(cldfrc2m_qist_min, 1, mpi_real8, masterprocid, mpicom, ierr)
+ call mpi_bcast(cldfrc2m_qist_max, 1, mpi_real8, masterprocid, mpicom, ierr)
call mpi_bcast(cldfrc2m_do_subgrid_growth, 1, mpi_logical,masterprocid, mpicom, ierr)
+ call mpi_bcast(cldfrc2m_do_avg_aist_algs, 1, mpi_logical,masterprocid, mpicom, ierr)
end subroutine cldfrc2m_readnl
@@ -139,6 +142,9 @@ subroutine cldfrc2m_init()
write(iulog,*) ' rhminis = ', rhminis_const
write(iulog,*) ' rhmaxis = ', rhmaxis_const
write(iulog,*) ' do_subgrid_growth = ', cldfrc2m_do_subgrid_growth
+ write(iulog,*) ' do_avg_aist_algs = ', cldfrc2m_do_avg_aist_algs
+ write(iulog,*) ' cldfrc2m_qist_min = ', cldfrc2m_qist_min
+ write(iulog,*) ' cldfrc2m_qist_max = ', cldfrc2m_qist_max
end if
end subroutine cldfrc2m_init
@@ -183,7 +189,7 @@ subroutine astG_PDF_single(U, p, qv, landfrac, snowh, a, Ga, orhmin, &
real(r8) cldrh ! RH of stratus cloud
real(r8) rhmin ! Critical RH
real(r8) rhwght
-
+
real(r8) :: rhminl
real(r8) :: rhminl_adj_land
real(r8) :: rhminh
@@ -226,7 +232,7 @@ subroutine astG_PDF_single(U, p, qv, landfrac, snowh, a, Ga, orhmin, &
a = 1._r8 - (-3._r8/sqrt(2._r8)*(U-cldrh)/dV)**(2._r8/3._r8)
Ga = dV/sqrt(2._r8)*sqrt(1._r8-a)
elseif( U .gt. (cldrh-dV) .and. U .le. (cldrh-dV/6._r8) ) then
- a = 4._r8*(cos((1._r8/3._r8)*(acos((3._r8/2._r8/sqrt(2._r8))* &
+ a = 4._r8*(cos((1._r8/3._r8)*(acos((3._r8/2._r8/sqrt(2._r8))* &
(1._r8+(U-cldrh)/dV))-2._r8*3.141592_r8)))**2._r8
Ga = dV/sqrt(2._r8)*(1._r8/sqrt(a)-sqrt(a))
elseif( U .le. (cldrh-dV) ) then
@@ -236,7 +242,7 @@ subroutine astG_PDF_single(U, p, qv, landfrac, snowh, a, Ga, orhmin, &
if( freeze_dry ) then
a = a *max(0.15_r8,min(1.0_r8,qv/0.0030_r8))
- Ga = Ga/max(0.15_r8,min(1.0_r8,qv/0.0030_r8))
+ Ga = Ga/max(0.15_r8,min(1.0_r8,qv/0.0030_r8))
endif
elseif( p .lt. premit ) then
@@ -251,7 +257,7 @@ subroutine astG_PDF_single(U, p, qv, landfrac, snowh, a, Ga, orhmin, &
a = 1._r8 - (-3._r8/sqrt(2._r8)*(U-cldrh)/dV)**(2._r8/3._r8)
Ga = dV/sqrt(2._r8)*sqrt(1._r8-a)
elseif( U .gt. (cldrh-dV) .and. U .le. (cldrh-dV/6._r8) ) then
- a = 4._r8*(cos((1._r8/3._r8)*(acos((3._r8/2._r8/sqrt(2._r8))* &
+ a = 4._r8*(cos((1._r8/3._r8)*(acos((3._r8/2._r8/sqrt(2._r8))* &
(1._r8+(U-cldrh)/dV))-2._r8*3.141592_r8)))**2._r8
Ga = dV/sqrt(2._r8)*(1._r8/sqrt(a)-sqrt(a))
elseif( U .le. (cldrh-dV) ) then
@@ -278,7 +284,7 @@ subroutine astG_PDF_single(U, p, qv, landfrac, snowh, a, Ga, orhmin, &
a = 1._r8 - (-3._r8/sqrt(2._r8)*(U-cldrh)/dV)**(2._r8/3._r8)
Ga = dV/sqrt(2._r8)*sqrt(1._r8-a)
elseif( U .gt. (cldrh-dV) .and. U .le. (cldrh-dV/6._r8) ) then
- a = 4._r8*(cos((1._r8/3._r8)*(acos((3._r8/2._r8/sqrt(2._r8))* &
+ a = 4._r8*(cos((1._r8/3._r8)*(acos((3._r8/2._r8/sqrt(2._r8))* &
(1._r8+(U-cldrh)/dV))-2._r8*3.141592_r8)))**2._r8
Ga = dV/sqrt(2._r8)*(1._r8/sqrt(a)-sqrt(a))
elseif( U .le. (cldrh-dV) ) then
@@ -344,7 +350,7 @@ subroutine astG_PDF(U_in, p_in, qv_in, landfrac_in, snowh_in, a_out, Ga_out, nco
real(r8) cldrh ! RH of stratus cloud
real(r8) rhmin ! Critical RH
real(r8) rhwght
-
+
! Statement functions
logical land
land(i) = nint(landfrac_in(i)) == 1
@@ -368,13 +374,13 @@ subroutine astG_PDF(U_in, p_in, qv_in, landfrac_in, snowh_in, a_out, Ga_out, nco
do i = 1, ncol
- U = U_in(i)
- p = p_in(i)
- qv = qv_in(i)
- landfrac = landfrac_in(i)
- snowh = snowh_in(i)
+ U = U_in(i)
+ p = p_in(i)
+ qv = qv_in(i)
+ landfrac = landfrac_in(i)
+ snowh = snowh_in(i)
- if (present(rhminl_in)) rhminl = rhminl_in(i)
+ if (present(rhminl_in)) rhminl = rhminl_in(i)
if (present(rhminl_adj_land_in)) rhminl_adj_land = rhminl_adj_land_in(i)
if (present(rhminh_in)) rhminh = rhminh_in(i)
@@ -395,7 +401,7 @@ subroutine astG_PDF(U_in, p_in, qv_in, landfrac_in, snowh_in, a_out, Ga_out, nco
a = 1._r8 - (-3._r8/sqrt(2._r8)*(U-cldrh)/dV)**(2._r8/3._r8)
Ga = dV/sqrt(2._r8)*sqrt(1._r8-a)
elseif( U .gt. (cldrh-dV) .and. U .le. (cldrh-dV/6._r8) ) then
- a = 4._r8*(cos((1._r8/3._r8)*(acos((3._r8/2._r8/sqrt(2._r8))* &
+ a = 4._r8*(cos((1._r8/3._r8)*(acos((3._r8/2._r8/sqrt(2._r8))* &
(1._r8+(U-cldrh)/dV))-2._r8*3.141592_r8)))**2._r8
Ga = dV/sqrt(2._r8)*(1._r8/sqrt(a)-sqrt(a))
elseif( U .le. (cldrh-dV) ) then
@@ -405,7 +411,7 @@ subroutine astG_PDF(U_in, p_in, qv_in, landfrac_in, snowh_in, a_out, Ga_out, nco
if( freeze_dry ) then
a = a *max(0.15_r8,min(1.0_r8,qv/0.0030_r8))
- Ga = Ga/max(0.15_r8,min(1.0_r8,qv/0.0030_r8))
+ Ga = Ga/max(0.15_r8,min(1.0_r8,qv/0.0030_r8))
endif
elseif( p .lt. premit ) then
@@ -420,7 +426,7 @@ subroutine astG_PDF(U_in, p_in, qv_in, landfrac_in, snowh_in, a_out, Ga_out, nco
a = 1._r8 - (-3._r8/sqrt(2._r8)*(U-cldrh)/dV)**(2._r8/3._r8)
Ga = dV/sqrt(2._r8)*sqrt(1._r8-a)
elseif( U .gt. (cldrh-dV) .and. U .le. (cldrh-dV/6._r8) ) then
- a = 4._r8*(cos((1._r8/3._r8)*(acos((3._r8/2._r8/sqrt(2._r8))* &
+ a = 4._r8*(cos((1._r8/3._r8)*(acos((3._r8/2._r8/sqrt(2._r8))* &
(1._r8+(U-cldrh)/dV))-2._r8*3.141592_r8)))**2._r8
Ga = dV/sqrt(2._r8)*(1._r8/sqrt(a)-sqrt(a))
elseif( U .le. (cldrh-dV) ) then
@@ -447,7 +453,7 @@ subroutine astG_PDF(U_in, p_in, qv_in, landfrac_in, snowh_in, a_out, Ga_out, nco
a = 1._r8 - (-3._r8/sqrt(2._r8)*(U-cldrh)/dV)**(2._r8/3._r8)
Ga = dV/sqrt(2._r8)*sqrt(1._r8-a)
elseif( U .gt. (cldrh-dV) .and. U .le. (cldrh-dV/6._r8) ) then
- a = 4._r8*(cos((1._r8/3._r8)*(acos((3._r8/2._r8/sqrt(2._r8))* &
+ a = 4._r8*(cos((1._r8/3._r8)*(acos((3._r8/2._r8/sqrt(2._r8))* &
(1._r8+(U-cldrh)/dV))-2._r8*3.141592_r8)))**2._r8
Ga = dV/sqrt(2._r8)*(1._r8/sqrt(a)-sqrt(a))
elseif( U .le. (cldrh-dV) ) then
@@ -458,7 +464,7 @@ subroutine astG_PDF(U_in, p_in, qv_in, landfrac_in, snowh_in, a_out, Ga_out, nco
endif
a_out(i) = a
- Ga_out(i) = Ga
+ Ga_out(i) = Ga
enddo
@@ -471,7 +477,7 @@ subroutine astG_RHU_single(U, p, qv, landfrac, snowh, a, Ga, orhmin, &
! --------------------------------------------------------- !
! Compute 'stratus fraction(a)' and Gs=(dU/da) from the !
! CAM35 cloud fraction formula. !
- ! Below is valid only for CAMUW at 1.9x2.5 fv dynamics core !
+ ! Below is valid only for CAMUW at 1.9x2.5 fv dynamics core !
! For the other cases, I should re-define 'rhminl,rhminh' & !
! 'premib,premit'. !
! Note that if U > 1, Ga = 1.e10 instead of Ga = 0, that is !
@@ -524,15 +530,15 @@ subroutine astG_RHU_single(U, p, qv, landfrac, snowh, a, Ga, orhmin, &
rhmin = rhminl
endif
rhdif = (U-rhmin)/(1.0_r8-rhmin)
- a = min(1._r8,(max(rhdif,0.0_r8))**2)
+ a = min(1._r8,(max(rhdif,0.0_r8))**2)
if( (U.ge.1._r8) .or. (U.le.rhmin) ) then
Ga = 1.e20_r8
- else
+ else
Ga = 0.5_r8*(1._r8-rhmin)*((1._r8-rhmin)/(U-rhmin))
endif
if( freeze_dry ) then
a = a*max(0.15_r8,min(1.0_r8,qv/0.0030_r8))
- Ga = Ga/max(0.15_r8,min(1.0_r8,qv/0.0030_r8))
+ Ga = Ga/max(0.15_r8,min(1.0_r8,qv/0.0030_r8))
endif
elseif( p .lt. premit ) then
@@ -542,7 +548,7 @@ subroutine astG_RHU_single(U, p, qv, landfrac, snowh, a, Ga, orhmin, &
a = min(1._r8,(max(rhdif,0._r8))**2)
if( (U.ge.1._r8) .or. (U.le.rhmin) ) then
Ga = 1.e20_r8
- else
+ else
Ga = 0.5_r8*(1._r8-rhmin)*((1._r8-rhmin)/(U-rhmin))
endif
@@ -560,7 +566,7 @@ subroutine astG_RHU_single(U, p, qv, landfrac, snowh, a, Ga, orhmin, &
a = min(1._r8,(max(rhdif,0._r8))**2)
if( (U.ge.1._r8) .or. (U.le.rhmin) ) then
Ga = 1.e10_r8
- else
+ else
Ga = 0.5_r8*(1._r8-rhmin)*((1._r8-rhmin)/(U-rhmin))
endif
@@ -578,7 +584,7 @@ subroutine astG_RHU(U_in, p_in, qv_in, landfrac_in, snowh_in, a_out, Ga_out, nco
! --------------------------------------------------------- !
! Compute 'stratus fraction(a)' and Gs=(dU/da) from the !
! CAM35 cloud fraction formula. !
- ! Below is valid only for CAMUW at 1.9x2.5 fv dynamics core !
+ ! Below is valid only for CAMUW at 1.9x2.5 fv dynamics core !
! For the other cases, I should re-define 'rhminl,rhminh' & !
! 'premib,premit'. !
! Note that if U > 1, Ga = 1.e10 instead of Ga = 0, that is !
@@ -635,13 +641,13 @@ subroutine astG_RHU(U_in, p_in, qv_in, landfrac_in, snowh_in, a_out, Ga_out, nco
do i = 1, ncol
- U = U_in(i)
- p = p_in(i)
- qv = qv_in(i)
- landfrac = landfrac_in(i)
- snowh = snowh_in(i)
+ U = U_in(i)
+ p = p_in(i)
+ qv = qv_in(i)
+ landfrac = landfrac_in(i)
+ snowh = snowh_in(i)
- if (present(rhminl_in)) rhminl = rhminl_in(i)
+ if (present(rhminl_in)) rhminl = rhminl_in(i)
if (present(rhminl_adj_land_in)) rhminl_adj_land = rhminl_adj_land_in(i)
if (present(rhminh_in)) rhminh = rhminh_in(i)
@@ -653,15 +659,15 @@ subroutine astG_RHU(U_in, p_in, qv_in, landfrac_in, snowh_in, a_out, Ga_out, nco
rhmin = rhminl
endif
rhdif = (U-rhmin)/(1.0_r8-rhmin)
- a = min(1._r8,(max(rhdif,0.0_r8))**2)
+ a = min(1._r8,(max(rhdif,0.0_r8))**2)
if( (U.ge.1._r8) .or. (U.le.rhmin) ) then
Ga = 1.e20_r8
- else
+ else
Ga = 0.5_r8*(1._r8-rhmin)*((1._r8-rhmin)/(U-rhmin))
endif
if( freeze_dry ) then
a = a*max(0.15_r8,min(1.0_r8,qv/0.0030_r8))
- Ga = Ga/max(0.15_r8,min(1.0_r8,qv/0.0030_r8))
+ Ga = Ga/max(0.15_r8,min(1.0_r8,qv/0.0030_r8))
endif
elseif( p .lt. premit ) then
@@ -671,7 +677,7 @@ subroutine astG_RHU(U_in, p_in, qv_in, landfrac_in, snowh_in, a_out, Ga_out, nco
a = min(1._r8,(max(rhdif,0._r8))**2)
if( (U.ge.1._r8) .or. (U.le.rhmin) ) then
Ga = 1.e20_r8
- else
+ else
Ga = 0.5_r8*(1._r8-rhmin)*((1._r8-rhmin)/(U-rhmin))
endif
@@ -689,14 +695,14 @@ subroutine astG_RHU(U_in, p_in, qv_in, landfrac_in, snowh_in, a_out, Ga_out, nco
a = min(1._r8,(max(rhdif,0._r8))**2)
if( (U.ge.1._r8) .or. (U.le.rhmin) ) then
Ga = 1.e10_r8
- else
+ else
Ga = 0.5_r8*(1._r8-rhmin)*((1._r8-rhmin)/(U-rhmin))
endif
endif
a_out(i) = a
- Ga_out(i) = Ga
+ Ga_out(i) = Ga
enddo
@@ -709,7 +715,7 @@ subroutine aist_single(qv, T, p, qi, landfrac, snowh, aist, &
qsatfac_out)
! --------------------------------------------------------- !
- ! Compute non-physical ice stratus fraction !
+ ! Compute non-physical ice stratus fraction !
! --------------------------------------------------------- !
real(r8), intent(in) :: qv ! Grid-mean water vapor[kg/kg]
@@ -797,19 +803,19 @@ subroutine aist_single(qv, T, p, qi, landfrac, snowh, aist, &
call qsat_water(T, p, es, qs)
esl = svp_water(T)
esi = svp_ice(T)
-
+
if( iceopt.lt.3 ) then
if( iceopt.eq.1 ) then
ttmp = max(195._r8,min(T,253._r8)) - 273.16_r8
icicval = a + b * ttmp + c * ttmp**2._r8
rho = p/(rair*T)
- icicval = icicval * 1.e-6_r8 / rho
+ icicval = icicval * 1.e-6_r8 / rho
else
ttmp = max(190._r8,min(T,273.16_r8))
icicval = 10._r8 **(as * bs**ttmp + cs)
icicval = icicval * 1.e-6_r8 * 18._r8 / 28.97_r8
endif
- aist = max(0._r8,min(qi/icicval,1._r8))
+ aist = max(0._r8,min(qi/icicval,1._r8))
elseif( iceopt.eq.3 ) then
aist = 1._r8 - exp(-Kc*qi/(qs*(esi/esl)))
aist = max(0._r8,min(aist,1._r8))
@@ -831,9 +837,9 @@ subroutine aist_single(qv, T, p, qi, landfrac, snowh, aist, &
! endif
endif
ncf = qi/((1._r8 - icecrit)*qs)
- if( ncf.le.0._r8 ) then
+ if( ncf.le.0._r8 ) then
aist = 0._r8
- elseif( ncf.gt.0._r8 .and. ncf.le.1._r8/6._r8 ) then
+ elseif( ncf.gt.0._r8 .and. ncf.le.1._r8/6._r8 ) then
aist = 0.5_r8*(6._r8 * ncf)**(2._r8/3._r8)
elseif( ncf.gt.1._r8/6._r8 .and. ncf.lt.1._r8 ) then
phi = (acos(3._r8*(1._r8-ncf)/2._r8**(3._r8/2._r8))+4._r8*3.1415927_r8)/3._r8
@@ -842,7 +848,7 @@ subroutine aist_single(qv, T, p, qi, landfrac, snowh, aist, &
aist = 1._r8
endif
aist = max(0._r8,min(aist,1._r8))
- elseif (iceopt.eq.5) then
+ elseif (iceopt.eq.5) then
! set rh ice cloud fraction
rhi= (qv+qi)/qs * (esl/esi)
if (rhmaxi .eq. rhmini) then
@@ -863,7 +869,7 @@ subroutine aist_single(qv, T, p, qi, landfrac, snowh, aist, &
! NOTE: Limit qsatfac so that adjusted RHliq would be 1. or less.
if (present(qsatfac_out) .and. cldfrc2m_do_subgrid_growth) then
qsatfac_out = max(min(qv / qs, 1._r8), (1._r8 - aist) * rhmini + aist * rhmaxi)
- end if
+ end if
! limiter to remove empty cloud and ice with no cloud
! and set icecld fraction to mincld if ice exists
@@ -879,19 +885,28 @@ subroutine aist_single(qv, T, p, qi, landfrac, snowh, aist, &
icimr=qi/aist
!minimum
- if (icimr.lt.qist_min) then
- aist = max(0._r8,min(1._r8,qi/qist_min))
+ if (icimr.lt.cldfrc2m_qist_min) then
+ if (cldfrc2m_do_avg_aist_algs) then
+ !
+ ! Take the geometric mean of the iceopt=4 and iceopt=5 values.
+ ! Mods developed by Thomas Toniazzo for NorESM.
+ aist = max(0._r8,min(1._r8,sqrt(aist*qi/cldfrc2m_qist_min)))
+ else
+ !
+ ! Default for iceopt=5
+ aist = max(0._r8,min(1._r8,qi/cldfrc2m_qist_min))
+ end if
endif
!maximum
- if (icimr.gt.qist_max) then
- aist = max(0._r8,min(1._r8,qi/qist_max))
+ if (icimr.gt.cldfrc2m_qist_max) then
+ aist = max(0._r8,min(1._r8,qi/cldfrc2m_qist_max))
endif
endif
- endif
+ endif
! 0.999_r8 is added to prevent infinite 'ql_st' at the end of instratus_condensate
- ! computed after updating 'qi_st'.
+ ! computed after updating 'qi_st'.
aist = max(0._r8,min(aist,0.999_r8))
@@ -904,7 +919,7 @@ subroutine aist_vector(qv_in, T_in, p_in, qi_in, ni_in, landfrac_in, snowh_in, a
qsatfac_out )
! --------------------------------------------------------- !
- ! Compute non-physical ice stratus fraction !
+ ! Compute non-physical ice stratus fraction !
! --------------------------------------------------------- !
real(r8), intent(in) :: qv_in(pcols) ! Grid-mean water vapor[kg/kg]
@@ -916,7 +931,7 @@ subroutine aist_vector(qv_in, T_in, p_in, qi_in, ni_in, landfrac_in, snowh_in, a
real(r8), intent(in) :: snowh_in(pcols) ! Snow depth (liquid water equivalent)
real(r8), intent(out) :: aist_out(pcols) ! Non-physical ice stratus fraction ( 0<= aist <= 1 )
- integer, intent(in) :: ncol
+ integer, intent(in) :: ncol
real(r8), optional, intent(in) :: rhmaxi_in(pcols)
real(r8), optional, intent(in) :: rhmini_in(pcols) ! Critical relative humidity for ice stratus
@@ -1013,9 +1028,9 @@ subroutine aist_vector(qv_in, T_in, p_in, qi_in, ni_in, landfrac_in, snowh_in, a
call svp_ice_vect(T_in(1:ncol), esi(1:ncol), ncol)
do i = 1, ncol
-
- landfrac = landfrac_in(i)
- snowh = snowh_in(i)
+
+ landfrac = landfrac_in(i)
+ snowh = snowh_in(i)
T = T_in(i)
qv = qv_in(i)
p = p_in(i)
@@ -1024,23 +1039,23 @@ subroutine aist_vector(qv_in, T_in, p_in, qi_in, ni_in, landfrac_in, snowh_in, a
qs = qsat_in(i)
if (present(rhmaxi_in)) rhmaxi = rhmaxi_in(i)
- if (present(rhmini_in)) rhmini = rhmini_in(i)
- if (present(rhminl_in)) rhminl = rhminl_in(i)
+ if (present(rhmini_in)) rhmini = rhmini_in(i)
+ if (present(rhminl_in)) rhminl = rhminl_in(i)
if (present(rhminl_adj_land_in)) rhminl_adj_land = rhminl_adj_land_in(i)
if (present(rhminh_in)) rhminh = rhminh_in(i)
-
+
if( iceopt.lt.3 ) then
if( iceopt.eq.1 ) then
ttmp = max(195._r8,min(T,253._r8)) - 273.16_r8
icicval = a + b * ttmp + c * ttmp**2._r8
rho = p/(rair*T)
- icicval = icicval * 1.e-6_r8 / rho
+ icicval = icicval * 1.e-6_r8 / rho
else
ttmp = max(190._r8,min(T,273.16_r8))
icicval = 10._r8 **(as * bs**ttmp + cs)
icicval = icicval * 1.e-6_r8 * 18._r8 / 28.97_r8
endif
- aist = max(0._r8,min(qi/icicval,1._r8))
+ aist = max(0._r8,min(qi/icicval,1._r8))
elseif( iceopt.eq.3 ) then
aist = 1._r8 - exp(-Kc*qi/(qs*(esi(i)/esl(i))))
aist = max(0._r8,min(aist,1._r8))
@@ -1062,9 +1077,9 @@ subroutine aist_vector(qv_in, T_in, p_in, qi_in, ni_in, landfrac_in, snowh_in, a
! endif
endif
ncf = qi/((1._r8 - icecrit)*qs)
- if( ncf.le.0._r8 ) then
+ if( ncf.le.0._r8 ) then
aist = 0._r8
- elseif( ncf.gt.0._r8 .and. ncf.le.1._r8/6._r8 ) then
+ elseif( ncf.gt.0._r8 .and. ncf.le.1._r8/6._r8 ) then
aist = 0.5_r8*(6._r8 * ncf)**(2._r8/3._r8)
elseif( ncf.gt.1._r8/6._r8 .and. ncf.lt.1._r8 ) then
phi = (acos(3._r8*(1._r8-ncf)/2._r8**(3._r8/2._r8))+4._r8*3.1415927_r8)/3._r8
@@ -1073,7 +1088,7 @@ subroutine aist_vector(qv_in, T_in, p_in, qi_in, ni_in, landfrac_in, snowh_in, a
aist = 1._r8
endif
aist = max(0._r8,min(aist,1._r8))
- elseif (iceopt.eq.5) then
+ elseif (iceopt.eq.5) then
! set rh ice cloud fraction
rhi= (qv+qi)/qs * (esl(i)/esi(i))
if (rhmaxi .eq. rhmini) then
@@ -1104,7 +1119,7 @@ subroutine aist_vector(qv_in, T_in, p_in, qi_in, ni_in, landfrac_in, snowh_in, a
aist = max(0._r8,min(qi/icicval,1._r8))
aist = min(aist,1._r8)
- endif
+ endif
if (iceopt.eq.5 .or. iceopt.eq.6) then
@@ -1131,19 +1146,28 @@ subroutine aist_vector(qv_in, T_in, p_in, qi_in, ni_in, landfrac_in, snowh_in, a
icimr=qi/aist
!minimum
- if (icimr.lt.qist_min) then
- aist = max(0._r8,min(1._r8,qi/qist_min))
+ if (icimr.lt.cldfrc2m_qist_min) then
+ if (cldfrc2m_do_avg_aist_algs) then
+ !
+ ! Take the geometric mean of the iceopt=4 and iceopt=5 values.
+ ! Mods developed by Thomas Toniazzo for NorESM.
+ aist = max(0._r8,min(1._r8,sqrt(aist*qi/cldfrc2m_qist_min)))
+ else
+ !
+ ! Default for iceopt=5
+ aist = max(0._r8,min(1._r8,qi/cldfrc2m_qist_min))
+ end if
endif
!maximum
- if (icimr.gt.qist_max) then
- aist = max(0._r8,min(1._r8,qi/qist_max))
+ if (icimr.gt.cldfrc2m_qist_max) then
+ aist = max(0._r8,min(1._r8,qi/cldfrc2m_qist_max))
endif
endif
- endif
+ endif
! 0.999_r8 is added to prevent infinite 'ql_st' at the end of instratus_condensate
- ! computed after updating 'qi_st'.
+ ! computed after updating 'qi_st'.
aist = max(0._r8,min(aist,0.999_r8))
diff --git a/src/physics/cam/cloud_fraction.F90 b/src/physics/cam/cloud_fraction.F90
index 365da98f50..3285862fae 100644
--- a/src/physics/cam/cloud_fraction.F90
+++ b/src/physics/cam/cloud_fraction.F90
@@ -751,10 +751,10 @@ subroutine cldfrc_fice(ncol, t, fice, fsnow)
! Arguments
integer, intent(in) :: ncol ! number of active columns
- real(r8), intent(in) :: t(pcols,pver) ! temperature
+ real(r8), intent(in) :: t(:,:) ! temperature
- real(r8), intent(out) :: fice(pcols,pver) ! Fractional ice content within cloud
- real(r8), intent(out) :: fsnow(pcols,pver) ! Fractional snow content for convection
+ real(r8), intent(out) :: fice(:,:) ! Fractional ice content within cloud
+ real(r8), intent(out) :: fsnow(:,:) ! Fractional snow content for convection
! Local variables
real(r8) :: tmax_fice ! max temperature for cloud ice formation
diff --git a/src/physics/cam/clubb_intr.F90 b/src/physics/cam/clubb_intr.F90
index 8a9c35bfd2..1432be7327 100644
--- a/src/physics/cam/clubb_intr.F90
+++ b/src/physics/cam/clubb_intr.F90
@@ -4,36 +4,36 @@ module clubb_intr
! Module to interface CAM with Cloud Layers Unified by Bi-normals (CLUBB), developed !
! by the University of Wisconsin Milwaukee Group (UWM). !
! !
- ! CLUBB replaces the exisiting turbulence, shallow convection, and macrophysics in CAM5 !
- ! !
+ ! CLUBB replaces the exisiting turbulence, shallow convection, and macrophysics in CAM5 !
+ ! !
! Lastly, a implicit diffusion solver is called, and tendencies retrieved by !
! differencing the diffused and initial states. !
- ! !
+ ! !
! Calling sequence: !
! !
!---------------------------Code history-------------------------------------------------------------- !
- ! Authors: P. Bogenschutz, C. Craig, A. Gettelman !
- ! Modified by: K Thayer-Calder !
- ! !
+ ! Authors: P. Bogenschutz, C. Craig, A. Gettelman !
+ ! Modified by: K Thayer-Calder !
+ ! !
!----------------------------------------------------------------------------------------------------- !
- use shr_kind_mod, only: r8=>shr_kind_r8
- use ppgrid, only: pver, pverp, pcols, begchunk, endchunk
- use phys_control, only: phys_getopts
- use physconst, only: cpair, gravit, rga, latvap, latice, zvir, rh2o, karman
- use air_composition, only: rairv, cpairv
-
- use spmd_utils, only: masterproc
- use constituents, only: pcnst, cnst_add
- use pbl_utils, only: calc_ustar, calc_obklen
- use ref_pres, only: top_lev => trop_cloud_top_lev
- use zm_conv_intr, only: zmconv_microp
+ use shr_kind_mod, only: r8=>shr_kind_r8
+ use ppgrid, only: pver, pverp, pcols, begchunk, endchunk
+ use phys_control, only: phys_getopts
+ use physconst, only: cpair, gravit, rga, latvap, latice, zvir, rh2o
+ use air_composition, only: rairv, cpairv
+ use cam_history_support, only: max_fieldname_len
+
+ use spmd_utils, only: masterproc
+ use constituents, only: pcnst, cnst_add
+ use pbl_utils, only: calc_ustar, calc_obklen
+ use ref_pres, only: top_lev => trop_cloud_top_lev
#ifdef CLUBB_SGS
- use clubb_api_module, only: pdf_parameter, implicit_coefs_terms
- use clubb_api_module, only: clubb_config_flags_type, grid, stats, nu_vertical_res_dep
- use clubb_api_module, only: nparams
- use clubb_mf, only: do_clubb_mf, do_clubb_mf_diag
- use cloud_fraction, only: dp1, dp2
+ use clubb_api_module, only: pdf_parameter, implicit_coefs_terms
+ use clubb_api_module, only: clubb_config_flags_type, grid, stats, nu_vertical_res_dep
+ use clubb_api_module, only: nparams
+ use clubb_mf, only: do_clubb_mf, do_clubb_mf_diag
+ use cloud_fraction, only: dp1, dp2
#endif
implicit none
@@ -45,7 +45,7 @@ module clubb_intr
stats_rad_zt(pcols), & ! stats_rad_zt grid
stats_rad_zm(pcols), & ! stats_rad_zm grid
stats_sfc(pcols) ! stats_sfc
-
+
!$omp threadprivate(stats_zt, stats_zm, stats_rad_zt, stats_rad_zm, stats_sfc)
#endif
@@ -63,7 +63,7 @@ module clubb_intr
stats_init_clubb, &
stats_zt, stats_zm, stats_sfc, &
stats_rad_zt, stats_rad_zm, &
- stats_end_timestep_clubb, &
+ stats_end_timestep_clubb, &
#endif
clubb_readnl, &
clubb_init_cnst, &
@@ -76,7 +76,6 @@ module clubb_intr
logical, public :: do_cldcool
logical :: clubb_do_icesuper
-
#ifdef CLUBB_SGS
type(clubb_config_flags_type), public :: clubb_config_flags
real(r8), dimension(nparams), public :: clubb_params ! Adjustable CLUBB parameters (C1, C2 ...)
@@ -89,7 +88,7 @@ module clubb_intr
integer, parameter :: &
grid_type = 3, & ! The 2 option specifies stretched thermodynamic levels
hydromet_dim = 0 ! The hydromet array in SAM-CLUBB is currently 0 elements
-
+
! Even though sclr_dim is set to 0, the dimension here is set to 1 to prevent compiler errors
! See github ticket larson-group/cam#133 for details
real(r8), parameter, dimension(1) :: &
@@ -101,28 +100,28 @@ module clubb_intr
theta0 = 300._r8, & ! Reference temperature [K]
ts_nudge = 86400._r8, & ! Time scale for u/v nudging (not used) [s]
p0_clubb = 100000._r8
-
- integer, parameter :: &
+
+ integer, parameter :: &
sclr_dim = 0 ! Higher-order scalars, set to zero
real(r8), parameter :: &
wp3_const = 1._r8 ! Constant to add to wp3 when moments are advected
-
- real(r8), parameter :: &
+
+ real(r8), parameter :: &
wpthlp_const = 10.0_r8 ! Constant to add to wpthlp when moments are advected
-
- real(r8), parameter :: &
+
+ real(r8), parameter :: &
wprtp_const = 0.01_r8 ! Constant to add to wprtp when moments are advected
-
- real(r8), parameter :: &
+
+ real(r8), parameter :: &
rtpthlp_const = 0.01_r8 ! Constant to add to rtpthlp when moments are advected
-
+
real(r8), parameter :: unset_r8 = huge(1.0_r8)
integer, parameter :: unset_i = huge(1)
- ! Commonly used temperature for the melting temp of ice crystals [K]
- real(r8), parameter :: meltpt_temp = 268.15_r8
-
+ ! Commonly used temperature for the melting temp of ice crystals [K]
+ real(r8), parameter :: meltpt_temp = 268.15_r8
+
real(r8) :: clubb_timestep = unset_r8 ! Default CLUBB timestep, unless overwriten by namelist
real(r8) :: clubb_rnevap_effic = unset_r8
@@ -178,7 +177,7 @@ module clubb_intr
real(r8) :: clubb_detliq_rad = unset_r8
real(r8) :: clubb_detice_rad = unset_r8
real(r8) :: clubb_detphase_lowtemp = unset_r8
-
+
integer :: &
clubb_iiPDF_type, & ! Selected option for the two-component normal
! (double Gaussian) PDF type to use for the w, rt,
@@ -190,7 +189,7 @@ module clubb_intr
clubb_tridiag_solve_method = unset_i ! Specifier for method to solve tri-diagonal systems
-
+
logical :: &
clubb_l_use_precip_frac, & ! Flag to use precipitation fraction in KK microphysics. The
! precipitation fraction is automatically set to 1 when this
@@ -253,8 +252,8 @@ module clubb_intr
! that is linearized in terms of wp3.
! (Requires ADG1 PDF and clubb_l_standard_term_ta).
clubb_l_godunov_upwind_wpxp_ta, & ! This flag determines whether we want to use an upwind
- ! differencing approximation rather than a centered
- ! differencing for turbulent advection terms.
+ ! differencing approximation rather than a centered
+ ! differencing for turbulent advection terms.
! It affects wpxp only.
clubb_l_godunov_upwind_xpyp_ta, & ! This flag determines whether we want to use an upwind
! differencing approximation rather than a centered
@@ -305,15 +304,15 @@ module clubb_intr
clubb_l_mono_flux_lim_vm, & ! Flag to turn on monotonic flux limiter for vm
clubb_l_mono_flux_lim_spikefix, & ! Flag to implement monotonic flux limiter code that
! eliminates spurious drying tendencies at model top
- clubb_l_intr_sfc_flux_smooth = .false. ! Add a locally calculated roughness to upwp and vpwp sfc fluxes
+ clubb_l_intr_sfc_flux_smooth = .false.! Add a locally calculated roughness to upwp and vpwp sfc fluxes
! Constant parameters
logical, parameter, private :: &
l_implemented = .true., & ! Implemented in a host model (always true)
l_host_applies_sfc_fluxes = .false. ! Whether the host model applies the surface fluxes
-
+
logical, parameter, private :: &
- apply_to_heat = .false. ! Apply WACCM energy fixer to heat or not (.true. = yes (duh))
+ apply_to_heat = .false. ! Apply WACCM energy fixer to heat or not (.true. = yes (duh))
logical :: lq(pcnst)
logical :: prog_modal_aero
@@ -322,11 +321,12 @@ module clubb_intr
logical :: clubb_do_liqsupersat = .false.
logical :: clubb_do_energyfix = .true.
logical :: history_budget
+ logical :: do_hb_above_clubb = .false.
integer :: history_budget_histfile_num
integer :: edsclr_dim ! Number of scalars to transport in CLUBB
integer :: offset
-
-! define physics buffer indicies here
+
+! define physics buffer indicies here
integer :: &
wp2_idx, & ! vertical velocity variances
wp3_idx, & ! third moment of vertical velocity
@@ -385,11 +385,12 @@ module clubb_intr
naai_idx, & ! ice number concentration
prer_evap_idx, & ! rain evaporation rate
qrl_idx, & ! longwave cooling rate
- radf_idx, &
- qsatfac_idx, & ! subgrid cloud water saturation scaling factor
+ radf_idx, &
+ qsatfac_idx, & ! subgrid cloud water saturation scaling factor
ice_supersat_idx, & ! ice cloud fraction for SILHS
rcm_idx, & ! Cloud water mixing ratio for SILHS
- ztodt_idx ! physics timestep for SILHS
+ ztodt_idx,& ! physics timestep for SILHS
+ clubbtop_idx ! level index for CLUBB top
! Indices for microphysical covariance tendencies
integer :: &
@@ -406,7 +407,7 @@ module clubb_intr
pdf_zm_varnce_w_2_idx, &
pdf_zm_mixt_frac_idx
- integer, public :: &
+ integer, public :: &
ixthlp2 = 0, &
ixwpthlp = 0, &
ixwprtp = 0, &
@@ -425,7 +426,7 @@ module clubb_intr
dnlfzm_idx = -1, & ! ZM detrained convective cloud water num concen.
dnifzm_idx = -1 ! ZM detrained convective cloud ice num concen.
- ! Output arrays for CLUBB statistics
+ ! Output arrays for CLUBB statistics
real(r8), allocatable, dimension(:,:,:) :: out_zt, out_zm, out_radzt, out_radzm, out_sfc
character(len=16) :: eddy_scheme ! Default set in phys_control.F90
@@ -439,14 +440,14 @@ module clubb_intr
#ifdef CLUBB_SGS
type(pdf_parameter), target, allocatable, public, protected :: &
pdf_params_chnk(:) ! PDF parameters (thermo. levs.) [units vary]
-
+
type(pdf_parameter), target, allocatable :: pdf_params_zm_chnk(:) ! PDF parameters on momentum levs. [units vary]
-
+
type(implicit_coefs_terms), target, allocatable :: pdf_implicit_coefs_terms_chnk(:) ! PDF impl. coefs. & expl. terms [units vary]
#endif
contains
-
+
! =============================================================================== !
! !
! =============================================================================== !
@@ -466,13 +467,15 @@ subroutine clubb_register_cam( )
!------------------------------------------------ !
! Add CLUBB fields to pbuf
- use physics_buffer, only: pbuf_add_field, dtype_r8, dyn_time_lvls
+ use physics_buffer, only: pbuf_add_field, dtype_r8, dtype_i4, dyn_time_lvls
use subcol_utils, only: subcol_get_scheme
-
+
+ !----- Begin Code -----
call phys_getopts( eddy_scheme_out = eddy_scheme, &
- deep_scheme_out = deep_scheme, &
+ deep_scheme_out = deep_scheme, &
history_budget_out = history_budget, &
- history_budget_histfile_num_out = history_budget_histfile_num )
+ history_budget_histfile_num_out = history_budget_histfile_num, &
+ do_hb_above_clubb_out = do_hb_above_clubb)
subcol_scheme = subcol_get_scheme()
if (trim(subcol_scheme) == 'SILHS') then
@@ -485,7 +488,7 @@ subroutine clubb_register_cam( )
cnst_names =(/'THLP2 ','RTP2 ','RTPTHLP','WPTHLP ','WPRTP ','WP2 ','WP3 ','UP2 ','VP2 '/)
do_cnst=.true.
! If CLUBB moments are advected, do not output them automatically which is typically done. Some moments
- ! need a constant added to them before they are advected, thus this would corrupt the output.
+ ! need a constant added to them before they are advected, thus this would corrupt the output.
! Users should refer to the "XXXX_CLUBB" (THLP2_CLUBB for instance) output variables for these moments
call cnst_add(trim(cnst_names(1)),0._r8,0._r8,0._r8,ixthlp2,longname='second moment vertical velocity',cam_outfld=.false.)
call cnst_add(trim(cnst_names(2)),0._r8,0._r8,0._r8,ixrtp2,longname='second moment rtp',cam_outfld=.false.)
@@ -497,6 +500,9 @@ subroutine clubb_register_cam( )
call cnst_add(trim(cnst_names(8)),0._r8,0._r8,0._r8,ixup2,longname='CLUBB 2nd moment u wind',cam_outfld=.false.)
call cnst_add(trim(cnst_names(9)),0._r8,0._r8,0._r8,ixvp2,longname='CLUBB 2nd moment v wind',cam_outfld=.false.)
end if
+ if (do_hb_above_clubb) then
+ call pbuf_add_field('clubbtop', 'physpkg', dtype_i4, (/pcols/), clubbtop_idx)
+ endif
! put pbuf_add calls here (see macrop_driver.F90 for sample) use indicies defined at top
call pbuf_add_field('pblh', 'global', dtype_r8, (/pcols/), pblh_idx)
@@ -515,7 +521,7 @@ subroutine clubb_register_cam( )
call pbuf_add_field('CMELIQ', 'physpkg',dtype_r8, (/pcols,pver/), cmeliq_idx)
call pbuf_add_field('QSATFAC', 'physpkg',dtype_r8, (/pcols,pver/), qsatfac_idx)
-
+
call pbuf_add_field('WP2_nadv', 'global', dtype_r8, (/pcols,pverp,dyn_time_lvls/), wp2_idx)
call pbuf_add_field('WP3_nadv', 'global', dtype_r8, (/pcols,pverp,dyn_time_lvls/), wp3_idx)
call pbuf_add_field('WPTHLP_nadv', 'global', dtype_r8, (/pcols,pverp,dyn_time_lvls/), wpthlp_idx)
@@ -524,7 +530,7 @@ subroutine clubb_register_cam( )
call pbuf_add_field('RTP2_nadv', 'global', dtype_r8, (/pcols,pverp,dyn_time_lvls/), rtp2_idx)
call pbuf_add_field('THLP2_nadv', 'global', dtype_r8, (/pcols,pverp,dyn_time_lvls/), thlp2_idx)
call pbuf_add_field('UP2_nadv', 'global', dtype_r8, (/pcols,pverp,dyn_time_lvls/), up2_idx)
- call pbuf_add_field('VP2_nadv', 'global', dtype_r8, (/pcols,pverp,dyn_time_lvls/), vp2_idx)
+ call pbuf_add_field('VP2_nadv', 'global', dtype_r8, (/pcols,pverp,dyn_time_lvls/), vp2_idx)
call pbuf_add_field('RTP3', 'global', dtype_r8, (/pcols,pverp,dyn_time_lvls/), rtp3_idx)
call pbuf_add_field('THLP3', 'global', dtype_r8, (/pcols,pverp,dyn_time_lvls/), thlp3_idx)
@@ -570,7 +576,7 @@ subroutine clubb_register_cam( )
call pbuf_add_field('pdf_zm_var_w_2', 'global', dtype_r8, (/pcols,pverp,dyn_time_lvls/), pdf_zm_varnce_w_2_idx)
call pbuf_add_field('pdf_zm_mixt_frac', 'global', dtype_r8, (/pcols,pverp,dyn_time_lvls/), pdf_zm_mixt_frac_idx)
-#endif
+#endif
end subroutine clubb_register_cam
! =============================================================================== !
@@ -594,14 +600,14 @@ function clubb_implements_cnst(name)
end function clubb_implements_cnst
-
+
! =============================================================================== !
! !
! =============================================================================== !
subroutine clubb_init_cnst(name, latvals, lonvals, mask, q)
#ifdef CLUBB_SGS
- use clubb_api_module, only: w_tol_sqd, rt_tol, thl_tol
+ use clubb_api_module, only: w_tol_sqd, rt_tol, thl_tol
#endif
!----------------------------------------------------------------------- !
@@ -674,7 +680,7 @@ subroutine clubb_init_cnst(name, latvals, lonvals, mask, q)
end subroutine clubb_init_cnst
-
+
! =============================================================================== !
! !
! =============================================================================== !
@@ -688,7 +694,7 @@ subroutine clubb_readnl(nlfile)
use spmd_utils, only: mpicom, mstrid=>masterprocid, mpi_logical, mpi_real8, &
mpi_integer
use clubb_mf, only: clubb_mf_readnl
-
+
use clubb_api_module, only: &
set_default_clubb_config_flags_api, & ! Procedure(s)
initialize_clubb_config_flags_type_api, &
@@ -701,7 +707,7 @@ subroutine clubb_readnl(nlfile)
character(len=*), parameter :: sub = 'clubb_readnl'
- logical :: clubb_history = .false., clubb_rad_history = .false. ! Stats enabled (T/F)
+ logical :: clubb_history = .false., clubb_rad_history = .false. ! Stats enabled (T/F)
logical :: clubb_cloudtop_cooling = .false., clubb_rainevap_turb = .false.
integer :: iunit, read_status, ierr
@@ -739,7 +745,7 @@ subroutine clubb_readnl(nlfile)
clubb_C_invrs_tau_N2_wpxp, &
clubb_C_invrs_tau_N2_xp2, &
clubb_c_K1, &
- clubb_c_K10, &
+ clubb_c_K10, &
clubb_c_K10h, &
clubb_c_K2, &
clubb_c_K8, &
@@ -805,16 +811,16 @@ subroutine clubb_readnl(nlfile)
clubb_tridiag_solve_method, &
clubb_up2_sfc_coef, &
clubb_wpxp_L_thresh
-
+
!----- Begin Code -----
- ! Determine if we want clubb_history to be output
+ ! Determine if we want clubb_history to be output
clubb_history = .false. ! Initialize to false
l_stats = .false. ! Initialize to false
l_output_rad_files = .false. ! Initialize to false
do_cldcool = .false. ! Initialize to false
do_rainturb = .false. ! Initialize to false
-
+
! Initialize namelist variables to clubb defaults
call set_default_clubb_config_flags_api( clubb_iiPDF_type, & ! Out
clubb_ipdf_call_placement, & ! Out
@@ -962,7 +968,7 @@ subroutine clubb_readnl(nlfile)
call mpi_bcast(clubb_c_K10, 1, mpi_real8, mstrid, mpicom, ierr)
if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_c_K10")
call mpi_bcast(clubb_c_K10h, 1, mpi_real8, mstrid, mpicom, ierr)
- if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_c_K10h")
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_c_K10h")
call mpi_bcast(clubb_beta, 1, mpi_real8, mstrid, mpicom, ierr)
if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_beta")
call mpi_bcast(clubb_C2rt, 1, mpi_real8, mstrid, mpicom, ierr)
@@ -1010,21 +1016,21 @@ subroutine clubb_readnl(nlfile)
call mpi_bcast(clubb_do_energyfix, 1, mpi_logical, mstrid, mpicom, ierr)
if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_do_energyfix")
call mpi_bcast(clubb_C_invrs_tau_bkgnd, 1, mpi_real8, mstrid, mpicom, ierr)
- if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_C_invrs_tau_bkgnd")
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_C_invrs_tau_bkgnd")
call mpi_bcast(clubb_C_invrs_tau_sfc, 1, mpi_real8, mstrid, mpicom, ierr)
- if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_C_invrs_tau_sfc")
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_C_invrs_tau_sfc")
call mpi_bcast(clubb_C_invrs_tau_shear, 1, mpi_real8, mstrid, mpicom, ierr)
- if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_C_invrs_tau_shear")
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_C_invrs_tau_shear")
call mpi_bcast(clubb_C_invrs_tau_N2, 1, mpi_real8, mstrid, mpicom, ierr)
- if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_C_invrs_tau_N2")
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_C_invrs_tau_N2")
call mpi_bcast(clubb_C_invrs_tau_N2_wp2, 1, mpi_real8, mstrid, mpicom, ierr)
- if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_C_invrs_tau_N2_wp2")
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_C_invrs_tau_N2_wp2")
call mpi_bcast(clubb_C_invrs_tau_N2_xp2, 1, mpi_real8, mstrid, mpicom, ierr)
- if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_C_invrs_tau_N2_xp2")
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_C_invrs_tau_N2_xp2")
call mpi_bcast(clubb_C_invrs_tau_N2_wpxp, 1, mpi_real8, mstrid, mpicom, ierr)
- if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_C_invrs_tau_N2_wpxp")
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_C_invrs_tau_N2_wpxp")
call mpi_bcast(clubb_C_invrs_tau_N2_clear_wp3, 1, mpi_real8, mstrid, mpicom, ierr)
- if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_C_invrs_tau_N2_clear_wp3")
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_C_invrs_tau_N2_clear_wp3")
call mpi_bcast(clubb_lmin_coef, 1, mpi_real8, mstrid, mpicom, ierr)
if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_lmin_coef")
call mpi_bcast(clubb_skw_max_mag, 1, mpi_real8, mstrid, mpicom, ierr)
@@ -1123,10 +1129,10 @@ subroutine clubb_readnl(nlfile)
! Overwrite defaults if they are true
if (clubb_history) l_stats = .true.
- if (clubb_rad_history) l_output_rad_files = .true.
+ if (clubb_rad_history) l_output_rad_files = .true.
if (clubb_cloudtop_cooling) do_cldcool = .true.
if (clubb_rainevap_turb) do_rainturb = .true.
-
+
! Check that all namelists have been set
if(clubb_timestep == unset_r8) call endrun(sub//": FATAL: clubb_timestep is not set")
if(clubb_rnevap_effic == unset_r8) call endrun(sub//": FATAL:clubb_rnevap_effic is not set")
@@ -1186,7 +1192,7 @@ subroutine clubb_readnl(nlfile)
if(clubb_detphase_lowtemp == unset_r8) call endrun(sub//": FATAL: clubb_detphase_lowtemp not set")
if(clubb_penta_solve_method == unset_i) call endrun(sub//": FATAL: clubb_penta_solve_method not set")
if(clubb_tridiag_solve_method == unset_i) call endrun(sub//": FATAL: clubb_tridiag_solve_method not set")
- if(clubb_detphase_lowtemp >= meltpt_temp) &
+ if(clubb_detphase_lowtemp >= meltpt_temp) &
call endrun(sub//": ERROR: clubb_detphase_lowtemp must be less than 268.15 K")
call initialize_clubb_config_flags_type_api( clubb_iiPDF_type, & ! In
@@ -1236,7 +1242,7 @@ subroutine clubb_readnl(nlfile)
clubb_l_e3sm_config, & ! In
clubb_l_vary_convect_depth, & ! In
clubb_l_use_tke_in_wp3_pr_turb_term, & ! In
- clubb_l_use_tke_in_wp2_wp3_K_dfsn, & ! In
+ clubb_l_use_tke_in_wp2_wp3_K_dfsn, & ! In
clubb_l_smooth_Heaviside_tau_wpxp, & ! In
clubb_l_enable_relaxed_clipping, & ! In
clubb_l_linearize_pbl_winds, & ! In
@@ -1272,8 +1278,6 @@ subroutine clubb_ini_cam(pbuf2d)
! From CAM libraries
use cam_history, only: addfld, add_default, horiz_only
- use ref_pres, only: pref_mid
- use hb_diff, only: init_hb_diff
use rad_constituents, only: rad_cnst_get_info, rad_cnst_get_mode_num_idx, rad_cnst_get_mam_mmr_idx
use cam_abortutils, only: endrun
@@ -1331,14 +1335,12 @@ subroutine clubb_ini_cam(pbuf2d)
#ifdef CLUBB_SGS
real(kind=time_precision) :: dum1, dum2, dum3
-
+
! The similar name to clubb_history is unfortunate...
logical :: history_amwg, history_clubb
integer :: err_code ! Code for when CLUBB fails
integer :: i, j, k, l ! Indices
- integer :: ntop_eddy ! Top interface level to which eddy vertical diffusion is applied ( = 1 )
- integer :: nbot_eddy ! Bottom interface level to which eddy vertical diffusion is applied ( = pver )
integer :: nmodes, nspec, m
integer :: ixq, ixcldice, ixcldliq, ixnumliq, ixnumice
integer :: lptr
@@ -1386,18 +1388,19 @@ subroutine clubb_ini_cam(pbuf2d)
pdf_implicit_coefs_terms_chnk(begchunk:endchunk) )
! ----------------------------------------------------------------- !
- ! Determine how many constituents CLUBB will transport. Note that
- ! CLUBB does not transport aerosol consituents. Therefore, need to
+ ! Determine how many constituents CLUBB will transport. Note that
+ ! CLUBB does not transport aerosol consituents. Therefore, need to
! determine how many aerosols constituents there are and subtract that
- ! off of pcnst (the total consituents)
+ ! off of pcnst (the total consituents)
! ----------------------------------------------------------------- !
call phys_getopts(prog_modal_aero_out=prog_modal_aero, &
history_amwg_out=history_amwg, &
- history_clubb_out=history_clubb)
+ history_clubb_out=history_clubb, &
+ do_hb_above_clubb_out=do_hb_above_clubb)
! Select variables to apply tendencies back to CAM
-
+
! Initialize all consituents to true to start
lq(1:pcnst) = .true.
edsclr_dim = pcnst
@@ -1411,12 +1414,12 @@ subroutine clubb_ini_cam(pbuf2d)
if (prog_modal_aero) then
! Turn off modal aerosols and decrement edsclr_dim accordingly
call rad_cnst_get_info(0, nmodes=nmodes)
-
+
do m = 1, nmodes
call rad_cnst_get_mode_num_idx(m, lptr)
lq(lptr)=.false.
edsclr_dim = edsclr_dim-1
-
+
call rad_cnst_get_info(0, m, nspec=nspec)
do l = 1, nspec
call rad_cnst_get_mam_mmr_idx(m, l, lptr)
@@ -1424,7 +1427,7 @@ subroutine clubb_ini_cam(pbuf2d)
edsclr_dim = edsclr_dim-1
end do
end do
-
+
! In addition, if running with MAM, droplet number is transported
! in dropmixnuc, therefore we do NOT want CLUBB to apply transport
! tendencies to avoid double counted. Else, we apply tendencies.
@@ -1448,7 +1451,7 @@ subroutine clubb_ini_cam(pbuf2d)
l_stats_samp = .false.
l_grads = .false.
- ! Overwrite defaults if needbe
+ ! Overwrite defaults if needbe
if (l_stats) l_stats_samp = .true.
! Define physics buffers indexes
@@ -1457,7 +1460,7 @@ subroutine clubb_ini_cam(pbuf2d)
ast_idx = pbuf_get_index('AST') ! Stratiform cloud fraction
alst_idx = pbuf_get_index('ALST') ! Liquid stratiform cloud fraction
aist_idx = pbuf_get_index('AIST') ! Ice stratiform cloud fraction
- qlst_idx = pbuf_get_index('QLST') ! Physical in-stratus LWC
+ qlst_idx = pbuf_get_index('QLST') ! Physical in-stratus LWC
qist_idx = pbuf_get_index('QIST') ! Physical in-stratus IWC
dp_frac_idx = pbuf_get_index('DP_FRAC') ! Deep convection cloud fraction
icwmrdp_idx = pbuf_get_index('ICWMRDP') ! In-cloud deep convective mixing ratio
@@ -1479,26 +1482,19 @@ subroutine clubb_ini_cam(pbuf2d)
iiedsclr_thl = -1
iiedsclr_CO2 = -1
- if (zmconv_microp) then
- dlfzm_idx = pbuf_get_index('DLFZM')
- difzm_idx = pbuf_get_index('DIFZM')
- dnlfzm_idx = pbuf_get_index('DNLFZM')
- dnifzm_idx = pbuf_get_index('DNIFZM')
- end if
-
! ----------------------------------------------------------------- !
! Define number of tracers for CLUBB to diffuse
- ! ----------------------------------------------------------------- !
-
+ ! ----------------------------------------------------------------- !
+
if (clubb_l_do_expldiff_rtm_thlm) then
offset = 2 ! diffuse temperature and moisture explicitly
- edsclr_dim = edsclr_dim + offset
+ edsclr_dim = edsclr_dim + offset
endif
-
+
! ----------------------------------------------------------------- !
! Setup CLUBB core
! ----------------------------------------------------------------- !
-
+
! Read in parameters for CLUBB. Just read in default values
call set_default_parameters_api( &
C1, C1b, C1c, C2rt, C2thl, C2rtthl, &
@@ -1602,7 +1598,7 @@ subroutine clubb_ini_cam(pbuf2d)
clubb_params(iC_invrs_tau_N2_xp2) = clubb_C_invrs_tau_N2_xp2
clubb_params(iC_invrs_tau_N2_wpxp) = clubb_C_invrs_tau_N2_wpxp
clubb_params(iC_invrs_tau_N2_clear_wp3) = clubb_C_invrs_tau_N2_clear_wp3
-
+
! Set up CLUBB core. Note that some of these inputs are overwritten
! when clubb_tend_cam is called. The reason is that heights can change
! at each time step, which is why dummy arrays are read in here for heights
@@ -1644,17 +1640,6 @@ subroutine clubb_ini_cam(pbuf2d)
call print_clubb_config_flags_api( iulog, clubb_config_flags ) ! Intent(in)
end if
- ! ----------------------------------------------------------------- !
- ! Set-up HB diffusion. Only initialized to diagnose PBL depth !
- ! ----------------------------------------------------------------- !
-
- ! Initialize eddy diffusivity module
-
- ntop_eddy = 1 ! if >1, must be <= nbot_molec
- nbot_eddy = pver ! currently always pver
-
- call init_hb_diff( gravit, cpair, ntop_eddy, nbot_eddy, pref_mid, karman, eddy_scheme )
-
! ----------------------------------------------------------------- !
! Add output fields for the history files
! ----------------------------------------------------------------- !
@@ -1682,7 +1667,7 @@ subroutine clubb_ini_cam(pbuf2d)
call addfld ('WPRCP_CLUBB', (/ 'ilev' /), 'A', 'W/m2', 'Liquid Water Flux')
call addfld ('CLOUDFRAC_CLUBB', (/ 'lev' /), 'A', 'fraction', 'Cloud Fraction')
call addfld ('RCMINLAYER_CLUBB', (/ 'lev' /), 'A', 'kg/kg', 'Cloud Water in Layer')
- call addfld ('CLOUDCOVER_CLUBB', (/ 'lev' /), 'A', 'fraction', 'Cloud Cover')
+ call addfld ('CLOUDCOVER_CLUBB', (/ 'lev' /), 'A', 'fraction', 'Cloud Cover')
call addfld ('WPTHVP_CLUBB', (/ 'ilev' /), 'A', 'W/m2', 'Buoyancy Flux')
call addfld ('RVMTEND_CLUBB', (/ 'lev' /), 'A', 'kg/kg /s', 'Water vapor tendency')
call addfld ('STEND_CLUBB', (/ 'lev' /), 'A', 'J/(kg s)', 'Static energy tendency')
@@ -1691,7 +1676,7 @@ subroutine clubb_ini_cam(pbuf2d)
call addfld ('UTEND_CLUBB', (/ 'lev' /), 'A', 'm/s /s', 'U-wind Tendency')
call addfld ('VTEND_CLUBB', (/ 'lev' /), 'A', 'm/s /s', 'V-wind Tendency')
call addfld ('ZT_CLUBB', (/ 'lev' /), 'A', 'm', 'Thermodynamic Heights')
- call addfld ('ZM_CLUBB', (/ 'ilev' /), 'A', 'm', 'Momentum Heights')
+ call addfld ('ZM_CLUBB', (/ 'ilev' /), 'A', 'm', 'Momentum Heights')
call addfld ('UM_CLUBB', (/ 'lev' /), 'A', 'm/s', 'Zonal Wind')
call addfld ('VM_CLUBB', (/ 'lev' /), 'A', 'm/s', 'Meridional Wind')
call addfld ('WM_ZT_CLUBB', (/ 'lev' /), 'A', 'm/s', 'Vertical Velocity')
@@ -1709,8 +1694,8 @@ subroutine clubb_ini_cam(pbuf2d)
call addfld ('FQTENDICE', (/ 'lev' /), 'A', 'fraction', 'Frequency of Ice Saturation Adjustment')
call addfld ('DPDLFLIQ', (/ 'lev' /), 'A', 'kg/kg/s', 'Detrained liquid water from deep convection')
- call addfld ('DPDLFICE', (/ 'lev' /), 'A', 'kg/kg/s', 'Detrained ice from deep convection')
- call addfld ('DPDLFT', (/ 'lev' /), 'A', 'K/s', 'T-tendency due to deep convective detrainment')
+ call addfld ('DPDLFICE', (/ 'lev' /), 'A', 'kg/kg/s', 'Detrained ice from deep convection')
+ call addfld ('DPDLFT', (/ 'lev' /), 'A', 'K/s', 'T-tendency due to deep convective detrainment')
call addfld ('RELVAR', (/ 'lev' /), 'A', '-', 'Relative cloud water variance')
call addfld ('CLUBB_GRID_SIZE', horiz_only, 'A', 'm', 'Horizontal grid box size seen by CLUBB')
@@ -1750,7 +1735,7 @@ subroutine clubb_ini_cam(pbuf2d)
call addfld ( 'edmf_S_AWV' , (/ 'ilev' /), 'A', 'm2/s2' , 'Sum of a_i*w_i*v_i (EDMF)' )
call addfld ( 'edmf_thlflx' , (/ 'ilev' /), 'A', 'W/m2' , 'thl flux (EDMF)' )
call addfld ( 'edmf_qtflx' , (/ 'ilev' /), 'A', 'W/m2' , 'qt flux (EDMF)' )
- end if
+ end if
! Initialize statistics, below are dummy variables
dum1 = 300._r8
@@ -1758,13 +1743,13 @@ subroutine clubb_ini_cam(pbuf2d)
dum3 = 300._r8
if (l_stats) then
-
+
do i=1, pcols
call stats_init_clubb( .true., dum1, dum2, &
nlev+1, nlev+1, nlev+1, dum3, &
stats_zt(i), stats_zm(i), stats_sfc(i), &
stats_rad_zt(i), stats_rad_zm(i))
- end do
+ end do
allocate(out_zt(pcols,pverp,stats_zt(1)%num_output_fields))
allocate(out_zm(pcols,pverp,stats_zm(1)%num_output_fields))
@@ -1774,12 +1759,12 @@ subroutine clubb_ini_cam(pbuf2d)
allocate(out_radzm(pcols,pverp,stats_rad_zm(1)%num_output_fields))
endif
-
+
! ----------------------------------------------------------------- !
! Make all of this output default, this is not CLUBB history
! ----------------------------------------------------------------- !
-
- if (clubb_do_adv .or. history_clubb) then
+
+ if (clubb_do_adv .or. history_clubb) then
call add_default('RELVAR', 1, ' ')
call add_default('RHO_CLUBB', 1, ' ')
call add_default('UP2_CLUBB', 1, ' ')
@@ -1812,14 +1797,14 @@ subroutine clubb_ini_cam(pbuf2d)
call add_default('UTEND_CLUBB', 1, ' ')
call add_default('VTEND_CLUBB', 1, ' ')
call add_default('ZT_CLUBB', 1, ' ')
- call add_default('ZM_CLUBB', 1, ' ')
+ call add_default('ZM_CLUBB', 1, ' ')
call add_default('UM_CLUBB', 1, ' ')
call add_default('VM_CLUBB', 1, ' ')
call add_default('WM_ZT_CLUBB', 1, ' ')
call add_default('PBLH', 1, ' ')
call add_default('CONCLD', 1, ' ')
endif
-
+
if (history_amwg) then
call add_default('PBLH', 1, ' ')
end if
@@ -1848,10 +1833,10 @@ subroutine clubb_ini_cam(pbuf2d)
call add_default( 'edmf_qtflx' , 1, ' ')
end if
- if (history_budget) then
+ if (history_budget) then
call add_default('DPDLFLIQ', history_budget_histfile_num, ' ')
call add_default('DPDLFICE', history_budget_histfile_num, ' ')
- call add_default('DPDLFT', history_budget_histfile_num, ' ')
+ call add_default('DPDLFT', history_budget_histfile_num, ' ')
call add_default('STEND_CLUBB', history_budget_histfile_num, ' ')
call add_default('RCMTEND_CLUBB', history_budget_histfile_num, ' ')
call add_default('RIMTEND_CLUBB', history_budget_histfile_num, ' ')
@@ -1859,7 +1844,7 @@ subroutine clubb_ini_cam(pbuf2d)
call add_default('UTEND_CLUBB', history_budget_histfile_num, ' ')
call add_default('VTEND_CLUBB', history_budget_histfile_num, ' ')
endif
-
+
! --------------- !
! First step? !
@@ -1878,12 +1863,12 @@ subroutine clubb_ini_cam(pbuf2d)
call pbuf_set_field(pbuf2d, thlp2_idx, thl_tol**2)
call pbuf_set_field(pbuf2d, up2_idx, w_tol_sqd)
call pbuf_set_field(pbuf2d, vp2_idx, w_tol_sqd)
-
+
call pbuf_set_field(pbuf2d, rtp3_idx, 0.0_r8)
call pbuf_set_field(pbuf2d, thlp3_idx, 0.0_r8)
call pbuf_set_field(pbuf2d, up3_idx, 0.0_r8)
call pbuf_set_field(pbuf2d, vp3_idx, 0.0_r8)
-
+
call pbuf_set_field(pbuf2d, upwp_idx, 0.0_r8)
call pbuf_set_field(pbuf2d, vpwp_idx, 0.0_r8)
call pbuf_set_field(pbuf2d, wpthvp_idx, 0.0_r8)
@@ -1921,10 +1906,10 @@ subroutine clubb_ini_cam(pbuf2d)
call pbuf_set_field(pbuf2d, pdf_zm_mixt_frac_idx, 0.0_r8)
endif
-
+
! The following is physpkg, so it needs to be initialized every time
call pbuf_set_field(pbuf2d, fice_idx, 0.0_r8)
-
+
! --------------- !
! End !
! Initialization !
@@ -1932,19 +1917,19 @@ subroutine clubb_ini_cam(pbuf2d)
#endif
end subroutine clubb_ini_cam
-
-
+
+
! =============================================================================== !
! !
! =============================================================================== !
subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
- cmfmc, cam_in, &
+ cmfmc, cam_in, &
macmic_it, cld_macmic_num_steps,dlf, det_s, det_ice)
!-------------------------------------------------------------------------------
- ! Description: Provide tendencies of shallow convection, turbulence, and
+ ! Description: Provide tendencies of shallow convection, turbulence, and
! macrophysics from CLUBB to CAM
- !
+ !
! Author: Cheryl Craig, March 2011
! Modifications: Pete Bogenschutz, March 2011 and onward
! Origin: Based heavily on UWM clubb_init.F90
@@ -1957,15 +1942,15 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
physics_ptend_sum, physics_update, set_wet_to_dry
use physics_buffer, only: pbuf_old_tim_idx, pbuf_get_field, physics_buffer_desc
+ use physics_buffer, only: pbuf_set_field
use constituents, only: cnst_get_ind, cnst_type
use camsrfexch, only: cam_in_t
- use time_manager, only: is_first_step
+ use time_manager, only: is_first_step
use cam_abortutils, only: endrun
use cam_logfile, only: iulog
use tropopause, only: tropopause_findChemTrop
use time_manager, only: get_nstep, is_first_restart_step
-
#ifdef CLUBB_SGS
use hb_diff, only: pblintd
use scamMOD, only: single_column,scm_clubb_iop_name
@@ -2004,13 +1989,13 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
use macrop_driver, only: liquid_macro_tend
use clubb_mf, only: integrate_mf
-
+
use perf_mod
#endif
implicit none
-
+
! ---------------------------------------------------- !
! Input Auguments !
! ---------------------------------------------------- !
@@ -2022,11 +2007,11 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
real(r8), intent(in) :: cmfmc(pcols,pverp) ! convective mass flux--m sub c [kg/m2/s]
integer, intent(in) :: cld_macmic_num_steps ! number of mac-mic iterations
integer, intent(in) :: macmic_it ! number of mac-mic iterations
-
+
! ---------------------------------------------------- !
! Input-Output Auguments !
! ---------------------------------------------------- !
-
+
type(physics_buffer_desc), pointer :: pbuf(:)
! ---------------------------------------------------- !
@@ -2035,11 +2020,11 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
type(physics_ptend), intent(out) :: ptend_all ! package tendencies
- ! These two variables are needed for energy check
+ ! These two variables are needed for energy check
real(r8), intent(out) :: det_s(pcols) ! Integral of detrained static energy from ice
real(r8), intent(out) :: det_ice(pcols) ! Integral of detrained ice for energy check
-
+
! ---------------------------------------------------- !
! Local Variables !
! ---------------------------------------------------- !
@@ -2048,26 +2033,26 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
type(physics_state) :: state1 ! Local copy of state variable
type(physics_ptend) :: ptend_loc ! Local tendency from processes, added up to return as ptend_all
-
+
integer :: i, j, k, t, ixind, nadv
integer :: ixcldice, ixcldliq, ixnumliq, ixnumice, ixq
integer :: itim_old
integer :: ncol, lchnk ! # of columns, and chunk identifier
integer :: err_code ! Diagnostic, for if some calculation goes amiss.
- integer :: icnt
+ integer :: icnt
logical :: lq2(pcnst)
integer :: iter
-
+
integer :: clubbtop(pcols)
-
+
real(r8) :: frac_limit, ic_limit
- real(r8) :: dtime ! CLUBB time step [s]
- real(r8) :: zt_out(pcols,pverp) ! output for the thermo CLUBB grid [m]
+ real(r8) :: dtime ! CLUBB time step [s]
+ real(r8) :: zt_out(pcols,pverp) ! output for the thermo CLUBB grid [m]
real(r8) :: zi_out(pcols,pverp) ! output for momentum CLUBB grid [m]
real(r8) :: ubar ! surface wind [m/s]
- real(r8) :: ustar ! surface stress [m/s]
+ real(r8) :: ustar ! surface stress [m/s]
real(r8) :: z0 ! roughness height [m]
real(r8) :: bflx22(pcols) ! Variable for buoyancy flux for pbl [K m/s]
real(r8) :: qclvar(pcols,pverp) ! cloud water variance [kg^2/kg^2]
@@ -2087,7 +2072,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
upwp_sfc_pert, & ! perturbed u'w' at surface [m^2/s^2]
vpwp_sfc_pert, & ! perturbed v'w' at surface [m^2/s^2]
grid_dx, grid_dy ! CAM grid [m]
-
+
real(r8), dimension(state%ncol,sclr_dim) :: &
wpsclrp_sfc ! Scalar flux at surface [{units vary} m/s]
@@ -2098,7 +2083,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
! NOTE: THESE VARIABLS SHOULD NOT BE USED IN PBUF OR OUTFLD (HISTORY) SUBROUTINES
real(r8), dimension(state%ncol,pverp+1-top_lev) :: &
thlm_forcing, & ! theta_l forcing (thermodynamic levels) [K/s]
- rtm_forcing, & ! r_t forcing (thermodynamic levels) [(kg/kg)/s]
+ rtm_forcing, & ! r_t forcing (thermodynamic levels) [(kg/kg)/s]
um_forcing, & ! u wind forcing (thermodynamic levels) [m/s/s]
vm_forcing, & ! v wind forcing (thermodynamic levels) [m/s/s]
wprtp_forcing, &
@@ -2173,7 +2158,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
rcm_in_layer_out, & ! CLUBB output of in-cloud liq. wat. mix. ratio [kg/kg]
cloud_cover_out, & ! CLUBB output of in-cloud cloud fraction [fraction]
invrs_tau_zm_out, & ! CLUBB output of 1 divided by time-scale [1/s]
- rtp2_mc_out, & ! total water tendency from rain evap
+ rtp2_mc_out, & ! total water tendency from rain evap
thlp2_mc_out, & ! thetal tendency from rain evap
wprtp_mc_out, &
wpthlp_mc_out, &
@@ -2204,7 +2189,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
sclrprtp, & ! sclr'rt' (momentum levels) [{units vary} (kg/kg)]
sclrpthlp, & ! sclr'thlp' (momentum levels) [{units vary} (K)]
wpsclrp ! w'sclr' (momentum levels) [{units vary} m/s]
-
+
real(r8), dimension(state%ncol,pverp,sclr_dim) :: &
sclrpthvp_inout ! sclr'th_v' (momentum levels) [{units vary} (K)]
@@ -2249,7 +2234,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
real(r8) :: pdfp_rtp2(pcols, pverp) ! Calculated R-tot variance from pdf_params [kg^2/kg^2]
real(r8) :: rtp2_zt_out(pcols, pverp) ! CLUBB R-tot variance on thermo levs [kg^2/kg^2]
real(r8) :: thl2_zt_out(pcols, pverp) ! CLUBB Theta-l variance on thermo levs
- real(r8) :: wp2_zt_out(pcols, pverp)
+ real(r8) :: wp2_zt_out(pcols, pverp)
real(r8) :: dlf_liq_out(pcols, pverp) ! Detrained liquid water from ZM [kg/kg/s]
real(r8) :: dlf_ice_out(pcols, pverp) ! Detrained ice water from ZM [kg/kg/s]
real(r8) :: wm_zt_out(pcols, pverp) ! CLUBB mean W on thermo levs output [m/s]
@@ -2279,7 +2264,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
! ---------------------------------------------------- !
! Pointers !
! ---------------------------------------------------- !
-
+
real(r8), pointer, dimension(:,:) :: wp2 ! vertical velocity variance [m^2/s^2]
real(r8), pointer, dimension(:,:) :: wp3 ! third moment of vertical velocity [m^3/s^3]
real(r8), pointer, dimension(:,:) :: wpthlp ! turbulent flux of thetal [m/s K]
@@ -2329,16 +2314,16 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
real(r8), pointer, dimension(:,:) :: qlst ! Physical in-stratus LWC [kg/kg]
real(r8), pointer, dimension(:,:) :: qist ! Physical in-stratus IWC [kg/kg]
real(r8), pointer, dimension(:,:) :: deepcu ! deep convection cloud fraction [fraction]
- real(r8), pointer, dimension(:,:) :: shalcu ! shallow convection cloud fraction [fraction]
+ real(r8), pointer, dimension(:,:) :: shalcu ! shallow convection cloud fraction [fraction]
real(r8), pointer, dimension(:,:) :: khzm ! CLUBB's eddy diffusivity of heat/moisture on momentum (i.e. interface) levels [m^2/s]
real(r8), pointer, dimension(:) :: pblh ! planetary boundary layer height [m]
real(r8), pointer, dimension(:,:) :: tke ! turbulent kinetic energy [m^2/s^2]
real(r8), pointer, dimension(:,:) :: dp_icwmr ! deep convection in cloud mixing ratio [kg/kg]
- real(r8), pointer, dimension(:,:) :: ice_supersat_frac ! Cloud fraction of ice clouds (pverp)[fraction]
+ real(r8), pointer, dimension(:,:) :: ice_supersat_frac ! Cloud fraction of ice clouds (pverp)[fraction]
real(r8), pointer, dimension(:,:) :: relvar ! relative cloud water variance [-]
real(r8), pointer, dimension(:,:) :: accre_enhan ! accretion enhancement factor [-]
real(r8), pointer, dimension(:,:) :: naai
- real(r8), pointer, dimension(:,:) :: cmeliq
+ real(r8), pointer, dimension(:,:) :: cmeliq
real(r8), pointer, dimension(:,:) :: cmfmc_sh ! Shallow convective mass flux--m subc (pcols,pverp) [kg/m2/s/]
real(r8), pointer, dimension(:,:) :: qsatfac
@@ -2420,13 +2405,13 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
intrinsic :: max
character(len=*), parameter :: subr='clubb_tend_cam'
-
+
type(grid) :: gr
integer :: begin_height, end_height
-
+
type(nu_vertical_res_dep) :: nu_vert_res_dep ! Vertical resolution dependent nu values
real(r8) :: lmin
-
+
#endif
det_s(:) = 0.0_r8
det_ice(:) = 0.0_r8
@@ -2447,7 +2432,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
pdfp_rtp2 = 0._r8
wm_zt_out = 0._r8
- temp2d = 0._r8
+ temp2d = 0._r8
temp2dp = 0._r8
dl_rad = clubb_detliq_rad
@@ -2458,7 +2443,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
ic_limit = 1.e-12_r8
inv_rh2o = 1._r8/rh2o
- if (clubb_do_adv) then
+ if (clubb_do_adv) then
apply_const = 1._r8 ! Initialize to one, only if CLUBB's moments are advected
else
apply_const = 0._r8 ! Never want this if CLUBB's moments are not advected
@@ -2495,7 +2480,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
! Determine time step of physics buffer
itim_old = pbuf_old_tim_idx()
- ! Establish associations between pointers and physics buffer fields
+ ! Establish associations between pointers and physics buffer fields
call pbuf_get_field(pbuf, wp2_idx, wp2, start=(/1,1,itim_old/), kount=(/pcols,pverp,1/))
call pbuf_get_field(pbuf, wp3_idx, wp3, start=(/1,1,itim_old/), kount=(/pcols,pverp,1/))
call pbuf_get_field(pbuf, wpthlp_idx, wpthlp, start=(/1,1,itim_old/), kount=(/pcols,pverp,1/))
@@ -2540,7 +2525,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
call pbuf_get_field(pbuf, rtm_idx, rtm, start=(/1,1,itim_old/), kount=(/pcols,pverp,1/))
call pbuf_get_field(pbuf, um_idx, um, start=(/1,1,itim_old/), kount=(/pcols,pverp,1/))
call pbuf_get_field(pbuf, vm_idx, vm, start=(/1,1,itim_old/), kount=(/pcols,pverp,1/))
-
+
call pbuf_get_field(pbuf, tke_idx, tke)
call pbuf_get_field(pbuf, qrl_idx, qrl)
call pbuf_get_field(pbuf, radf_idx, radf_clubb)
@@ -2574,13 +2559,13 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
call pbuf_get_field(pbuf, wprtp_mc_zt_idx, wprtp_mc_zt)
call pbuf_get_field(pbuf, wpthlp_mc_zt_idx, wpthlp_mc_zt)
call pbuf_get_field(pbuf, rtpthlp_mc_zt_idx, rtpthlp_mc_zt)
-
+
! Allocate pdf_params only if they aren't allocated already.
if ( .not. allocated(pdf_params_chnk(lchnk)%mixt_frac) ) then
call init_pdf_params_api( pverp+1-top_lev, ncol, pdf_params_chnk(lchnk) )
call init_pdf_params_api( pverp+1-top_lev, ncol, pdf_params_zm_chnk(lchnk) )
end if
-
+
if ( .not. allocated(pdf_implicit_coefs_terms_chnk(lchnk)%coef_wp4_implicit) ) then
call init_pdf_implicit_coefs_terms_api( pverp+1-top_lev, ncol, sclr_dim, &
pdf_implicit_coefs_terms_chnk(lchnk) )
@@ -2588,15 +2573,15 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
! Initialize the apply_const variable (note special logic is due to eularian backstepping)
if (clubb_do_adv .and. (is_first_step() .or. all(wpthlp(1:ncol,1:pver) == 0._r8))) then
- apply_const = 0._r8 ! On first time through do not remove constant
- ! from moments since it has not been added yet
+ apply_const = 0._r8 ! On first time through do not remove constant
+ ! from moments since it has not been added yet
endif
! Set the ztodt timestep in pbuf for SILHS
ztodtptr(:) = 1.0_r8*hdtime
! Define the grid box size. CLUBB needs this information to determine what
- ! the maximum length scale should be. This depends on the column for
+ ! the maximum length scale should be. This depends on the column for
! variable mesh grids and lat-lon grids
if (single_column) then
! If single column specify grid box size to be something
@@ -2604,7 +2589,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
grid_dx(:) = 100000._r8
grid_dy(:) = 100000._r8
else
-
+
call grid_size(state1, grid_dx, grid_dy)
end if
@@ -2619,11 +2604,11 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
lq2(1) = .TRUE.
lq2(ixcldice) = .TRUE.
lq2(ixnumice) = .TRUE.
-
+
latsub = latvap + latice
-
+
call physics_ptend_init(ptend_loc, state%psetcols, 'iceadj', ls=.true., lq=lq2 )
-
+
stend(:ncol,:)=0._r8
qvtend(:ncol,:)=0._r8
qitend(:ncol,:)=0._r8
@@ -2637,9 +2622,9 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
! update local copy of state with the tendencies
ptend_loc%q(:ncol,top_lev:pver,1)=qvtend(:ncol,top_lev:pver)
- ptend_loc%q(:ncol,top_lev:pver,ixcldice)=qitend(:ncol,top_lev:pver)
+ ptend_loc%q(:ncol,top_lev:pver,ixcldice)=qitend(:ncol,top_lev:pver)
ptend_loc%q(:ncol,top_lev:pver,ixnumice)=initend(:ncol,top_lev:pver)
- ptend_loc%s(:ncol,top_lev:pver)=stend(:ncol,top_lev:pver)
+ ptend_loc%s(:ncol,top_lev:pver)=stend(:ncol,top_lev:pver)
! Add the ice tendency to the output tendency
call physics_ptend_sum(ptend_loc, ptend_all, ncol)
@@ -2653,56 +2638,56 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
call outfld( 'QVTENDICE', qvtend, pcols, lchnk )
call outfld( 'QITENDICE', qitend, pcols, lchnk )
call outfld( 'NITENDICE', initend, pcols, lchnk )
-
+
endif
! Determine CLUBB time step and make it sub-step friendly
- ! For now we want CLUBB time step to be 5 min since that is
+ ! For now we want CLUBB time step to be 5 min since that is
! what has been scientifically validated. However, there are certain
- ! instances when a 5 min time step will not be possible (based on
+ ! instances when a 5 min time step will not be possible (based on
! host model time step or on macro-micro sub-stepping
- dtime = clubb_timestep
-
- ! Now check to see if dtime is greater than the host model
- ! (or sub stepped) time step. If it is, then simply
- ! set it equal to the host (or sub step) time step.
+ dtime = clubb_timestep
+
+ ! Now check to see if dtime is greater than the host model
+ ! (or sub stepped) time step. If it is, then simply
+ ! set it equal to the host (or sub step) time step.
! This section is mostly to deal with small host model
- ! time steps (or small sub-steps)
+ ! time steps (or small sub-steps)
if (dtime > hdtime) then
dtime = hdtime
endif
-
+
! Now check to see if CLUBB time step divides evenly into
! the host model time step. If not, force it to divide evenly.
! We also want it to be 5 minutes or less. This section is
! mainly for host model time steps that are not evenly divisible
- ! by 5 minutes
+ ! by 5 minutes
if (mod(hdtime,dtime) .ne. 0) then
dtime = hdtime/2._r8
- do while (dtime > clubb_timestep)
+ do while (dtime > clubb_timestep)
dtime = dtime/2._r8
end do
- endif
+ endif
! If resulting host model time step and CLUBB time step do not divide evenly
- ! into each other, have model throw a fit.
+ ! into each other, have model throw a fit.
if (mod(hdtime,dtime) .ne. 0) then
call endrun(subr//': CLUBB time step and HOST time step NOT compatible')
endif
-
- ! determine number of timesteps CLUBB core should be advanced,
- ! host time step divided by CLUBB time step
+
+ ! determine number of timesteps CLUBB core should be advanced,
+ ! host time step divided by CLUBB time step
nadv = max(hdtime/dtime,1._r8)
-
- ! Initialize forcings for transported scalars to zero
+
+ ! Initialize forcings for transported scalars to zero
sclrm_forcing(:,:,:) = 0._r8
edsclrm_forcing(:,:,:) = 0._r8
sclrm(:,:,:) = 0._r8
-
+
! Compute inverse exner function consistent with CLUBB's definition, which uses a constant
- ! surface pressure. CAM's exner (in state) does not. Therefore, for consistent
- ! treatment with CLUBB code, anytime exner is needed to treat CLUBB variables
+ ! surface pressure. CAM's exner (in state) does not. Therefore, for consistent
+ ! treatment with CLUBB code, anytime exner is needed to treat CLUBB variables
! (such as thlm), use "inv_exner_clubb" otherwise use the exner in state
do k=1,pver
do i=1,ncol
@@ -2716,8 +2701,8 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
inv_exner_clubb_surf(i) = 1._r8/((state1%pmid(i,pver)/p0_clubb)**(rairv(i,pver,lchnk)/cpairv(i,pver,lchnk)))
enddo
- ! At each CLUBB call, initialize mean momentum and thermo CLUBB state
- ! from the CAM state
+ ! At each CLUBB call, initialize mean momentum and thermo CLUBB state
+ ! from the CAM state
do k=1,pver ! loop over levels
do i=1,ncol ! loop over columns
@@ -2730,11 +2715,11 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
* inv_exner_clubb(i,k)
if (clubb_do_adv) then
- if (macmic_it == 1) then
+ if (macmic_it == 1) then
- ! Note that some of the moments below can be positive or negative.
- ! Remove a constant that was added to prevent dynamics from clipping
- ! them to prevent dynamics from making them positive.
+ ! Note that some of the moments below can be positive or negative.
+ ! Remove a constant that was added to prevent dynamics from clipping
+ ! them to prevent dynamics from making them positive.
thlp2(i,k) = state1%q(i,k,ixthlp2)
rtp2(i,k) = state1%q(i,k,ixrtp2)
rtpthlp(i,k) = state1%q(i,k,ixrtpthlp) - (rtpthlp_const*apply_const)
@@ -2749,23 +2734,23 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
enddo
enddo
-
+
if (clubb_do_adv) then
- ! If not last step of macmic loop then set apply_const back to
- ! zero to prevent output from being corrupted.
- if (macmic_it == cld_macmic_num_steps) then
- apply_const = 1._r8
+ ! If not last step of macmic loop then set apply_const back to
+ ! zero to prevent output from being corrupted.
+ if (macmic_it == cld_macmic_num_steps) then
+ apply_const = 1._r8
else
apply_const = 0._r8
endif
- endif
+ endif
rtm(1:ncol,pverp) = rtm(1:ncol,pver)
um(1:ncol,pverp) = state1%u(1:ncol,pver)
vm(1:ncol,pverp) = state1%v(1:ncol,pver)
thlm(1:ncol,pverp) = thlm(1:ncol,pver)
-
- if (clubb_do_adv) then
+
+ if (clubb_do_adv) then
thlp2(1:ncol,pverp) = thlp2(1:ncol,pver)
rtp2(1:ncol,pverp) = rtp2(1:ncol,pver)
rtpthlp(1:ncol,pverp) = rtpthlp(1:ncol,pver)
@@ -2777,7 +2762,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
vp2(1:ncol,pverp) = vp2(1:ncol,pver)
endif
- ! Compute virtual potential temperature, which is needed for CLUBB
+ ! Compute virtual potential temperature, which is needed for CLUBB
do k=1,pver
do i=1,ncol
thv(i,k) = state1%t(i,k)*inv_exner_clubb(i,k)*(1._r8+zvir*state1%q(i,k,ixq)&
@@ -2815,24 +2800,24 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
mf_thlflx_output(:,:) = 0._r8
mf_qtflx_output(:,:) = 0._r8
end if
-
+
call t_startf("clubb_tend_cam_i_loop")
! Determine Coriolis force at given latitude. This is never used
! when CLUBB is implemented in a host model, therefore just set
! to zero.
- fcor(:) = 0._r8
+ fcor(:) = 0._r8
! Define the CLUBB momentum grid (in height, units of m)
do k=1, nlev+1
- do i=1, ncol
+ do i=1, ncol
zi_g(i,k) = state1%zi(i,pverp-k+1)-state1%zi(i,pver+1)
- end do
+ end do
end do
! Define the CLUBB thermodynamic grid (in units of m)
do k=1, nlev
- do i=1, ncol
+ do i=1, ncol
zt_g(i,k+1) = state1%zm(i,pver-k+1)-state1%zi(i,pver+1)
end do
end do
@@ -2842,18 +2827,18 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
dz_g(i,k) = state1%zi(i,k)-state1%zi(i,k+1) ! compute thickness
end do
end do
-
- ! Thermodynamic ghost point is below surface
+
+ ! Thermodynamic ghost point is below surface
do i=1, ncol
zt_g(i,1) = -1._r8*zt_g(i,2)
end do
-
+
do i=1, ncol
! Set the elevation of the surface
sfc_elevation(i) = state1%zi(i,pver+1)
end do
- ! Compute thermodynamic stuff needed for CLUBB on thermo levels.
+ ! Compute thermodynamic stuff needed for CLUBB on thermo levels.
! Inputs for the momentum levels are set below setup_clubb core
do k=1,nlev
do i=1, ncol
@@ -2862,7 +2847,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
invrs_rho_ds_zt(i,k+1) = 1._r8/(rho_ds_zt(i,k+1))
! full state (moist) variables
- p_in_Pa(i,k+1) = state1%pmid(i,pver-k+1)
+ p_in_Pa(i,k+1) = state1%pmid(i,pver-k+1)
exner(i,k+1) = 1._r8/inv_exner_clubb(i,pver-k+1)
thv(i,k+1) = state1%t(i,pver-k+1)*inv_exner_clubb(i,pver-k+1)*(1._r8+zvir*state1%q(i,pver-k+1,ixq) &
-state1%q(i,pver-k+1,ixcldliq))
@@ -2871,13 +2856,13 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
! exception - setting this to moist thv
thv_ds_zt(i,k+1) = thv(i,k+1)
- rfrzm(i,k+1) = state1%q(i,pver-k+1,ixcldice)
+ rfrzm(i,k+1) = state1%q(i,pver-k+1,ixcldice)
radf(i,k+1) = radf_clubb(i,pver-k+1)
qrl_clubb(i,k+1) = qrl(i,pver-k+1)/(cpairv(i,k,lchnk)*state1%pdeldry(i,pver-k+1))
end do
end do
-
- ! Compute mean w wind on thermo grid, convert from omega to w
+
+ ! Compute mean w wind on thermo grid, convert from omega to w
do k=1,nlev
do i=1,ncol
wm_zt(i,k+1) = -1._r8*(state1%omega(i,pver-k+1)-state1%omega(i,pver))/(rho_zt(i,k+1)*gravit)
@@ -2899,8 +2884,8 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
qrl_clubb(i,1) = qrl_clubb(i,2)
wm_zt(i,1) = wm_zt(i,2)
end do
-
-
+
+
! ------------------------------------------------- !
! Begin case specific code for SCAM cases. !
! This section of code block is NOT called in !
@@ -2918,21 +2903,21 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
! Compute surface wind (ubar)
ubar = sqrt(um(1,pver)**2+vm(1,pver)**2)
if (ubar < 0.25_r8) ubar = 0.25_r8
-
+
! Below denotes case specifics for surface momentum
! and thermodynamic fluxes, depending on the case
- ! Define ustar (based on case, if not variable)
+ ! Define ustar (based on case, if not variable)
ustar = 0.25_r8 ! Initialize ustar in case no case
-
+
if(trim(scm_clubb_iop_name) == 'BOMEX_5day') then
ustar = 0.28_r8
endif
-
+
if(trim(scm_clubb_iop_name) == 'ATEX_48hr') then
ustar = 0.30_r8
endif
-
+
if(trim(scm_clubb_iop_name) == 'RICO_3day') then
ustar = 0.28_r8
endif
@@ -2940,23 +2925,23 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
if(trim(scm_clubb_iop_name) == 'arm97' .or. trim(scm_clubb_iop_name) == 'gate' .or. &
trim(scm_clubb_iop_name) == 'toga' .or. trim(scm_clubb_iop_name) == 'mpace' .or. &
trim(scm_clubb_iop_name) == 'ARM_CC') then
-
+
bflx22(1) = (gravit/theta0)*wpthlp_sfc(1)
- ustar = diag_ustar(zt_g(1,2),bflx22(1),ubar,zo(1))
+ ustar = diag_ustar(zt_g(1,2),bflx22(1),ubar,zo(1))
endif
-
- ! Compute the surface momentum fluxes, if this is a SCAM simulation
+
+ ! Compute the surface momentum fluxes, if this is a SCAM simulation
upwp_sfc(1) = -um(1,pver)*ustar**2/ubar
vpwp_sfc(1) = -vm(1,pver)*ustar**2/ubar
-
+
end if
- ! Define surface sources for transported variables for diffusion, will
+ ! Define surface sources for transported variables for diffusion, will
! be zero as these tendencies are done in vertical_diffusion
do ixind=1,edsclr_dim
do i=1,ncol
wpedsclrp_sfc(i,ixind) = 0._r8
- end do
+ end do
end do
! Set stats output and increment equal to CLUBB and host dt
@@ -2965,10 +2950,10 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
stats_nsamp = nint(stats_tsamp/dtime)
stats_nout = nint(stats_tout/dtime)
-
- ! Heights need to be set at each timestep. Therefore, recall
- ! setup_grid and setup_parameters for this.
-
+
+ ! Heights need to be set at each timestep. Therefore, recall
+ ! setup_grid and setup_parameters for this.
+
! Set-up CLUBB core at each CLUBB call because heights can change
! Important note: do not make any calls that use CLUBB grid-height
! operators (such as zt2zm_api, etc.) until AFTER the
@@ -3001,7 +2986,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
vm_ref(:,:) = 0.0_r8
ug(:,:) = 0.0_r8
vg(:,:) = 0.0_r8
-
+
! Add forcings for SILHS covariance contributions
rtp2_forcing = zt2zm_api( pverp+1-top_lev, ncol, gr, rtp2_mc_zt(1:ncol,:) )
thlp2_forcing = zt2zm_api( pverp+1-top_lev, ncol, gr, thlp2_mc_zt(1:ncol,:) )
@@ -3015,7 +3000,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
wprtp_mc_zt(:,:) = 0.0_r8
wpthlp_mc_zt(:,:) = 0.0_r8
rtpthlp_mc_zt(:,:) = 0.0_r8
-
+
! Compute some inputs from the thermodynamic grid
! to the momentum grid
@@ -3024,9 +3009,9 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
invrs_rho_ds_zm = zt2zm_api( pverp+1-top_lev, ncol, gr, invrs_rho_ds_zt )
thv_ds_zm = zt2zm_api( pverp+1-top_lev, ncol, gr, thv_ds_zt )
wm_zm = zt2zm_api( pverp+1-top_lev, ncol, gr, wm_zt )
-
+
! Surface fluxes provided by host model
- do i=1,ncol
+ do i=1,ncol
wpthlp_sfc(i) = cam_in%shf(i)/(cpairv(i,pver,lchnk)*rho_ds_zm(i,1)) ! Sensible heat flux
wpthlp_sfc(i) = wpthlp_sfc(i)*inv_exner_clubb_surf(i) ! Potential temperature flux
wprtp_sfc(i) = cam_in%cflx(i,1)/rho_ds_zm(i,1) ! Moisture flux
@@ -3042,7 +3027,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
call calc_ustar( state1%t(i,pver), state1%pmid(i,pver), cam_in%wsx(i), cam_in%wsy(i), &
rrho(i), ustar )
-
+
upwp_sfc(i) = -state1%u(i,pver)*ustar**2/ubar
vpwp_sfc(i) = -state1%v(i,pver)*ustar**2/ubar
end do
@@ -3056,12 +3041,12 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
! Perturbed winds are not used in CAM
upwp_sfc_pert = 0.0_r8
vpwp_sfc_pert = 0.0_r8
-
+
! Need to flip arrays around for CLUBB core
do k=1,nlev+1
do i=1,ncol
- um_in(i,k) = um(i,pverp-k+1)
- vm_in(i,k) = vm(i,pverp-k+1)
+ um_in(i,k) = um(i,pverp-k+1)
+ vm_in(i,k) = vm(i,pverp-k+1)
upwp_in(i,k) = upwp(i,pverp-k+1)
vpwp_in(i,k) = vpwp(i,pverp-k+1)
wpthvp_in(i,k) = wpthvp(i,pverp-k+1)
@@ -3120,13 +3105,13 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
vm_pert_inout = 0.0_r8
upwp_pert_inout = 0.0_r8
vpwp_pert_inout = 0.0_r8
-
+
do k=2,nlev+1
do i=1,ncol
pre_in(i,k) = prer_evap(i,pverp-k+1)
end do
end do
-
+
do i=1,ncol
pre_in(i,1) = pre_in(i,2)
end do
@@ -3134,7 +3119,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
do i=1,ncol
rcm_inout(i,1) = rcm_inout(i,2)
end do
-
+
! Initialize these to prevent crashing behavior
do k=1,nlev+1
do i=1,ncol
@@ -3161,7 +3146,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
end do
end do
end do
-
+
do ixind=1, hydromet_dim
do k=1, nlev+1
do i=1, ncol
@@ -3176,7 +3161,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
! pressure,exner on momentum grid needed for mass flux calc.
if (do_clubb_mf) then
-
+
do k=1,pver
do i=1,ncol
kappa_zt(i,k+1) = (rairv(i,pver-k+1,lchnk)/cpairv(i,pver-k+1,lchnk))
@@ -3184,7 +3169,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
invrs_exner_zt(i,k+1) = inv_exner_clubb(i,pver-k+1)
end do
end do
-
+
do i=1,ncol
kappa_zt(i,1) = kappa_zt(i,2)
qc_zt(i,1) = qc_zt(i,2)
@@ -3192,21 +3177,21 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
end do
kappa_zm(1:ncol,:) = zt2zm_api(pverp+1-top_lev, ncol, gr, kappa_zt(1:ncol,:))
-
+
do k=1,pverp
do i=1,ncol
p_in_Pa_zm(i,k) = state1%pint(i,pverp-k+1)
invrs_exner_zm(i,k) = 1._r8/((p_in_Pa_zm(i,k)/p0_clubb)**(kappa_zm(i,k)))
end do
end do
-
+
end if
-
-
+
+
if (clubb_do_adv) then
if (macmic_it == 1) then
-
- wp2_in = zt2zm_api(pverp+1-top_lev, ncol, gr, wp2_in )
+
+ wp2_in = zt2zm_api(pverp+1-top_lev, ncol, gr, wp2_in )
wpthlp_in = zt2zm_api(pverp+1-top_lev, ncol, gr, wpthlp_in )
wprtp_in = zt2zm_api(pverp+1-top_lev, ncol, gr, wprtp_in )
up2_in = zt2zm_api(pverp+1-top_lev, ncol, gr, up2_in )
@@ -3224,49 +3209,49 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
vp2_in(i,k) = max(w_tol_sqd,vp2_in(i,k))
end do
end do
-
+
end if
end if
- ! Do the same for tracers
+ ! Do the same for tracers
icnt=0
do ixind=1,pcnst
- if (lq(ixind)) then
-
+ if (lq(ixind)) then
+
icnt = icnt+1
-
+
do k=1,nlev
do i=1,ncol
edsclr_in(i,k+1,icnt) = state1%q(i,pver-k+1,ixind)
end do
end do
-
+
do i=1,ncol
edsclr_in(i,1,icnt) = edsclr_in(i,2,icnt)
end do
-
+
end if
end do
-
- if (clubb_l_do_expldiff_rtm_thlm) then
+
+ if (clubb_l_do_expldiff_rtm_thlm) then
do k=1,nlev
do i=1, ncol
edsclr_in(i,k+1,icnt+1) = thlm(i,pver-k+1)
edsclr_in(i,k+1,icnt+2) = rtm(i,pver-k+1)
end do
end do
-
+
do i=1, ncol
edsclr_in(i,1,icnt+1) = edsclr_in(i,2,icnt+1)
- edsclr_in(i,1,icnt+2) = edsclr_in(i,2,icnt+2)
+ edsclr_in(i,1,icnt+2) = edsclr_in(i,2,icnt+2)
end do
-
+
endif
do t=1,nadv ! do needed number of "sub" timesteps for each CAM step
-
+
! Increment the statistics then being stats timestep
if (l_stats) then
call stats_begin_timestep_api(t, stats_nsamp, stats_nout)
@@ -3276,18 +3261,18 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
!###################### CALL MF DIAGNOSTIC PLUMES ######################
!#######################################################################
if (do_clubb_mf) then
-
+
do k=2,pverp
do i=1, ncol
dzt(i,k) = zi_g(i,k) - zi_g(i,k-1)
end do
end do
-
+
do i=1, ncol
dzt(i,1) = dzt(i,2)
invrs_dzt(i,:) = 1._r8/dzt(i,:)
end do
-
+
rtm_zm_in(1:ncol,:) = zt2zm_api( pverp+1-top_lev, ncol, gr, rtm_in(1:ncol,:) )
thlm_zm_in(1:ncol,:) = zt2zm_api( pverp+1-top_lev, ncol, gr, thlm_in(1:ncol,:) )
@@ -3316,19 +3301,19 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
rtm_forcing(i,1) = 0._r8
thlm_forcing(i,1)= 0._r8
end do
-
+
do k=2,pverp
do i=1, ncol
rtm_forcing(i,k) = rtm_forcing(i,k) - invrs_rho_ds_zt(i,k) * invrs_dzt(i,k) * &
((rho_ds_zm(i,k) * mf_qtflx(i,k)) - (rho_ds_zm(i,k-1) * mf_qtflx(i,k-1)))
-
+
thlm_forcing(i,k) = thlm_forcing(i,k) - invrs_rho_ds_zt(i,k) * invrs_dzt(i,k) * &
((rho_ds_zm(i,k) * mf_thlflx(i,k)) - (rho_ds_zm(i,k-1) * mf_thlflx(i,k-1)))
end do
end do
end if
-
+
! Advance CLUBB CORE one timestep in the future
call advance_clubb_core_api( gr, pverp+1-top_lev, ncol, &
l_implemented, dtime, fcor, sfc_elevation, hydromet_dim, &
@@ -3370,7 +3355,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
wprcp_out, w_up_in_cloud_out, w_down_in_cloud_out, &
cloudy_updraft_frac_out, cloudy_downdraft_frac_out, &
rcm_in_layer_out, cloud_cover_out, invrs_tau_zm_out )
-
+
! Note that CLUBB does not produce an error code specific to any column, and
! one value only for the entire chunk
if ( err_code == clubb_fatal_error ) then
@@ -3379,15 +3364,15 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
write(fstderr,*) "LON: Range:", state1%lon(1), " -- ", state1%lon(ncol)
call endrun(subr//': Fatal error in CLUBB library')
end if
-
+
if (do_rainturb) then
-
+
do k=1,nlev+1
do i=1,ncol
- rvm_in(i,k) = rtm_in(i,k) - rcm_inout(i,k)
+ rvm_in(i,k) = rtm_in(i,k) - rcm_inout(i,k)
end do
end do
-
+
call update_xp2_mc_api( gr, nlev+1, ncol, dtime, cloud_frac_inout, &
rcm_inout, rvm_in, thlm_in, wm_zt, &
exner, pre_in, pdf_params_chnk(lchnk), &
@@ -3399,35 +3384,35 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
do i=1,ncol
dum1 = (1._r8 - cam_in%landfrac(i))
- ! update turbulent moments based on rain evaporation
+ ! update turbulent moments based on rain evaporation
rtp2_in(i,k) = rtp2_in(i,k) + clubb_rnevap_effic * dum1 * rtp2_mc_out(i,k) * dtime
- thlp2_in(i,k) = thlp2_in(i,k) + clubb_rnevap_effic * dum1 * thlp2_mc_out(i,k) * dtime
+ thlp2_in(i,k) = thlp2_in(i,k) + clubb_rnevap_effic * dum1 * thlp2_mc_out(i,k) * dtime
wprtp_in(i,k) = wprtp_in(i,k) + clubb_rnevap_effic * dum1 * wprtp_mc_out(i,k) * dtime
wpthlp_in(i,k) = wpthlp_in(i,k) + clubb_rnevap_effic * dum1 * wpthlp_mc_out(i,k) * dtime
end do
end do
-
- end if
-
+
+ end if
+
if (do_cldcool) then
-
+
rcm_out_zm = zt2zm_api(pverp+1-top_lev, ncol, gr, rcm_inout )
qrl_zm = zt2zm_api(pverp+1-top_lev, ncol, gr, qrl_clubb )
thlp2_rad_out(:,:) = 0._r8
-
+
do i=1, ncol
call calculate_thlp2_rad_api(nlev+1, rcm_out_zm(i,:), thlprcp_out(i,:), qrl_zm(i,:), clubb_params, &
thlp2_rad_out(i,:))
end do
-
+
do i=1, ncol
thlp2_in(i,:) = thlp2_in(i,:) + thlp2_rad_out(i,:) * dtime
thlp2_in(i,:) = max(thl_tol**2,thlp2_in(i,:))
end do
-
+
end if
-
+
! Check to see if stats should be output, here stats are read into
! output arrays to make them conformable to CAM output
if (l_stats) then
@@ -3440,16 +3425,16 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
enddo ! end time loop
if (clubb_do_adv) then
- if (macmic_it == cld_macmic_num_steps) then
-
- wp2_in = zm2zt_api( pverp+1-top_lev, ncol, gr, wp2_in )
+ if (macmic_it == cld_macmic_num_steps) then
+
+ wp2_in = zm2zt_api( pverp+1-top_lev, ncol, gr, wp2_in )
wpthlp_in = zm2zt_api( pverp+1-top_lev, ncol, gr, wpthlp_in )
wprtp_in = zm2zt_api( pverp+1-top_lev, ncol, gr, wprtp_in )
up2_in = zm2zt_api( pverp+1-top_lev, ncol, gr, up2_in )
vp2_in = zm2zt_api( pverp+1-top_lev, ncol, gr, vp2_in )
thlp2_in = zm2zt_api( pverp+1-top_lev, ncol, gr, thlp2_in )
rtp2_in = zm2zt_api( pverp+1-top_lev, ncol, gr, rtp2_in )
- rtpthlp_in = zm2zt_api( pverp+1-top_lev, ncol, gr, rtpthlp_in )
+ rtpthlp_in = zm2zt_api( pverp+1-top_lev, ncol, gr, rtpthlp_in )
do k=1,nlev+1
do i=1, ncol
@@ -3460,16 +3445,16 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
vp2_in(i,k) = max(w_tol_sqd, vp2_in(i,k))
end do
end do
-
+
end if
end if
-
+
! Convert RTP2 and THLP2 to thermo grid for output
rtp2_zt = zm2zt_api( pverp+1-top_lev, ncol, gr, rtp2_in )
thl2_zt = zm2zt_api( pverp+1-top_lev, ncol, gr, thlp2_in )
wp2_zt = zm2zt_api( pverp+1-top_lev, ncol, gr, wp2_in )
- ! Arrays need to be "flipped" to CAM grid
+ ! Arrays need to be "flipped" to CAM grid
do k=1, nlev+1
do i=1, ncol
um(i,pverp-k+1) = um_in(i,k)
@@ -3525,18 +3510,18 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
rtp2_zt_out(i,pverp-k+1) = rtp2_zt(i,k)
thl2_zt_out(i,pverp-k+1) = thl2_zt(i,k)
wp2_zt_out(i,pverp-k+1) = wp2_zt(i,k)
-
+
end do
end do
do k=1, nlev+1
do i=1, ncol
-
+
mean_rt = pdf_params_chnk(lchnk)%mixt_frac(i,k) &
* pdf_params_chnk(lchnk)%rt_1(i,k) &
+ ( 1.0_r8 - pdf_params_chnk(lchnk)%mixt_frac(i,k) ) &
* pdf_params_chnk(lchnk)%rt_2(i,k)
-
+
pdfp_rtp2(i,pverp-k+1) = pdf_params_chnk(lchnk)%mixt_frac(i,k) &
* ( ( pdf_params_chnk(lchnk)%rt_1(i,k) - mean_rt )**2 &
+ pdf_params_chnk(lchnk)%varnce_rt_1(i,k) ) &
@@ -3602,18 +3587,18 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
khzm(i,k) = 0._r8
qclvar(i,k) = 2._r8
end do
- end do
+ end do
! enforce zero tracer tendencies above the top_lev level -- no change
icnt=0
do ixind=1,pcnst
- if (lq(ixind)) then
+ if (lq(ixind)) then
icnt=icnt+1
-
+
do i=1, ncol
edsclr_out(i,:top_lev-1,icnt) = state1%q(i,:top_lev-1,ixind)
end do
-
+
end if
end do
@@ -3631,7 +3616,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
end do
! Section below is concentrated on energy fixing for conservation.
- ! because CLUBB and CAM's thermodynamic variables are different.
+ ! because CLUBB and CAM's thermodynamic variables are different.
! Initialize clubbtop to top_lev, for finding the highlest level CLUBB is
! active for informing where to apply the energy fixer.
@@ -3639,16 +3624,23 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
clubbtop(i) = top_lev
do while ((rtp2(i,clubbtop(i)) <= 1.e-15_r8 .and. rcm(i,clubbtop(i)) == 0._r8) .and. clubbtop(i) < pver)
clubbtop(i) = clubbtop(i) + 1
- end do
+ end do
end do
-
+ !
+ ! set pbuf field so that HB scheme is only applied above CLUBB top
+ !
+ if (do_hb_above_clubb) then
+ call pbuf_set_field(pbuf, clubbtop_idx, clubbtop)
+ endif
+
+
! Compute integrals for static energy, kinetic energy, water vapor, and liquid water
! after CLUBB is called. This is for energy conservation purposes.
se_a(:) = 0._r8
ke_a(:) = 0._r8
wv_a(:) = 0._r8
wl_a(:) = 0._r8
-
+
do k=1,pver
do i=1, ncol
se_a(i) = se_a(i) + clubb_s(i,k)*state1%pdel(i,k)*rga
@@ -3656,14 +3648,14 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
wv_a(i) = wv_a(i) + (rtm(i,k)-rcm(i,k))*state1%pdeldry(i,k)*rga
wl_a(i) = wl_a(i) + (rcm(i,k))*state1%pdeldry(i,k)*rga
end do
- end do
-
+ end do
+
! Do the same as above, but for before CLUBB was called.
se_b(:) = 0._r8
ke_b(:) = 0._r8
wv_b(:) = 0._r8
- wl_b(:) = 0._r8
-
+ wl_b(:) = 0._r8
+
do k=1, pver
do i=1, ncol
se_b(i) = se_b(i) + state1%s(i,k)*state1%pdel(i,k)*rga
@@ -3672,23 +3664,23 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
wl_b(i) = wl_b(i) + state1%q(i,k,ixcldliq)*state1%pdeldry(i,k)*rga
end do
end do
-
-
+
+
do i=1, ncol
! Based on these integrals, compute the total energy before and after CLUBB call
te_a(i) = se_a(i) + ke_a(i) + (latvap+latice) * wv_a(i) + latice * wl_a(i)
te_b(i) = se_b(i) + ke_b(i) + (latvap+latice) * wv_b(i) + latice * wl_b(i)
-
+
! Take into account the surface fluxes of heat and moisture
! Use correct qflux from cam_in, not lhf/latvap as was done previously
- te_b(i) = te_b(i) + (cam_in%shf(i)+cam_in%cflx(i,1)*(latvap+latice)) * hdtime
+ te_b(i) = te_b(i) + (cam_in%shf(i)+cam_in%cflx(i,1)*(latvap+latice)) * hdtime
! Compute the disbalance of total energy, over depth where CLUBB is active
se_dis(i) = (te_a(i) - te_b(i))/(state1%pint(i,pverp)-state1%pint(i,clubbtop(i)))
end do
! Fix the total energy coming out of CLUBB so it achieves energy conservation.
- ! Apply this fixer throughout the column evenly, but only at layers where
+ ! Apply this fixer throughout the column evenly, but only at layers where
! CLUBB is active.
!
! NOTE: The energy fixer seems to cause the climate to change significantly
@@ -3704,7 +3696,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
end do
endif
-
+
! Now compute the tendencies of CLUBB to CAM, note that pverp is the ghost point
! for all variables and therefore is never called in this loop
do k=1, pver
@@ -3718,17 +3710,17 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
end do
end do
-
-
+
+
if (clubb_do_adv) then
if (macmic_it == cld_macmic_num_steps) then
-
+
do k=1, pver
do i=1, ncol
- ! Here add a constant to moments which can be either positive or
+ ! Here add a constant to moments which can be either positive or
! negative. This is to prevent clipping when dynamics tries to
- ! make all constituents positive
+ ! make all constituents positive
wp3(i,k) = wp3(i,k) + wp3_const
rtpthlp(i,k) = rtpthlp(i,k) + rtpthlp_const
wpthlp(i,k) = wpthlp(i,k) + wpthlp_const
@@ -3737,18 +3729,18 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
ptend_loc%q(i,k,ixthlp2) = (thlp2(i,k) - state1%q(i,k,ixthlp2)) / hdtime ! THLP Variance
ptend_loc%q(i,k,ixrtp2) = (rtp2(i,k) - state1%q(i,k,ixrtp2)) / hdtime ! RTP Variance
ptend_loc%q(i,k,ixrtpthlp) = (rtpthlp(i,k) - state1%q(i,k,ixrtpthlp)) / hdtime ! RTP THLP covariance
- ptend_loc%q(i,k,ixwpthlp) = (wpthlp(i,k) - state1%q(i,k,ixwpthlp)) / hdtime ! WPTHLP
+ ptend_loc%q(i,k,ixwpthlp) = (wpthlp(i,k) - state1%q(i,k,ixwpthlp)) / hdtime ! WPTHLP
ptend_loc%q(i,k,ixwprtp) = (wprtp(i,k) - state1%q(i,k,ixwprtp)) / hdtime ! WPRTP
ptend_loc%q(i,k,ixwp2) = (wp2(i,k) - state1%q(i,k,ixwp2)) / hdtime ! WP2
ptend_loc%q(i,k,ixwp3) = (wp3(i,k) - state1%q(i,k,ixwp3)) / hdtime ! WP3
ptend_loc%q(i,k,ixup2) = (up2(i,k) - state1%q(i,k,ixup2)) / hdtime ! UP2
ptend_loc%q(i,k,ixvp2) = (vp2(i,k) - state1%q(i,k,ixvp2)) / hdtime ! VP2
-
+
end do
end do
-
+
else
-
+
do k=1, pver
do i=1, ncol
ptend_loc%q(i,k,ixthlp2) = 0._r8
@@ -3759,16 +3751,16 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
ptend_loc%q(i,k,ixwp2) = 0._r8
ptend_loc%q(i,k,ixwp3) = 0._r8
ptend_loc%q(i,k,ixup2) = 0._r8
- ptend_loc%q(i,k,ixvp2) = 0._r8
+ ptend_loc%q(i,k,ixvp2) = 0._r8
end do
end do
-
+
end if
end if
-
+
! Apply tendencies to ice mixing ratio, liquid and ice number, and aerosol constituents.
- ! Loading up this array doesn't mean the tendencies are applied.
+ ! Loading up this array doesn't mean the tendencies are applied.
! edsclr_out is compressed with just the constituents being used, ptend and state are not compressed
icnt=0
do ixind=1,pcnst
@@ -3779,17 +3771,17 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
(ixind /= ixrtpthlp) .and. (ixind /= ixwpthlp) .and.&
(ixind /= ixwprtp) .and. (ixind /= ixwp2) .and.&
(ixind /= ixwp3) .and. (ixind /= ixup2) .and. (ixind /= ixvp2) ) then
-
+
do k=1, pver
do i=1, ncol
- ptend_loc%q(i,k,ixind) = (edsclr_out(i,k,icnt)-state1%q(i,k,ixind))/hdtime ! transported constituents
+ ptend_loc%q(i,k,ixind) = (edsclr_out(i,k,icnt)-state1%q(i,k,ixind))/hdtime ! transported constituents
end do
end do
-
+
end if
end if
end do
-
+
call t_stopf("clubb_tend_cam_i_loop")
call outfld('KVH_CLUBB', khzm, pcols, lchnk)
@@ -3798,7 +3790,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
call outfld('ELEAK_CLUBB', eleak, pcols, lchnk)
call outfld('TFIX_CLUBB', se_dis, pcols, lchnk)
- ! Add constant to ghost point so that output is not corrupted
+ ! Add constant to ghost point so that output is not corrupted
if (clubb_do_adv) then
if (macmic_it == cld_macmic_num_steps) then
wp3(:,pverp) = wp3(:,pverp) + wp3_const
@@ -3806,7 +3798,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
wpthlp(:,pverp) = wpthlp(:,pverp) + wpthlp_const
wprtp(:,pverp) = wprtp(:,pverp) + wprtp_const
end if
- end if
+ end if
! ------------------------------------------------- !
! End column computation of CLUBB, begin to apply !
@@ -3832,32 +3824,32 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
call physics_ptend_sum(ptend_loc,ptend_all,ncol)
call physics_update(state1,ptend_loc,hdtime)
-
- ! Due to the order of operation of CLUBB, which closes on liquid first,
- ! then advances it's predictive equations second, this can lead to
- ! RHliq > 1 directly before microphysics is called. Therefore, we use
- ! ice_macro_tend to enforce RHliq <= 1 everywhere before microphysics is called.
-
+
+ ! Due to the order of operation of CLUBB, which closes on liquid first,
+ ! then advances it's predictive equations second, this can lead to
+ ! RHliq > 1 directly before microphysics is called. Therefore, we use
+ ! ice_macro_tend to enforce RHliq <= 1 everywhere before microphysics is called.
+
if (clubb_do_liqsupersat) then
-
+
! -------------------------------------- !
! Ice Saturation Adjustment Computation !
! -------------------------------------- !
-
+
latsub = latvap + latice
lq2(:) = .FALSE.
lq2(ixq) = .TRUE.
lq2(ixcldliq) = .TRUE.
lq2(ixnumliq) = .TRUE.
-
+
call physics_ptend_init(ptend_loc, state%psetcols, 'iceadj', ls=.true., lq=lq2 )
-
+
stend(:ncol,:)=0._r8
qvtend(:ncol,:)=0._r8
qctend(:ncol,:)=0._r8
inctend(:ncol,:)=0._r8
-
+
call liquid_macro_tend(npccn(1:ncol,top_lev:pver), state1%t(1:ncol,top_lev:pver), &
state1%pmid(1:ncol,top_lev:pver), state1%q(1:ncol,top_lev:pver,ixq), &
state1%q(1:ncol,top_lev:pver,ixcldliq), state1%q(1:ncol,top_lev:pver,ixnumliq), &
@@ -3869,13 +3861,13 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
ptend_loc%q(:ncol,top_lev:pver,ixcldliq)=qctend(:ncol,top_lev:pver)
ptend_loc%q(:ncol,top_lev:pver,ixnumliq)=inctend(:ncol,top_lev:pver)
ptend_loc%s(:ncol,top_lev:pver)=stend(:ncol,top_lev:pver)
-
+
! Add the ice tendency to the output tendency
call physics_ptend_sum(ptend_loc, ptend_all, ncol)
-
+
! ptend_loc is reset to zero by this call
call physics_update(state1, ptend_loc, hdtime)
-
+
! Write output for tendencies:
! oufld: QVTENDICE,QCTENDICE,NCTENDICE,FQTENDICE
temp2d(:ncol,:pver) = stend(:ncol,:pver)/cpairv(:ncol,:pver,lchnk)
@@ -3883,25 +3875,25 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
call outfld( 'QVTENDICE', qvtend, pcols, lchnk )
call outfld( 'QCTENDICE', qctend, pcols, lchnk )
call outfld( 'NCTENDICE', inctend, pcols, lchnk )
-
+
where(qctend .ne. 0._r8)
fqtend = 1._r8
elsewhere
fqtend = 0._r8
end where
-
+
call outfld( 'FQTENDICE', fqtend, pcols, lchnk )
end if
-
+
! ------------------------------------------------------------ !
! The rest of the code deals with diagnosing variables !
! for microphysics/radiation computation and macrophysics !
! ------------------------------------------------------------ !
-
- ! --------------------------------------------------------------------------------- !
+
+ ! --------------------------------------------------------------------------------- !
! COMPUTE THE ICE CLOUD DETRAINMENT !
! Detrainment of convective condensate into the environment or stratiform cloud !
- ! --------------------------------------------------------------------------------- !
+ ! --------------------------------------------------------------------------------- !
! Initialize the shallow convective detrainment rate, will always be zero
dlf2(:,:) = 0.0_r8
@@ -3916,13 +3908,6 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
call physics_ptend_init(ptend_loc,state%psetcols, 'clubb', ls=.true., lq=lqice)
- if (zmconv_microp) then
- call pbuf_get_field(pbuf, dlfzm_idx, dlfzm)
- call pbuf_get_field(pbuf, difzm_idx, difzm)
- call pbuf_get_field(pbuf, dnlfzm_idx, dnlfzm)
- call pbuf_get_field(pbuf, dnifzm_idx, dnifzm)
- end if
-
do k=1,pver
do i=1,ncol
if( state1%t(i,k) > meltpt_temp ) then
@@ -3930,35 +3915,24 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
elseif ( state1%t(i,k) < dt_low ) then
dum1 = 1.0_r8
else
- dum1 = ( meltpt_temp - state1%t(i,k) ) / ( meltpt_temp - dt_low )
+ dum1 = ( meltpt_temp - state1%t(i,k) ) / ( meltpt_temp - dt_low )
endif
- if (zmconv_microp) then
- ptend_loc%q(i,k,ixcldliq) = dlfzm(i,k) + dlf2(i,k) * ( 1._r8 - dum1 )
- ptend_loc%q(i,k,ixcldice) = difzm(i,k) + dlf2(i,k) * dum1
-
- ptend_loc%q(i,k,ixnumliq) = dnlfzm(i,k) + 3._r8 * ( dlf2(i,k) * ( 1._r8 - dum1 ) ) &
- / (4._r8*3.14_r8*dl_rad**3*997._r8) ! Shallow Convection
- ptend_loc%q(i,k,ixnumice) = dnifzm(i,k) + 3._r8 * ( dlf2(i,k) * dum1 ) &
- / (4._r8*3.14_r8*di_rad**3*500._r8) ! Shallow Convection
- ptend_loc%s(i,k) = dlf2(i,k) * dum1 * latice
- else
-
- ptend_loc%q(i,k,ixcldliq) = dlf(i,k) * ( 1._r8 - dum1 )
- ptend_loc%q(i,k,ixcldice) = dlf(i,k) * dum1
- ptend_loc%q(i,k,ixnumliq) = 3._r8 * ( max(0._r8, ( dlf(i,k) - dlf2(i,k) )) * ( 1._r8 - dum1 ) ) &
+ ptend_loc%q(i,k,ixcldliq) = dlf(i,k) * ( 1._r8 - dum1 )
+ ptend_loc%q(i,k,ixcldice) = dlf(i,k) * dum1
+ ptend_loc%q(i,k,ixnumliq) = 3._r8 * ( max(0._r8, ( dlf(i,k) - dlf2(i,k) )) * ( 1._r8 - dum1 ) ) &
/ (4._r8*3.14_r8*dl_rad**3*997._r8) + & ! Deep Convection
3._r8 * ( dlf2(i,k) * ( 1._r8 - dum1 ) ) &
- / (4._r8*3.14_r8*10.e-6_r8**3*997._r8) ! Shallow Convection
- ptend_loc%q(i,k,ixnumice) = 3._r8 * ( max(0._r8, ( dlf(i,k) - dlf2(i,k) )) * dum1 ) &
+ / (4._r8*3.14_r8*10.e-6_r8**3*997._r8) ! Shallow Convection
+ ptend_loc%q(i,k,ixnumice) = 3._r8 * ( max(0._r8, ( dlf(i,k) - dlf2(i,k) )) * dum1 ) &
/ (4._r8*3.14_r8*di_rad**3*500._r8) + & ! Deep Convection
3._r8 * ( dlf2(i,k) * dum1 ) &
/ (4._r8*3.14_r8*50.e-6_r8**3*500._r8) ! Shallow Convection
- ptend_loc%s(i,k) = dlf(i,k) * dum1 * latice
+ ptend_loc%s(i,k) = dlf(i,k) * dum1 * latice
+
+ dlf_liq_out(i,k) = dlf(i,k) * ( 1._r8 - dum1 )
+ dlf_ice_out(i,k) = dlf(i,k) * dum1
- dlf_liq_out(i,k) = dlf(i,k) * ( 1._r8 - dum1 )
- dlf_ice_out(i,k) = dlf(i,k) * dum1
- end if
! convert moist dlf tendencies to dry
ptend_loc%q(i,k,ixcldliq) = ptend_loc%q(i,k,ixcldliq)*state1%pdel(i,k)/state1%pdeldry(i,k)
ptend_loc%q(i,k,ixcldice) = ptend_loc%q(i,k,ixcldice)*state1%pdel(i,k)/state1%pdeldry(i,k)
@@ -3970,20 +3944,20 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
det_ice(i) = det_ice(i) - ptend_loc%q(i,k,ixcldice)*state1%pdeldry(i,k)*rga
enddo
enddo
-
+
det_ice(:ncol) = det_ice(:ncol)/1000._r8 ! divide by density of water
! output moist basis to be consistent with history variable definition
- temp2d(:ncol,:pver) = ptend_loc%q(:ncol,:pver,ixcldliq)*state1%pdeldry(:ncol,:pver)/state1%pdel(:ncol,:pver)
+ temp2d(:ncol,:pver) = ptend_loc%q(:ncol,:pver,ixcldliq)*state1%pdeldry(:ncol,:pver)/state1%pdel(:ncol,:pver)
call outfld( 'DPDLFLIQ', temp2d, pcols, lchnk)
! output moist basis to be consistent with history variable definition
temp2d(:ncol,:pver) = ptend_loc%q(:ncol,:pver,ixcldice)*state1%pdeldry(:ncol,:pver)/state1%pdel(:ncol,:pver)
call outfld( 'DPDLFICE', temp2d, pcols, lchnk)
-
+
temp2d(:ncol,:pver) = ptend_loc%s(:ncol,:pver)/cpairv(:ncol,:pver, lchnk)
call outfld( 'DPDLFT', temp2d, pcols, lchnk)
-
+
call outfld( 'DETNLIQTND', ptend_loc%q(:,:,ixnumliq),pcols, lchnk )
call physics_ptend_sum(ptend_loc,ptend_all,ncol)
@@ -4010,19 +3984,19 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
else
relvarmax = 10.0_r8
endif
-
+
relvar(:,:) = relvarmax ! default
- if (deep_scheme .ne. 'CLUBB_SGS') then
+ if (deep_scheme .ne. 'CLUBB_SGS') then
where (rcm(:ncol,:pver) /= 0 .and. qclvar(:ncol,:pver) /= 0) &
relvar(:ncol,:pver) = min(relvarmax,max(0.001_r8,rcm(:ncol,:pver)**2/qclvar(:ncol,:pver)))
endif
-
+
! ------------------------------------------------- !
! Optional Accretion enhancement factor !
- ! ------------------------------------------------- !
+ ! ------------------------------------------------- !
accre_enhan(:ncol,:pver) = 1._r8
-
+
! ------------------------------------------------- !
! Diagnose some output variables !
! ------------------------------------------------- !
@@ -4048,7 +4022,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
sl_output(i,k) = cpairv(i,k,lchnk)*state1%t(i,k)+gravit*state1%zm(i,k)-latvap*state1%q(i,k,ixcldliq)
enddo
enddo
-
+
do k=1,pverp
do i=1,ncol
wpthlp_output(i,k) = (wpthlp(i,k)-(apply_const*wpthlp_const))*rho(i,k)*cpair ! liquid water potential temperature flux
@@ -4062,53 +4036,53 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
end if
enddo
enddo
-
- ! --------------------------------------------------------------------------------- !
+
+ ! --------------------------------------------------------------------------------- !
! Diagnose some quantities that are computed in macrop_tend here. !
! These are inputs required for the microphysics calculation. !
! !
! FIRST PART COMPUTES THE STRATIFORM CLOUD FRACTION FROM CLUBB CLOUD FRACTION !
- ! --------------------------------------------------------------------------------- !
-
- ! initialize variables
+ ! --------------------------------------------------------------------------------- !
+
+ ! initialize variables
alst(:,:) = 0.0_r8
- qlst(:,:) = 0.0_r8
-
+ qlst(:,:) = 0.0_r8
+
do k=1,pver
do i=1,ncol
- alst(i,k) = cloud_frac(i,k)
+ alst(i,k) = cloud_frac(i,k)
qlst(i,k) = rcm(i,k)/max(0.01_r8,alst(i,k)) ! Incloud stratus condensate mixing ratio
enddo
enddo
-
- ! --------------------------------------------------------------------------------- !
+
+ ! --------------------------------------------------------------------------------- !
! THIS PART COMPUTES CONVECTIVE AND DEEP CONVECTIVE CLOUD FRACTION !
- ! --------------------------------------------------------------------------------- !
-
+ ! --------------------------------------------------------------------------------- !
+
deepcu(:,:) = 0.0_r8
shalcu(:,:) = 0.0_r8
-
+
do k=1,pver-1
do i=1,ncol
- ! diagnose the deep convective cloud fraction, as done in macrophysics based on the
- ! deep convective mass flux, read in from pbuf. Since shallow convection is never
+ ! diagnose the deep convective cloud fraction, as done in macrophysics based on the
+ ! deep convective mass flux, read in from pbuf. Since shallow convection is never
! called, the shallow convective mass flux will ALWAYS be zero, ensuring that this cloud
- ! fraction is purely from deep convection scheme.
+ ! fraction is purely from deep convection scheme.
deepcu(i,k) = max(0.0_r8,min(dp1*log(1.0_r8+dp2*(cmfmc(i,k+1)-cmfmc_sh(i,k+1))),0.6_r8))
shalcu(i,k) = 0._r8
-
+
if (deepcu(i,k) <= frac_limit .or. dp_icwmr(i,k) < ic_limit) then
deepcu(i,k) = 0._r8
endif
-
- ! using the deep convective cloud fraction, and CLUBB cloud fraction (variable
+
+ ! using the deep convective cloud fraction, and CLUBB cloud fraction (variable
! "cloud_frac"), compute the convective cloud fraction. This follows the formulation
- ! found in macrophysics code. Assumes that convective cloud is all nonstratiform cloud
+ ! found in macrophysics code. Assumes that convective cloud is all nonstratiform cloud
! from CLUBB plus the deep convective cloud fraction
concld(i,k) = min(cloud_frac(i,k)-alst(i,k)+deepcu(i,k),0.80_r8)
enddo
enddo
-
+
if (single_column) then
if (trim(scm_clubb_iop_name) == 'ATEX_48hr' .or. &
trim(scm_clubb_iop_name) == 'BOMEX_5day' .or. &
@@ -4116,20 +4090,20 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
trim(scm_clubb_iop_name) == 'DYCOMSrf02_06hr' .or. &
trim(scm_clubb_iop_name) == 'RICO_3day' .or. &
trim(scm_clubb_iop_name) == 'ARM_CC') then
-
+
deepcu(:,:) = 0.0_r8
concld(:,:) = 0.0_r8
-
- endif
+
+ endif
endif
-
- ! --------------------------------------------------------------------------------- !
+
+ ! --------------------------------------------------------------------------------- !
! COMPUTE THE ICE CLOUD FRACTION PORTION !
! use the aist_vector function to compute the ice cloud fraction !
- ! --------------------------------------------------------------------------------- !
+ ! --------------------------------------------------------------------------------- !
aist(:,:top_lev-1) = 0._r8
- qsatfac(:, :) = 0._r8 ! Zero out entire profile in case qsatfac is left undefined in aist_vector below
+ qsatfac(:, :) = 0._r8 ! Zero out entire profile in case qsatfac is left undefined in aist_vector below
do k = top_lev, pver
@@ -4158,37 +4132,37 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
qsatfac_out=qsatfac(:,k), rhmini_in=rhmini, rhmaxi_in=rhmaxi)
endif
enddo
-
- ! --------------------------------------------------------------------------------- !
+
+ ! --------------------------------------------------------------------------------- !
! THIS PART COMPUTES THE LIQUID STRATUS FRACTION !
! !
! For now leave the computation of ice stratus fraction from macrop_driver intact !
- ! because CLUBB does nothing with ice. Here I simply overwrite the liquid stratus !
+ ! because CLUBB does nothing with ice. Here I simply overwrite the liquid stratus !
! fraction that was coded in macrop_driver !
- ! --------------------------------------------------------------------------------- !
-
+ ! --------------------------------------------------------------------------------- !
+
! Recompute net stratus fraction using maximum over-lapping assumption, as done
! in macrophysics code, using alst computed above and aist read in from physics buffer
-
+
do k=1,pver
do i=1,ncol
ast(i,k) = max(alst(i,k),aist(i,k))
- qist(i,k) = state1%q(i,k,ixcldice)/max(0.01_r8,aist(i,k))
+ qist(i,k) = state1%q(i,k,ixcldice)/max(0.01_r8,aist(i,k))
enddo
enddo
-
- ! Probably need to add deepcu cloud fraction to the cloud fraction array, else would just
- ! be outputting the shallow convective cloud fraction
+
+ ! Probably need to add deepcu cloud fraction to the cloud fraction array, else would just
+ ! be outputting the shallow convective cloud fraction
do k=1,pver
do i=1,ncol
cloud_frac(i,k) = min(ast(i,k)+deepcu(i,k),1.0_r8)
enddo
enddo
-
- ! --------------------------------------------------------------------------------- !
+
+ ! --------------------------------------------------------------------------------- !
! DIAGNOSE THE PBL DEPTH !
! this is needed for aerosol code !
- ! --------------------------------------------------------------------------------- !
+ ! --------------------------------------------------------------------------------- !
do i=1,ncol
do k=1,pver
!use local exner since state%exner is not a proper exner
@@ -4197,7 +4171,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
thv(i,k) = th(i,k)*(1.0_r8+zvir*state1%q(i,k,ixq) - state1%q(i,k,ixcldliq))
enddo
enddo
-
+
! diagnose surface friction and obukhov length (inputs to diagnose PBL depth)
rrho(1:ncol) = (rga)*(state1%pdel(1:ncol,pver)/dz_g(1:ncol,pver))
call calc_ustar( ncol, state1%t(1:ncol,pver), state1%pmid(1:ncol,pver), cam_in%wsx(1:ncol), cam_in%wsy(1:ncol), &
@@ -4206,10 +4180,10 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
call calc_obklen( ncol, th(1:ncol,pver), thv(1:ncol,pver), cam_in%cflx(1:ncol,1), cam_in%shf(1:ncol), &
rrho(1:ncol), ustar2(1:ncol), kinheat(1:ncol), kinwat(1:ncol), kbfs(1:ncol), &
obklen(1:ncol))
-
+
dummy2(:) = 0._r8
dummy3(:) = 0._r8
-
+
where (kbfs(:ncol) == -0.0_r8) kbfs(:ncol) = 0.0_r8
! Compute PBL depth according to Holtslag-Boville Scheme
@@ -4219,14 +4193,14 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
! Output the PBL depth
call outfld('PBLH', pblh, pcols, lchnk)
-
+
! Assign the first pver levels of cloud_frac back to cld
cld(:,1:pver) = cloud_frac(:,1:pver)
- ! --------------------------------------------------------------------------------- !
+ ! --------------------------------------------------------------------------------- !
! END CLOUD FRACTION DIAGNOSIS, begin to store variables back into buffer !
- ! --------------------------------------------------------------------------------- !
-
+ ! --------------------------------------------------------------------------------- !
+
! Output calls of variables goes here
call outfld( 'RELVAR', relvar, pcols, lchnk )
call outfld( 'RHO_CLUBB', rho(:,1:pver), pcols, lchnk )
@@ -4270,7 +4244,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
call outfld( 'CLUBB_GRID_SIZE', grid_dx, pcols, lchnk )
call outfld( 'QSATFAC', qsatfac, pcols, lchnk)
-
+
! --------------------------------------------------------------- !
! Writing state variables after EDMF scheme for detailed analysis !
! --------------------------------------------------------------- !
@@ -4299,44 +4273,44 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
end if
! Output CLUBB history here
- if (l_stats) then
-
+ if (l_stats) then
+
do j=1,stats_zt(1)%num_output_fields
-
+
temp1 = trim(stats_zt(1)%file%grid_avg_var(j)%name)
sub = temp1
- if (len(temp1) > 16) sub = temp1(1:16)
-
+ if (len(temp1) > max_fieldname_len) sub = temp1(1:max_fieldname_len)
+
call outfld(trim(sub), out_zt(:,:,j), pcols, lchnk )
enddo
-
+
do j=1,stats_zm(1)%num_output_fields
-
+
temp1 = trim(stats_zm(1)%file%grid_avg_var(j)%name)
sub = temp1
- if (len(temp1) > 16) sub = temp1(1:16)
-
+ if (len(temp1) > max_fieldname_len) sub = temp1(1:max_fieldname_len)
+
call outfld(trim(sub),out_zm(:,:,j), pcols, lchnk)
enddo
- if (l_output_rad_files) then
+ if (l_output_rad_files) then
do j=1,stats_rad_zt(1)%num_output_fields
call outfld(trim(stats_rad_zt(1)%file%grid_avg_var(j)%name), out_radzt(:,:,j), pcols, lchnk)
enddo
-
+
do j=1,stats_rad_zm(1)%num_output_fields
call outfld(trim(stats_rad_zm(1)%file%grid_avg_var(j)%name), out_radzm(:,:,j), pcols, lchnk)
enddo
endif
-
+
do j=1,stats_sfc(1)%num_output_fields
call outfld(trim(stats_sfc(1)%file%grid_avg_var(j)%name), out_sfc(:,:,j), pcols, lchnk)
enddo
-
+
endif
-
+
call t_stopf("clubb_tend_cam")
-
+
return
#endif
end subroutine clubb_tend_cam
@@ -4370,7 +4344,7 @@ subroutine clubb_emissions_cam (state, cam_in, ptend)
! --------------- !
! Local Variables !
! --------------- !
- integer :: m, ncol
+ integer :: m, ncol
logical :: lq(pcnst)
! ----------------------- !
@@ -4394,7 +4368,7 @@ subroutine clubb_emissions_cam (state, cam_in, ptend)
endif
end do
- end subroutine clubb_emissions_cam
+ end subroutine clubb_emissions_cam
! =============================================================================== !
! !
@@ -4402,12 +4376,12 @@ end subroutine clubb_emissions_cam
! Saturation adjustment for ice
! Add ice mass if supersaturated
-subroutine ice_macro_tend(naai,t,p,qv,qi,ni,xxls,deltat,stend,qvtend,qitend,nitend,vlen)
+subroutine ice_macro_tend(naai,t,p,qv,qi,ni,xxls,deltat,stend,qvtend,qitend,nitend,vlen)
use wv_sat_methods, only: wv_sat_qsat_ice
integer, intent(in) :: vlen
- real(r8), dimension(vlen), intent(in) :: naai !Activated number of ice nuclei
+ real(r8), dimension(vlen), intent(in) :: naai !Activated number of ice nuclei
real(r8), dimension(vlen), intent(in) :: t !temperature (k)
real(r8), dimension(vlen), intent(in) :: p !pressure (pa)
real(r8), dimension(vlen), intent(in) :: qv !water vapor mixing ratio
@@ -4415,11 +4389,11 @@ subroutine ice_macro_tend(naai,t,p,qv,qi,ni,xxls,deltat,stend,qvtend,qitend,nite
real(r8), dimension(vlen), intent(in) :: ni !ice number concentration
real(r8), intent(in) :: xxls !latent heat of freezing
real(r8), intent(in) :: deltat !timestep
- real(r8), dimension(vlen), intent(out) :: stend ! 'temperature' tendency
+ real(r8), dimension(vlen), intent(out) :: stend ! 'temperature' tendency
real(r8), dimension(vlen), intent(out) :: qvtend !vapor tendency
real(r8), dimension(vlen), intent(out) :: qitend !ice mass tendency
- real(r8), dimension(vlen), intent(out) :: nitend !ice number tendency
-
+ real(r8), dimension(vlen), intent(out) :: nitend !ice number tendency
+
real(r8) :: ESI(vlen)
real(r8) :: QSI(vlen)
integer :: i
@@ -4442,7 +4416,7 @@ subroutine ice_macro_tend(naai,t,p,qv,qi,ni,xxls,deltat,stend,qvtend,qitend,nite
qitend(i) = (qv(i)-QSI(i))/deltat
qvtend(i) = 0._r8 - qitend(i)
stend(i) = qitend(i) * xxls ! moist static energy tend...[J/kg/s] !
-
+
! if ice exists (more than 1 L-1) and there is condensation, do not add to number (= growth), else, add 10um ice
if (ni(i) < 1.e3_r8 .and. (qi(i)+qitend(i)*deltat) > 1.e-18_r8) then
nitend(i) = nitend(i) + 3._r8 * qitend(i)/(4._r8*3.14_r8* 10.e-6_r8**3*997._r8)
@@ -4476,7 +4450,7 @@ end subroutine ice_macro_tend
! Code writen March, 1999 by Bjorn Stevens
!
-real(r8) function diag_ustar( z, bflx, wnd, z0 )
+real(r8) function diag_ustar( z, bflx, wnd, z0 )
use shr_const_mod, only : shr_const_karman, shr_const_pi, shr_const_g
@@ -4545,59 +4519,59 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, &
! Description: Initializes the statistics saving functionality of
! the CLUBB model. This is for purpose of CAM-CLUBB interface. Here
! the traditional stats_init of CLUBB is not called, as it is not compatible
- ! with CAM output.
-
+ ! with CAM output.
+
!-----------------------------------------------------------------------
use clubb_api_module, only: &
- ztscr01, &
- ztscr02, &
- ztscr03, &
- ztscr04, &
- ztscr05, &
- ztscr06, &
- ztscr07, &
- ztscr08, &
- ztscr09, &
- ztscr10, &
- ztscr11, &
- ztscr12, &
- ztscr13, &
- ztscr14, &
- ztscr15, &
- ztscr16, &
- ztscr17, &
- ztscr18, &
- ztscr19, &
- ztscr20, &
+ ztscr01, &
+ ztscr02, &
+ ztscr03, &
+ ztscr04, &
+ ztscr05, &
+ ztscr06, &
+ ztscr07, &
+ ztscr08, &
+ ztscr09, &
+ ztscr10, &
+ ztscr11, &
+ ztscr12, &
+ ztscr13, &
+ ztscr14, &
+ ztscr15, &
+ ztscr16, &
+ ztscr17, &
+ ztscr18, &
+ ztscr19, &
+ ztscr20, &
ztscr21
use clubb_api_module, only: &
- zmscr01, &
- zmscr02, &
- zmscr03, &
- zmscr04, &
- zmscr05, &
- zmscr06, &
- zmscr07, &
- zmscr08, &
- zmscr09, &
- zmscr10, &
- zmscr11, &
- zmscr12, &
- zmscr13, &
- zmscr14, &
+ zmscr01, &
+ zmscr02, &
+ zmscr03, &
+ zmscr04, &
+ zmscr05, &
+ zmscr06, &
+ zmscr07, &
+ zmscr08, &
+ zmscr09, &
+ zmscr10, &
+ zmscr11, &
+ zmscr12, &
+ zmscr13, &
+ zmscr14, &
zmscr15, &
zmscr16, &
zmscr17, &
l_stats, &
- l_output_rad_files, &
- stats_tsamp, &
- stats_tout, &
- l_stats_samp, &
- l_stats_last, &
- l_netcdf, &
+ l_output_rad_files, &
+ stats_tsamp, &
+ stats_tout, &
+ l_stats_samp, &
+ l_stats_last, &
+ l_netcdf, &
l_grads
use clubb_api_module, only: time_precision, & !
@@ -4619,16 +4593,16 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, &
logical, intent(in) :: l_stats_in ! Stats on? T/F
- real(kind=time_precision), intent(in) :: &
+ real(kind=time_precision), intent(in) :: &
stats_tsamp_in, & ! Sampling interval [s]
stats_tout_in ! Output interval [s]
integer, intent(in) :: nnzp ! Grid points in the vertical [count]
- integer, intent(in) :: nnrad_zt ! Grid points in the radiation grid [count]
+ integer, intent(in) :: nnrad_zt ! Grid points in the radiation grid [count]
integer, intent(in) :: nnrad_zm ! Grid points in the radiation grid [count]
real(kind=time_precision), intent(in) :: delt ! Timestep (dtmain in CLUBB) [s]
-
+
! Output Variables
type (stats), intent(out) :: stats_zt, & ! stats_zt grid
stats_zm, & ! stats_zm grid
@@ -4649,11 +4623,11 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, &
character(len=var_length), dimension(nvarmax_rad_zm) :: clubb_vars_rad_zm ! Variables on the radiation levels
character(len=var_length), dimension(nvarmax_sfc) :: clubb_vars_sfc ! Variables at the model surface
- namelist /clubb_stats_nl/ &
- clubb_vars_zt, &
+ namelist /clubb_stats_nl/ &
+ clubb_vars_zt, &
clubb_vars_zm, &
clubb_vars_rad_zt, &
- clubb_vars_rad_zm, &
+ clubb_vars_rad_zm, &
clubb_vars_sfc
! Local Variables
@@ -4671,7 +4645,7 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, &
! Set stats_variables variables with inputs from calling subroutine
l_stats = l_stats_in
-
+
stats_tsamp = stats_tsamp_in
stats_tout = stats_tout_in
@@ -4689,7 +4663,7 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, &
clubb_vars_rad_zm = ''
clubb_vars_sfc = ''
- ! Read variables to compute from the namelist
+ ! Read variables to compute from the namelist
if (masterproc) then
iunit= getunit()
open(unit=iunit,file="atm_in",status='old')
@@ -4736,8 +4710,8 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, &
! Initialize zt (mass points)
i = 1
- do while ( ichar(clubb_vars_zt(i)(1:1)) /= 0 .and. &
- len_trim(clubb_vars_zt(i)) /= 0 .and. &
+ do while ( ichar(clubb_vars_zt(i)(1:1)) /= 0 .and. &
+ len_trim(clubb_vars_zt(i)) /= 0 .and. &
i <= nvarmax_zt )
i = i + 1
enddo
@@ -4821,8 +4795,8 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, &
! Initialize zm (momentum points)
i = 1
- do while ( ichar(clubb_vars_zm(i)(1:1)) /= 0 .and. &
- len_trim(clubb_vars_zm(i)) /= 0 .and. &
+ do while ( ichar(clubb_vars_zm(i)(1:1)) /= 0 .and. &
+ len_trim(clubb_vars_zm(i)) /= 0 .and. &
i <= nvarmax_zm )
i = i + 1
end do
@@ -4896,10 +4870,10 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, &
! Initialize rad_zt (radiation points)
if (l_output_rad_files) then
-
+
i = 1
- do while ( ichar(clubb_vars_rad_zt(i)(1:1)) /= 0 .and. &
- len_trim(clubb_vars_rad_zt(i)) /= 0 .and. &
+ do while ( ichar(clubb_vars_rad_zt(i)(1:1)) /= 0 .and. &
+ len_trim(clubb_vars_rad_zt(i)) /= 0 .and. &
i <= nvarmax_rad_zt )
i = i + 1
end do
@@ -4932,10 +4906,10 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, &
stats_rad_zt )
! Initialize rad_zm (radiation points)
-
+
i = 1
- do while ( ichar(clubb_vars_rad_zm(i)(1:1)) /= 0 .and. &
- len_trim(clubb_vars_rad_zm(i)) /= 0 .and. &
+ do while ( ichar(clubb_vars_rad_zm(i)(1:1)) /= 0 .and. &
+ len_trim(clubb_vars_rad_zm(i)) /= 0 .and. &
i <= nvarmax_rad_zm )
i = i + 1
end do
@@ -4963,7 +4937,7 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, &
allocate( stats_rad_zm%file%grid_avg_var( stats_rad_zm%num_output_fields ) )
allocate( stats_rad_zm%file%z( stats_rad_zm%kk ) )
-
+
call stats_init_rad_zm_api( clubb_vars_rad_zm, l_error, &
stats_rad_zm )
end if ! l_output_rad_files
@@ -4972,8 +4946,8 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, &
! Initialize sfc (surface point)
i = 1
- do while ( ichar(clubb_vars_sfc(i)(1:1)) /= 0 .and. &
- len_trim(clubb_vars_sfc(i)) /= 0 .and. &
+ do while ( ichar(clubb_vars_sfc(i)(1:1)) /= 0 .and. &
+ len_trim(clubb_vars_sfc(i)) /= 0 .and. &
i <= nvarmax_sfc )
i = i + 1
end do
@@ -5015,58 +4989,58 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, &
! Now call add fields
if (first_call) then
-
+
do i = 1, stats_zt%num_output_fields
-
+
temp1 = trim(stats_zt%file%grid_avg_var(i)%name)
sub = temp1
- if (len(temp1) > 16) sub = temp1(1:16)
-
+ if (len(temp1) > max_fieldname_len) sub = temp1(1:max_fieldname_len)
+
call addfld(trim(sub),(/ 'ilev' /),&
'A',trim(stats_zt%file%grid_avg_var(i)%units),trim(stats_zt%file%grid_avg_var(i)%description))
enddo
-
+
do i = 1, stats_zm%num_output_fields
-
+
temp1 = trim(stats_zm%file%grid_avg_var(i)%name)
sub = temp1
- if (len(temp1) > 16) sub = temp1(1:16)
-
+ if (len(temp1) > max_fieldname_len) sub = temp1(1:max_fieldname_len)
+
call addfld(trim(sub),(/ 'ilev' /),&
'A',trim(stats_zm%file%grid_avg_var(i)%units),trim(stats_zm%file%grid_avg_var(i)%description))
enddo
- if (l_output_rad_files) then
+ if (l_output_rad_files) then
do i = 1, stats_rad_zt%num_output_fields
call addfld(trim(stats_rad_zt%file%grid_avg_var(i)%name),(/ 'ilev' /),&
'A',trim(stats_rad_zt%file%grid_avg_var(i)%units),trim(stats_rad_zt%file%grid_avg_var(i)%description))
enddo
-
+
do i = 1, stats_rad_zm%num_output_fields
call addfld(trim(stats_rad_zm%file%grid_avg_var(i)%name),(/ 'ilev' /),&
'A',trim(stats_rad_zm%file%grid_avg_var(i)%units),trim(stats_rad_zm%file%grid_avg_var(i)%description))
enddo
endif
-
+
do i = 1, stats_sfc%num_output_fields
call addfld(trim(stats_sfc%file%grid_avg_var(i)%name),horiz_only,&
'A',trim(stats_sfc%file%grid_avg_var(i)%units),trim(stats_sfc%file%grid_avg_var(i)%description))
enddo
-
+
end if
return
- end subroutine stats_init_clubb
-
+ end subroutine stats_init_clubb
+
#endif
! =============================================================================== !
! !
! =============================================================================== !
-#ifdef CLUBB_SGS
+#ifdef CLUBB_SGS
subroutine stats_end_timestep_clubb(thecol, stats_zt, stats_zm, stats_rad_zt, stats_rad_zm, stats_sfc, &
out_zt, out_zm, out_radzt, out_radzm, out_sfc)
!-----------------------------------------------------------------------
@@ -5081,8 +5055,8 @@ subroutine stats_end_timestep_clubb(thecol, stats_zt, stats_zm, stats_rad_zt, st
use clubb_api_module, only: &
fstderr, & ! Constant(s)
- l_stats_last, &
- stats_tsamp, &
+ l_stats_last, &
+ stats_tsamp, &
stats_tout, &
l_output_rad_files, &
clubb_at_least_debug_level_api ! Procedure(s)
@@ -5092,14 +5066,14 @@ subroutine stats_end_timestep_clubb(thecol, stats_zt, stats_zm, stats_rad_zt, st
implicit none
integer :: thecol
-
+
! Input Variables
type (stats), intent(inout) :: stats_zt, & ! stats_zt grid
stats_zm, & ! stats_zm grid
stats_rad_zt, & ! stats_rad_zt grid
stats_rad_zm, & ! stats_rad_zm grid
stats_sfc ! stats_sfc
-
+
! Inout variables
real(r8), intent(inout) :: out_zt(:,:,:) ! (pcols,pverp,stats_zt%num_output_fields)
real(r8), intent(inout) :: out_zm(:,:,:) ! (pcols,pverp,stats_zt%num_output_fields)
@@ -5130,36 +5104,36 @@ subroutine stats_end_timestep_clubb(thecol, stats_zt, stats_zm, stats_rad_zt, st
end if
call stats_avg( stats_sfc%kk, stats_sfc%num_output_fields, stats_sfc%accum_field_values, stats_sfc%accum_num_samples )
- ! Here we are not outputting the data, rather reading the stats into
+ ! Here we are not outputting the data, rather reading the stats into
! arrays which are conformable to CAM output. Also, the data is "flipped"
- ! in the vertical level to be the same as CAM output.
+ ! in the vertical level to be the same as CAM output.
do i = 1, stats_zt%num_output_fields
- do k = 1, stats_zt%kk
+ do k = 1, stats_zt%kk
out_zt(thecol,pverp-k+1,i) = stats_zt%accum_field_values(1,1,k,i)
if(is_nan(out_zt(thecol,k,i))) out_zt(thecol,k,i) = 0.0_r8
- enddo
+ enddo
enddo
do i = 1, stats_zm%num_output_fields
- do k = 1, stats_zt%kk
+ do k = 1, stats_zt%kk
out_zm(thecol,pverp-k+1,i) = stats_zm%accum_field_values(1,1,k,i)
if(is_nan(out_zm(thecol,k,i))) out_zm(thecol,k,i) = 0.0_r8
- enddo
+ enddo
enddo
- if (l_output_rad_files) then
+ if (l_output_rad_files) then
do i = 1, stats_rad_zt%num_output_fields
- do k = 1, stats_rad_zt%kk
+ do k = 1, stats_rad_zt%kk
out_radzt(thecol,pverp-k+1,i) = stats_rad_zt%accum_field_values(1,1,k,i)
if(is_nan(out_radzt(thecol,k,i))) out_radzt(thecol,k,i) = 0.0_r8
- enddo
+ enddo
enddo
-
+
do i = 1, stats_rad_zm%num_output_fields
- do k = 1, stats_rad_zm%kk
+ do k = 1, stats_rad_zm%kk
out_radzm(thecol,pverp-k+1,i) = stats_rad_zm%accum_field_values(1,1,k,i)
if(is_nan(out_radzm(thecol,k,i))) out_radzm(thecol,k,i) = 0.0_r8
- enddo
+ enddo
enddo
! Fill in values above the CLUBB top.
@@ -5169,9 +5143,9 @@ subroutine stats_end_timestep_clubb(thecol, stats_zt, stats_zm, stats_rad_zt, st
out_radzm(thecol,:top_lev-1,:) = 0.0_r8
endif ! l_output_rad_files
-
+
do i = 1, stats_sfc%num_output_fields
- out_sfc(thecol,1,i) = stats_sfc%accum_field_values(1,1,1,i)
+ out_sfc(thecol,1,i) = stats_sfc%accum_field_values(1,1,1,i)
if(is_nan(out_sfc(thecol,1,i))) out_sfc(thecol,1,i) = 0.0_r8
enddo
@@ -5192,14 +5166,14 @@ subroutine stats_end_timestep_clubb(thecol, stats_zt, stats_zm, stats_rad_zt, st
return
end subroutine stats_end_timestep_clubb
-#endif
-
+#endif
+
! =============================================================================== !
! !
! =============================================================================== !
#ifdef CLUBB_SGS
-
+
!-----------------------------------------------------------------------
subroutine stats_zero( kk, num_output_fields, x, n, l_in_update )
@@ -5233,14 +5207,14 @@ subroutine stats_zero( kk, num_output_fields, x, n, l_in_update )
return
end subroutine stats_zero
-
+
#endif
! =============================================================================== !
! !
! =============================================================================== !
-
+
#ifdef CLUBB_SGS
!-----------------------------------------------------------------------
subroutine stats_avg( kk, num_output_fields, x, n )
@@ -5288,7 +5262,7 @@ subroutine grid_size(state, grid_dx, grid_dy)
use shr_const_mod, only: shr_const_pi
use physics_types, only: physics_state
-
+
type(physics_state), intent(in) :: state
real(r8), intent(out) :: grid_dx(state%ncol), grid_dy(state%ncol) ! CAM grid [m]
@@ -5303,17 +5277,17 @@ subroutine grid_size(state, grid_dx, grid_dy)
do i=1,state%ncol
column_area = get_area_p(state%lchnk,i)
degree = sqrt(column_area)*(180._r8/shr_const_pi)
-
+
! Now find meters per degree latitude
! Below equation finds distance between two points on an ellipsoid, derived from expansion
- ! taking into account ellipsoid using World Geodetic System (WGS84) reference
+ ! taking into account ellipsoid using World Geodetic System (WGS84) reference
mpdeglat = earth_ellipsoid1 - earth_ellipsoid2 * cos(2._r8*state%lat(i)) + earth_ellipsoid3 * cos(4._r8*state%lat(i))
grid_dx(i) = mpdeglat * degree
grid_dy(i) = grid_dx(i) ! Assume these are the same
- enddo
+ enddo
- end subroutine grid_size
+ end subroutine grid_size
#endif
-
+
end module clubb_intr
diff --git a/src/physics/cam/constituents.F90 b/src/physics/cam/constituents.F90
index 9d47652318..b93cf060b3 100644
--- a/src/physics/cam/constituents.F90
+++ b/src/physics/cam/constituents.F90
@@ -72,7 +72,6 @@ module constituents
character(len=16), public :: fixcnam (pcnst) ! names of species slt fixer tendencies
character(len=16), public :: tendnam (pcnst) ! names of total tendencies of species
character(len=16), public :: ptendnam (pcnst) ! names of total physics tendencies of species
-character(len=16), public :: dmetendnam(pcnst) ! names of dme adjusted tracers (FV)
character(len=16), public :: sflxnam (pcnst) ! names of surface fluxes of species
character(len=16), public :: tottnam (pcnst) ! names for horz + vert + fixer tendencies
@@ -174,7 +173,7 @@ subroutine cnst_add (name, mwc, cpc, qminc, &
padv = padv+1
ind = padv
if (padv > pcnst) then
- write(errmsg, *) sub//': FATAL: advected tracer (', trim(name), ') index for greater than pcnst=', pcnst
+ write(errmsg, *) sub//': FATAL: advected tracer (', trim(name), ') index is greater than number of constituents'
call endrun(errmsg)
end if
@@ -497,7 +496,6 @@ subroutine cnst_chk_dim
fixcnam (m) = 'DF'//cnst_name(m)
tendnam (m) = 'TE'//cnst_name(m)
ptendnam (m) = 'PTE'//cnst_name(m)
- dmetendnam(m) = 'DME'//cnst_name(m)
tottnam (m) = 'TA'//cnst_name(m)
sflxnam(m) = 'SF'//cnst_name(m)
end do
diff --git a/src/physics/cam/convect_shallow.F90 b/src/physics/cam/convect_shallow.F90
index 0fa7e3b83d..ffd1db8f5f 100644
--- a/src/physics/cam/convect_shallow.F90
+++ b/src/physics/cam/convect_shallow.F90
@@ -13,25 +13,26 @@ module convect_shallow
use shr_kind_mod, only : r8=>shr_kind_r8
use physconst, only : cpair, zvir
use ppgrid, only : pver, pcols, pverp
- use zm_conv, only : zm_conv_evap
+ use zm_conv_evap, only : zm_conv_evap_run
+ use zm_conv_intr, only : zmconv_ke, zmconv_ke_lnd, zmconv_org
use cam_history, only : outfld, addfld, horiz_only
use cam_logfile, only : iulog
use phys_control, only : phys_getopts
implicit none
- private
+ private
save
public :: &
convect_shallow_register, & ! Register fields in physics buffer
convect_shallow_init, & ! Initialize shallow module
convect_shallow_tend, & ! Return tendencies
- convect_shallow_use_shfrc !
+ convect_shallow_use_shfrc !
! The following namelist variable controls which shallow convection package is used.
! 'Hack' = Hack shallow convection (default)
! 'UW' = UW shallow convection by Sungsu Park and Christopher S. Bretherton
- ! 'UNICON' = General Convection Model by Sungsu Park
+ ! 'UNICON' = General Convection Model by Sungsu Park
! 'off' = No shallow convection
character(len=16) :: shallow_scheme ! Default set in phys_control.F90, use namelist to change
@@ -40,16 +41,16 @@ module convect_shallow
logical :: history_budget ! Output tendencies and state variables for CAM4 T, qv, ql, qi
integer :: history_budget_histfile_num ! output history file number for budget fields
- ! Physics buffer indices
- integer :: icwmrsh_idx = 0
- integer :: rprdsh_idx = 0
- integer :: rprdtot_idx = 0
- integer :: cldtop_idx = 0
- integer :: cldbot_idx = 0
- integer :: cush_idx = 0
+ ! Physics buffer indices
+ integer :: icwmrsh_idx = 0
+ integer :: rprdsh_idx = 0
+ integer :: rprdtot_idx = 0
+ integer :: cldtop_idx = 0
+ integer :: cldbot_idx = 0
+ integer :: cush_idx = 0
integer :: nevapr_shcu_idx = 0
- integer :: shfrc_idx = 0
- integer :: cld_idx = 0
+ integer :: shfrc_idx = 0
+ integer :: cld_idx = 0
integer :: concld_idx = 0
integer :: rprddp_idx = 0
integer :: tke_idx = 0
@@ -84,9 +85,9 @@ subroutine convect_shallow_register
use physics_buffer, only : pbuf_add_field, dtype_r8, dyn_time_lvls
use phys_control, only: use_gw_convect_sh
use unicon_cam, only: unicon_cam_register
-
+
call phys_getopts( shallow_scheme_out = shallow_scheme, microp_scheme_out = microp_scheme)
-
+
! SPCAM registers its own fields
if (shallow_scheme == 'SPCAM') return
@@ -95,7 +96,7 @@ subroutine convect_shallow_register
call pbuf_add_field('RPRDTOT', 'physpkg' ,dtype_r8,(/pcols,pver/), rprdtot_idx )
call pbuf_add_field('CLDTOP', 'physpkg' ,dtype_r8,(/pcols,1/), cldtop_idx )
call pbuf_add_field('CLDBOT', 'physpkg' ,dtype_r8,(/pcols,1/), cldbot_idx )
- call pbuf_add_field('cush', 'global' ,dtype_r8,(/pcols,dyn_time_lvls/), cush_idx )
+ call pbuf_add_field('cush', 'global' ,dtype_r8,(/pcols,dyn_time_lvls/), cush_idx )
call pbuf_add_field('NEVAPR_SHCU','physpkg' ,dtype_r8,(/pcols,pver/), nevapr_shcu_idx )
call pbuf_add_field('PREC_SH', 'physpkg' ,dtype_r8,(/pcols/), prec_sh_idx )
call pbuf_add_field('SNOW_SH', 'physpkg' ,dtype_r8,(/pcols/), snow_sh_idx )
@@ -110,16 +111,16 @@ subroutine convect_shallow_register
endif
! shallow interface gbm flux_convective_cloud_rain+snow (kg/m2/s)
- call pbuf_add_field('SH_FLXPRC','physpkg',dtype_r8,(/pcols,pverp/),sh_flxprc_idx)
+ call pbuf_add_field('SH_FLXPRC','physpkg',dtype_r8,(/pcols,pverp/),sh_flxprc_idx)
! shallow interface gbm flux_convective_cloud_snow (kg/m2/s)
- call pbuf_add_field('SH_FLXSNW','physpkg',dtype_r8,(/pcols,pverp/),sh_flxsnw_idx)
+ call pbuf_add_field('SH_FLXSNW','physpkg',dtype_r8,(/pcols,pverp/),sh_flxsnw_idx)
! shallow gbm cloud liquid water (kg/kg)
- call pbuf_add_field('SH_CLDLIQ','physpkg',dtype_r8,(/pcols,pver/),sh_cldliq_idx)
+ call pbuf_add_field('SH_CLDLIQ','physpkg',dtype_r8,(/pcols,pver/),sh_cldliq_idx)
! shallow gbm cloud ice water (kg/kg)
- call pbuf_add_field('SH_CLDICE','physpkg',dtype_r8,(/pcols,pver/),sh_cldice_idx)
+ call pbuf_add_field('SH_CLDICE','physpkg',dtype_r8,(/pcols,pver/),sh_cldice_idx)
! If gravity waves from shallow convection are on, output this field.
if (use_gw_convect_sh) then
@@ -154,7 +155,7 @@ subroutine convect_shallow_init(pref_edge, pbuf2d)
use spmd_utils, only : masterproc
use cam_abortutils, only : endrun
use phys_control, only : cam_physpkg_is
-
+
use physics_buffer, only : pbuf_get_index, physics_buffer_desc, pbuf_set_field
real(r8), intent(in) :: pref_edge(plevp) ! Reference pressures at interfaces
@@ -163,7 +164,7 @@ subroutine convect_shallow_init(pref_edge, pbuf2d)
integer limcnv ! Top interface level limit for convection
integer k
character(len=16) :: eddy_scheme
-
+
! SPCAM does its own convection
if (shallow_scheme == 'SPCAM') return
@@ -221,7 +222,7 @@ subroutine convect_shallow_init(pref_edge, pbuf2d)
call addfld( 'PCLDBOT', horiz_only, 'A', '1', 'Pressure of cloud base' )
call addfld( 'FREQSH', horiz_only, 'A', 'fraction', 'Fractional occurance of shallow convection' )
-
+
call addfld( 'HKFLXPRC', (/ 'ilev' /), 'A', 'kg/m2/s', 'Flux of precipitation from HK convection' )
call addfld( 'HKFLXSNW', (/ 'ilev' /), 'A', 'kg/m2/s', 'Flux of snow from HK convection' )
call addfld( 'HKNTPRPD', (/ 'lev' /), 'A', 'kg/kg/s', 'Net precipitation production from HK convection' )
@@ -286,7 +287,7 @@ subroutine convect_shallow_init(pref_edge, pbuf2d)
if( masterproc ) then
write(iulog,*) 'MFINTI: Convection will be capped at intfc ', limcnv, ' which is ', pref_edge(limcnv), ' pascals'
end if
-
+
call mfinti( rair, cpair, gravit, latvap, rhoh2o, limcnv) ! Get args from inti.F90
case('UW') ! Park and Bretherton shallow convection scheme
@@ -346,7 +347,7 @@ end function convect_shallow_use_shfrc
!=============================================================================== !
subroutine convect_shallow_tend( ztodt , cmfmc , &
- qc , qc2 , rliq , rliq2 , &
+ qc , qc2 , rliq , rliq2 , &
state , ptend_all, pbuf, cam_in)
use physics_buffer, only : physics_buffer_desc, pbuf_get_field, pbuf_set_field, pbuf_old_tim_idx
@@ -357,7 +358,7 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
use physics_types, only : physics_ptend_dealloc
use physics_types, only : physics_ptend_sum
use camsrfexch, only : cam_in_t
-
+
use constituents, only : pcnst, cnst_get_ind, cnst_get_type_byind
use hk_conv, only : cmfmca
use uwshcu, only : compute_uwshcu_inv
@@ -365,7 +366,7 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
use time_manager, only : get_nstep
use wv_saturation, only : qsat
- use physconst, only : latice, latvap, rhoh2o
+ use physconst, only : latice, latvap, rhoh2o, tmelt, gravit
use spmd_utils, only : iam
implicit none
@@ -381,7 +382,7 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
real(r8), intent(out) :: rliq2(pcols) ! Vertically-integrated reserved cloud condensate [ m/s ]
real(r8), intent(out) :: qc2(pcols,pver) ! Same as qc but only from shallow convection scheme
-
+
real(r8), intent(inout) :: cmfmc(pcols,pverp) ! Moist deep + shallow convection cloud mass flux [ kg/s/m2 ]
real(r8), intent(inout) :: qc(pcols,pver) ! dq/dt due to export of cloud water into environment by shallow
@@ -392,7 +393,7 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
! --------------- !
- ! Local Variables !
+ ! Local Variables !
! --------------- !
integer :: i, k, m
integer :: n, x
@@ -432,7 +433,7 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
real(r8) :: pcnb(pcols) ! Bottom pressure level of shallow + deep convective activity
real(r8) :: cmfsl(pcols,pverp ) ! Convective flux of liquid water static energy
real(r8) :: cmflq(pcols,pverp ) ! Convective flux of total water in energy unit
-
+
real(r8) :: ftem_preCu(pcols,pver) ! Saturation vapor pressure after shallow Cu convection
real(r8) :: tem2(pcols,pver) ! Saturation specific humidity and RH
real(r8) :: t_preCu(pcols,pver) ! Temperature after shallow Cu convection
@@ -442,7 +443,7 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
real(r8) :: icwmr_UW(pcols,pver) ! In-cloud Cumulus LWC [ kg/m2 ]
real(r8) :: icimr_UW(pcols,pver) ! In-cloud Cumulus IWC [ kg/m2 ]
real(r8) :: ptend_tracer(pcols,pver,pcnst) ! Tendencies of tracers
- real(r8) :: sum1, sum2, sum3, pdelx
+ real(r8) :: sum1, sum2, sum3, pdelx
real(r8) :: landfracdum(pcols)
real(r8), dimension(pcols,pver) :: sl, qt, slv
@@ -476,14 +477,14 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
type(unicon_out_t) :: unicon_out
! ----------------------- !
- ! Main Computation Begins !
+ ! Main Computation Begins !
! ----------------------- !
zero = 0._r8
nstep = get_nstep()
lchnk = state%lchnk
ncol = state%ncol
-
+
call physics_state_copy( state, state1 ) ! Copy state to local state1.
! Associate pointers with physics buffer fields
@@ -553,7 +554,7 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
snow = 0._r8
case('Hack') ! Hack scheme
-
+
lq(:) = .TRUE.
call physics_ptend_init( ptend_loc, state%psetcols, 'cmfmca', ls=.true., lq=lq ) ! Initialize local ptend type
@@ -565,7 +566,7 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
state%rpdel , state%zm , tpert , qpert , state%phis , &
pblh , state%t , state%q , ptend_loc%s , ptend_loc%q , &
cmfmc2 , rprdsh , cmfsl , cmflq , precc , &
- qc2 , cnt2 , cnb2 , icwmr , rliq2 , &
+ qc2 , cnt2 , cnb2 , icwmr , rliq2 , &
state%pmiddry, state%pdeldry, state%rpdeldry )
case('UW') ! UW shallow convection scheme
@@ -576,7 +577,7 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
! Initialize local ptend type
lq(:) = .TRUE.
- call physics_ptend_init( ptend_loc, state%psetcols, 'UWSHCU', ls=.true., lu=.true., lv=.true., lq=lq )
+ call physics_ptend_init( ptend_loc, state%psetcols, 'UWSHCU', ls=.true., lu=.true., lv=.true., lq=lq )
call pbuf_get_field(pbuf, cush_idx, cush ,(/1,itim_old/), (/pcols,1/))
call pbuf_get_field(pbuf, tke_idx, tke)
@@ -587,7 +588,7 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
call pbuf_get_field(pbuf, sh_e_ed_ratio_idx, sh_e_ed_ratio)
call compute_uwshcu_inv( pcols , pver , ncol , pcnst , ztodt , &
- state%pint, state%zi, state%pmid , state%zm , state%pdel , &
+ state%pint, state%zi, state%pmid , state%zm , state%pdel , &
state%u , state%v , state%q(:,:,1) , state%q(:,:,ixcldliq), state%q(:,:,ixcldice), &
state%t , state%s , state%q(:,:,:) , &
tke , cld , concld , pblh , cush , &
@@ -606,14 +607,14 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
! In addition, define 'icwmr' which includes both liquid and ice. !
! --------------------------------------------------------------------- !
- icwmr(:ncol,:) = iccmr_UW(:ncol,:)
+ icwmr(:ncol,:) = iccmr_UW(:ncol,:)
rprdsh(:ncol,:) = rprdsh(:ncol,:) + cmfdqs(:ncol,:)
do m = 4, pcnst
ptend_loc%q(:ncol,:pver,m) = ptend_tracer(:ncol,:pver,m)
enddo
! Conservation check
-
+
! do i = 1, ncol
! do m = 1, pcnst
! sum1 = 0._r8
@@ -626,8 +627,8 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
! pdelx = state%pdeldry(i,k)
! endif
! sum1 = sum1 + state%q(i,k,m)*pdelx
- ! sum2 = sum2 +(state%q(i,k,m)+ptend_loc%q(i,k,m)*ztodt)*pdelx
- ! sum3 = sum3 + ptend_loc%q(i,k,m)*pdelx
+ ! sum2 = sum2 +(state%q(i,k,m)+ptend_loc%q(i,k,m)*ztodt)*pdelx
+ ! sum3 = sum3 + ptend_loc%q(i,k,m)*pdelx
! enddo
! if( m .gt. 3 .and. abs(sum1) .gt. 1.e-13_r8 .and. abs(sum2-sum1)/sum1 .gt. 1.e-12_r8 ) then
!! if( m .gt. 3 .and. abs(sum3) .gt. 1.e-13_r8 ) then
@@ -671,7 +672,7 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
end select
- ! --------------------------------------------------------!
+ ! --------------------------------------------------------!
! Calculate fractional occurance of shallow convection !
! --------------------------------------------------------!
@@ -696,7 +697,7 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
! -------------------------------------------------------------- !
! 'cnt2' & 'cnb2' are from shallow, 'cnt' & 'cnb' are from deep !
- ! 'cnt2' & 'cnb2' are the interface indices of cloud top & base: !
+ ! 'cnt2' & 'cnb2' are the interface indices of cloud top & base: !
! cnt2 = float(kpen) !
! cnb2 = float(krel - 1) !
! Note that indices decreases with height. !
@@ -707,28 +708,28 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
if( cnb2(i) > cnb(i)) cnb(i) = cnb2(i)
if( cnb(i) == 1._r8 ) cnb(i) = cnt(i)
pcnt(i) = state%pmid(i,int(cnt(i)))
- pcnb(i) = state%pmid(i,int(cnb(i)))
+ pcnb(i) = state%pmid(i,int(cnb(i)))
end do
-
+
! ----------------------------------------------- !
! This quantity was previously known as CMFDQR. !
! Now CMFDQR is the shallow rain production only. !
! ----------------------------------------------- !
-
+
call pbuf_set_field(pbuf, rprdtot_idx, rprdsh(:ncol,:pver) + rprddp(:ncol,:pver), start=(/1,1/), kount=(/ncol,pver/))
-
- ! ----------------------------------------------------------------------- !
+
+ ! ----------------------------------------------------------------------- !
! Add shallow reserved cloud condensate to deep reserved cloud condensate !
! qc [ kg/kg/s] , rliq [ m/s ] !
! ----------------------------------------------------------------------- !
qc(:ncol,:pver) = qc(:ncol,:pver) + qc2(:ncol,:pver)
- rliq(:ncol) = rliq(:ncol) + rliq2(:ncol)
+ rliq(:ncol) = rliq(:ncol) + rliq2(:ncol)
! ---------------------------------------------------------------------------- !
! Output new partition of cloud condensate variables, as well as precipitation !
- ! ---------------------------------------------------------------------------- !
+ ! ---------------------------------------------------------------------------- !
if( microp_scheme == 'MG' ) then
call cnst_get_ind( 'NUMLIQ', ixnumliq )
@@ -752,12 +753,12 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
call outfld( 'CLDTOP' , cnt , pcols , lchnk )
call outfld( 'CLDBOT' , cnb , pcols , lchnk )
call outfld( 'PCLDTOP', pcnt , pcols , lchnk )
- call outfld( 'PCLDBOT', pcnb , pcols , lchnk )
+ call outfld( 'PCLDBOT', pcnb , pcols , lchnk )
call outfld( 'FREQSH' , freqsh , pcols , lchnk )
if( shallow_scheme .eq. 'UW' ) then
call outfld( 'CBMF' , cbmf , pcols , lchnk )
- call outfld( 'UWFLXPRC', flxprec , pcols , lchnk )
+ call outfld( 'UWFLXPRC', flxprec , pcols , lchnk )
call outfld( 'UWFLXSNW' , flxsnow , pcols , lchnk )
endif
@@ -795,8 +796,8 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
call outfld( 't_pre_Cu ', state1%t , pcols, lchnk )
call outfld( 'rh_pre_Cu ', ftem_preCu , pcols, lchnk )
- ! ----------------------------------------------- !
- ! Update physics state type state1 with ptend_loc !
+ ! ----------------------------------------------- !
+ ! Update physics state type state1 with ptend_loc !
! ----------------------------------------------- !
call physics_update( state1, ptend_loc, ztodt )
@@ -827,8 +828,8 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
call outfld( 't_aft_Cu ', state1%t , pcols, lchnk )
call outfld( 'rh_aft_Cu ', ftem , pcols, lchnk )
- tten(:ncol,:) = ( state1%t(:ncol,:pver) - t_preCu(:ncol,:) ) / ztodt
- rhten(:ncol,:) = ( ftem(:ncol,:) - ftem_preCu(:ncol,:) ) / ztodt
+ tten(:ncol,:) = ( state1%t(:ncol,:pver) - t_preCu(:ncol,:) ) / ztodt
+ rhten(:ncol,:) = ( ftem(:ncol,:) - ftem_preCu(:ncol,:) ) / ztodt
call outfld( 'tten_Cu ', tten , pcols, lchnk )
call outfld( 'rhten_Cu ', rhten , pcols, lchnk )
@@ -837,7 +838,7 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
! ------------------------------------------------------------------------ !
! UW-Shallow Cumulus scheme includes !
! evaporation physics inside in it. So when 'shallow_scheme = UW', we must !
- ! NOT perform below 'zm_conv_evap'. !
+ ! NOT perform below 'zm_conv_evap_run'. !
! ------------------------------------------------------------------------ !
if( shallow_scheme .eq. 'Hack' ) then
@@ -855,7 +856,7 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
lq(1) = .TRUE.
lq(2:) = .FALSE.
- call physics_ptend_init(ptend_loc, state1%psetcols, 'zm_conv_evap', ls=.true., lq=lq)
+ call physics_ptend_init(ptend_loc, state1%psetcols, 'zm_conv_evap_run', ls=.true., lq=lq)
call pbuf_get_field(pbuf, sh_flxprc_idx, flxprec )
call pbuf_get_field(pbuf, sh_flxsnw_idx, flxsnow )
@@ -866,17 +867,24 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
sh_cldliq(:ncol,:) = 0._r8
sh_cldice(:ncol,:) = 0._r8
- call zm_conv_evap( state1%ncol, state1%lchnk, &
- state1%t, state1%pmid, state1%pdel, state1%q(:pcols,:pver,1), &
- landfracdum, &
- ptend_loc%s, tend_s_snwprd, tend_s_snwevmlt, &
- ptend_loc%q(:pcols,:pver,1), &
- rprdsh, cld, ztodt, &
- precc, snow, ntprprd, ntsnprd , flxprec, flxsnow )
-
- ! ------------------------------------------ !
- ! record history variables from zm_conv_evap !
- ! ------------------------------------------ !
+ !REMOVECAM - no longer need these when CAM is retired and pcols no longer exists
+ tend_s_snwprd(:,:) = 0._r8
+ tend_s_snwevmlt(:,:) = 0._r8
+ snow(:) = 0._r8
+ !REMOVECAM_END
+
+ call zm_conv_evap_run(state1%ncol, pver, pverp, &
+ gravit, latice, latvap, tmelt, &
+ cpair, zmconv_ke, zmconv_ke_lnd, zmconv_org, &
+ state1%t(:ncol,:),state1%pmid(:ncol,:),state1%pdel(:ncol,:),state1%q(:ncol,:pver,1), &
+ landfracdum(:ncol), &
+ ptend_loc%s(:ncol,:), tend_s_snwprd(:ncol,:), tend_s_snwevmlt(:ncol,:), ptend_loc%q(:ncol,:pver,1), &
+ rprdsh(:ncol,:), cld(:ncol,:), ztodt, &
+ precc(:ncol), snow(:ncol), ntprprd(:ncol,:), ntsnprd(:ncol,:), flxprec(:ncol,:), flxsnow(:ncol,:) )
+
+ ! ---------------------------------------------- !
+ ! record history variables from zm_conv_evap_run !
+ ! ---------------------------------------------- !
evapcsh(:ncol,:pver) = ptend_loc%q(:ncol,:pver,1)
@@ -894,7 +902,7 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
call outfld( 'HKNTSNPD' , ntsnprd , pcols, lchnk )
call outfld( 'HKEIHEAT' , ptend_loc%s , pcols, lchnk )
- ! ---------------------------------------------------------------- !
+ ! ---------------------------------------------------------------- !
! Add tendency from this process to tend from other processes here !
! ---------------------------------------------------------------- !
diff --git a/src/physics/cam/cospsimulator_intr.F90 b/src/physics/cam/cospsimulator_intr.F90
index 7dea97d94e..855a8e82d5 100644
--- a/src/physics/cam/cospsimulator_intr.F90
+++ b/src/physics/cam/cospsimulator_intr.F90
@@ -220,7 +220,7 @@ module cospsimulator_intr
! pbuf indices
integer :: cld_idx, concld_idx, lsreffrain_idx, lsreffsnow_idx, cvreffliq_idx
integer :: cvreffice_idx, dpcldliq_idx, dpcldice_idx
- integer :: shcldliq_idx, shcldice_idx, shcldliq1_idx, shcldice1_idx, dpflxprc_idx
+ integer :: shcldliq1_idx, shcldice1_idx, dpflxprc_idx
integer :: dpflxsnw_idx, shflxprc_idx, shflxsnw_idx, lsflxprc_idx, lsflxsnw_idx
integer :: rei_idx, rel_idx
@@ -687,7 +687,7 @@ subroutine cospsimulator_intr_init()
use mod_cosp_config, only : R_UNDEF
integer :: ncid,latid,lonid,did,hrid,minid,secid, istat
- integer :: i
+ integer :: i, ierr
! ISCCP OUTPUTS
if (lisccp_sim) then
@@ -1164,14 +1164,12 @@ subroutine cospsimulator_intr_init()
cvreffice_idx = pbuf_get_index('CV_REFFICE')
dpcldliq_idx = pbuf_get_index('DP_CLDLIQ')
dpcldice_idx = pbuf_get_index('DP_CLDICE')
- shcldliq_idx = pbuf_get_index('SH_CLDLIQ')
- shcldice_idx = pbuf_get_index('SH_CLDICE')
shcldliq1_idx = pbuf_get_index('SH_CLDLIQ1')
shcldice1_idx = pbuf_get_index('SH_CLDICE1')
dpflxprc_idx = pbuf_get_index('DP_FLXPRC')
dpflxsnw_idx = pbuf_get_index('DP_FLXSNW')
- shflxprc_idx = pbuf_get_index('SH_FLXPRC')
- shflxsnw_idx = pbuf_get_index('SH_FLXSNW')
+ shflxprc_idx = pbuf_get_index('SH_FLXPRC', errcode=ierr)
+ shflxsnw_idx = pbuf_get_index('SH_FLXSNW', errcode=ierr)
lsflxprc_idx = pbuf_get_index('LS_FLXPRC')
lsflxsnw_idx = pbuf_get_index('LS_FLXSNW')
@@ -1411,6 +1409,7 @@ subroutine cospsimulator_intr_run(state,pbuf, cam_in,emis,coszrs,cld_swtau_in,sn
real(r8), pointer, dimension(:,:) :: cv_reffice ! convective cld ice effective drop size (microns)
!! precip flux pointers (use for cam4 or cam5)
+ real(r8), target, dimension(pcols,pverp) :: zero_ifc ! zero array for interface fields not in the pbuf
! Added pointers; pbuff in zm_conv_intr.F90, calc in zm_conv.F90
real(r8), pointer, dimension(:,:) :: dp_flxprc ! deep interface gbm flux_convective_cloud_rain+snow (kg m^-2 s^-1)
real(r8), pointer, dimension(:,:) :: dp_flxsnw ! deep interface gbm flux_convective_cloud_snow (kg m^-2 s^-1)
@@ -1567,6 +1566,8 @@ subroutine cospsimulator_intr_run(state,pbuf, cam_in,emis,coszrs,cld_swtau_in,sn
lchnk = state%lchnk ! state variable contains a number of columns, one chunk
ncol = state%ncol ! number of columns in the chunk
+ zero_ifc = 0._r8
+
! Initialize temporary variables as R_UNDEF - need to do this otherwise array expansion puts garbage in history
! file for columns over which COSP did make calculations.
tmp(1:pcols) = R_UNDEF
@@ -1807,8 +1808,16 @@ subroutine cospsimulator_intr_run(state,pbuf, cam_in,emis,coszrs,cld_swtau_in,sn
!! precipitation fluxes (use for both cam4 and cam5 for now....)
call pbuf_get_field(pbuf, dpflxprc_idx, dp_flxprc )
call pbuf_get_field(pbuf, dpflxsnw_idx, dp_flxsnw )
- call pbuf_get_field(pbuf, shflxprc_idx, sh_flxprc )
- call pbuf_get_field(pbuf, shflxsnw_idx, sh_flxsnw )
+ if (shflxprc_idx > 0) then
+ call pbuf_get_field(pbuf, shflxprc_idx, sh_flxprc )
+ else
+ sh_flxprc => zero_ifc
+ end if
+ if (shflxsnw_idx > 0) then
+ call pbuf_get_field(pbuf, shflxsnw_idx, sh_flxsnw )
+ else
+ sh_flxsnw => zero_ifc
+ end if
call pbuf_get_field(pbuf, lsflxprc_idx, ls_flxprc )
call pbuf_get_field(pbuf, lsflxsnw_idx, ls_flxsnw )
diff --git a/src/physics/cam/geopotential.F90 b/src/physics/cam/geopotential.F90
index b06b145e51..ad49e470c4 100644
--- a/src/physics/cam/geopotential.F90
+++ b/src/physics/cam/geopotential.F90
@@ -1,4 +1,3 @@
-
module geopotential
!---------------------------------------------------------------------------------
@@ -8,7 +7,7 @@ module geopotential
! The hydrostatic matrix elements must be consistent with the dynamics algorithm.
! The diagonal element is the itegration weight from interface k+1 to midpoint k.
! The offdiagonal element is the weight between interfaces.
-!
+!
! Author: B.Boville, Feb 2001 from earlier code by Boville and S.J. Lin
!---------------------------------------------------------------------------------
@@ -20,102 +19,9 @@ module geopotential
private
save
- public geopotential_dse
public geopotential_t
contains
-!===============================================================================
- subroutine geopotential_dse( &
- piln , pmln , pint , pmid , pdel , rpdel , &
- dse , q , phis , rair , gravit , cpair , &
- zvir , t , zi , zm , ncol )
-!-----------------------------------------------------------------------
-!
-! Purpose:
-! Compute the temperature and geopotential height (above the surface) at the
-! midpoints and interfaces from the input dry static energy and pressures.
-!
-!-----------------------------------------------------------------------
-!------------------------------Arguments--------------------------------
-!
-! Input arguments
- integer, intent(in) :: ncol ! Number of longitudes
-
- ! rair, and cpair are passed in as slices of rank 3 arrays allocated
- ! at runtime. Don't specify size to avoid temporary copy.
- real(r8), intent(in) :: piln (:,:) ! (pcols,pverp) - Log interface pressures
- real(r8), intent(in) :: pmln (:,:) ! (pcols,pver) - Log midpoint pressures
- real(r8), intent(in) :: pint (:,:) ! (pcols,pverp) - Interface pressures
- real(r8), intent(in) :: pmid (:,:) ! (pcols,pver) - Midpoint pressures
- real(r8), intent(in) :: pdel (:,:) ! (pcols,pver) - layer thickness
- real(r8), intent(in) :: rpdel(:,:) ! (pcols,pver) - inverse of layer thickness
- real(r8), intent(in) :: dse (:,:) ! (pcols,pver) - dry static energy
- real(r8), intent(in) :: q (:,:) ! (pcols,pver) - specific humidity
- real(r8), intent(in) :: phis (:) ! (pcols) - surface geopotential
- real(r8), intent(in) :: rair (:,:) ! - Gas constant for dry air
- real(r8), intent(in) :: gravit ! - Acceleration of gravity
- real(r8), intent(in) :: cpair(:,:) ! - specific heat at constant p for dry air
- real(r8), intent(in) :: zvir (:,:) ! (pcols,pver) - rh2o/rair - 1
-
-! Output arguments
-
- real(r8), intent(out) :: t(:,:) ! (pcols,pver) - temperature
- real(r8), intent(out) :: zi(:,:) ! (pcols,pverp) - Height above surface at interfaces
- real(r8), intent(out) :: zm(:,:) ! (pcols,pver) - Geopotential height at mid level
-!
-!---------------------------Local variables-----------------------------------------
-!
- logical :: calc1 ! switch for calculation method
- integer :: i,k ! Lon, level, level indices
- real(r8) :: hkk(ncol) ! diagonal element of hydrostatic matrix
- real(r8) :: hkl(ncol) ! off-diagonal element
- real(r8) :: rog(ncol,pver) ! Rair / gravit
- real(r8) :: tv ! virtual temperature
- real(r8) :: tvfac ! Tv/T
-!
-!----------------------------------------------------------------------------------
- rog(:ncol,:) = rair(:ncol,:) / gravit
-
-! set calculation method based on dycore type
- calc1 = dycore_is ('LR').or.dycore_is('FV3')
-
-! The surface height is zero by definition.
- do i = 1,ncol
- zi(i,pverp) = 0.0_r8
- end do
-
-! Compute the virtual temperature, zi, zm from bottom up
-! Note, zi(i,k) is the interface above zm(i,k)
- do k = pver, 1, -1
-
-! First set hydrostatic elements consistent with dynamics
- if (calc1) then
- do i = 1,ncol
- hkl(i) = piln(i,k+1) - piln(i,k)
- hkk(i) = 1._r8 - pint(i,k) * hkl(i) * rpdel(i,k)
- end do
- else
- do i = 1,ncol
- hkl(i) = pdel(i,k) / pmid(i,k)
- hkk(i) = 0.5_r8 * hkl(i)
- end do
- end if
-
-! Now compute tv, t, zm, zi
- do i = 1,ncol
- tvfac = 1._r8 + zvir(i,k) * q(i,k)
- tv = (dse(i,k) - phis(i) - gravit*zi(i,k+1)) / ((cpair(i,k) / tvfac) + &
- rair(i,k)*hkk(i))
-
- t (i,k) = tv / tvfac
-
- zm(i,k) = zi(i,k+1) + rog(i,k) * tv * hkk(i)
- zi(i,k) = zi(i,k+1) + rog(i,k) * tv * hkl(i)
- end do
- end do
-
- return
- end subroutine geopotential_dse
!===============================================================================
subroutine geopotential_t( &
@@ -123,16 +29,18 @@ subroutine geopotential_t( &
t , q , rair , gravit , zvir , &
zi , zm , ncol )
-!-----------------------------------------------------------------------
-!
-! Purpose:
-! Compute the geopotential height (above the surface) at the midpoints and
+!-----------------------------------------------------------------------
+!
+! Purpose:
+! Compute the geopotential height (above the surface) at the midpoints and
! interfaces using the input temperatures and pressures.
!
!-----------------------------------------------------------------------
-use ppgrid, only : pcols
-
+use ppgrid, only: pcols
+use constituents, only: pcnst, cnst_get_ind
+use ccpp_constituent_prop_mod, only: ccpp_const_props !CCPP constituent properties array (CAM version)
+use geopotential_temp, only: geopotential_temp_run !CCPP version
!------------------------------Arguments--------------------------------
!
! Input arguments
@@ -146,7 +54,7 @@ subroutine geopotential_t( &
real(r8), intent(in) :: pdel (:,:) ! (pcols,pver) - layer thickness
real(r8), intent(in) :: rpdel(:,:) ! (pcols,pver) - inverse of layer thickness
real(r8), intent(in) :: t (:,:) ! (pcols,pver) - temperature
- real(r8), intent(in) :: q (:,:) ! (pcols,pver) - specific humidity
+ real(r8), intent(in) :: q (:,:,:) ! (pcols,pver,:)- tracers (moist mixing ratios)
real(r8), intent(in) :: rair (:,:) ! (pcols,pver) - Gas constant for dry air
real(r8), intent(in) :: gravit ! - Acceleration of gravity
real(r8), intent(in) :: zvir (:,:) ! (pcols,pver) - rh2o/rair - 1
@@ -158,57 +66,88 @@ subroutine geopotential_t( &
!
!---------------------------Local variables-----------------------------
!
- integer :: i,k ! Lon, level indices
+ logical :: lagrang ! Lagrangian vertical coordinate flag
+ integer :: ixq ! state constituent array index for water vapor
+ integer :: i,k,idx ! Lon, level indices, water species index
real(r8) :: hkk(ncol) ! diagonal element of hydrostatic matrix
real(r8) :: hkl(ncol) ! off-diagonal element
real(r8) :: rog(ncol,pver) ! Rair / gravit
real(r8) :: tv ! virtual temperature
real(r8) :: tvfac ! Tv/T
+ real(r8) :: qfac(ncol,pver) ! factor to convert from wet to dry mixing ratio
+ real(r8) :: sum_dry_mixing_ratio(ncol,pver)! sum of dry water mixing ratios
+
+ !CCPP-required variables (not used):
+ integer :: errflg
+ character(len=512) :: errmsg
+
!
!-----------------------------------------------------------------------
!
- rog(:ncol,:) = rair(:ncol,:) / gravit
+ !Determine index for water vapor mass mixing ratio
+ call cnst_get_ind('Q', ixq)
-! The surface height is zero by definition.
+ !
+ ! original code for backwards compatability with FV and EUL
+ !
+ if (.not.(dycore_is('MPAS') .or. dycore_is('SE'))) then
- do i = 1,ncol
- zi(i,pverp) = 0.0_r8
- end do
+ !dry air gas constant over gravity
+ rog(:ncol,:) = rair(:ncol,:) / gravit
-! Compute zi, zm from bottom up.
-! Note, zi(i,k) is the interface above zm(i,k)
+ ! The surface height is zero by definition.
+ do i = 1,ncol
+ zi(i,pverp) = 0.0_r8
+ end do
- do k = pver, 1, -1
+ ! Compute zi, zm from bottom up.
+ ! Note, zi(i,k) is the interface above zm(i,k)
+ do k = pver, 1, -1
-! First set hydrostatic elements consistent with dynamics
+ ! First set hydrostatic elements consistent with dynamics
- if ((dycore_is('LR') .or. dycore_is('FV3'))) then
- do i = 1,ncol
- hkl(i) = piln(i,k+1) - piln(i,k)
- hkk(i) = 1._r8 - pint(i,k) * hkl(i) * rpdel(i,k)
- end do
- else!MPAS, SE or EUL
- !
- ! For EUL and SE: pmid = 0.5*(pint(k+1)+pint(k))
- ! For MPAS : pmid is computed from theta_m, rhodry, etc.
- !
- do i = 1,ncol
- hkl(i) = pdel(i,k) / pmid(i,k)
- hkk(i) = 0.5_r8 * hkl(i)
- end do
- end if
+ if ((dycore_is('LR') .or. dycore_is('FV3'))) then
+ do i = 1,ncol
+ hkl(i) = piln(i,k+1) - piln(i,k)
+ hkk(i) = 1._r8 - pint(i,k) * hkl(i) * rpdel(i,k)
+ end do
+ else
+ do i = 1,ncol
+ hkl(i) = pdel(i,k) / pmid(i,k)
+ hkk(i) = 0.5_r8 * hkl(i)
+ end do
+ end if
-! Now compute tv, zm, zi
+ ! Now compute tv, zm, zi
- do i = 1,ncol
- tvfac = 1._r8 + zvir(i,k) * q(i,k)
+ do i = 1,ncol
+ tvfac = 1._r8 + zvir(i,k) * q(i,k,ixq)
tv = t(i,k) * tvfac
zm(i,k) = zi(i,k+1) + rog(i,k) * tv * hkk(i)
zi(i,k) = zi(i,k+1) + rog(i,k) * tv * hkl(i)
- end do
- end do
+ end do
+ end do
+ else !Using MPAS or SE dycore
+
+ !Determine vertical coordinate type,
+ !NOTE: Currently the FV (LR) or FV3 dycores
+ ! do not allow for condensate loading,
+ ! so for now 'lagrang' will always be FALSE.
+ if ((dycore_is('LR') .or. dycore_is('FV3'))) then
+ lagrang = .true.
+ else
+ lagrang = .false.
+ end if
+
+ !Use CCPP version of geopotential_t:
+ call geopotential_temp_run(pver, lagrang, pver, 1, pverp, 1, &
+ pcnst, piln(1:ncol,:), pint(1:ncol,:), pmid(1:ncol,:), &
+ pdel(1:ncol,:), rpdel(1:ncol,:), t(1:ncol,:), &
+ q(1:ncol,:,ixq), q(1:ncol,:,:), ccpp_const_props, &
+ rair(1:ncol,:), gravit, zvir(1:ncol,:), zi(1:ncol,:), &
+ zm(1:ncol,:), ncol, errflg, errmsg)
- return
+ end if
end subroutine geopotential_t
end module geopotential
diff --git a/src/physics/cam/gw_drag.F90 b/src/physics/cam/gw_drag.F90
index 9788ef79ab..0f48e661af 100644
--- a/src/physics/cam/gw_drag.F90
+++ b/src/physics/cam/gw_drag.F90
@@ -72,7 +72,7 @@ module gw_drag
! Factor for SH orographic waves.
real(r8) :: gw_oro_south_fac = 1._r8
-
+
! Frontogenesis function critical threshold.
real(r8) :: frontgfc = unset_r8
@@ -136,9 +136,6 @@ module gw_drag
type(BeresSourceDesc) :: beres_dp_desc
type(BeresSourceDesc) :: beres_sh_desc
- ! Width of gaussian used to create frontogenesis tau profile [m/s].
- real(r8), parameter :: front_gaussian_width = 30._r8
-
! Frontogenesis wave settings.
type(CMSourceDesc) :: cm_desc
type(CMSourceDesc) :: cm_igw_desc
@@ -183,12 +180,15 @@ module gw_drag
character(len=1), parameter :: beres_dp_pf = "B"
character(len=1), parameter :: beres_sh_pf = "S"
- ! namelist
+ ! namelist
logical :: history_amwg ! output the variables used by the AMWG diag package
logical :: gw_lndscl_sgh = .true. ! scale SGH by land frac
real(r8) :: gw_prndl = 0.25_r8
real(r8) :: gw_qbo_hdepth_scaling = 1._r8 ! heating depth scaling factor
+ ! Width of gaussian used to create frontogenesis tau profile [m/s].
+ real(r8) :: front_gaussian_width = -huge(1._r8)
+
logical :: gw_top_taper=.false.
real(r8), pointer :: vramp(:)=>null()
@@ -232,7 +232,7 @@ subroutine gw_drag_readnl(nlfile)
rdg_gamma_cd_llb, trpd_leewv_rdg_gamma, bnd_rdggm, &
gw_oro_south_fac, gw_limit_tau_without_eff, &
gw_lndscl_sgh, gw_prndl, gw_apply_tndmax, gw_qbo_hdepth_scaling, &
- gw_top_taper
+ gw_top_taper, front_gaussian_width
!----------------------------------------------------------------------
if (use_simple_phys) return
@@ -333,6 +333,8 @@ subroutine gw_drag_readnl(nlfile)
call mpi_bcast(gw_drag_file_sh, len(gw_drag_file_sh), mpi_character, mstrid, mpicom, ierr)
if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: gw_drag_file_sh")
+ call mpi_bcast(front_gaussian_width, 1, mpi_real8, mstrid, mpicom, ierr)
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: front_gaussian_width")
! Check if fcrit2 was set.
call shr_assert(fcrit2 /= unset_r8, &
@@ -379,7 +381,7 @@ subroutine gw_init()
! temporary for restart with ridge scheme
use cam_initfiles, only: bnd_topo
-
+
use cam_pio_utils, only: cam_pio_openfile
use cam_grid_support, only: cam_grid_check, cam_grid_id
use cam_grid_support, only: cam_grid_get_dim_names
@@ -539,7 +541,7 @@ subroutine gw_init()
! Initialize subordinate modules.
call gw_common_init(pver,&
- tau_0_ubc, ktop, gravit, rair, alpha, gw_prndl, &
+ tau_0_ubc, ktop, gravit, rair, alpha, gw_prndl, &
gw_qbo_hdepth_scaling, errstring )
call shr_assert(trim(errstring) == "", "gw_common_init: "//errstring// &
errMsg(__FILE__, __LINE__))
@@ -551,7 +553,7 @@ subroutine gw_init()
&but effgw_oro was not set.")
end if
end if
-
+
if (use_gw_oro .or. use_gw_rdg_beta .or. use_gw_rdg_gamma) then
sgh_idx = pbuf_get_index('SGH')
@@ -611,7 +613,7 @@ subroutine gw_init()
! Try to open topo file here. This workaround will not be needed
! once the refactored initialization sequence is on trunk.
-
+
allocate(fh_topo)
! Error exit is from getfil if file not found.
call getfil(bnd_topo, bnd_topo_loc)
@@ -627,12 +629,12 @@ subroutine gw_init()
rdg_mxdis(pcols,prdg,begchunk:endchunk), &
rdg_anixy(pcols,prdg,begchunk:endchunk), &
rdg_angll(pcols,prdg,begchunk:endchunk) )
-
+
call infld('GBXAR', fh_topo, dim1name, dim2name, 1, pcols, &
begchunk, endchunk, rdg_gbxar, found, gridname='physgrid')
if (.not. found) call endrun(sub//': ERROR: GBXAR not found on topo file')
rdg_gbxar = rdg_gbxar * (rearth/1000._r8)*(rearth/1000._r8) ! transform to km^2
-
+
call infld('HWDTH', fh_topo, dim1name, 'nrdg', dim2name, 1, pcols, &
1, prdg, begchunk, endchunk, rdg_hwdth, found, gridname='physgrid')
if (.not. found) call endrun(sub//': ERROR: HWDTH not found on topo file')
@@ -707,7 +709,7 @@ subroutine gw_init()
'interface geopotential heights in GW code ' )
call addfld('ZMGW', (/ 'lev' /) , 'A' ,'m' , &
'midlayer geopotential heights in GW code ' )
-
+
call addfld('TAUM1_DIAG' , (/ 'ilev' /) , 'I' ,'N/m2' , &
'Ridge based momentum flux profile')
call addfld('TAU1RDGBETAM' , (/ 'ilev' /) , 'I' ,'N/m2' , &
@@ -749,7 +751,7 @@ subroutine gw_init()
if (effgw_rdg_gamma == unset_r8) then
call endrun(sub//": ERROR: Anisotropic OGW enabled, but effgw_rdg_gamma was not set.")
end if
-
+
call getfil(bnd_rdggm, bnd_rdggm_loc, iflag=1, lexist=found)
if (found) then
call cam_pio_openfile(fh_rdggm, bnd_rdggm_loc, PIO_NOWRITE)
@@ -793,7 +795,7 @@ subroutine gw_init()
call infld('ANGLL', fh_rdggm, dim1name, 'nrdg', dim2name, 1, pcols, &
1, prdg, begchunk, endchunk, rdg_angllg, found, gridname='physgrid')
if (.not. found) call endrun(sub//': ERROR: ANGLL not found on bnd_rdggm')
-
+
call pio_closefile(fh_rdggm)
call addfld ('TAU1RDGGAMMAM' , (/ 'ilev' /) , 'I' ,'N/m2' , &
@@ -1365,7 +1367,7 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat)
real(r8), parameter :: degree2radian = pi/180._r8
real(r8), parameter :: al0 = 82.5_r8 * degree2radian
real(r8), parameter :: dlat0 = 5.0_r8 * degree2radian
-
+
! effective gw diffusivity at interfaces needed for output
real(r8) :: egwdffi(state%ncol,pver+1)
! sum from the two types of spectral GW
@@ -1451,7 +1453,7 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat)
! Totals that accumulate over different sources.
egwdffi_tot = 0._r8
flx_heat = 0._r8
-
+
if (use_gw_convect_dp) then
!------------------------------------------------------------------
! Convective gravity waves (Beres scheme, deep).
@@ -1802,7 +1804,7 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat)
! Efficiency of gravity wave momentum transfer.
! Take into account that wave sources are only over land.
call pbuf_get_field(pbuf, sgh_idx, sgh)
-
+
if (gw_lndscl_sgh) then
where (cam_in%landfrac(:ncol) >= epsilon(1._r8))
effgw = effgw_oro * cam_in%landfrac(:ncol)
@@ -1969,7 +1971,7 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat)
! Write totals to history file.
call outfld('EKGW', egwdffi_tot , ncol, lchnk)
call outfld('TTGW', ptend%s/cpairv(:,:,lchnk), pcols, lchnk)
-
+
call outfld('UTGW_TOTAL', ptend%u, pcols, lchnk)
call outfld('VTGW_TOTAL', ptend%v, pcols, lchnk)
@@ -2143,7 +2145,7 @@ subroutine gw_rdg_calc( &
! initialize accumulated momentum fluxes and tendencies
taurx = 0._r8
- taury = 0._r8
+ taury = 0._r8
ttrdg = 0._r8
utrdg = 0._r8
vtrdg = 0._r8
@@ -2151,36 +2153,36 @@ subroutine gw_rdg_calc( &
do nn = 1, n_rdg
kwvrdg = 0.001_r8 / ( hwdth(:,nn) + 0.001_r8 ) ! this cant be done every time step !!!
- isoflag = 0
+ isoflag = 0
effgw = effgw_rdg * ( hwdth(1:ncol,nn)* clngt(1:ncol,nn) ) / gbxar(1:ncol)
effgw = min( effgw_rdg_max , effgw )
call gw_rdg_src(ncol, band_oro, p, &
u, v, t, mxdis(:,nn), angll(:,nn), anixy(:,nn), kwvrdg, isoflag, zi, nm, &
- src_level, tend_level, bwv_level, tlb_level, tau, ubm, ubi, xv, yv, &
+ src_level, tend_level, bwv_level, tlb_level, tau, ubm, ubi, xv, yv, &
ubmsrc, usrc, vsrc, nsrc, rsrc, m2src, tlb, bwv, Fr1, Fr2, Frx, c)
call gw_rdg_belowpeak(ncol, band_oro, rdg_cd_llb, &
- t, mxdis(:,nn), anixy(:,nn), kwvrdg, &
+ t, mxdis(:,nn), anixy(:,nn), kwvrdg, &
zi, nm, ni, rhoi, &
- src_level, tau, &
- ubmsrc, nsrc, rsrc, m2src, tlb, bwv, Fr1, Fr2, Frx, &
+ src_level, tau, &
+ ubmsrc, nsrc, rsrc, m2src, tlb, bwv, Fr1, Fr2, Frx, &
tauoro, taudsw, hdspwv, hdspdw)
call gw_rdg_break_trap(ncol, band_oro, &
- zi, nm, ni, ubm, ubi, rhoi, kwvrdg , bwv, tlb, wbr, &
- src_level, tlb_level, hdspwv, hdspdw, mxdis(:,nn), &
- tauoro, taudsw, tau, &
+ zi, nm, ni, ubm, ubi, rhoi, kwvrdg , bwv, tlb, wbr, &
+ src_level, tlb_level, hdspwv, hdspdw, mxdis(:,nn), &
+ tauoro, taudsw, tau, &
ldo_trapped_waves=trpd_leewv)
-
+
call gw_drag_prof(ncol, band_oro, p, src_level, tend_level, dt, &
t, vramp, &
piln, rhoi, nm, ni, ubm, ubi, xv, yv, &
effgw, c, kvtt, q, dse, tau, utgw, vtgw, &
ttgw, qtgw, egwdffi, gwut, dttdf, dttke, &
- kwvrdg=kwvrdg, &
+ kwvrdg=kwvrdg, &
satfac_in = 1._r8, lapply_vdiff=gw_rdg_do_vdiff , tau_diag=tau_diag )
! Add the tendencies from each ridge to the totals.
diff --git a/src/physics/cam/hb_diff.F90 b/src/physics/cam/hb_diff.F90
index f1b67d68a0..ba97978e72 100644
--- a/src/physics/cam/hb_diff.F90
+++ b/src/physics/cam/hb_diff.F90
@@ -35,6 +35,7 @@ module hb_diff
! Public interfaces
public init_hb_diff
public compute_hb_diff
+ public compute_hb_free_atm_diff
public pblintd
!
! PBL limits
@@ -131,7 +132,7 @@ end subroutine init_hb_diff
!===============================================================================
- subroutine compute_hb_diff(lchnk, ncol, &
+ subroutine compute_hb_diff(ncol , &
th ,t ,q ,z ,zi , &
pmid ,u ,v ,taux ,tauy , &
shflx ,qflx ,obklen ,ustar ,pblh , &
@@ -139,8 +140,8 @@ subroutine compute_hb_diff(lchnk, ncol, &
tpert ,qpert ,cldn ,ocnfrac ,tke , &
ri , &
eddy_scheme)
- !-----------------------------------------------------------------------
- !
+ !-----------------------------------------------------------------------
+ !
! Purpose:
! Interface routines for calcualtion and diatnostics of turbulence related
! coefficients
@@ -155,7 +156,6 @@ subroutine compute_hb_diff(lchnk, ncol, &
!
! Input arguments
!
- integer, intent(in) :: lchnk ! chunk index (for debug only)
integer, intent(in) :: ncol ! number of atmospheric columns
real(r8), intent(in) :: th(pcols,pver) ! potential temperature [K]
@@ -196,8 +196,8 @@ subroutine compute_hb_diff(lchnk, ncol, &
real(r8) :: rrho(pcols) ! 1./bottom level density
real(r8) :: wstar(pcols) ! convective velocity scale [m/s]
real(r8) :: kqfs(pcols) ! kinematic surf constituent flux (kg/m2/s)
- real(r8) :: khfs(pcols) ! kinimatic surface heat flux
- real(r8) :: kbfs(pcols) ! surface buoyancy flux
+ real(r8) :: khfs(pcols) ! kinimatic surface heat flux
+ real(r8) :: kbfs(pcols) ! surface buoyancy flux
real(r8) :: kvf(pcols,pverp) ! free atmospheric eddy diffsvty [m2/s]
real(r8) :: s2(pcols,pver) ! shear squared
real(r8) :: n2(pcols,pver) ! brunt vaisaila frequency
@@ -236,7 +236,7 @@ subroutine compute_hb_diff(lchnk, ncol, &
!
! Get pbl exchange coefficients
!
- call austausch_pbl(lchnk, ncol, &
+ call austausch_pbl(ncol , &
z ,kvf ,kqfs ,khfs ,kbfs , &
obklen ,ustar ,wstar ,pblh ,kvm , &
kvh ,cgh ,cgs ,tpert ,qpert , &
@@ -244,9 +244,95 @@ subroutine compute_hb_diff(lchnk, ncol, &
!
kvq(:ncol,:) = kvh(:ncol,:)
-
- return
end subroutine compute_hb_diff
+
+ subroutine compute_hb_free_atm_diff(ncol, &
+ th ,t ,q ,z , &
+ pmid ,u ,v ,taux ,tauy , &
+ shflx ,qflx ,obklen ,ustar , &
+ kvm ,kvh ,kvq ,cgh ,cgs , &
+ ri )
+ !-----------------------------------------------------------------------
+ !
+ ! This is a version of compute_hb_diff that only computes free
+ ! atmosphere exchange (no PBL computations)
+ !
+ ! Author: B. Stevens (rewrite August 2000)
+ ! Modified by Thomas Toniazzo and Peter H. Lauritzen (June 2023)
+ !
+ !-----------------------------------------------------------------------
+
+ use pbl_utils, only: virtem, calc_ustar, calc_obklen, austausch_atm
+
+ !------------------------------Arguments--------------------------------
+ !
+ ! Input arguments
+ !
+ integer, intent(in) :: ncol ! number of atmospheric columns
+
+ real(r8), intent(in) :: th(pcols,pver) ! potential temperature [K]
+ real(r8), intent(in) :: t(pcols,pver) ! temperature (used for density)
+ real(r8), intent(in) :: q(pcols,pver) ! specific humidity [kg/kg]
+ real(r8), intent(in) :: z(pcols,pver) ! height above surface [m]
+ real(r8), intent(in) :: u(pcols,pver) ! zonal velocity
+ real(r8), intent(in) :: v(pcols,pver) ! meridional velocity
+ real(r8), intent(in) :: taux(pcols) ! zonal stress [N/m2]
+ real(r8), intent(in) :: tauy(pcols) ! meridional stress [N/m2]
+ real(r8), intent(in) :: shflx(pcols) ! sensible heat flux
+ real(r8), intent(in) :: qflx(pcols) ! water vapor flux
+ real(r8), intent(in) :: pmid(pcols,pver) ! midpoint pressures
+ !
+ ! Output arguments
+ !
+ real(r8), intent(out) :: kvm(pcols,pverp) ! eddy diffusivity for momentum [m2/s]
+ real(r8), intent(out) :: kvh(pcols,pverp) ! eddy diffusivity for heat [m2/s]
+ real(r8), intent(out) :: kvq(pcols,pverp) ! eddy diffusivity for constituents [m2/s]
+ real(r8), intent(out) :: cgh(pcols,pverp) ! counter-gradient term for heat [J/kg/m]
+ real(r8), intent(out) :: cgs(pcols,pverp) ! counter-gradient star (cg/flux)
+ real(r8), intent(out) :: ustar(pcols) ! surface friction velocity [m/s]
+ real(r8), intent(out) :: obklen(pcols) ! Obukhov length
+ real(r8), intent(out) :: ri(pcols,pver) ! richardson number: n2/s2
+ !
+ !---------------------------Local workspace-----------------------------
+ !
+ real(r8) :: thv(pcols,pver) ! virtual potential temperature
+ real(r8) :: rrho(pcols) ! 1./bottom level density
+ real(r8) :: kqfs(pcols) ! kinematic surf constituent flux (kg/m2/s)
+ real(r8) :: khfs(pcols) ! kinimatic surface heat flux
+ real(r8) :: kbfs(pcols) ! surface buoyancy flux
+ real(r8) :: kvf(pcols,pverp) ! free atmospheric eddy diffsvty [m2/s]
+ real(r8) :: s2(pcols,pver) ! shear squared
+ real(r8) :: n2(pcols,pver) ! brunt vaisaila frequency
+
+ ! virtual potential temperature
+ call virtem(ncol, (pver-ntop_turb+1), th(:ncol,ntop_turb:),q(:ncol,ntop_turb:), thv(:ncol,ntop_turb:))
+
+ ! Compute ustar, Obukhov length, and kinematic surface fluxes.
+ call calc_ustar(ncol, t(:ncol,pver),pmid(:ncol,pver),taux(:ncol),tauy(:ncol), &
+ rrho(:ncol),ustar(:ncol))
+ call calc_obklen(ncol, th(:ncol,pver), thv(:ncol,pver), qflx(:ncol), &
+ shflx(:ncol), rrho(:ncol), ustar(:ncol), &
+ khfs(:ncol), kqfs(:ncol), kbfs(:ncol), &
+ obklen(:ncol))
+ ! Calculate s2, n2, and Richardson number.
+ call trbintd(ncol , &
+ thv ,z ,u ,v , &
+ s2 ,n2 ,ri )
+ !
+ ! Get free atmosphere exchange coefficients
+ !
+ call austausch_atm(pcols, ncol, pver, ntop_turb, nbot_turb, &
+ ml2, ri, s2, kvf)
+
+ kvq(:ncol,:) = kvf(:ncol,:)
+ kvm(:ncol,:) = kvf(:ncol,:)
+ kvh(:ncol,:) = kvf(:ncol,:)
+ cgh(:ncol,:) = 0._r8
+ cgs(:ncol,:) = 0._r8
+
+ end subroutine compute_hb_free_atm_diff
+
+
!
!===============================================================================
subroutine trbintd(ncol , &
@@ -488,7 +574,7 @@ subroutine pblintd(ncol , &
end subroutine pblintd
!
!===============================================================================
- subroutine austausch_pbl(lchnk ,ncol , &
+ subroutine austausch_pbl(ncol , &
z ,kvf ,kqfs ,khfs ,kbfs , &
obklen ,ustar ,wstar ,pblh ,kvm , &
kvh ,cgh ,cgs ,tpert ,qpert , &
@@ -524,7 +610,6 @@ subroutine austausch_pbl(lchnk ,ncol , &
!
! Input arguments
!
- integer, intent(in) :: lchnk ! local chunk index (for debug only)
integer, intent(in) :: ncol ! number of atmospheric columns
real(r8), intent(in) :: z(pcols,pver) ! height above surface [m]
diff --git a/src/physics/cam/hetfrz_classnuc.F90 b/src/physics/cam/hetfrz_classnuc.F90
index f0afa46525..01ec5a57e5 100644
--- a/src/physics/cam/hetfrz_classnuc.F90
+++ b/src/physics/cam/hetfrz_classnuc.F90
@@ -9,24 +9,25 @@ module hetfrz_classnuc
! hetfrz_classnuc_init
! hetfrz_classnuc_calc
!
-! Author:
+! Author:
! Corinna Hoose, UiO, May 2009
-! Yong Wang and Xiaohong Liu, UWyo, 12/2012,
+! Yong Wang and Xiaohong Liu, UWyo, 12/2012,
! implement in CAM5 and constrain uncertain parameters using natural dust and
-! BC(soot) datasets.
-! Yong Wang and Xiaohong Liu, UWyo, 05/2013, implement the PDF-contact angle
-! approach: Y. Wang et al., Atmos. Chem. Phys., 2014.
+! BC(soot) datasets.
+! Yong Wang and Xiaohong Liu, UWyo, 05/2013, implement the PDF-contact angle approach:
+! Y. Wang et al., Atmos. Chem. Phys., 2014. https://doi.org/10.5194/acp-14-10411-2014
! Jack Chen, NCAR, 09/2015, modify calculation of dust activation fraction.
!
!-----------------------------------------------------------------------
use shr_kind_mod, only: r8 => shr_kind_r8
-use wv_saturation, only: svp_water, svp_ice
+use wv_saturation, only: svp_water
use shr_spfn_mod, only: erf => shr_spfn_erf
+use physconst, only: pi, planck, boltz, mwso4, amu, pstd
+
implicit none
private
-save
public :: hetfrz_classnuc_init, hetfrz_classnuc_calc
@@ -36,10 +37,9 @@ module hetfrz_classnuc
real(r8) :: rhoh2o
real(r8) :: mwh2o
real(r8) :: tmelt
-real(r8) :: pi
!*****************************************************************************
-! PDF theta model
+! PDF theta model
!*****************************************************************************
! some variables for PDF theta model
! immersion freezing
@@ -52,25 +52,35 @@ module hetfrz_classnuc
! dim_theta index values of 53 through 113. These loop bounds are
! hardcoded in the variables i1 and i2.
-logical :: pdf_imm_in = .true.
+logical, parameter :: pdf_imm_in = .true.
integer, parameter :: pdf_n_theta = 301
integer, parameter :: i1 = 53
integer, parameter :: i2 = 113
-real(r8) :: dim_theta(pdf_n_theta) = 0.0_r8
+
+real(r8) :: dim_theta(pdf_n_theta) = -huge(1._r8)
real(r8) :: pdf_imm_theta(pdf_n_theta) = 0.0_r8
-real(r8) :: pdf_d_theta
-real(r8) :: dim_f_imm_dust_a1(pdf_n_theta) = 0.0_r8
-real(r8) :: dim_f_imm_dust_a3(pdf_n_theta) = 0.0_r8
+real(r8) :: pdf_d_theta = -huge(1._r8)
+real(r8) :: dim_f_imm(pdf_n_theta) = 0.0_r8
integer :: iulog
+real(r8), parameter :: n1 = 1.e19_r8 ! number of water molecules in contact with unit area of substrate [m-2]
+real(r8), parameter :: rhplanck = 1._r8/planck
+real(r8), parameter :: nus = 1.e13_r8 ! frequ. of vibration [s-1] higher freq. (as in P&K, consistent with Anupam's data)
+real(r8), parameter :: rhwincloud = 0.98_r8 ! 98% RH in mixed-phase clouds (Korolev & Isaac, JAS 2006)
+
+logical, parameter :: tot_in = .false.
+
+real(r8) :: bc_limfac = -huge(1._r8) ! soot ice nucleating fraction
+real(r8) :: dust_limfac = -huge(1._r8) ! dust ice nucleating fraction
+
!===================================================================================================
contains
!===================================================================================================
subroutine hetfrz_classnuc_init( &
rair_in, cpair_in, rh2o_in, rhoh2o_in, mwh2o_in, &
- tmelt_in, pi_in, iulog_in)
+ tmelt_in, iulog_in, bc_limfac_in, dust_limfac_in)
real(r8), intent(in) :: rair_in
real(r8), intent(in) :: cpair_in
@@ -78,8 +88,9 @@ subroutine hetfrz_classnuc_init( &
real(r8), intent(in) :: rhoh2o_in
real(r8), intent(in) :: mwh2o_in
real(r8), intent(in) :: tmelt_in
- real(r8), intent(in) :: pi_in
integer, intent(in) :: iulog_in
+ real(r8), intent(in) :: bc_limfac_in
+ real(r8), intent(in) :: dust_limfac_in
rair = rair_in
cpair = cpair_in
@@ -87,9 +98,11 @@ subroutine hetfrz_classnuc_init( &
rhoh2o = rhoh2o_in
mwh2o = mwh2o_in
tmelt = tmelt_in
- pi = pi_in
iulog = iulog_in
+ bc_limfac = bc_limfac_in
+ dust_limfac = dust_limfac_in
+
! Initialize all the PDF theta variables:
if (pdf_imm_in) then
call hetfrz_classnuc_init_pdftheta()
@@ -99,100 +112,60 @@ end subroutine hetfrz_classnuc_init
!===================================================================================================
-subroutine hetfrz_classnuc_calc( &
- deltat, t, p, supersatice, &
+subroutine hetfrz_classnuc_calc(ntypes, types,&
+ deltat, T, p, supersatice, &
fn, &
r3lx, icnlx, &
frzbcimm, frzduimm, &
frzbccnt, frzducnt, &
frzbcdep, frzdudep, &
- hetraer, awcam, awfacm, dstcoat, &
- total_aer_num, coated_aer_num, uncoated_aer_num, &
+ hetraer, wact_factor, dstcoat, &
+ total_aer_num, uncoated_aer_num, &
total_interstitial_aer_num, total_cloudborne_aer_num, errstring)
+ integer, intent(in) :: ntypes
+ character(len=*), intent(in) :: types(ntypes)
real(r8), intent(in) :: deltat ! timestep [s]
- real(r8), intent(in) :: t ! temperature [K]
+ real(r8), intent(in) :: T ! temperature [K]
real(r8), intent(in) :: p ! pressure [Pa]
real(r8), intent(in) :: supersatice ! supersaturation ratio wrt ice at 100%rh over water [ ]
real(r8), intent(in) :: r3lx ! volume mean drop radius [m]
real(r8), intent(in) :: icnlx ! in-cloud droplet concentration [cm-3]
- real(r8), intent(in) :: fn(3) ! fraction activated [ ] for cloud borne aerosol number
- ! index values are 1:bc, 2:dust_a1, 3:dust_a3
- real(r8), intent(in) :: hetraer(3) ! bc and dust mass mean radius [m]
- real(r8), intent(in) :: awcam(3) ! modal added mass [mug m-3]
- real(r8), intent(in) :: awfacm(3) ! (OC+BC)/(OC+BC+SO4)
- real(r8), intent(in) :: dstcoat(3) ! coated fraction
- real(r8), intent(in) :: total_aer_num(3) ! total bc and dust number concentration(interstitial+cloudborne) [#/cm^3]
- real(r8), intent(in) :: coated_aer_num(3) ! coated bc and dust number concentration(interstitial)
- real(r8), intent(in) :: uncoated_aer_num(3) ! uncoated bc and dust number concentration(interstitial)
- real(r8), intent(in) :: total_interstitial_aer_num(3) ! total bc and dust concentration(interstitial)
- real(r8), intent(in) :: total_cloudborne_aer_num(3) ! total bc and dust concentration(cloudborne)
-
- real(r8), intent(out) :: frzbcimm ! het. frz by BC immersion nucleation [cm-3 s-1]
- real(r8), intent(out) :: frzduimm ! het. frz by dust immersion nucleation [cm-3 s-1]
- real(r8), intent(out) :: frzbccnt ! het. frz by BC contact nucleation [cm-3 s-1]
- real(r8), intent(out) :: frzducnt ! het. frz by dust contact nucleation [cm-3 s-1]
- real(r8), intent(out) :: frzbcdep ! het. frz by BC deposition nucleation [cm-3 s-1]
- real(r8), intent(out) :: frzdudep ! het. frz by dust deposition nucleation [cm-3 s-1]
+ real(r8), intent(in) :: fn(ntypes) ! fraction activated [ ] for cloud borne aerosol number
+ ! index values are 1:bc, 2:dust_a1, 3:dust_a3
+ real(r8), intent(in) :: hetraer(ntypes) ! bc and dust mass mean radius [m]
+ real(r8), intent(in) :: wact_factor(ntypes) ! water activity factor -- density*(1.-(OC+BC)/(OC+BC+SO4)) [mug m-3]
+ real(r8), intent(in) :: dstcoat(ntypes) ! coated fraction
+ real(r8), intent(in) :: total_aer_num(ntypes) ! total bc and dust number concentration(interstitial+cloudborne) [#/cm^3]
+ real(r8), intent(in) :: uncoated_aer_num(ntypes) ! uncoated bc and dust number concentration(interstitial)
+ real(r8), intent(in) :: total_interstitial_aer_num(ntypes) ! total bc and dust concentration(interstitial)
+ real(r8), intent(in) :: total_cloudborne_aer_num(ntypes) ! total bc and dust concentration(cloudborne)
+
+ real(r8), target, intent(out) :: frzbcimm ! het. frz by BC immersion nucleation [cm-3 s-1]
+ real(r8), target, intent(out) :: frzduimm ! het. frz by dust immersion nucleation [cm-3 s-1]
+ real(r8), target, intent(out) :: frzbccnt ! het. frz by BC contact nucleation [cm-3 s-1]
+ real(r8), target, intent(out) :: frzducnt ! het. frz by dust contact nucleation [cm-3 s-1]
+ real(r8), target, intent(out) :: frzbcdep ! het. frz by BC deposition nucleation [cm-3 s-1]
+ real(r8), target, intent(out) :: frzdudep ! het. frz by dust deposition nucleation [cm-3 s-1]
character(len=*), intent(out) :: errstring
! local variables
- real(r8) :: aw(3) ! water activity [ ]
- real(r8) :: molal(3) ! molality [moles/kg]
- real(r8), parameter :: Mso4 = 96.06_r8
-
- integer, parameter :: id_bc = 1
- integer, parameter :: id_dst1 = 2
- integer, parameter :: id_dst3 = 3
- logical :: do_bc, do_dst1, do_dst3
-
- real(r8), parameter :: n1 = 1.e19_r8 ! number of water molecules in contact with unit area of substrate [m-2]
- real(r8), parameter :: kboltz = 1.38e-23_r8
- real(r8), parameter :: hplanck = 6.63e-34_r8
- real(r8), parameter :: rhplanck = 1._r8/hplanck
- real(r8), parameter :: amu = 1.66053886e-27_r8
- real(r8), parameter :: nus = 1.e13_r8 ! frequ. of vibration [s-1] higher freq. (as in P&K, consistent with Anupam's data)
- real(r8), parameter :: taufrz = 195.435_r8 ! time constant for falloff of freezing rate [s]
- real(r8), parameter :: rhwincloud = 0.98_r8 ! 98% RH in mixed-phase clouds (Korolev & Isaac, JAS 2006)
- real(r8), parameter :: limfacbc = 0.01_r8 ! max. ice nucleating fraction soot
- real(r8) :: tc
- real(r8) :: vwice
- real(r8) :: rhoice
- real(r8) :: sigma_iw ! [J/m2]
- real(r8) :: sigma_iv ! [J/m2]
- real(r8) :: esice ! [Pa]
- real(r8) :: eswtr ! [Pa]
- real(r8) :: rgimm
- real(r8) :: rgdep
- real(r8) :: dg0dep
- real(r8) :: Adep
- real(r8) :: dg0cnt
- real(r8) :: Acnt
- real(r8) :: rgimm_bc
- real(r8) :: rgimm_dust_a1, rgimm_dust_a3
- real(r8) :: dg0imm_bc
- real(r8) :: dg0imm_dust_a1, dg0imm_dust_a3
- real(r8) :: Aimm_bc
- real(r8) :: Aimm_dust_a1, Aimm_dust_a3
- real(r8) :: q, m, phi
- real(r8) :: r_bc ! model radii of BC modes [m]
- real(r8) :: r_dust_a1, r_dust_a3 ! model radii of dust modes [m]
- real(r8) :: f_imm_bc
- real(r8) :: f_imm_dust_a1, f_imm_dust_a3
- real(r8) :: Jimm_bc
- real(r8) :: Jimm_dust_a1, Jimm_dust_a3
- real(r8) :: f_dep_bc
- real(r8) :: f_dep_dust_a1, f_dep_dust_a3
- real(r8) :: Jdep_bc
- real(r8) :: Jdep_dust_a1, Jdep_dust_a3
- real(r8) :: f_cnt_bc
- real(r8) :: f_cnt_dust_a1,f_cnt_dust_a3
- real(r8) :: Jcnt_bc
- real(r8) :: Jcnt_dust_a1,Jcnt_dust_a3
- integer :: i
+ real(r8) :: tc
+ real(r8) :: vwice
+ real(r8) :: rhoice
+ real(r8) :: sigma_iw ! [J/m2]
+ real(r8) :: sigma_iv ! [J/m2]
+ real(r8) :: eswtr ! [Pa]
+
+ real(r8) :: rgimm ! critical germ size
+ real(r8) :: rgdep
+ real(r8) :: dg0dep ! homogeneous energy of germ formation
+ real(r8) :: dg0cnt
+ real(r8) :: Adep ! prefactors
+ real(r8) :: Acnt
!********************************************************
! Hoose et al., 2010 fitting parameters
@@ -221,334 +194,322 @@ subroutine hetfrz_classnuc_calc( &
real(r8),parameter :: theta_dep_bc = 28._r8 ! contact angle [deg], converted to rad later !Moehler et al (2005), soot
real(r8),parameter :: dga_dep_bc = -2.E-19_r8 ! activation energy [J]
- real(r8) :: Kcoll_bc ! collision kernel [cm3 s-1]
- real(r8) :: Kcoll_dust_a1 ! collision kernel [cm3 s-1]
- real(r8) :: Kcoll_dust_a3 ! collision kernel [cm3 s-1]
+ ! form factor
+ ! only consider flat surfaces due to uncertainty of curved surfaces
+ real(r8),parameter :: m_depcnt_bc = COS(theta_dep_bc*pi/180._r8)
+ real(r8),parameter :: f_depcnt_bc = (2+m_depcnt_bc)*(1-m_depcnt_bc)**2/4._r8
+
+ real(r8),parameter :: m_depcnt_dst = COS(theta_dep_dust*pi/180._r8)
+ real(r8),parameter :: f_depcnt_dust = (2+m_depcnt_dst)*(1-m_depcnt_dst)**2/4._r8
+
+ real(r8),parameter :: m_imm_bc = COS(theta_imm_bc*pi/180._r8)
+ real(r8),parameter :: f_imm_bc = (2+m_imm_bc)*(1-m_imm_bc)**2/4._r8
+
+ real(r8),parameter :: m_imm_dust = COS(theta_imm_dust*pi/180._r8)
+ real(r8),parameter :: f_imm_dust = (2+m_imm_dust)*(1-m_imm_dust)**2/4._r8
- logical :: tot_in = .false.
+ real(r8) :: f_dep, f_cnt, f_imm
+ real(r8) :: dga_dep, dga_imm
+ real(r8) :: limfac
+ real(r8) :: frzimm, frzcnt, frzdep
+ real(r8), pointer :: frzimm_ptr, frzcnt_ptr, frzdep_ptr
- real(r8) :: dim_Jimm_dust_a1(pdf_n_theta), dim_Jimm_dust_a3(pdf_n_theta)
- real(r8) :: sum_imm_dust_a1, sum_imm_dust_a3
+ logical :: pdf_imm
+
+ integer :: ispc
+
+ real(r8) :: ktherm(ntypes), kcoll(ntypes)
+
+ real(r8), parameter :: Ktherm_bc = 4.2_r8 ! black carbon thermal conductivity [J/(m s K)]
+ real(r8), parameter :: Ktherm_dst = 0.72_r8 ! clay thermal conductivity [J/(m s K)]
!------------------------------------------------------------------------------------------------
errstring = ' '
- ! get saturation vapor pressures
+ nullify(frzimm_ptr)
+ nullify(frzcnt_ptr)
+ nullify(frzdep_ptr)
+
+ frzbcimm = 0._r8
+ frzbccnt= 0._r8
+ frzbcdep = 0._r8
+ frzduimm = 0._r8
+ frzducnt= 0._r8
+ frzdudep = 0._r8
+
+ ! get saturation vapor pressure
eswtr = svp_water(t) ! 0 for liquid
- esice = svp_ice(t) ! 1 for ice
- tc = t - tmelt
+ tc = T - tmelt
rhoice = 916.7_r8-0.175_r8*tc-5.e-4_r8*tc**2
vwice = mwh2o*amu/rhoice
sigma_iw = (28.5_r8+0.25_r8*tc)*1E-3_r8
sigma_iv = (76.1_r8-0.155_r8*tc + 28.5_r8+0.25_r8*tc)*1E-3_r8
- ! get mass mean radius
- r_bc = hetraer(1)
- r_dust_a1 = hetraer(2)
- r_dust_a3 = hetraer(3)
-
- ! calculate collision kernels as a function of environmental parameters and aerosol/droplet sizes
- call collkernel(t, p, eswtr, rhwincloud, r3lx, &
- r_bc, & ! BC modes
- r_dust_a1, r_dust_a3, & ! dust modes
- Kcoll_bc, & ! collision kernel [cm3 s-1]
- Kcoll_dust_a1, Kcoll_dust_a3)
-
- !*****************************************************************************
- ! take water activity into account
- !*****************************************************************************
- ! solute effect
- aw(:) = 1._r8
- molal(:) = 0._r8
+ ! critical germ size
+ rgimm = 2*vwice*sigma_iw/(boltz*T*LOG(supersatice))
- ! The heterogeneous ice freezing temperatures of all IN generally decrease with
- ! increasing total solute mole fraction. Therefore, the large solution concentration
- ! will cause the freezing point depression and the ice freezing temperatures of all
- ! IN will get close to the homogeneous ice freezing temperatures. Since we take into
- ! account water activity for three heterogeneous freezing modes(immersion, deposition,
- ! and contact), we utilize interstitial aerosols(not cloudborne aerosols) to calculate
- ! water activity.
- ! If the index of IN is 0, it means three freezing modes of this aerosol are depressed.
+ ! critical germ size
+ ! assume 98% RH in mixed-phase clouds (Korolev & Isaac, JAS 2006)
+ rgdep=2*vwice*sigma_iv/(boltz*T*LOG(rhwincloud*supersatice))
- do i = 1, 3
- !calculate molality
- if ( total_interstitial_aer_num(i) > 0._r8 ) then
- molal(i) = (1.e-6_r8*awcam(i)*(1._r8-awfacm(i))/(Mso4*total_interstitial_aer_num(i)*1.e6_r8))/ &
- (4*pi/3*rhoh2o*(MAX(r3lx,4.e-6_r8))**3)
- aw(i) = 1._r8/(1._r8+2.9244948e-2_r8*molal(i)+2.3141243e-3_r8*molal(i)**2+7.8184854e-7_r8*molal(i)**3)
- end if
- end do
+ ! homogeneous energy of germ formation
+ dg0dep = 4*pi/3._r8*sigma_iv*rgdep**2
- !*****************************************************************************
- ! immersion freezing begin
- !*****************************************************************************
+ ! prefactor
+ ! attention: division of small numbers
+ Adep = (rhwincloud*eswtr)**2*(vwice/(mwh2o*amu))/(boltz*T*nus)*SQRT(sigma_iv/(boltz*T))
- frzbcimm = 0._r8
- frzduimm = 0._r8
- frzbccnt = 0._r8
- frzducnt = 0._r8
- frzbcdep = 0._r8
- frzdudep = 0._r8
+ ! homogeneous energy of germ formation
+ dg0cnt = 4*pi/3._r8*sigma_iv*rgimm**2
- ! critical germ size
- rgimm = 2*vwice*sigma_iw/(kboltz*t*LOG(supersatice))
- ! take solute effect into account
- rgimm_bc = rgimm
- rgimm_dust_a1 = rgimm
- rgimm_dust_a3 = rgimm
+ ! prefactor
+ ! attention: division of small numbers
+ Acnt = rhwincloud*eswtr*4*pi/(nus*SQRT(2*pi*mwh2o*amu*boltz*T))
+
+ do ispc = 1, ntypes
+
+ select case (trim(types(ispc)))
+ case ('black-c')
+ ktherm(ispc) = ktherm_bc
+ case ('dust')
+ ktherm(ispc) = ktherm_dst
+ case default
+ errstring = 'hetfrz_classnuc_calc ERROR: unrecognized aerosol type: '//trim(types(ispc))
+ return
+ end select
+ end do
- ! if aw*Si<=1, the freezing point depression is strong enough to prevent freezing
+ call collkernel(T, p, eswtr, rhwincloud, r3lx, hetraer, Ktherm, Kcoll)
+
+ do ispc = 1, ntypes
+
+ select case (trim(types(ispc)))
+ case ('black-c')
+ f_dep = f_depcnt_bc
+ f_cnt = f_depcnt_bc
+ f_imm = f_imm_bc
+ dga_dep = dga_dep_bc
+ dga_imm = dga_imm_bc
+ pdf_imm = .false.
+ limfac = bc_limfac
+ frzimm_ptr => frzbcimm
+ frzcnt_ptr => frzbccnt
+ frzdep_ptr => frzbcdep
+ case ('dust')
+ f_dep = f_depcnt_dust
+ f_cnt = f_depcnt_dust
+ f_imm = f_imm_dust
+ dga_dep = dga_dep_dust
+ dga_imm = dga_imm_dust
+ pdf_imm = .true.
+ limfac = dust_limfac
+ frzimm_ptr => frzduimm
+ frzcnt_ptr => frzducnt
+ frzdep_ptr => frzdudep
+ case default
+ errstring = 'hetfrz_classnuc_calc ERROR: unrecognized aerosol type: '//trim(types(ispc))
+ return
+ end select
+
+ call hetfrz_classnuc_calc_rates( f_dep, f_cnt, f_imm, dga_dep, dga_imm, pdf_imm, limfac, &
+ kcoll(ispc), hetraer(ispc), icnlx, r3lx, T, supersatice, sigma_iw, &
+ rgimm, rgdep, dg0dep, Adep, dg0cnt, Acnt, vwice, deltat, &
+ fn(ispc), wact_factor(ispc), dstcoat(ispc), &
+ total_aer_num(ispc), total_interstitial_aer_num(ispc), total_cloudborne_aer_num(ispc), uncoated_aer_num(ispc), &
+ frzimm, frzcnt, frzdep, errstring )
+
+ ! accumulate dust and bc frz rates
+ frzimm_ptr = frzimm_ptr + frzimm
+ frzcnt_ptr = frzcnt_ptr + frzcnt
+ frzdep_ptr = frzdep_ptr + frzdep
- if (aw(id_bc)*supersatice > 1._r8 ) then
- do_bc = .true.
- rgimm_bc = 2*vwice*sigma_iw/(kboltz*t*LOG(aw(id_bc)*supersatice))
- else
- do_bc = .false.
- end if
+ end do
- if (aw(id_dst1)*supersatice > 1._r8 ) then
- do_dst1 = .true.
- rgimm_dust_a1 = 2*vwice*sigma_iw/(kboltz*t*LOG(aw(id_dst1)*supersatice))
- else
- do_dst1 = .false.
- end if
+ end subroutine hetfrz_classnuc_calc
+
+ subroutine hetfrz_classnuc_calc_rates( f_dep, f_cnt, f_imm, dga_dep, dga_imm, pdf_imm, limfac, &
+ kcoll, mradius, icnlx, r3lx, T, supersatice, sigma_iw, &
+ rgimm, rgdep, dg0dep, Adep, dg0cnt, Acnt, vwice, deltat, &
+ fn, wact_factor, dstcoat, &
+ total_aer_num, total_interstitial_aer_num, total_cloudborne_aer_num, uncoated_aer_num, &
+ frzimm, frzcnt, frzdep, errstring )
+
+ ! input
+ real(r8), intent(in) :: f_dep ! deposition form factor
+ real(r8), intent(in) :: f_cnt ! contact form factor
+ real(r8), intent(in) :: f_imm ! immersion form factor
+ real(r8), intent(in) :: dga_dep ! deposition activation energy [J]
+ real(r8), intent(in) :: dga_imm ! immersion activation energy [J]
+ logical, intent(in) :: pdf_imm ! PDF theta model switch (TRUE for dust)
+ real(r8), intent(in) :: limfac ! Limit to 1% of available potential IN (for BC), no limit for dust
+ real(r8), intent(in) :: kcoll ! collision kernel [cm3 s-1]
+ real(r8), intent(in) :: mradius ! mass mean radius [m]
+ real(r8), intent(in) :: icnlx ! in-cloud droplet concentration [cm-3]
+ real(r8), intent(in) :: r3lx ! volume mean drop radius [m]
+ real(r8), intent(in) :: T ! temperature [K]
+ real(r8), intent(in) :: supersatice ! supersaturation ratio wrt ice at 100%rh over water [ ]
+ real(r8), intent(in) :: sigma_iw ! [J/m2]
+ real(r8), intent(in) :: rgimm ! critical germ size
+ real(r8), intent(in) :: rgdep ! critical germ size
+ real(r8), intent(in) :: dg0dep ! homogeneous energy of germ formation
+ real(r8), intent(in) :: Adep ! deposition nucleation prefactor
+ real(r8), intent(in) :: dg0cnt ! homogeneous energy of germ formation
+ real(r8), intent(in) :: Acnt ! contact nucleation prefactor
+
+ real(r8), intent(in) :: vwice
+ real(r8), intent(in) :: deltat ! timestep [s]
+ real(r8), intent(in) :: fn ! fraction activated [ ] for cloud borne aerosol number
+ real(r8), intent(in) :: wact_factor ! water activity factor -- density*(1.-(OC+BC)/(OC+BC+SO4)) [mug m-3]
+ real(r8), intent(in) :: dstcoat ! coated fraction
+ real(r8), intent(in) :: total_aer_num ! total bc and dust number concentration(interstitial+cloudborne) [#/cm^3]
+ real(r8), intent(in) :: total_interstitial_aer_num ! total bc and dust concentration(interstitial)
+ real(r8), intent(in) :: total_cloudborne_aer_num ! total bc and dust concentration(cloudborne)
+ real(r8), intent(in) :: uncoated_aer_num ! uncoated bc and dust number concentration(interstitial)
+ ! output
+ real(r8), intent(out) :: frzimm ! het. frz by immersion nucleation [cm-3 s-1]
+ real(r8), intent(out) :: frzcnt ! het. frz by contact nucleation [cm-3 s-1]
+ real(r8), intent(out) :: frzdep ! het. frz by deposition nucleation [cm-3 s-1]
- if (aw(id_dst3)*supersatice > 1._r8 ) then
- do_dst3 = .true.
- rgimm_dust_a3 = 2*vwice*sigma_iw/(kboltz*t*LOG(aw(id_dst3)*supersatice))
- else
- do_dst3 = .false.
- end if
-
- ! form factor
- ! only consider flat surfaces due to uncertainty of curved surfaces
+ character(len=*), intent(out) :: errstring
- m = COS(theta_imm_bc*pi/180._r8)
- f_imm_bc = (2+m)*(1-m)**2/4._r8
- if (.not. pdf_imm_in) then
- m = COS(theta_imm_dust*pi/180._r8)
- f_imm_dust_a1 = (2+m)*(1-m)**2/4._r8
+ ! local vars
+ real(r8) :: aw ! water activity [ ]
+ real(r8) :: molal ! molality [moles/kg]
- m = COS(theta_imm_dust*pi/180._r8)
- f_imm_dust_a3 = (2+m)*(1-m)**2/4._r8
- end if
+ real(r8) :: Aimm
+ real(r8) :: Jdep
+ real(r8) :: Jimm
+ real(r8) :: Jcnt
+ real(r8) :: dg0imm
+ real(r8) :: rgimm_aer
+ real(r8) :: sum_imm
+ real(r8) :: dim_Jimm(pdf_n_theta)
- ! homogeneous energy of germ formation
- dg0imm_bc = 4*pi/3._r8*sigma_iw*rgimm_bc**2
- dg0imm_dust_a1 = 4*pi/3._r8*sigma_iw*rgimm_dust_a1**2
- dg0imm_dust_a3 = 4*pi/3._r8*sigma_iw*rgimm_dust_a3**2
+ logical :: do_frz
+ logical :: do_imm
- ! prefactor
- Aimm_bc = n1*((vwice*rhplanck)/(rgimm_bc**3)*SQRT(3._r8/pi*kboltz*T*dg0imm_bc))
- Aimm_dust_a1 = n1*((vwice*rhplanck)/(rgimm_dust_a1**3)*SQRT(3._r8/pi*kboltz*T*dg0imm_dust_a1))
- Aimm_dust_a3 = n1*((vwice*rhplanck)/(rgimm_dust_a3**3)*SQRT(3._r8/pi*kboltz*T*dg0imm_dust_a3))
+ integer :: i
- ! nucleation rate per particle
+ !*****************************************************************************
+ ! take water activity into account
+ !*****************************************************************************
+ ! solute effect
+ aw = 1._r8
+ molal = 0._r8
- Jimm_bc = Aimm_bc*r_bc**2/SQRT(f_imm_bc)*EXP((-dga_imm_bc-f_imm_bc*dg0imm_bc)/(kboltz*T))
- if (.not. pdf_imm_in) then
- ! 1/sqrt(f)
- ! the expression of Chen et al. (sqrt(f)) may however lead to unphysical
- ! behavior as it implies J->0 when f->0 (i.e. ice nucleation would be
- ! more difficult on easily wettable materials).
- Jimm_dust_a1 = Aimm_dust_a1*r_dust_a1**2/SQRT(f_imm_dust_a1)*EXP((-dga_imm_dust-f_imm_dust_a1*dg0imm_dust_a1)/(kboltz*T))
- Jimm_dust_a3 = Aimm_dust_a3*r_dust_a3**2/SQRT(f_imm_dust_a3)*EXP((-dga_imm_dust-f_imm_dust_a3*dg0imm_dust_a3)/(kboltz*T))
- end if
+ ! The heterogeneous ice freezing temperatures of all IN generally decrease with
+ ! increasing total solute mole fraction. Therefore, the large solution concentration
+ ! will cause the freezing point depression and the ice freezing temperatures of all
+ ! IN will get close to the homogeneous ice freezing temperatures. Since we take into
+ ! account water activity for three heterogeneous freezing modes(immersion, deposition,
+ ! and contact), we utilize interstitial aerosols(not cloudborne aerosols) to calculate
+ ! water activity.
+ ! If the index of IN is 0, it means three freezing modes of this aerosol are depressed.
- if (pdf_imm_in) then
- dim_Jimm_dust_a1 = 0.0_r8
- dim_Jimm_dust_a3 = 0.0_r8
- do i = i1,i2
- ! 1/sqrt(f)
- dim_Jimm_dust_a1(i) = Aimm_dust_a1*r_dust_a1**2/SQRT(dim_f_imm_dust_a1(i))*EXP((-dga_imm_dust-dim_f_imm_dust_a1(i)* &
- dg0imm_dust_a1)/(kboltz*T))
- dim_Jimm_dust_a1(i) = max(dim_Jimm_dust_a1(i), 0._r8)
-
- dim_Jimm_dust_a3(i) = Aimm_dust_a3*r_dust_a3**2/SQRT(dim_f_imm_dust_a3(i))*EXP((-dga_imm_dust-dim_f_imm_dust_a3(i)* &
- dg0imm_dust_a3)/(kboltz*T))
- dim_Jimm_dust_a3(i) = max(dim_Jimm_dust_a3(i), 0._r8)
- end do
+ !calculate molality
+ if ( total_interstitial_aer_num > 0._r8 ) then
+ molal = (1.e-6_r8*wact_factor/(mwso4*total_interstitial_aer_num*1.e6_r8))/ &
+ (4*pi/3*rhoh2o*(MAX(r3lx,4.e-6_r8))**3)
+ aw = 1._r8/(1._r8+2.9244948e-2_r8*molal+2.3141243e-3_r8*molal**2+7.8184854e-7_r8*molal**3)
end if
- ! Limit to 1% of available potential IN (for BC), no limit for dust
- if (pdf_imm_in) then
- sum_imm_dust_a1 = 0._r8
- sum_imm_dust_a3 = 0._r8
- do i = i1,i2-1
- sum_imm_dust_a1 = sum_imm_dust_a1+0.5_r8*((pdf_imm_theta(i)*exp(-dim_Jimm_dust_a1(i)*deltat)+ &
- pdf_imm_theta(i+1)*exp(-dim_Jimm_dust_a1(i+1)*deltat)))*pdf_d_theta
- sum_imm_dust_a3 = sum_imm_dust_a3+0.5_r8*((pdf_imm_theta(i)*exp(-dim_Jimm_dust_a3(i)*deltat)+ &
- pdf_imm_theta(i+1)*exp(-dim_Jimm_dust_a3(i+1)*deltat)))*pdf_d_theta
- end do
- do i = i1,i2
- if (sum_imm_dust_a1 > 0.99_r8) then
- sum_imm_dust_a1 = 1.0_r8
- end if
- if (sum_imm_dust_a3 > 0.99_r8) then
- sum_imm_dust_a3 = 1.0_r8
- end if
- end do
-
- end if
+ !*****************************************************************************
+ ! immersion freezing begin
+ !*****************************************************************************
- if (.not.tot_in) then
- if (do_bc) frzbcimm = frzbcimm+MIN(limfacbc*total_cloudborne_aer_num(id_bc)/deltat, &
- total_cloudborne_aer_num(id_bc)/deltat*(1._r8-exp(-Jimm_bc*deltat)))
+ frzimm = 0._r8
+ frzcnt = 0._r8
+ frzdep = 0._r8
- if (.not. pdf_imm_in) then
- if (do_dst1) frzduimm = frzduimm+MIN(1*total_cloudborne_aer_num(id_dst1)/deltat, &
- total_cloudborne_aer_num(id_dst1)/deltat*(1._r8-exp(-Jimm_dust_a1*deltat)))
- if (do_dst3) frzduimm = frzduimm+MIN(1*total_cloudborne_aer_num(id_dst3)/deltat, &
- total_cloudborne_aer_num(id_dst3)/deltat*(1._r8-exp(-Jimm_dust_a3*deltat)))
- else
- if (do_dst1) frzduimm = frzduimm+MIN(1*total_cloudborne_aer_num(id_dst1)/deltat, &
- total_cloudborne_aer_num(id_dst1)/deltat*(1._r8-sum_imm_dust_a1))
- if (do_dst3) frzduimm = frzduimm+MIN(1*total_cloudborne_aer_num(id_dst3)/deltat, &
- total_cloudborne_aer_num(id_dst3)/deltat*(1._r8-sum_imm_dust_a3))
- end if
+ ! take solute effect into account
+ rgimm_aer = rgimm
+
+ ! if aw*Si<=1, the freezing point depression is strong enough to prevent freezing
+ do_frz = aw*supersatice > 1._r8
+ if (do_frz) then
+ rgimm_aer = 2*vwice*sigma_iw/(boltz*T*LOG(aw*supersatice))
else
- if (do_bc) frzbcimm = frzbcimm+MIN(limfacbc*fn(id_bc)*total_aer_num(id_bc)/deltat, &
- fn(id_bc)*total_aer_num(id_bc)/deltat*(1._r8-exp(-Jimm_bc*deltat)))
-
- if (.not. pdf_imm_in) then
- if (do_dst1) frzduimm = frzduimm+MIN(1*fn(id_dst1)*total_aer_num(id_dst1)/deltat, &
- fn(id_dst1)*total_aer_num(id_dst1)/deltat*(1._r8-exp(-Jimm_dust_a1*deltat)))
- if (do_dst3) frzduimm = frzduimm+MIN(1*fn(id_dst3)*total_aer_num(id_dst3)/deltat, &
- fn(id_dst3)*total_aer_num(id_dst3)/deltat*(1._r8-exp(-Jimm_dust_a3*deltat)))
+ return
+ endif
+
+ do_imm = T <= 263.15_r8 ! temperature threshold for immersion freezing (-10 C)
+
+ if (do_imm) then
+ ! homogeneous energy of germ formation
+ dg0imm = 4*pi/3._r8*sigma_iw*rgimm_aer**2
+
+ ! prefactor
+ Aimm = n1*((vwice*rhplanck)/(rgimm_aer**3)*SQRT(3._r8/pi*boltz*T*dg0imm))
+
+ ! nucleation rate per particle
+
+ if (pdf_imm) then
+ dim_Jimm(:) = 0._r8
+ do i = i1,i2
+ ! 1/sqrt(f)
+ dim_Jimm(i) = Aimm*mradius**2/SQRT(dim_f_imm(i))*EXP((-dga_imm-dim_f_imm(i)*dg0imm)/(boltz*T))
+ dim_Jimm(i) = max(dim_Jimm(i), 0._r8)
+ end do
+
+ sum_imm = 0._r8
+ do i = i1,i2-1
+ sum_imm = sum_imm + 0.5_r8*((pdf_imm_theta(i )*exp(-dim_Jimm(i )*deltat)+ &
+ pdf_imm_theta(i+1)*exp(-dim_Jimm(i+1)*deltat)))*pdf_d_theta
+ end do
+ if (sum_imm > 0.99_r8) then
+ sum_imm = 1.0_r8
+ end if
else
- if (do_dst1) frzduimm = frzduimm+MIN(1*fn(id_dst1)*total_aer_num(id_dst1)/deltat, &
- fn(id_dst1)*total_aer_num(id_dst1)/deltat*(1._r8-sum_imm_dust_a1))
- if (do_dst3) frzduimm = frzduimm+MIN(1*fn(id_dst3)*total_aer_num(id_dst3)/deltat, &
- fn(id_dst3)*total_aer_num(id_dst3)/deltat*(1._r8-sum_imm_dust_a3))
+ Jimm = Aimm*mradius**2/SQRT(f_imm)*EXP(( -dga_imm - f_imm*dg0imm )/(boltz*T))
+ sum_imm = exp(-Jimm*deltat)
end if
end if
- if (t > 263.15_r8) then
- frzduimm = 0._r8
- frzbcimm = 0._r8
- end if
-
!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Deposition nucleation
!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- ! critical germ size
- ! assume 98% RH in mixed-phase clouds (Korolev & Isaac, JAS 2006)
- rgdep=2*vwice*sigma_iv/(kboltz*t*LOG(rhwincloud*supersatice))
-
- ! form factor
- m = COS(theta_dep_bc*pi/180._r8)
- f_dep_bc = (2+m)*(1-m)**2/4._r8
-
- m = COS(theta_dep_dust*pi/180._r8)
- f_dep_dust_a1 = (2+m)*(1-m)**2/4._r8
-
- m = COS(theta_dep_dust*pi/180._r8)
- f_dep_dust_a3 = (2+m)*(1-m)**2/4._r8
-
- ! homogeneous energy of germ formation
- dg0dep = 4*pi/3._r8*sigma_iv*rgdep**2
-
- ! prefactor
- ! attention: division of small numbers
- Adep = (rhwincloud*eswtr)**2*(vwice/(mwh2o*amu))/(kboltz*T*nus)*SQRT(sigma_iv/(kboltz*T))
! nucleation rate per particle
if (rgdep > 0) then
- Jdep_bc = Adep*r_bc**2/SQRT(f_dep_bc)*EXP((-dga_dep_bc-f_dep_bc*dg0dep)/(kboltz*T))
- Jdep_dust_a1 = Adep*r_dust_a1**2/SQRT(f_dep_dust_a1)*EXP((-dga_dep_dust-f_dep_dust_a1*dg0dep)/(kboltz*T))
- Jdep_dust_a3 = Adep*r_dust_a3**2/SQRT(f_dep_dust_a3)*EXP((-dga_dep_dust-f_dep_dust_a3*dg0dep)/(kboltz*T))
+ Jdep = Adep*mradius**2/SQRT(f_dep)*EXP((-dga_dep-f_dep*dg0dep)/(boltz*T))
else
- Jdep_bc = 0._r8
- Jdep_dust_a1 = 0._r8
- Jdep_dust_a3 = 0._r8
+ Jdep = 0._r8
end if
- ! Limit to 1% of available potential IN (for BC), no limit for dust
- if (.not.tot_in) then
- if (do_bc) frzbcdep = frzbcdep+MIN(limfacbc*uncoated_aer_num(id_bc)/deltat, &
- uncoated_aer_num(id_bc)/deltat &
- *(1._r8-exp(-Jdep_bc*deltat)))
- if (do_dst1) frzdudep = frzdudep+MIN(uncoated_aer_num(id_dst1)/deltat, &
- uncoated_aer_num(id_dst1)/deltat &
- *(1._r8-exp(-Jdep_dust_a1*deltat)))
- if (do_dst3) frzdudep = frzdudep+MIN(uncoated_aer_num(id_dst3)/deltat, &
- uncoated_aer_num(id_dst3)/deltat &
- *(1._r8-exp(-Jdep_dust_a3*deltat)))
- else
- if (do_bc) frzbcdep = frzbcdep+MIN(limfacbc*(1._r8-fn(id_bc)) &
- *(1._r8-dstcoat(1))*total_aer_num(id_bc)/deltat, &
- (1._r8-fn(id_bc))*(1._r8-dstcoat(1))*total_aer_num(id_bc)/deltat &
- *(1._r8-exp(-Jdep_bc*deltat)))
- if (do_dst1) frzdudep = frzdudep+MIN((1._r8-fn(id_dst1)) &
- *(1._r8-dstcoat(2))*total_aer_num(id_dst1)/deltat, &
- (1._r8-fn(id_dst1))*(1._r8-dstcoat(2))*total_aer_num(id_dst1)/deltat &
- *(1._r8-exp(-Jdep_dust_a1*deltat)))
- if (do_dst3) frzdudep = frzdudep+MIN((1._r8-fn(id_dst3)) &
- *(1._r8-dstcoat(3))*total_aer_num(id_dst3)/deltat, &
- (1._r8-fn(id_dst3))*(1._r8-dstcoat(3))*total_aer_num(id_dst3)/deltat &
- *(1._r8-exp(-Jdep_dust_a3*deltat)))
- end if
-
- !!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! contact nucleation
- !!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
- ! form factor
- m = COS(theta_dep_bc*pi/180._r8)
- f_cnt_bc = (2+m)*(1-m)**2/4._r8
-
- m = COS(theta_dep_dust*pi/180._r8)
- f_cnt_dust_a1 = (2+m)*(1-m)**2/4._r8
-
- m = COS(theta_dep_dust*pi/180._r8)
- f_cnt_dust_a3 = (2+m)*(1-m)**2/4._r8
-
- ! homogeneous energy of germ formation
- dg0cnt = 4*pi/3._r8*sigma_iv*rgimm**2
-
- ! prefactor
- ! attention: division of small numbers
- Acnt = rhwincloud*eswtr*4*pi/(nus*SQRT(2*pi*mwh2o*amu*kboltz*T))
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! nucleation rate per particle
- Jcnt_bc = Acnt*r_bc**2*EXP((-dga_dep_bc-f_cnt_bc*dg0cnt)/(kboltz*T))*Kcoll_bc*icnlx
- Jcnt_dust_a1 = Acnt*r_dust_a1**2*EXP((-dga_dep_dust-f_cnt_dust_a1*dg0cnt)/(kboltz*T))*Kcoll_dust_a1*icnlx
- Jcnt_dust_a3 = Acnt*r_dust_a3**2*EXP((-dga_dep_dust-f_cnt_dust_a3*dg0cnt)/(kboltz*T))*Kcoll_dust_a3*icnlx
-
- ! Limit to 1% of available potential IN (for BC), no limit for dust
- if (.not.tot_in) then
- if (do_bc) frzbccnt = frzbccnt+MIN(limfacbc*uncoated_aer_num(id_bc)/deltat, &
- uncoated_aer_num(id_bc)/deltat &
- *(1._r8-exp(-Jcnt_bc*deltat)))
- if (do_dst1) frzducnt = frzducnt+MIN(uncoated_aer_num(id_dst1)/deltat, &
- uncoated_aer_num(id_dst1)/deltat &
- *(1._r8-exp(-Jcnt_dust_a1*deltat)))
- if (do_dst3) frzducnt = frzducnt+MIN(uncoated_aer_num(id_dst3)/deltat, &
- uncoated_aer_num(id_dst3)/deltat &
- *(1._r8-exp(-Jcnt_dust_a3*deltat)))
+ Jcnt = Acnt*mradius**2*EXP((-dga_dep-f_cnt*dg0cnt)/(boltz*T))*Kcoll*icnlx
+
+ ! Limit to 1% of available potential IN (for BC), no limit for dust
+ if (tot_in) then
+ if (do_imm) then
+ frzimm = MIN(limfac*fn*total_aer_num/deltat, fn*total_aer_num/deltat*(1._r8-sum_imm))
+ end if
+ frzdep = MIN(limfac*(1._r8-fn)*(1._r8-dstcoat)*total_aer_num/deltat, &
+ (1._r8-fn)*(1._r8-dstcoat)*total_aer_num/deltat*(1._r8-exp(-Jdep*deltat)))
+ frzcnt = MIN(limfac*(1._r8-fn)*(1._r8-dstcoat)*total_aer_num/deltat, &
+ (1._r8-fn)*(1._r8-dstcoat)*total_aer_num/deltat*(1._r8-exp(-Jcnt*deltat)))
else
- if (do_bc) frzbccnt = frzbccnt+MIN(limfacbc*(1._r8-fn(id_bc))*(1._r8-dstcoat(1))*total_aer_num(id_bc)/deltat, &
- (1._r8-fn(id_bc))*(1._r8-dstcoat(1))*total_aer_num(id_bc)/deltat &
- *(1._r8-exp(-Jcnt_bc*deltat)))
- if (do_dst1) frzducnt = frzducnt+MIN((1._r8-fn(id_dst1))*(1._r8-dstcoat(2))*total_aer_num(id_dst1)/deltat, &
- (1._r8-fn(id_dst1))*(1._r8-dstcoat(2))*total_aer_num(id_dst1)/deltat &
- *(1._r8-exp(-Jcnt_dust_a1*deltat)))
- if (do_dst3) frzducnt = frzducnt+MIN((1._r8-fn(id_dst3))*(1._r8-dstcoat(3))*total_aer_num(id_dst3)/deltat, &
- (1._r8-fn(id_dst3))*(1._r8-dstcoat(3))*total_aer_num(id_dst3)/deltat &
- *(1._r8-exp(-Jcnt_dust_a3*deltat)))
+ if (do_imm) then
+ frzimm = MIN(limfac*total_cloudborne_aer_num /deltat, total_cloudborne_aer_num/deltat*(1._r8-sum_imm))
+ end if
+ frzdep = MIN(limfac*uncoated_aer_num/deltat, uncoated_aer_num/deltat*(1._r8-exp(-Jdep*deltat)))
+ frzcnt = MIN(limfac*uncoated_aer_num/deltat, uncoated_aer_num/deltat*(1._r8-exp(-Jcnt*deltat)))
end if
-
- if (frzducnt <= -1._r8) then
- write(iulog,*) 'hetfrz_classnuc_calc: frzducnt', frzducnt, Jcnt_dust_a1,Jcnt_dust_a3, &
- Kcoll_dust_a1, Kcoll_dust_a3
+
+ if (frzcnt <= -1._r8) then
+ write(iulog,*) 'hetfrz_classnuc_calc: frzcnt, Jcnt, Kcoll: ', frzcnt, Jcnt, Kcoll
errstring = 'ERROR in hetfrz_classnuc_calc::frzducnt'
return
end if
-end subroutine hetfrz_classnuc_calc
+end subroutine hetfrz_classnuc_calc_rates
!===================================================================================================
@@ -559,27 +520,22 @@ end subroutine hetfrz_classnuc_calc
! Author: Corinna Hoose, UiO, October 2009
!
! Modifications: Yong Wang and Xiaohong Liu, UWyo, 12/2012
+!
+! "Seinfeld & Pandis" referenced in several places in this routine is:
+! Atmospheric Chemistry and Physics: From Air Pollution to Climate Change, 3rd Edition
+! John H. Seinfeld, Spyros N. Pandis ISBN: 978-1-118-94740-1
!-----------------------------------------------------------------------
-subroutine collkernel( &
- t, pres, eswtr, rhwincloud, r3lx, &
- r_bc, & ! BC modes
- r_dust_a1, r_dust_a3, & ! dust modes
- Kcoll_bc, & ! collision kernel [cm3 s-1]
- Kcoll_dust_a1, Kcoll_dust_a3)
-
- real(r8), intent(in) :: t ! temperature [K]
- real(r8), intent(in) :: pres ! pressure [Pa]
- real(r8), intent(in) :: eswtr ! saturation vapor pressure of water [Pa]
- real(r8), intent(in) :: r3lx ! volume mean drop radius [m]
- real(r8), intent(in) :: rhwincloud ! in-cloud relative humidity over water [ ]
- real(r8), intent(in) :: r_bc ! model radii of BC modes [m]
- real(r8), intent(in) :: r_dust_a1 ! model radii of dust modes [m]
- real(r8), intent(in) :: r_dust_a3 ! model radii of dust modes [m]
-
- real(r8), intent(out) :: Kcoll_bc ! collision kernel [cm3 s-1]
- real(r8), intent(out) :: Kcoll_dust_a1
- real(r8), intent(out) :: Kcoll_dust_a3
+subroutine collkernel( temp, pres, eswtr, rhwincloud, r3lx, rad, Ktherm, Kcoll )
+
+ real(r8), intent(in) :: temp ! temperature [K]
+ real(r8), intent(in) :: pres ! pressure [Pa]
+ real(r8), intent(in) :: eswtr ! saturation vapor pressure of water [Pa]
+ real(r8), intent(in) :: r3lx ! volume mean drop radius [m]
+ real(r8), intent(in) :: rhwincloud ! in-cloud relative humidity over water [ ]
+ real(r8), intent(in) :: rad(:) ! aerosol radius [m]
+ real(r8), intent(in) :: Ktherm(:) ! thermal conductivity of aerosol [J/(m s K)]
+ real(r8), intent(out) :: Kcoll(:) ! collision kernel [cm3 s-1]
! local variables
real(r8) :: a, b, c, a_f, b_f, c_f, f
@@ -593,37 +549,34 @@ subroutine collkernel( &
real(r8) :: Pr ! Prandtl number [ ]
real(r8) :: Sc ! Schmidt number [ ]
real(r8) :: vterm ! terminal velocity [m s-1]
- real(r8) :: Ktherm ! thermal conductivity of aerosol [J/(m s K)]
real(r8) :: Dvap ! water vapor diffusivity [m2 s-1]
real(r8) :: Daer ! aerosol diffusivity [m2 s-1]
real(r8) :: latvap ! latent heat of vaporization [J kg-1]
- real(r8) :: kboltz ! Boltzmann constant [J K-1]
real(r8) :: G ! thermodynamic function in Cotton et al. [kg m-1 s-1]
- real(r8) :: r_a ! aerosol radius [m]
real(r8) :: f_t ! factor by Waldmann & Schmidt [ ]
real(r8) :: Q_heat ! heat flux [J m-2 s-1]
real(r8) :: Tdiff_cotton ! temperature difference between droplet and environment [K]
real(r8) :: K_brownian,K_thermo_cotton,K_diffusio_cotton ! collision kernels [m3 s-1]
- real(r8) :: K_total ! total collision kernel [cm3 s-1]
- integer :: i
+
+ integer :: ntot, idx
+
!------------------------------------------------------------------------------------------------
-
- Kcoll_bc = 0._r8
- Kcoll_dust_a1 = 0._r8
- Kcoll_dust_a3 = 0._r8
- tc = t - tmelt
- kboltz = 1.38065e-23_r8
+ ntot = size(ktherm)
+
+ Kcoll(:) = 0._r8
+
+ tc = temp - tmelt
! air viscosity for tc<0, from depvel_part.F90
viscos_air = (1.718_r8+0.0049_r8*tc-1.2e-5_r8*tc*tc)*1.e-5_r8
! air density
- rho_air = pres/(rair*t)
- ! mean free path: Seinfeld & Pandis 8.6
- lambda = 2*viscos_air/(pres*SQRT(8/(pi*rair*t)))
+ rho_air = pres/(rair*temp)
+ ! mean free path: Seinfeld & Pandis 8.6 (Book: ISBN: 978-1-118-94740-1)
+ lambda = 2*viscos_air/(pres*SQRT(8/(pi*rair*temp)))
! latent heat of vaporization, varies with T
latvap = 1000*(-0.0000614342_r8*tc**3 + 0.00158927_r8*tc**2 - 2.36418_r8*tc + 2500.79_r8)
- ! droplet terminal velocity after Chen & Liu, QJRMS 2004
+ ! droplet terminal velocity after Chen & Liu, QJRMS 2004 (https://doi-org.cuucar.idm.oclc.org/10.1256/qj.03.41)
a = 8.8462e2_r8
b = 9.7593e7_r8
c = -3.4249e-11_r8
@@ -635,54 +588,49 @@ subroutine collkernel( &
! Reynolds number
Re = 2*vterm*r3lx*rho_air/viscos_air
- ! thermal conductivity of air: Seinfeld & Pandis eq. 15.75
- Ktherm_air = 1.e-3_r8*(4.39_r8+0.071_r8*t) !J/(m s K)
+ ! thermal conductivity of air: Seinfeld & Pandis eq. 15.75 (Book: ISBN: 978-1-118-94740-1)
+ Ktherm_air = 1.e-3_r8*(4.39_r8+0.071_r8*temp) !J/(m s K)
! Prandtl number
Pr = viscos_air*cpair/Ktherm_air
- ! water vapor diffusivity: Pruppacher & Klett 13-3
- Dvap = 0.211e-4_r8*(t/273.15_r8)*(101325._r8/pres)
+ ! water vapor diffusivity: Pruppacher & Klett 13-3 (https://link.springer.com/book/10.1007/978-0-306-48100-0)
+ Dvap = 0.211e-4_r8*(temp/tmelt)*(pstd/pres)
! G-factor = rhoh2o*Xi in Rogers & Yau, p. 104
- G = rhoh2o/((latvap/(rh2o*t) - 1)*latvap*rhoh2o/(Ktherm_air*t) &
- + rhoh2o*rh2o*t/(Dvap*eswtr))
-
- ! variables depending on aerosol radius
- ! loop over 3 aerosol modes
- do i = 1, 3
- if (i == 1) r_a = r_bc
- if (i == 2) r_a = r_dust_a1
- if (i == 3) r_a = r_dust_a3
- ! Knudsen number (Seinfeld & Pandis 8.1)
- Kn = lambda/r_a
- ! aerosol diffusivity
- Daer = kboltz*t*(1 + Kn)/(6*pi*r_a*viscos_air)
- ! Schmidt number
- Sc = viscos_air/(Daer*rho_air)
-
- ! Young (1974) first equ. on page 771
- K_brownian = 4*pi*r3lx*Daer*(1 + 0.3_r8*Re**0.5_r8*Sc**0.33_r8)
-
- ! thermal conductivities from Seinfeld & Pandis, Table 8.6
- if (i == 1) Ktherm = 4.2_r8 ! Carbon
- if (i == 2 .or. i == 3) Ktherm = 0.72_r8 ! clay
- ! form factor
- f_t = 0.4_r8*(1._r8 + 1.45_r8*Kn + 0.4_r8*Kn*EXP(-1._r8/Kn)) &
- *(Ktherm_air + 2.5_r8*Kn*Ktherm) &
- /((1._r8 + 3._r8*Kn)*(2._r8*Ktherm_air + 5._r8*Kn*Ktherm+Ktherm))
- ! calculate T-Tc as in Cotton et al.
- Tdiff_cotton = -G*(rhwincloud - 1._r8)*latvap/Ktherm_air
- Q_heat = Ktherm_air/r3lx*(1._r8 + 0.3_r8*Re**0.5_r8*Pr**0.33_r8)*Tdiff_cotton
- K_thermo_cotton = 4._r8*pi*r3lx*r3lx*f_t*Q_heat/pres
- K_diffusio_cotton = -(1._r8/f_t)*(rh2o*t/latvap)*K_thermo_cotton
- K_total = 1.e6_r8*(K_brownian + K_thermo_cotton + K_diffusio_cotton) ! convert m3/s -> cm3/s
- ! set K to 0 if negative
- if (K_total .lt. 0._r8) K_total = 0._r8
-
- if (i == 1) Kcoll_bc = K_total
- if (i == 2) Kcoll_dust_a1 = K_total
- if (i == 3) Kcoll_dust_a3 = K_total
-
+ G = rhoh2o/((latvap/(rh2o*temp) - 1)*latvap*rhoh2o/(Ktherm_air*temp) &
+ + rhoh2o*rh2o*temp/(Dvap*eswtr))
+
+ do idx = 1,ntot
+ if (rad(idx)>0._r8) then
+ ! Knudsen number (Seinfeld & Pandis 8.1) (Book: ISBN: 978-1-118-94740-1)
+ Kn = lambda/rad(idx)
+ ! aerosol diffusivity
+ Daer = boltz*temp*(1 + Kn)/(6*pi*rad(idx)*viscos_air)
+
+ ! Schmidt number
+ Sc = viscos_air/(Daer*rho_air)
+
+ ! Young (1974) first equ. on page 771 (doi: 10.1175/1520-0469(1974)031<0768:TROCNI>2.0.CO;2)
+ K_brownian = 4*pi*r3lx*Daer*(1 + 0.3_r8*Re**0.5_r8*Sc**0.33_r8)
+
+ ! thermal conductivities from Seinfeld & Pandis, Table 8.6 (Book: ISBN: 978-1-118-94740-1)
+ ! form factor
+ f_t = 0.4_r8*(1._r8 + 1.45_r8*Kn + 0.4_r8*Kn*EXP(-1._r8/Kn)) &
+ *(Ktherm_air + 2.5_r8*Kn*Ktherm(idx)) &
+ /((1._r8 + 3._r8*Kn)*(2._r8*Ktherm_air + 5._r8*Kn*Ktherm(idx)+Ktherm(idx)))
+
+ ! calculate T-Tc as in Cotton et al.
+ Tdiff_cotton = -G*(rhwincloud - 1._r8)*latvap/Ktherm_air
+ Q_heat = Ktherm_air/r3lx*(1._r8 + 0.3_r8*Re**0.5_r8*Pr**0.33_r8)*Tdiff_cotton
+ K_thermo_cotton = 4._r8*pi*r3lx*r3lx*f_t*Q_heat/pres
+ K_diffusio_cotton = -(1._r8/f_t)*(rh2o*temp/latvap)*K_thermo_cotton
+ Kcoll(idx) = 1.e6_r8*(K_brownian + K_thermo_cotton + K_diffusio_cotton) ! convert m3/s -> cm3/s
+
+ ! set K to 0 if negative
+ if (Kcoll(idx) < 0._r8) Kcoll(idx) = 0._r8
+ else
+ Kcoll(idx) = 0._r8
+ endif
end do
-
+
end subroutine collkernel
!===================================================================================================
@@ -722,8 +670,7 @@ subroutine hetfrz_classnuc_init_pdftheta()
do i = i1, i2
m = cos(dim_theta(i))
temp = (2+m)*(1-m)**2/4._r8
- dim_f_imm_dust_a1(i) = temp
- dim_f_imm_dust_a3(i) = temp
+ dim_f_imm(i) = temp
end do
end subroutine hetfrz_classnuc_init_pdftheta
diff --git a/src/physics/cam/hetfrz_classnuc_cam.F90 b/src/physics/cam/hetfrz_classnuc_cam.F90
index 83542f0281..2f6d11787b 100644
--- a/src/physics/cam/hetfrz_classnuc_cam.F90
+++ b/src/physics/cam/hetfrz_classnuc_cam.F90
@@ -8,28 +8,25 @@ module hetfrz_classnuc_cam
use shr_kind_mod, only: r8=>shr_kind_r8
use spmd_utils, only: masterproc
-use ppgrid, only: pcols, pver, begchunk, endchunk
+use ppgrid, only: pcols, pver
use physconst, only: rair, cpair, rh2o, rhoh2o, mwh2o, tmelt, pi
use constituents, only: cnst_get_ind
use physics_types, only: physics_state
use physics_buffer, only: physics_buffer_desc, pbuf_get_index, pbuf_old_tim_idx, pbuf_get_field
-use phys_control, only: phys_getopts, use_hetfrz_classnuc
-use rad_constituents, only: rad_cnst_get_info, rad_cnst_get_mode_idx, rad_cnst_get_spec_idx, &
- rad_cnst_get_aer_mmr, rad_cnst_get_aer_props, &
- rad_cnst_get_mode_num, rad_cnst_get_mode_props
-
+use phys_control, only: use_hetfrz_classnuc
use physics_buffer, only: pbuf_add_field, dtype_r8, pbuf_old_tim_idx, &
pbuf_get_index, pbuf_get_field
-use cam_history, only: addfld, add_default, outfld
-
+use cam_history, only: addfld, add_default, outfld, fieldname_len
use ref_pres, only: top_lev => trop_cloud_top_lev
use wv_saturation, only: svp_water_vect, svp_ice_vect
-
use cam_logfile, only: iulog
use error_messages, only: handle_errmsg, alloc_err
use cam_abortutils, only: endrun
+use string_utils, only: int2str
+use hetfrz_classnuc,only: hetfrz_classnuc_init, hetfrz_classnuc_calc
-use hetfrz_classnuc, only: hetfrz_classnuc_init, hetfrz_classnuc_calc
+use aerosol_properties_mod, only: aerosol_properties, aero_name_len
+use aerosol_state_mod, only: aerosol_state
implicit none
private
@@ -39,11 +36,12 @@ module hetfrz_classnuc_cam
hetfrz_classnuc_cam_readnl, &
hetfrz_classnuc_cam_register, &
hetfrz_classnuc_cam_init, &
- hetfrz_classnuc_cam_calc, &
- hetfrz_classnuc_cam_save_cbaero
+ hetfrz_classnuc_cam_calc
! Namelist variables
logical :: hist_hetfrz_classnuc = .false.
+real(r8) :: hetfrz_bc_scalfac = -huge(1._r8) ! scaling factor for BC
+real(r8) :: hetfrz_dust_scalfac = -huge(1._r8) ! scaling factor for dust
! Vars set via init method.
real(r8) :: mincld ! minimum allowed cloud fraction
@@ -57,83 +55,32 @@ module hetfrz_classnuc_cam
! pbuf indices for fields provided by heterogeneous freezing
integer :: &
- frzimm_idx, &
- frzcnt_idx, &
- frzdep_idx
+ frzimm_idx = -1, &
+ frzcnt_idx = -1, &
+ frzdep_idx = -1
! pbuf indices for fields needed by heterogeneous freezing
integer :: &
ast_idx = -1
-! modal aerosols
-integer, parameter :: MAM3_nmodes = 3
-integer, parameter :: MAM7_nmodes = 7
-integer, parameter :: MAM4_nmodes = 4
-integer, parameter :: MAM5_nmodes = 5
-integer :: nmodes = -1 ! number of aerosol modes
-
-! mode indices
-integer :: mode_accum_idx = -1 ! accumulation mode
-integer :: mode_coarse_idx = -1 ! coarse mode
-integer :: mode_finedust_idx = -1 ! fine dust mode
-integer :: mode_coardust_idx = -1 ! coarse dust mode
-integer :: mode_pcarbon_idx = -1 ! primary carbon mode
-integer :: mode_statcoar_idx = -1 ! strat_coarse mode
-
-! mode properties
-real(r8) :: alnsg_mode_accum
-real(r8) :: alnsg_mode_coarse
-real(r8) :: alnsg_mode_finedust
-real(r8) :: alnsg_mode_coardust
-real(r8) :: alnsg_mode_pcarbon
-real(r8) :: alnsg_mode_statcoar
-
-! specie properties
-real(r8) :: specdens_dust
-real(r8) :: specdens_so4
-real(r8) :: specdens_bc
-real(r8) :: specdens_soa
-real(r8) :: specdens_pom
-
-! List all species
-integer :: ncnst = 0 ! Total number of constituents (mass and number) needed
- ! by the parameterization (depends on aerosol model used)
-
-integer :: so4_accum ! sulfate in accumulation mode
-integer :: bc_accum ! black-c in accumulation mode
-integer :: pom_accum ! p-organic in accumulation mode
-integer :: soa_accum ! s-organic in accumulation mode
-integer :: dst_accum ! dust in accumulation mode
-integer :: ncl_accum ! seasalt in accumulation mode
-integer :: num_accum ! number in accumulation mode
-
-integer :: dst_coarse ! dust in coarse mode
-integer :: ncl_coarse ! seasalt in coarse mode
-integer :: so4_coarse ! sulfate in coarse mode
-integer :: num_coarse ! number in coarse mode
-
-integer :: dst_finedust ! dust in finedust mode
-integer :: so4_finedust ! sulfate in finedust mode
-integer :: num_finedust ! number in finedust mode
-
-integer :: dst_coardust ! dust in coardust mode
-integer :: so4_coardust ! sulfate in coardust mode
-integer :: num_coardust ! number in coardust mode
-
-integer :: bc_pcarbon ! black-c in primary carbon mode
-integer :: pom_pcarbon ! p-organic in primary carbon mode
-integer :: num_pcarbon ! number in primary carbon mode
-
-! Index arrays for looping over all constituents
-integer, allocatable :: mode_idx(:)
-integer, allocatable :: spec_idx(:)
-
-! Copy of cloud borne aerosols before modification by droplet nucleation
-! The basis is converted from mass to volume.
-real(r8), allocatable :: aer_cb(:,:,:,:)
-
-! Copy of interstitial aerosols with basis converted from mass to volume.
-real(r8), allocatable :: aer(:,:,:,:)
+type index_t
+ integer :: bin_ndx
+ integer :: spc_ndx
+end type index_t
+
+type(index_t),allocatable :: indices(:)
+character(len=16),allocatable :: types(:)
+character(len=fieldname_len),allocatable :: tot_dens_hnames(:)
+character(len=fieldname_len),allocatable :: cld_dens_hnames(:)
+character(len=fieldname_len),allocatable :: amb_dens_hnames(:)
+character(len=fieldname_len),allocatable :: coated_dens_hnames(:)
+character(len=fieldname_len),allocatable :: uncoated_dens_hnames(:)
+character(len=fieldname_len),allocatable :: cldfn_dens_hnames(:)
+character(len=fieldname_len),allocatable :: coated_frac_hnames(:)
+character(len=fieldname_len),allocatable :: radius_hnames(:)
+character(len=fieldname_len),allocatable :: wactfac_hnames(:)
+
+integer :: tot_num_bins = 0
!===============================================================================
contains
@@ -143,7 +90,7 @@ subroutine hetfrz_classnuc_cam_readnl(nlfile)
use namelist_utils, only: find_group_name
use units, only: getunit, freeunit
- use mpishorthand
+ use spmd_utils, only: mpicom, mstrid=>masterprocid, mpi_logical, mpi_real8, mpi_success
character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input
@@ -151,7 +98,7 @@ subroutine hetfrz_classnuc_cam_readnl(nlfile)
integer :: unitn, ierr
character(len=*), parameter :: subname = 'hetfrz_classnuc_cam_readnl'
- namelist /hetfrz_classnuc_nl/ hist_hetfrz_classnuc
+ namelist /hetfrz_classnuc_nl/ hist_hetfrz_classnuc, hetfrz_bc_scalfac, hetfrz_dust_scalfac
!-----------------------------------------------------------------------------
@@ -167,13 +114,21 @@ subroutine hetfrz_classnuc_cam_readnl(nlfile)
end if
close(unitn)
call freeunit(unitn)
-
end if
-#ifdef SPMD
! Broadcast namelist variables
- call mpibcast(hist_hetfrz_classnuc, 1, mpilog, 0, mpicom)
-#endif
+ call mpi_bcast(hist_hetfrz_classnuc, 1, mpi_logical, mstrid, mpicom, ierr)
+ if (ierr /= mpi_success) call endrun(subname//" mpi_bcast: hist_hetfrz_classnuc")
+ call mpi_bcast(hetfrz_bc_scalfac, 1, mpi_real8, mstrid, mpicom, ierr)
+ if (ierr /= mpi_success) call endrun(subname//" mpi_bcast: hetfrz_bc_scalfac")
+ call mpi_bcast(hetfrz_dust_scalfac, 1, mpi_real8, mstrid, mpicom, ierr)
+ if (ierr /= mpi_success) call endrun(subname//" mpi_bcast: hetfrz_dust_scalfac")
+
+ if (masterproc) then
+ write(iulog,*) subname,': hist_hetfrz_classnuc = ',hist_hetfrz_classnuc
+ write(iulog,*) subname,': hetfrz_bc_scalfac = ',hetfrz_bc_scalfac
+ write(iulog,*) subname,': hetfrz_dust_scalfac = ',hetfrz_dust_scalfac
+ end if
end subroutine hetfrz_classnuc_cam_readnl
@@ -192,26 +147,109 @@ end subroutine hetfrz_classnuc_cam_register
!================================================================================================
-subroutine hetfrz_classnuc_cam_init(mincld_in)
+subroutine hetfrz_classnuc_cam_init(mincld_in, aero_props)
real(r8), intent(in) :: mincld_in
+ class(aerosol_properties), intent(in) :: aero_props
! local variables
- logical :: prog_modal_aero
- integer :: m, n, nspec
- integer :: istat
-
- real(r8) :: sigma_logr_aer
-
- character(len=32) :: str32
+ integer :: istat, cnt, ibin, ispc
+ character(len=42) :: tmpstr
+ character(len=aero_name_len) :: species_type
character(len=*), parameter :: routine = 'hetfrz_classnuc_cam_init'
+
!--------------------------------------------------------------------------------------------
if (.not. use_hetfrz_classnuc) return
- ! This parameterization currently assumes that prognostic modal aerosols are on. Check...
- call phys_getopts(prog_modal_aero_out=prog_modal_aero)
- if (.not. prog_modal_aero) call endrun(routine//': cannot use hetfrz_classnuc without prognostic modal aerosols')
+ cnt = 0
+ do ibin = 1, aero_props%nbins()
+ do ispc = 1, aero_props%nspecies(ibin)
+ if (aero_props%hetfrz_species(ibin,ispc)) then
+ cnt = cnt+1
+ end if
+ end do
+ end do
+
+ tot_num_bins = cnt
+
+ allocate(indices(tot_num_bins), stat=istat)
+ call alloc_err(istat, routine, 'indices', tot_num_bins)
+ allocate(types(tot_num_bins), stat=istat)
+ call alloc_err(istat, routine, 'types', tot_num_bins)
+
+ allocate(tot_dens_hnames(tot_num_bins), stat=istat)
+ call alloc_err(istat, routine, 'tot_dens_hnames', tot_num_bins)
+
+ allocate(cld_dens_hnames(tot_num_bins), stat=istat)
+ call alloc_err(istat, routine, 'cld_dens_hnames', tot_num_bins)
+
+ allocate(cldfn_dens_hnames(tot_num_bins), stat=istat)
+ call alloc_err(istat, routine, 'cldfn_dens_hnames', tot_num_bins)
+
+ allocate(amb_dens_hnames(tot_num_bins), stat=istat)
+ call alloc_err(istat, routine, 'amb_dens_hnames', tot_num_bins)
+
+ allocate(coated_dens_hnames(tot_num_bins), stat=istat)
+ call alloc_err(istat, routine, 'coated_dens_hnames', tot_num_bins)
+
+ allocate(uncoated_dens_hnames(tot_num_bins), stat=istat)
+ call alloc_err(istat, routine, 'uncoated_dens_hnames', tot_num_bins)
+
+ allocate(coated_frac_hnames(tot_num_bins), stat=istat)
+ call alloc_err(istat, routine, 'coated_frac_hnames', tot_num_bins)
+
+ allocate(radius_hnames(tot_num_bins), stat=istat)
+ call alloc_err(istat, routine, 'radius_hnames', tot_num_bins)
+
+ allocate(wactfac_hnames(tot_num_bins), stat=istat)
+ call alloc_err(istat, routine, 'wactfac_hnames', tot_num_bins)
+
+ cnt = 0
+ do ibin = 1, aero_props%nbins()
+
+ do ispc = 1, aero_props%nspecies(ibin)
+ if (aero_props%hetfrz_species(ibin,ispc)) then
+ call aero_props%species_type(ibin, ispc, species_type)
+ cnt = cnt+1
+ indices(cnt)%bin_ndx = ibin
+ indices(cnt)%spc_ndx = ispc
+ types(cnt) = trim(species_type)
+ tmpstr = trim(species_type)//trim(int2str(ibin))
+
+ cldfn_dens_hnames(cnt) = trim(tmpstr)//'_cld_fn'
+ tot_dens_hnames(cnt) = trim(tmpstr)//'_tot_num'
+ cld_dens_hnames(cnt) = trim(tmpstr)//'_cld_num'
+ amb_dens_hnames(cnt) = trim(tmpstr)//'_amb_num'
+ coated_dens_hnames(cnt) = trim(tmpstr)//'_coated'
+ uncoated_dens_hnames(cnt) = trim(tmpstr)//'_uncoated'
+ coated_frac_hnames(cnt) = trim(tmpstr)//'_coated_frac'
+ radius_hnames(cnt) = trim(tmpstr)//'_radius'
+ wactfac_hnames(cnt) = trim(tmpstr)//'_wactfac'
+
+ call addfld(tot_dens_hnames(cnt),(/ 'lev' /), 'A', '#/cm3', &
+ 'total '//trim(tmpstr)//' number density' )
+ call addfld(cld_dens_hnames(cnt),(/ 'lev' /), 'A', '#/cm3', &
+ 'cloud borne '//trim(tmpstr)//' number density' )
+ call addfld(cldfn_dens_hnames(cnt),(/ 'lev' /), 'A', '#/cm3', &
+ 'cloud borne '//trim(tmpstr)//' number density derived from fn' )
+ call addfld(amb_dens_hnames(cnt),(/ 'lev' /), 'A', '#/cm3', &
+ 'ambient '//trim(tmpstr)//' number density' )
+ call addfld(coated_dens_hnames(cnt),(/ 'lev' /), 'A', '#/cm3', &
+ 'coated '//trim(tmpstr)//' number density' )
+ call addfld(uncoated_dens_hnames(cnt),(/ 'lev' /), 'A', '#/cm3', &
+ 'uncoated '//trim(tmpstr)//' number density' )
+ call addfld(coated_frac_hnames(cnt),(/ 'lev' /), 'A', '#/cm3', &
+ 'coated '//trim(tmpstr)//' fraction' )
+ call addfld(radius_hnames(cnt),(/ 'lev' /), 'A', 'm', &
+ 'ambient '//trim(tmpstr)//' radius' )
+ call addfld(wactfac_hnames(cnt),(/ 'lev' /), 'A', ' ', &
+ trim(tmpstr)//' water activity mass factor' )
+
+ end if
+ end do
+
+ end do
mincld = mincld_in
@@ -223,30 +261,9 @@ subroutine hetfrz_classnuc_cam_init(mincld_in)
! pbuf fields used by hetfrz_classnuc
ast_idx = pbuf_get_index('AST')
- call addfld('bc_num', (/ 'lev' /), 'A', '#/cm3', 'total bc number')
- call addfld('dst1_num', (/ 'lev' /), 'A', '#/cm3', 'total dst1 number')
- call addfld('dst3_num', (/ 'lev' /), 'A', '#/cm3', 'total dst3 number')
- call addfld('bcc_num', (/ 'lev' /), 'A', '#/cm3', 'coated bc number')
- call addfld('dst1c_num', (/ 'lev' /), 'A', '#/cm3', 'coated dst1 number')
- call addfld('dst3c_num', (/ 'lev' /), 'A', '#/cm3', 'coated dst3 number')
- call addfld('bcuc_num', (/ 'lev' /), 'A', '#/cm3', 'uncoated bc number')
- call addfld('dst1uc_num', (/ 'lev' /), 'A', '#/cm3', 'uncoated dst1 number')
- call addfld('dst3uc_num', (/ 'lev' /), 'A', '#/cm3', 'uncoated dst3 number')
-
- call addfld('bc_a1_num', (/ 'lev' /), 'A', '#/cm3', 'interstitial bc number')
- call addfld('dst_a1_num', (/ 'lev' /), 'A', '#/cm3', 'interstitial dst1 number')
- call addfld('dst_a3_num', (/ 'lev' /), 'A', '#/cm3', 'interstitial dst3 number')
- call addfld('bc_c1_num', (/ 'lev' /), 'A', '#/cm3', 'cloud borne bc number')
- call addfld('dst_c1_num', (/ 'lev' /), 'A', '#/cm3', 'cloud borne dst1 number')
- call addfld('dst_c3_num', (/ 'lev' /), 'A', '#/cm3', 'cloud borne dst3 number')
-
- call addfld('fn_bc_c1_num', (/ 'lev' /), 'A', '#/cm3', 'cloud borne bc number derived from fn')
- call addfld('fn_dst_c1_num', (/ 'lev' /), 'A', '#/cm3', 'cloud borne dst1 number derived from fn')
- call addfld('fn_dst_c3_num', (/ 'lev' /), 'A', '#/cm3', 'cloud borne dst3 number derived from fn')
-
- call addfld('na500', (/ 'lev' /), 'A', '#/cm3', 'interstitial aerosol number with D>500 nm')
- call addfld('totna500', (/ 'lev' /), 'A', '#/cm3', 'total aerosol number with D>500 nm')
-
+ call addfld('FRZIMM', (/ 'lev' /), 'A', ' ', 'immersion freezing')
+ call addfld('FRZCNT', (/ 'lev' /), 'A', ' ', 'contact freezing')
+ call addfld('FRZDEP', (/ 'lev' /), 'A', ' ', 'deposition freezing')
call addfld('FREQIMM', (/ 'lev' /), 'A', 'fraction', 'Fractional occurance of immersion freezing')
call addfld('FREQCNT', (/ 'lev' /), 'A', 'fraction', 'Fractional occurance of contact freezing')
call addfld('FREQDEP', (/ 'lev' /), 'A', 'fraction', 'Fractional occurance of deposition freezing')
@@ -290,30 +307,6 @@ subroutine hetfrz_classnuc_cam_init(mincld_in)
if (hist_hetfrz_classnuc) then
- call add_default('bc_num', 1, ' ')
- call add_default('dst1_num', 1, ' ')
- call add_default('dst3_num', 1, ' ')
- call add_default('bcc_num', 1, ' ')
- call add_default('dst1c_num', 1, ' ')
- call add_default('dst3c_num', 1, ' ')
- call add_default('bcuc_num', 1, ' ')
- call add_default('dst1uc_num', 1, ' ')
- call add_default('dst3uc_num', 1, ' ')
-
- call add_default('bc_a1_num', 1, ' ')
- call add_default('dst_a1_num', 1, ' ')
- call add_default('dst_a3_num', 1, ' ')
- call add_default('bc_c1_num', 1, ' ')
- call add_default('dst_c1_num', 1, ' ')
- call add_default('dst_c3_num', 1, ' ')
-
- call add_default('fn_bc_c1_num', 1, ' ')
- call add_default('fn_dst_c1_num', 1, ' ')
- call add_default('fn_dst_c3_num', 1, ' ')
-
- call add_default('na500', 1, ' ')
- call add_default('totna500', 1, ' ')
-
call add_default('FREQIMM', 1, ' ')
call add_default('FREQCNT', 1, ' ')
call add_default('FREQDEP', 1, ' ')
@@ -328,7 +321,7 @@ subroutine hetfrz_classnuc_cam_init(mincld_in)
call add_default('BCFREZDEP', 1, ' ')
call add_default('NIMIX_IMM', 1, ' ')
- call add_default('NIMIX_CNT', 1, ' ')
+ call add_default('NIMIX_CNT', 1, ' ')
call add_default('NIMIX_DEP', 1, ' ')
call add_default('DSTNIDEP', 1, ' ')
@@ -345,241 +338,23 @@ subroutine hetfrz_classnuc_cam_init(mincld_in)
end if
- ! The following code sets indices of the mode specific species used
- ! in the module. Having a list of the species needed allows us to
- ! allocate temporary space for just those species rather than for all the
- ! CAM species (pcnst) which may be considerably more than needed.
- !
- ! The indices set below are for use with the CAM rad_constituents
- ! interfaces. Using the rad_constituents interfaces isolates the physics
- ! parameterization which requires constituent information from the chemistry
- ! code which provides that information.
-
- ! nmodes is the total number of modes
- call rad_cnst_get_info(0, nmodes=nmodes)
-
- ! Determine mode indices for all modes referenced in this module.
- mode_accum_idx = rad_cnst_get_mode_idx(0, 'accum')
- mode_coarse_idx = rad_cnst_get_mode_idx(0, 'coarse')
- mode_finedust_idx = rad_cnst_get_mode_idx(0, 'fine_dust')
- mode_coardust_idx = rad_cnst_get_mode_idx(0, 'coarse_dust')
- mode_pcarbon_idx = rad_cnst_get_mode_idx(0, 'primary_carbon')
-
- ! Check that required mode types were found
- if (nmodes == MAM3_nmodes) then
- if (mode_accum_idx == -1 .or. mode_coarse_idx == -1) then
- write(iulog,*) routine//': ERROR required mode type not found - mode idx:', &
- mode_accum_idx, mode_coarse_idx
- call endrun(routine//': ERROR required mode type not found')
- end if
-
- else if (nmodes == MAM7_nmodes) then
- if (mode_coardust_idx == -1 .or. mode_finedust_idx == -1 .or. mode_pcarbon_idx == -1) then
- write(iulog,*) routine//': ERROR required mode type not found - mode idx:', &
- mode_coardust_idx, mode_finedust_idx, mode_pcarbon_idx
- call endrun(routine//': ERROR required mode type not found')
- end if
- else if (nmodes == MAM4_nmodes .or. nmodes == MAM5_nmodes) then
- if (mode_accum_idx == -1 .or. mode_coarse_idx == -1 .or. mode_pcarbon_idx == -1) then
- write(iulog,*) routine//': ERROR required mode type not found - mode idx:', &
- mode_accum_idx, mode_coarse_idx, mode_pcarbon_idx
- call endrun(routine//': ERROR required mode type not found')
- end if
- end if
-
- ! Set some mode properties
-
- call rad_cnst_get_mode_props(0, mode_accum_idx, sigmag=sigma_logr_aer)
- alnsg_mode_accum = log(sigma_logr_aer)
-
- if (nmodes == MAM3_nmodes) then
- call rad_cnst_get_mode_props(0, mode_coarse_idx, sigmag=sigma_logr_aer)
- alnsg_mode_coarse = log(sigma_logr_aer)
-
- else if (nmodes == MAM7_nmodes) then
- call rad_cnst_get_mode_props(0, mode_finedust_idx, sigmag=sigma_logr_aer)
- alnsg_mode_finedust = log(sigma_logr_aer)
-
- call rad_cnst_get_mode_props(0, mode_coardust_idx, sigmag=sigma_logr_aer)
- alnsg_mode_coardust = log(sigma_logr_aer)
-
- call rad_cnst_get_mode_props(0, mode_pcarbon_idx, sigmag=sigma_logr_aer)
- alnsg_mode_pcarbon = log(sigma_logr_aer)
-
- else if (nmodes == MAM4_nmodes .or. nmodes == MAM5_nmodes) then
- call rad_cnst_get_mode_props(0, mode_coarse_idx, sigmag=sigma_logr_aer)
- alnsg_mode_coarse = log(sigma_logr_aer)
-
- call rad_cnst_get_mode_props(0, mode_pcarbon_idx, sigmag=sigma_logr_aer)
- alnsg_mode_pcarbon = log(sigma_logr_aer)
- end if
-
- ! Set list indices for all constituents (mass and number) used in this module.
- ! The list is specific to the aerosol model used. Note that the order of the
- ! constituents in these lists is arbitrary.
-
- if (nmodes == MAM3_nmodes) then
- ncnst = 11
- so4_accum = 1
- bc_accum = 2
- pom_accum = 3
- soa_accum = 4
- dst_accum = 5
- ncl_accum = 6
- num_accum = 7
- dst_coarse = 8
- ncl_coarse = 9
- so4_coarse = 10
- num_coarse = 11
- else if (nmodes == MAM7_nmodes) then
- ncnst = 15
- so4_accum = 1
- bc_accum = 2
- pom_accum = 3
- soa_accum = 4
- ncl_accum = 6
- num_accum = 7
- dst_finedust = 8
- so4_finedust = 9
- num_finedust = 10
- dst_coardust = 11
- so4_coardust = 12
- num_coardust = 13
- bc_pcarbon = 5
- pom_pcarbon = 14
- num_pcarbon = 15
- else if (nmodes == MAM4_nmodes .or. nmodes == MAM5_nmodes) then
- ncnst = 14
- so4_accum = 1
- bc_accum = 2
- pom_accum = 3
- soa_accum = 4
- dst_accum = 5
- ncl_accum = 6
- num_accum = 7
- dst_coarse = 8
- ncl_coarse = 9
- so4_coarse = 10
- num_coarse = 11
- bc_pcarbon = 12
- pom_pcarbon = 13
- num_pcarbon = 14
- end if
-
- ! Allocate arrays to hold specie and mode indices for all constitutents (mass and number)
- ! needed in this module.
- allocate(mode_idx(ncnst), spec_idx(ncnst), stat=istat)
- call alloc_err(istat, routine, 'mode_idx, spec_idx', ncnst)
- mode_idx = -1
- spec_idx = -1
-
- ! Allocate space for copy of cloud borne aerosols before modification by droplet nucleation.
- allocate(aer_cb(pcols,pver,ncnst,begchunk:endchunk), stat=istat)
- call alloc_err(istat, routine, 'aer_cb', pcols*pver*ncnst*(endchunk-begchunk+1))
-
- ! Allocate space for copy of interstitial aerosols with modified basis
- allocate(aer(pcols,pver,ncnst,begchunk:endchunk), stat=istat)
- call alloc_err(istat, routine, 'aer', pcols*pver*ncnst*(endchunk-begchunk+1))
-
- ! The following code sets the species and mode indices for each constituent
- ! in the list. The indices are identical in the interstitial and the cloud
- ! borne phases.
- ! Specie index 0 is used to indicate the mode number mixing ratio
-
- ! Indices for species in accumulation mode (so4, bc, pom, soa, nacl, dust)
- spec_idx(num_accum) = 0
- mode_idx(num_accum) = mode_accum_idx
- spec_idx(so4_accum) = rad_cnst_get_spec_idx(0, mode_accum_idx, 'sulfate')
- mode_idx(so4_accum) = mode_accum_idx
- spec_idx(bc_accum) = rad_cnst_get_spec_idx(0, mode_accum_idx, 'black-c')
- mode_idx(bc_accum) = mode_accum_idx
- spec_idx(pom_accum) = rad_cnst_get_spec_idx(0, mode_accum_idx, 'p-organic')
- mode_idx(pom_accum) = mode_accum_idx
- spec_idx(soa_accum) = rad_cnst_get_spec_idx(0, mode_accum_idx, 's-organic')
- mode_idx(soa_accum) = mode_accum_idx
- spec_idx(ncl_accum) = rad_cnst_get_spec_idx(0, mode_accum_idx, 'seasalt')
- mode_idx(ncl_accum) = mode_accum_idx
- if (nmodes == MAM3_nmodes .or. nmodes == MAM4_nmodes .or. nmodes == MAM5_nmodes) then
- spec_idx(dst_accum) = rad_cnst_get_spec_idx(0, mode_accum_idx, 'dust')
- mode_idx(dst_accum) = mode_accum_idx
- end if
-
- ! Indices for species in coarse mode (dust, nacl, so4)
- if (mode_coarse_idx > 0) then
- spec_idx(num_coarse) = 0
- mode_idx(num_coarse) = mode_coarse_idx
- spec_idx(ncl_coarse) = rad_cnst_get_spec_idx(0, mode_coarse_idx, 'seasalt')
- mode_idx(ncl_coarse) = mode_coarse_idx
- spec_idx(dst_coarse) = rad_cnst_get_spec_idx(0, mode_coarse_idx, 'dust')
- mode_idx(dst_coarse) = mode_coarse_idx
- spec_idx(so4_coarse) = rad_cnst_get_spec_idx(0, mode_coarse_idx, 'sulfate')
- mode_idx(so4_coarse) = mode_coarse_idx
- end if
-
- ! Indices for species in fine dust mode (dust, so4)
- if (mode_finedust_idx > 0) then
- spec_idx(num_finedust) = 0
- mode_idx(num_finedust) = mode_finedust_idx
- spec_idx(dst_finedust) = rad_cnst_get_spec_idx(0, mode_finedust_idx, 'dust')
- mode_idx(dst_finedust) = mode_finedust_idx
- spec_idx(so4_finedust) = rad_cnst_get_spec_idx(0, mode_finedust_idx, 'sulfate')
- mode_idx(so4_finedust) = mode_finedust_idx
- end if
-
- ! Indices for species in coarse dust mode (dust, so4)
- if (mode_coardust_idx > 0) then
- spec_idx(num_coardust) = 0
- mode_idx(num_coardust) = mode_coardust_idx
- spec_idx(dst_coardust) = rad_cnst_get_spec_idx(0, mode_coardust_idx, 'dust')
- mode_idx(dst_coardust) = mode_coardust_idx
- spec_idx(so4_coardust) = rad_cnst_get_spec_idx(0, mode_coardust_idx, 'sulfate')
- mode_idx(so4_coardust) = mode_coardust_idx
- end if
-
- ! Indices for species in primary carbon mode (bc, pom)
- if (mode_pcarbon_idx > 0) then
- spec_idx(num_pcarbon) = 0
- mode_idx(num_pcarbon) = mode_pcarbon_idx
- spec_idx(bc_pcarbon) = rad_cnst_get_spec_idx(0, mode_pcarbon_idx, 'black-c')
- mode_idx(bc_pcarbon) = mode_pcarbon_idx
- spec_idx(pom_pcarbon) = rad_cnst_get_spec_idx(0, mode_pcarbon_idx, 'p-organic')
- mode_idx(pom_pcarbon) = mode_pcarbon_idx
- end if
-
- ! Check that all required specie types were found
- if (any(spec_idx == -1)) then
- write(iulog,*) routine//': ERROR required species type not found - indicies:', spec_idx
- call endrun(routine//': ERROR required species type not found')
- end if
-
- ! Get some specie specific properties.
- if (nmodes == MAM3_nmodes .or. nmodes == MAM4_nmodes .or. nmodes == MAM5_nmodes) then
- call rad_cnst_get_aer_props(0, mode_idx(dst_accum), spec_idx(dst_accum), density_aer=specdens_dust)
- else if (nmodes == MAM7_nmodes) then
- call rad_cnst_get_aer_props(0, mode_idx(dst_finedust), spec_idx(dst_finedust), density_aer=specdens_dust)
- end if
- call rad_cnst_get_aer_props(0, mode_idx(so4_accum), spec_idx(so4_accum), density_aer=specdens_so4)
- call rad_cnst_get_aer_props(0, mode_idx(bc_accum), spec_idx(bc_accum), density_aer=specdens_bc)
- call rad_cnst_get_aer_props(0, mode_idx(soa_accum), spec_idx(soa_accum), density_aer=specdens_soa)
- call rad_cnst_get_aer_props(0, mode_idx(pom_accum), spec_idx(pom_accum), density_aer=specdens_pom)
-
- call hetfrz_classnuc_init( &
- rair, cpair, rh2o, rhoh2o, mwh2o, &
- tmelt, pi, iulog)
+ call hetfrz_classnuc_init(rair, cpair, rh2o, rhoh2o, mwh2o, tmelt, iulog, &
+ hetfrz_bc_scalfac, hetfrz_dust_scalfac )
end subroutine hetfrz_classnuc_cam_init
!================================================================================================
-subroutine hetfrz_classnuc_cam_calc( &
- state, deltatin, factnum, pbuf)
+subroutine hetfrz_classnuc_cam_calc(aero_props, aero_state, state, deltatin, factnum, pbuf)
! arguments
- type(physics_state), target, intent(in) :: state
- real(r8), intent(in) :: deltatin ! time step (s)
- real(r8), intent(in) :: factnum(:,:,:) ! activation fraction for aerosol number
- type(physics_buffer_desc), pointer :: pbuf(:)
-
+ class(aerosol_properties), intent(in) :: aero_props
+ class(aerosol_state), intent(in) :: aero_state
+ type(physics_state), target, intent(in) :: state
+ real(r8), intent(in) :: deltatin ! time step (s)
+ real(r8), intent(in) :: factnum(:,:,:) ! activation fraction for aerosol number
+ type(physics_buffer_desc), pointer :: pbuf(:)
+
! local workspace
! outputs shared with the microphysics via the pbuf
@@ -592,26 +367,11 @@ subroutine hetfrz_classnuc_cam_calc( &
real(r8) :: rho(pcols,pver) ! air density (kg m-3)
- real(r8), pointer :: ast(:,:)
+ real(r8), pointer :: ast(:,:)
real(r8) :: lcldm(pcols,pver)
- real(r8), pointer :: ptr2d(:,:)
-
- real(r8) :: fn(3)
- real(r8) :: awcam(pcols,pver,3)
- real(r8) :: awfacm(pcols,pver,3)
- real(r8) :: hetraer(pcols,pver,3)
- real(r8) :: dstcoat(pcols,pver,3)
- real(r8) :: total_interstitial_aer_num(pcols,pver,3)
- real(r8) :: total_cloudborne_aer_num(pcols,pver,3)
- real(r8) :: total_aer_num(pcols,pver,3)
- real(r8) :: coated_aer_num(pcols,pver,3)
- real(r8) :: uncoated_aer_num(pcols,pver,3)
-
- real(r8) :: fn_cloudborne_aer_num(pcols,pver,3)
-
- real(r8) :: esi(pcols), esl(pcols)
+ real(r8) :: esi(pcols), esl(pcols)
real(r8) :: con1, r3lx, supersatice
real(r8) :: qcic
@@ -622,6 +382,7 @@ subroutine hetfrz_classnuc_cam_calc( &
real(r8) :: frzbcdep(pcols,pver), frzdudep(pcols,pver)
real(r8) :: freqimm(pcols,pver), freqcnt(pcols,pver), freqdep(pcols,pver), freqmix(pcols,pver)
+
real(r8) :: nnuccc_bc(pcols,pver), nnucct_bc(pcols,pver), nnudep_bc(pcols,pver)
real(r8) :: nnuccc_dst(pcols,pver), nnucct_dst(pcols,pver), nnudep_dst(pcols,pver)
real(r8) :: niimm_bc(pcols,pver), nicnt_bc(pcols,pver), nidep_bc(pcols,pver)
@@ -630,8 +391,17 @@ subroutine hetfrz_classnuc_cam_calc( &
real(r8) :: numice10s_imm_dst(pcols,pver)
real(r8) :: numice10s_imm_bc(pcols,pver)
- real(r8) :: na500(pcols,pver)
- real(r8) :: tot_na500(pcols,pver)
+ real(r8) :: coated(pcols,pver,tot_num_bins)
+ real(r8) :: aer_radius(pcols,pver,tot_num_bins)
+ real(r8) :: aer_wactfac(pcols,pver,tot_num_bins)
+
+ real(r8) :: coated_amb_aer_num(pcols,pver,tot_num_bins)
+ real(r8) :: uncoated_amb_aer_num(pcols,pver,tot_num_bins)
+ real(r8) :: amb_aer_num(pcols,pver,tot_num_bins)
+ real(r8) :: cld_aer_num(pcols,pver,tot_num_bins)
+ real(r8) :: tot_aer_num(pcols,pver,tot_num_bins)
+ real(r8) :: fn_cld_aer_num(pcols,pver)
+ real(r8) :: fraction_activated(pcols,pver,tot_num_bins)
character(128) :: errstring ! Error status
!-------------------------------------------------------------------------------
@@ -661,85 +431,45 @@ subroutine hetfrz_classnuc_cam_calc( &
end do
end do
- ! Convert interstitial and cloud borne aerosols from a mass to a volume basis before
- ! being used in get_aer_num
- do i = 1, ncnst
- aer_cb(:ncol,:,i,lchnk) = aer_cb(:ncol,:,i,lchnk) * rho(:ncol,:)
-
- ! Check whether constituent is a mass or number mixing ratio
- if (spec_idx(i) == 0) then
- call rad_cnst_get_mode_num(0, mode_idx(i), 'a', state, pbuf, ptr2d)
- else
- call rad_cnst_get_aer_mmr(0, mode_idx(i), spec_idx(i), 'a', state, pbuf, ptr2d)
- end if
- aer(:ncol,:,i,lchnk) = ptr2d(:ncol,:) * rho(:ncol,:)
- end do
+ do i = 1,tot_num_bins
- ! Init top levels of outputs of get_aer_num
- total_aer_num = 0._r8
- coated_aer_num = 0._r8
- uncoated_aer_num = 0._r8
- total_interstitial_aer_num = 0._r8
- total_cloudborne_aer_num = 0._r8
- hetraer = 0._r8
- awcam = 0._r8
- awfacm = 0._r8
- dstcoat = 0._r8
- na500 = 0._r8
- tot_na500 = 0._r8
-
- ! output aerosols as reference information for heterogeneous freezing
- do i = 1, ncol
- do k = top_lev, pver
- call get_aer_num(i, k, ncnst, aer(:,:,:,lchnk), aer_cb(:,:,:,lchnk), rho(i,k), &
- total_aer_num(i,k,:), coated_aer_num(i,k,:), uncoated_aer_num(i,k,:), &
- total_interstitial_aer_num(i,k,:), total_cloudborne_aer_num(i,k,:), &
- hetraer(i,k,:), awcam(i,k,:), awfacm(i,k,:), dstcoat(i,k,:), &
- na500(i,k), tot_na500(i,k))
-
- fn_cloudborne_aer_num(i,k,1) = total_aer_num(i,k,1)*factnum(i,k,mode_accum_idx) ! bc
- if (nmodes == MAM3_nmodes .or. nmodes == MAM4_nmodes) then
- fn_cloudborne_aer_num(i,k,2) = total_aer_num(i,k,2)*factnum(i,k,mode_accum_idx) ! dst_a1
- fn_cloudborne_aer_num(i,k,3) = total_aer_num(i,k,3)*factnum(i,k,mode_coarse_idx) ! dst_a3
- else if (nmodes == MAM7_nmodes) then
- fn_cloudborne_aer_num(i,k,2) = total_aer_num(i,k,2)*factnum(i,k,mode_finedust_idx)
- fn_cloudborne_aer_num(i,k,3) = total_aer_num(i,k,3)*factnum(i,k,mode_coardust_idx)
- end if
- end do
- end do
+ call aero_state%get_amb_species_numdens( indices(i)%bin_ndx, ncol, pver, types(i), aero_props, rho, amb_aer_num(:,:,i))
+ call aero_state%get_cld_species_numdens( indices(i)%bin_ndx, ncol, pver, types(i), aero_props, rho, cld_aer_num(:,:,i))
+
+ tot_aer_num(:ncol,:,i) = cld_aer_num(:ncol,:,i) + amb_aer_num(:ncol,:,i)
+
+ call outfld(tot_dens_hnames(i), tot_aer_num(:,:,i), pcols, lchnk)
+ call outfld(amb_dens_hnames(i), amb_aer_num(:,:,i), pcols, lchnk)
+ call outfld(cld_dens_hnames(i), cld_aer_num(:,:,i), pcols, lchnk)
+
+ aer_radius(:ncol,:,i) = aero_state%mass_mean_radius( indices(i)%bin_ndx, indices(i)%spc_ndx, ncol, pver, aero_props, rho )
+
+ coated(:ncol,:,i) = aero_state%coated_frac( indices(i)%bin_ndx, types(i), ncol, pver, aero_props, aer_radius(:,:,i) )
- call outfld('bc_num', total_aer_num(:,:,1), pcols, lchnk)
- call outfld('dst1_num', total_aer_num(:,:,2), pcols, lchnk)
- call outfld('dst3_num', total_aer_num(:,:,3), pcols, lchnk)
+ call outfld(coated_frac_hnames(i), coated(:,:,i), pcols, lchnk)
- call outfld('bcc_num', coated_aer_num(:,:,1), pcols, lchnk)
- call outfld('dst1c_num', coated_aer_num(:,:,2), pcols, lchnk)
- call outfld('dst3c_num', coated_aer_num(:,:,3), pcols, lchnk)
+ coated_amb_aer_num(:ncol,:,i) = amb_aer_num(:ncol,:,i)*coated(:ncol,:,i)
+ uncoated_amb_aer_num(:ncol,:,i) = amb_aer_num(:ncol,:,i)*(1._r8-coated(:ncol,:,i))
- call outfld('bcuc_num', uncoated_aer_num(:,:,1), pcols, lchnk)
- call outfld('dst1uc_num', uncoated_aer_num(:,:,2), pcols, lchnk)
- call outfld('dst3uc_num', uncoated_aer_num(:,:,3), pcols, lchnk)
+ call outfld(coated_dens_hnames(i), coated_amb_aer_num(:,:,i), pcols, lchnk)
+ call outfld(uncoated_dens_hnames(i), uncoated_amb_aer_num(:,:,i), pcols, lchnk)
+ call outfld(radius_hnames(i), aer_radius(:ncol,:,i), ncol, lchnk)
- call outfld('bc_a1_num', total_interstitial_aer_num(:,:,1), pcols, lchnk)
- call outfld('dst_a1_num', total_interstitial_aer_num(:,:,2), pcols, lchnk)
- call outfld('dst_a3_num', total_interstitial_aer_num(:,:,3), pcols, lchnk)
+ call aero_state%watact_mfactor(indices(i)%bin_ndx, types(i), ncol, pver, aero_props, rho, aer_wactfac(:ncol,:,i))
+ call outfld(wactfac_hnames(i), aer_wactfac(:,:,i), pcols, lchnk)
- call outfld('bc_c1_num', total_cloudborne_aer_num(:,:,1), pcols, lchnk)
- call outfld('dst_c1_num', total_cloudborne_aer_num(:,:,2), pcols, lchnk)
- call outfld('dst_c3_num', total_cloudborne_aer_num(:,:,3), pcols, lchnk)
+ fn_cld_aer_num(:ncol,:) = tot_aer_num(:ncol,:,i)*factnum(:ncol,:,indices(i)%bin_ndx)
+ call outfld(cldfn_dens_hnames(i), fn_cld_aer_num, pcols, lchnk)
- call outfld('fn_bc_c1_num', fn_cloudborne_aer_num(:,:,1), pcols, lchnk)
- call outfld('fn_dst_c1_num', fn_cloudborne_aer_num(:,:,2), pcols, lchnk)
- call outfld('fn_dst_c3_num', fn_cloudborne_aer_num(:,:,3), pcols, lchnk)
-
- call outfld('na500', na500, pcols, lchnk)
- call outfld('totna500', tot_na500, pcols, lchnk)
+ fraction_activated(:ncol,:,i) = factnum(:ncol,:,indices(i)%bin_ndx)
+
+ end do
! frzimm, frzcnt, frzdep are the outputs of this parameterization used by the microphysics
call pbuf_get_field(pbuf, frzimm_idx, frzimm)
call pbuf_get_field(pbuf, frzcnt_idx, frzcnt)
call pbuf_get_field(pbuf, frzdep_idx, frzdep)
-
+
frzimm(:ncol,:) = 0._r8
frzcnt(:ncol,:) = 0._r8
frzdep(:ncol,:) = 0._r8
@@ -790,22 +520,13 @@ subroutine hetfrz_classnuc_cam_calc( &
r3lx = max(4.e-6_r8, r3lx)
supersatice = esl(i)/esi(i)
- fn(1) = factnum(i,k,mode_accum_idx) ! bc accumulation mode
- if (nmodes == MAM3_nmodes .or. nmodes == MAM4_nmodes .or. nmodes == MAM5_nmodes) then
- fn(2) = factnum(i,k,mode_accum_idx) ! dust_a1 accumulation mode
- fn(3) = factnum(i,k,mode_coarse_idx) ! dust_a3 coarse mode
- else if (nmodes == MAM7_nmodes) then
- fn(2) = factnum(i,k,mode_finedust_idx)
- fn(3) = factnum(i,k,mode_coardust_idx)
- end if
-
- call hetfrz_classnuc_calc( &
+ call hetfrz_classnuc_calc( tot_num_bins, types, &
deltatin, t(i,k), pmid(i,k), supersatice, &
- fn, r3lx, ncic*rho(i,k)*1.0e-6_r8, frzbcimm(i,k), frzduimm(i,k), &
- frzbccnt(i,k), frzducnt(i,k), frzbcdep(i,k), frzdudep(i,k), hetraer(i,k,:), &
- awcam(i,k,:), awfacm(i,k,:), dstcoat(i,k,:), total_aer_num(i,k,:), &
- coated_aer_num(i,k,:), uncoated_aer_num(i,k,:), total_interstitial_aer_num(i,k,:), &
- total_cloudborne_aer_num(i,k,:), errstring)
+ fraction_activated(i,k,:), r3lx, ncic*rho(i,k)*1.0e-6_r8, frzbcimm(i,k), frzduimm(i,k), &
+ frzbccnt(i,k), frzducnt(i,k), frzbcdep(i,k), frzdudep(i,k), aer_radius(i,k,:), &
+ aer_wactfac(i,k,:), coated(i,k,:), tot_aer_num(i,k,:), &
+ uncoated_amb_aer_num(i,k,:), amb_aer_num(i,k,:), &
+ cld_aer_num(i,k,:), errstring)
call handle_errmsg(errstring, subname="hetfrz_classnuc_calc")
@@ -817,6 +538,7 @@ subroutine hetfrz_classnuc_cam_calc( &
if (frzcnt(i,k) > 0._r8) freqcnt(i,k) = 1._r8
if (frzdep(i,k) > 0._r8) freqdep(i,k) = 1._r8
if ((frzimm(i,k) + frzcnt(i,k) + frzdep(i,k)) > 0._r8) freqmix(i,k) = 1._r8
+
else
frzimm(i,k) = 0._r8
frzcnt(i,k) = 0._r8
@@ -828,7 +550,7 @@ subroutine hetfrz_classnuc_cam_calc( &
nnudep_bc(i,k) = frzbcdep(i,k)*1.0e6_r8*ast(i,k)
nnuccc_dst(i,k) = frzduimm(i,k)*1.0e6_r8*ast(i,k)
- nnucct_dst(i,k) = frzducnt(i,k)*1.0e6_r8*ast(i,k)
+ nnucct_dst(i,k) = frzducnt(i,k)*1.0e6_r8*ast(i,k)
nnudep_dst(i,k) = frzdudep(i,k)*1.0e6_r8*ast(i,k)
niimm_bc(i,k) = frzbcimm(i,k)*1.0e6_r8*deltatin
@@ -845,6 +567,10 @@ subroutine hetfrz_classnuc_cam_calc( &
end do
end do
+ call outfld('FRZIMM', frzimm, pcols, lchnk)
+ call outfld('FRZCNT', frzcnt, pcols, lchnk)
+ call outfld('FRZDEP', frzdep, pcols, lchnk)
+
call outfld('FREQIMM', freqimm, pcols, lchnk)
call outfld('FREQCNT', freqcnt, pcols, lchnk)
call outfld('FREQDEP', freqdep, pcols, lchnk)
@@ -859,7 +585,7 @@ subroutine hetfrz_classnuc_cam_calc( &
call outfld('BCFREZDEP', nnudep_bc, pcols, lchnk)
call outfld('NIMIX_IMM', niimm_bc+niimm_dst, pcols, lchnk)
- call outfld('NIMIX_CNT', nicnt_bc+nicnt_dst, pcols, lchnk)
+ call outfld('NIMIX_CNT', nicnt_bc+nicnt_dst, pcols, lchnk)
call outfld('NIMIX_DEP', nidep_bc+nidep_dst, pcols, lchnk)
call outfld('DSTNICNT', nicnt_dst, pcols, lchnk)
@@ -880,491 +606,4 @@ end subroutine hetfrz_classnuc_cam_calc
!====================================================================================================
-subroutine hetfrz_classnuc_cam_save_cbaero(state, pbuf)
-
- ! Save the required cloud borne aerosol constituents.
- type(physics_state), intent(in) :: state
- type(physics_buffer_desc), pointer :: pbuf(:)
-
- ! local variables
- integer :: i, lchnk
- real(r8), pointer :: ptr2d(:,:)
- !-------------------------------------------------------------------------------
-
- lchnk = state%lchnk
-
- ! loop over the cloud borne constituents required by this module and save
- ! a local copy
-
- do i = 1, ncnst
-
- ! Check whether constituent is a mass or number mixing ratio
- if (spec_idx(i) == 0) then
- call rad_cnst_get_mode_num(0, mode_idx(i), 'c', state, pbuf, ptr2d)
- else
- call rad_cnst_get_aer_mmr(0, mode_idx(i), spec_idx(i), 'c', state, pbuf, ptr2d)
- end if
- aer_cb(:,:,i,lchnk) = ptr2d
- end do
-
-end subroutine hetfrz_classnuc_cam_save_cbaero
-
-!====================================================================================================
-
-subroutine get_aer_num(ii, kk, ncnst, aer, aer_cb, rhoair,&
- total_aer_num, &
- coated_aer_num, &
- uncoated_aer_num, &
- total_interstial_aer_num, &
- total_cloudborne_aer_num, &
- hetraer, awcam, awfacm, dstcoat, &
- na500, tot_na500)
-
- !*****************************************************************************
- ! Purpose: Calculate BC and Dust number, including total number(interstitial+
- ! cloud borne), one monolayer coated number, and uncoated number
- !
- ! Author: Yong Wang and Xiaohong Liu, UWyo, 12/2012
- !*****************************************************************************
-
- ! input
- integer, intent(in) :: ii, kk, ncnst
- real(r8), intent(in) :: aer(pcols,pver,ncnst) ! interstitial aerosols, volume basis
- real(r8), intent(in) :: aer_cb(pcols,pver,ncnst) ! cloud borne aerosols, volume basis
- real(r8), intent(in) :: rhoair ! air density (kg/m3)
-
- ! The interstitial and cloud borne aerosol concentrations are accessed from
- ! module variables local to this module.
-
- ! output
- real(r8), intent(out) :: total_aer_num(3) ! #/cm^3
- real(r8), intent(out) :: total_interstial_aer_num(3) ! #/cm^3
- real(r8), intent(out) :: total_cloudborne_aer_num(3) ! #/cm^3
- real(r8), intent(out) :: coated_aer_num(3) ! #/cm^3
- real(r8), intent(out) :: uncoated_aer_num(3) ! #/cm^3
- real(r8), intent(out) :: hetraer(3) ! BC and Dust mass mean radius [m]
- real(r8), intent(out) :: awcam(3) ! modal added mass [mug m-3]
- real(r8), intent(out) :: awfacm(3) ! (OC+BC)/(OC+BC+SO4)
- real(r8), intent(out) :: dstcoat(3) ! coated fraction
- real(r8), intent(out) :: na500 ! #/cm^3 interstitial aerosol number with D>500 nm (#/cm^3)
- real(r8), intent(out) :: tot_na500 ! #/cm^3 total aerosol number with D>500 nm (#/cm^3)
-
-
- !local variables
- !------------coated variables--------------------
- real(r8), parameter :: n_so4_monolayers_dust = 1.0_r8 ! number of so4(+nh4) monolayers needed to coat a dust particle
- real(r8), parameter :: dr_so4_monolayers_dust = n_so4_monolayers_dust * 4.76e-10_r8
- real(r8), parameter :: spechygro_so4 = 0.507_r8 ! Sulfate hygroscopicity
- real(r8), parameter :: spechygro_soa = 0.14_r8 ! SOA hygroscopicity
- real(r8), parameter :: spechygro_pom = 0.1_r8 ! POM hygroscopicity
- real(r8), parameter :: soa_equivso4_factor = spechygro_soa/spechygro_so4
- real(r8), parameter :: pom_equivso4_factor = spechygro_pom/spechygro_so4
- real(r8) :: vol_shell(3)
- real(r8) :: vol_core(3)
- real(r8) :: fac_volsfc_dust_a1, fac_volsfc_dust_a3, fac_volsfc_bc
- real(r8) :: tmp1, tmp2
- real(r8) :: bc_num ! bc number in accumulation mode for MAM3
- ! bc number in accumulation and primary carbon mode for MAM7 and MAM4
- real(r8) :: dst1_num, dst3_num ! dust number in accumulation and corase mode for MAM3
- ! dust number in fine dust and corase dust mode for MAM7 and MAM4
- logical :: num_to_mass_in = .true.
- real(r8), parameter :: bc_num_to_mass = 4.669152e+17_r8 ! #/kg from emission
- real(r8), parameter :: dst1_num_to_mass = 3.484e+15_r8 ! #/kg for dust in accumulation mode
-
- real(r8) :: dmc, ssmc
-
- real(r8) :: as_so4, as_du, as_soa
- real(r8) :: dst1_num_imm, dst3_num_imm, bc_num_imm
- real(r8) :: dmc_imm, ssmc_imm
- real(r8) :: as_bc, as_pom, as_ss
-
- real(r8) :: r_bc ! model radii of BC modes [m]
- real(r8) :: r_dust_a1, r_dust_a3 ! model radii of dust modes [m]
-
- integer :: i
- real(r8) :: dst1_scale
- !-------------------------------------------------------------------------------
-
- ! init output vars
- total_aer_num = 0._r8
- total_interstial_aer_num = 0._r8
- total_cloudborne_aer_num = 0._r8
- coated_aer_num = 0._r8
- uncoated_aer_num = 0._r8
- hetraer = 0._r8
- awcam = 0._r8
- awfacm = 0._r8
- dstcoat = 0._r8
- na500 = 0._r8
- tot_na500 = 0._r8
-
- !*****************************************************************************
- ! calculate intersitial aerosol
- !*****************************************************************************
-
- if (nmodes == MAM3_nmodes .or. nmodes == MAM4_nmodes .or. nmodes == MAM5_nmodes) then
-
- if (.not. num_to_mass_in) then
-
- as_so4 = aer(ii,kk,so4_accum)
- as_bc = aer(ii,kk,bc_accum)
- as_pom = aer(ii,kk,pom_accum)
- as_soa = aer(ii,kk,soa_accum)
- as_ss = aer(ii,kk,ncl_accum)
- as_du = aer(ii,kk,dst_accum)
-
- if (as_du > 0._r8) then
- dst1_num = as_du/(as_so4+as_bc+as_pom+as_soa+as_ss+as_du) &
- * aer(ii,kk,num_accum)*1.0e-6_r8 ! #/cm^3
- else
- dst1_num = 0.0_r8
- end if
-
- if (as_bc > 0._r8) then
- bc_num = as_bc/(as_so4+as_bc+as_pom+as_soa+as_ss+as_du) &
- * aer(ii,kk,num_accum)*1.0e-6_r8 ! #/cm^3
- else
- bc_num = 0.0_r8
- end if
-
- else
-
- dst1_num = aer(ii,kk,dst_accum) * dst1_num_to_mass*1.0e-6_r8 ! #/cm^3, dust # in accumulation mode
- bc_num = aer(ii,kk,bc_accum) * bc_num_to_mass*1.0e-6_r8 ! #/cm^3
- end if
- dmc = aer(ii,kk,dst_coarse)
- ssmc = aer(ii,kk,ncl_coarse)
-
- if (dmc > 0._r8 ) then
- dst3_num = dmc/(ssmc+dmc) * aer(ii,kk,num_coarse)*1.0e-6_r8 ! #/cm^3
- else
- dst3_num = 0.0_r8
- end if
-
- if (nmodes == MAM4_nmodes .or. nmodes == MAM5_nmodes) then
- bc_num = bc_num+(aer(ii,kk,bc_pcarbon)) * bc_num_to_mass*1.0e-6_r8 ! #/cm^3
- end if
- else if (nmodes == MAM7_nmodes) then
- bc_num = (aer(ii,kk,bc_accum)+aer(ii,kk,bc_pcarbon)) * bc_num_to_mass*1.0e-6_r8 ! #/cm^3
- dst1_num = aer(ii,kk,num_finedust)*1.0e-6_r8 ! #/cm^3
- dst3_num = aer(ii,kk,num_coardust)*1.0e-6_r8 ! #/cm^3
- end if
-
- !*****************************************************************************
- ! calculate cloud borne aerosol
- !*****************************************************************************
-
- if (nmodes == MAM3_nmodes .or. nmodes == MAM4_nmodes .or. nmodes == MAM5_nmodes) then
-
- as_so4 = aer_cb(ii,kk,so4_accum)
- as_bc = aer_cb(ii,kk,bc_accum)
- as_pom = aer_cb(ii,kk,pom_accum)
- as_soa = aer_cb(ii,kk,soa_accum)
- as_ss = aer_cb(ii,kk,ncl_accum)
- as_du = aer_cb(ii,kk,dst_accum)
-
- if (as_du > 0._r8) then
- dst1_num_imm = as_du/(as_so4+as_bc+as_pom+as_soa+as_ss+as_du) &
- * aer_cb(ii,kk,num_accum)*1.0e-6_r8 ! #/cm^3
- else
- dst1_num_imm = 0.0_r8
- end if
-
- if (as_bc > 0._r8) then
- bc_num_imm = as_bc/(as_so4+as_bc+as_pom+as_soa+as_ss+as_du) &
- * aer_cb(ii,kk,num_accum)*1.0e-6_r8 ! #/cm^3
- else
- bc_num_imm = 0.0_r8
- end if
-
- dmc_imm = aer_cb(ii,kk,dst_coarse)
- ssmc_imm = aer_cb(ii,kk,ncl_coarse)
-
- if (dmc_imm > 0._r8) then
- dst3_num_imm = dmc_imm/(ssmc_imm+dmc_imm) * aer_cb(ii,kk,num_coarse)*1.0e-6_r8 ! #/cm^3
- else
- dst3_num_imm = 0.0_r8
- end if
-
- else if (nmodes == MAM7_nmodes) then
- ! primary carbon mode is insoluble and thus don't consider its cloud-borne state
- as_so4 = aer_cb(ii,kk,so4_accum)
- as_bc = aer_cb(ii,kk,bc_accum)
- as_pom = aer_cb(ii,kk,pom_accum)
- as_soa = aer_cb(ii,kk,soa_accum)
- as_ss = aer_cb(ii,kk,ncl_accum)
- if (as_bc > 0._r8) then
- bc_num_imm = as_bc/(as_so4+as_bc+as_pom+as_soa+as_ss) &
- * aer_cb(ii,kk,num_accum)*1.0e-6_r8 ! #/cm^3
- else
- bc_num_imm = 0.0_r8
- end if
- dst1_num_imm = aer_cb(ii,kk,num_finedust)*1.0e-6_r8 ! #/cm^3
- dst3_num_imm = aer_cb(ii,kk,num_coardust)*1.0e-6_r8 ! #/cm^3
- end if
-
- total_interstial_aer_num(1) = bc_num
- total_interstial_aer_num(2) = dst1_num
- total_interstial_aer_num(3) = dst3_num
-
- total_cloudborne_aer_num(1) = bc_num_imm
- total_cloudborne_aer_num(2) = dst1_num_imm
- total_cloudborne_aer_num(3) = dst3_num_imm
-
- !*****************************************************************************
- ! calculate mass mean radius
- !*****************************************************************************
-
- if (nmodes == MAM3_nmodes .or. nmodes == MAM4_nmodes .or. nmodes == MAM5_nmodes) then
-
- if (nmodes == MAM3_nmodes) then
-
- if (aer(ii,kk,bc_accum)*1.0e-3_r8 > 1.0e-30_r8 .and. bc_num > 1.0e-3_r8) then
- r_bc = ( 3._r8/(4*pi*specdens_bc)*aer(ii,kk,bc_accum)/(bc_num*1.0e6_r8) )**(1._r8/3._r8)
- else
- r_bc = 0.04e-6_r8
- end if
-
- else
- if ((aer(ii,kk,bc_accum)+aer(ii,kk,bc_pcarbon))*1.0e-3_r8 > 1.0e-30_r8 &
- .and. bc_num > 1.0e-3_r8) then
- r_bc = ( 3._r8/(4*pi*specdens_bc)*(aer(ii,kk,bc_accum)+aer(ii,kk,bc_pcarbon))/ &
- (bc_num*1.0e6_r8) )**(1._r8/3._r8)
- else
- r_bc = 0.067e-6_r8 ! from emission size
- end if
-
- end if
-
- if (aer(ii,kk,dst_accum)*1.0e-3_r8 > 1.0e-30_r8 .and. dst1_num > 1.0e-3_r8) then
- r_dust_a1 = ( 3._r8/(4*pi*specdens_dust)*aer(ii,kk,dst_accum)/(dst1_num*1.0e6_r8) )**(1._r8/3._r8)
- else
- r_dust_a1 = 0.258e-6_r8
- end if
-
- if (aer(ii,kk,dst_coarse)*1.0e-3_r8 > 1.0e-30_r8 .and. dst3_num > 1.0e-3_r8) then
- r_dust_a3 = ( 3._r8/(4*pi*specdens_dust)*aer(ii,kk,dst_coarse)/(dst3_num*1.0e6_r8) )**(1._r8/3._r8)
- else
- r_dust_a3 = 1.576e-6_r8
- end if
-
- else if (nmodes == MAM7_nmodes) then
-
- if ((aer(ii,kk,bc_accum)+aer(ii,kk,bc_pcarbon))*1.0e-3_r8 > 1.0e-30_r8 &
- .and. bc_num > 1.0e-3_r8) then
- r_bc = ( 3._r8/(4*pi*specdens_bc)*(aer(ii,kk,bc_accum)+aer(ii,kk,bc_pcarbon))/ &
- (bc_num*1.0e6_r8) )**(1._r8/3._r8)
- else
- r_bc = 0.067e-6_r8 ! from emission size
- end if
-
- if (aer(ii,kk,dst_finedust)*1.0e-3_r8 > 1.0e-30_r8 .and. dst1_num > 1.0e-3_r8) then
- r_dust_a1 = ( 3._r8/(4*pi*specdens_dust)*aer(ii,kk,dst_finedust)/(dst1_num*1.0e6_r8) )**(1._r8/3._r8)
- else
- r_dust_a1 = 0.258e-6_r8
- end if
-
- if (aer(ii,kk,dst_coardust)*1.0e-3_r8 > 1.0e-30_r8 .and. dst3_num > 1.0e-3_r8) then
- r_dust_a3 = ( 3._r8/(4*pi*specdens_dust)*aer(ii,kk,dst_coardust)/(dst3_num*1.0e6_r8) )**(1._r8/3._r8)
- else
- r_dust_a3 = 1.576e-6_r8
- end if
- end if
-
- hetraer(1) = r_bc
- hetraer(2) = r_dust_a1
- hetraer(3) = r_dust_a3
-
- !*****************************************************************************
- ! calculate coated fraction
- !*****************************************************************************
-
- if (nmodes == MAM3_nmodes .or. nmodes == MAM4_nmodes .or. nmodes == MAM5_nmodes) then
-
- fac_volsfc_bc = exp(2.5_r8*alnsg_mode_accum**2)
- fac_volsfc_dust_a1 = exp(2.5_r8*alnsg_mode_accum**2)
- fac_volsfc_dust_a3 = exp(2.5_r8*alnsg_mode_coarse**2)
-
- vol_shell(2) = ( aer(ii,kk,so4_accum)/specdens_so4 + &
- aer(ii,kk,pom_accum)*pom_equivso4_factor/specdens_pom + &
- aer(ii,kk,soa_accum)*soa_equivso4_factor/specdens_soa )/rhoair
-
- vol_core(2) = aer(ii,kk,dst_accum)/(specdens_dust*rhoair)
-
- ! ratio1 = vol_shell/vol_core =
- ! actual hygroscopic-shell-volume/dust-core-volume
- ! ratio2 = 6.0_r8*dr_so4_monolayers_pcage/(dgncur_a*fac_volsfc_dust)
- ! = (shell-volume corresponding to n_so4_monolayers_pcage)/core-volume
- ! The 6.0/(dgncur_a*fac_volsfc_dust) = (mode-surface-area/mode-volume)
- ! Note that vol_shell includes both so4, pom, AND soa as "equivalent so4",
- ! The soa_equivso4_factor accounts for the lower hygroscopicity of soa.
- !
- ! Define xferfrac_pcage = min( 1.0, ratio1/ratio2)
- ! But ratio1/ratio2 == tmp1/tmp2, and coding below avoids possible overflow
-
- ! bc
- if (nmodes == MAM3_nmodes) then
- vol_shell(1) = vol_shell(2)
- vol_core(1) = aer(ii,kk,bc_accum)/(specdens_bc*rhoair)
- tmp1 = vol_shell(1)*(r_bc*2._r8)*fac_volsfc_bc
- tmp2 = max(6.0_r8*dr_so4_monolayers_dust*vol_core(1), 0.0_r8)
- dstcoat(1) = tmp1/tmp2
- else
- fac_volsfc_bc = exp(2.5_r8*alnsg_mode_pcarbon**2)
- vol_shell(1) = ( aer(ii,kk,pom_pcarbon)*pom_equivso4_factor/specdens_pom )/rhoair
- vol_core(1) = aer(ii,kk,bc_pcarbon)/(specdens_bc*rhoair)
- tmp1 = vol_shell(1)*(r_bc*2._r8)*fac_volsfc_bc
- tmp2 = max(6.0_r8*dr_so4_monolayers_dust*vol_core(1), 0.0_r8)
- dstcoat(1) = tmp1/tmp2
- end if
-
- ! dust_a1
- tmp1 = vol_shell(2)*(r_dust_a1*2._r8)*fac_volsfc_dust_a1
- tmp2 = max(6.0_r8*dr_so4_monolayers_dust*vol_core(2), 0.0_r8)
- dstcoat(2) = tmp1/tmp2
-
- ! dust_a3
- vol_shell(3) = aer(ii,kk,so4_coarse)/(specdens_so4*rhoair)
- vol_core(3) = aer(ii,kk,dst_coarse)/(specdens_dust*rhoair)
- tmp1 = vol_shell(3)*(r_dust_a3*2._r8)*fac_volsfc_dust_a3
- tmp2 = max(6.0_r8*dr_so4_monolayers_dust*vol_core(3), 0.0_r8)
- dstcoat(3) = tmp1/tmp2
-
- else if (nmodes == MAM7_nmodes) then
-
- ! for BC, only consider primary carbon mode,
- ! because most of particles in this mode are uncoated
- ! and nearly all particles in accumulation mode are coated
- fac_volsfc_bc = exp(2.5_r8*alnsg_mode_pcarbon**2)
-
- vol_shell(1) = ( aer(ii,kk,pom_pcarbon)*pom_equivso4_factor/specdens_pom )/rhoair
- vol_core(1) = aer(ii,kk,bc_pcarbon)/(specdens_bc*rhoair)
- tmp1 = vol_shell(1)*(r_bc*2._r8)*fac_volsfc_bc
- tmp2 = max(6.0_r8*dr_so4_monolayers_dust*vol_core(1), 0.0_r8)
- dstcoat(1) = tmp1/tmp2
-
- fac_volsfc_dust_a1 = exp(2.5_r8*alnsg_mode_finedust**2)
- fac_volsfc_dust_a3 = exp(2.5_r8*alnsg_mode_coardust**2)
-
- vol_shell(2) = aer(ii,kk,so4_finedust)/(specdens_so4*rhoair)
- vol_core(2) = aer(ii,kk,dst_finedust)/(specdens_dust*rhoair)
-
- tmp1 = vol_shell(2)*(r_dust_a1*2._r8)*fac_volsfc_dust_a1
- tmp2 = max(6.0_r8*dr_so4_monolayers_dust*vol_core(2), 0.0_r8)
- dstcoat(2) = tmp1/tmp2
-
- vol_shell(3) = aer(ii,kk,so4_coardust)/(specdens_so4*rhoair)
- vol_core(3) = aer(ii,kk,dst_coardust)/(specdens_dust*rhoair)
- tmp1 = vol_shell(3)*(r_dust_a3*2._r8)*fac_volsfc_dust_a3
- tmp2 = max(6.0_r8*dr_so4_monolayers_dust*vol_core(3), 0.0_r8)
- dstcoat(3) = tmp1/tmp2
-
- end if
-
- if (dstcoat(1) > 1._r8) dstcoat(1) = 1._r8
- if (dstcoat(1) < 0.001_r8) dstcoat(1) = 0.001_r8
- if (dstcoat(2) > 1._r8) dstcoat(2) = 1._r8
- if (dstcoat(2) < 0.001_r8) dstcoat(2) = 0.001_r8
- if (dstcoat(3) > 1._r8) dstcoat(3) = 1._r8
- if (dstcoat(3) < 0.001_r8) dstcoat(3) = 0.001_r8
-
- do i = 1, 3
- total_aer_num(i) = total_interstial_aer_num(i) + total_cloudborne_aer_num(i)
- coated_aer_num(i) = total_interstial_aer_num(i)*dstcoat(i)
- uncoated_aer_num(i) = total_interstial_aer_num(i)*(1._r8-dstcoat(i))
- end do
-
- if (nmodes == MAM4_nmodes .or. nmodes == MAM7_nmodes .or. nmodes == MAM5_nmodes) then
- coated_aer_num(1) = (aer(ii,kk,bc_pcarbon)*bc_num_to_mass*1.0e-6_r8)*dstcoat(1)+ &
- (aer(ii,kk,bc_accum)*bc_num_to_mass*1.0e-6_r8)
- uncoated_aer_num(1) = (aer(ii,kk,bc_pcarbon)*bc_num_to_mass*1.0e-6_r8)*(1._r8-dstcoat(1))
- end if
-
- if (nmodes == MAM3_nmodes .or. nmodes == MAM4_nmodes .or. nmodes == MAM5_nmodes) then
- dst1_scale = 0.488_r8 ! scaled for D>0.5-1 um from 0.1-1 um
- else if (nmodes == MAM7_nmodes) then
- dst1_scale = 0.566_r8 ! scaled for D>0.5-2 um from 0.1-2 um
- end if
-
- tot_na500 = total_aer_num(1)*0.0256_r8 & ! scaled for D>0.5 um using Clarke et al., 1997; 2004; 2007: rg=0.1um, sig=1.6
- + total_aer_num(2)*dst1_scale + total_aer_num(3)
-
- na500 = total_interstial_aer_num(1)*0.0256_r8 & ! scaled for D>0.5 um using Clarke et al., 1997; 2004; 2007: rg=0.1um, sig=1.6
- + total_interstial_aer_num(2)*dst1_scale + total_interstial_aer_num(3)
-
- !*****************************************************************************
- ! prepare some variables for water activity
- !*****************************************************************************
-
- if (nmodes == MAM3_nmodes .or. nmodes == MAM4_nmodes .or. nmodes == MAM5_nmodes) then
- ! accumulation mode for dust_a1
- if (aer(ii,kk,num_accum) > 0._r8) then
- awcam(2) = (dst1_num*1.0e6_r8)/aer(ii,kk,num_accum)* &
- ( aer(ii,kk,so4_accum) + aer(ii,kk,soa_accum) + &
- aer(ii,kk,pom_accum) + aer(ii,kk,bc_accum) )*1.0e9_r8 ! [mug m-3]
- else
- awcam(2) = 0._r8
- end if
-
- if (awcam(2) > 0._r8) then
- awfacm(2) = ( aer(ii,kk,bc_accum) + aer(ii,kk,soa_accum) + aer(ii,kk,pom_accum) )/ &
- ( aer(ii,kk,soa_accum) + aer(ii,kk,pom_accum) + aer(ii,kk,so4_accum) + aer(ii,kk,bc_accum) )
- else
- awfacm(2) = 0._r8
- end if
-
- ! accumulation mode for bc (if MAM4, primary carbon mode is insoluble)
- if (aer(ii,kk,num_accum) > 0._r8) then
- awcam(1) = (bc_num*1.0e6_r8)/aer(ii,kk,num_accum)* &
- ( aer(ii,kk,so4_accum) + aer(ii,kk,soa_accum) + aer(ii,kk,pom_accum) + aer(ii,kk,bc_accum) )*1.0e9_r8 ! [mug m-3]
- else
- awcam(1) = 0._r8
- end if
- awfacm(1) = awfacm(2)
-
- ! coarse mode for dust_a3
- if (aer(ii,kk,num_coarse) > 0._r8) then
- awcam(3) = (dst3_num*1.0e6_r8)/aer(ii,kk,num_coarse)* aer(ii,kk,so4_coarse)*1.0e9_r8
- else
- awcam(3) = 0._r8
- end if
- awfacm(3) = 0._r8
-
- else if (nmodes == MAM7_nmodes) then
-
- ! accumulation mode for bc (primary carbon mode is insoluble)
- if (aer(ii,kk,num_accum) > 0._r8) then
- awcam(1) = (bc_num*1.0e6_r8)/aer(ii,kk,num_accum)* &
- ( aer(ii,kk,so4_accum) + aer(ii,kk,soa_accum) + aer(ii,kk,pom_accum) + aer(ii,kk,bc_accum) )*1.0e9_r8 ! [mug m-3]
- else
- awcam(1) = 0._r8
- end if
-
- if (awcam(1) > 0._r8) then
- awfacm(1) = ( aer(ii,kk,bc_accum) + aer(ii,kk,soa_accum) + aer(ii,kk,pom_accum) )/ &
- ( aer(ii,kk,soa_accum) + aer(ii,kk,pom_accum) + aer(ii,kk,so4_accum) + aer(ii,kk,bc_accum) )
- else
- awfacm(1) = 0._r8
- end if
-
- if (aer(ii,kk,num_finedust) > 0._r8) then
- awcam(2) = (dst1_num*1.0e6_r8)/aer(ii,kk,num_finedust)* aer(ii,kk,so4_finedust)*1.0e9_r8
- else
- awcam(2) = 0._r8
- end if
- awfacm(2) = 0._r8
-
- if (aer(ii,kk,num_coardust) > 0._r8) then
- awcam(3) = (dst3_num*1.0e6_r8)/aer(ii,kk,num_coardust)* aer(ii,kk,so4_coardust)*1.0e9_r8
- else
- awcam(3) = 0._r8
- end if
- awfacm(3) = 0._r8
-
- end if
-
-end subroutine get_aer_num
-
-!====================================================================================================
-
end module hetfrz_classnuc_cam
diff --git a/src/physics/cam/macrop_driver.F90 b/src/physics/cam/macrop_driver.F90
index 3e7c276b3c..92d52fff8c 100644
--- a/src/physics/cam/macrop_driver.F90
+++ b/src/physics/cam/macrop_driver.F90
@@ -6,7 +6,7 @@ module macrop_driver
! Provides the CAM interface to the prognostic cloud macrophysics
!
! Author: Andrew Gettelman, Cheryl Craig October 2010
- ! Origin: modified from stratiform.F90 elements
+ ! Origin: modified from stratiform.F90 elements
! (Boville 2002, Coleman 2004, Park 2009, Kay 2010)
!-------------------------------------------------------------------------------------------------------
@@ -22,7 +22,6 @@ module macrop_driver
use perf_mod, only: t_startf, t_stopf
use cam_logfile, only: iulog
use cam_abortutils, only: endrun
- use zm_conv_intr, only: zmconv_microp
implicit none
private
@@ -42,12 +41,12 @@ module macrop_driver
! Private Module Parameters !
! ------------------------- !
- ! 'cu_det_st' : If .true. (.false.), detrain cumulus liquid condensate into the pre-existing liquid stratus
- ! (environment) without (with) macrophysical evaporation. If there is no pre-esisting stratus,
+ ! 'cu_det_st' : If .true. (.false.), detrain cumulus liquid condensate into the pre-existing liquid stratus
+ ! (environment) without (with) macrophysical evaporation. If there is no pre-esisting stratus,
! evaporate cumulus liquid condensate. This option only influences the treatment of cumulus
! liquid condensate, not cumulus ice condensate.
- logical, parameter :: cu_det_st = .false.
+ logical, parameter :: cu_det_st = .false.
! Parameters used for selecting generalized critical RH for liquid and ice stratus
integer :: rhminl_opt = 0
@@ -79,11 +78,11 @@ module macrop_driver
ast_idx, &! stratiform cloud fraction index in physics buffer
aist_idx, &! ice stratiform cloud fraction index in physics buffer
alst_idx, &! liquid stratiform cloud fraction index in physics buffer
- qist_idx, &! ice stratiform in-cloud IWC
- qlst_idx, &! liquid stratiform in-cloud LWC
+ qist_idx, &! ice stratiform in-cloud IWC
+ qlst_idx, &! liquid stratiform in-cloud LWC
concld_idx, &! concld index in physics buffer
- fice_idx, &
- cmeliq_idx, &
+ fice_idx, &
+ cmeliq_idx, &
shfrc_idx
integer :: &
@@ -98,8 +97,8 @@ module macrop_driver
qtl_flx_idx = -1, &! overbar(w'qtl' where qtl = qv + ql) from the PBL scheme
qti_flx_idx = -1, &! overbar(w'qti' where qti = qv + qi) from the PBL scheme
cmfr_det_idx = -1, &! detrained convective mass flux from UNICON
- qlr_det_idx = -1, &! detrained convective ql from UNICON
- qir_det_idx = -1, &! detrained convective qi from UNICON
+ qlr_det_idx = -1, &! detrained convective ql from UNICON
+ qir_det_idx = -1, &! detrained convective qi from UNICON
cmfmc_sh_idx = -1
contains
@@ -166,7 +165,7 @@ subroutine macrop_driver_register
! !
!---------------------------------------------------------------------- !
-
+
use physics_buffer, only : pbuf_add_field, dtype_r8, dyn_time_lvls
!-----------------------------------------------------------------------
@@ -203,12 +202,12 @@ subroutine macrop_driver_init(pbuf2d)
!-------------------------------------------- !
! !
! Initialize the cloud water parameterization !
- ! !
+ ! !
!-------------------------------------------- !
use physics_buffer, only : pbuf_get_index
use cam_history, only: addfld, add_default
use convect_shallow, only: convect_shallow_use_shfrc
-
+
type(physics_buffer_desc), pointer :: pbuf2d(:,:)
logical :: history_aerosol ! Output the MAM aerosol tendencies
@@ -234,7 +233,7 @@ subroutine macrop_driver_init(pbuf2d)
if( convect_shallow_use_shfrc() ) then
use_shfrc = .true.
shfrc_idx = pbuf_get_index('shfrc')
- else
+ else
use_shfrc = .false.
endif
@@ -269,7 +268,7 @@ subroutine macrop_driver_init(pbuf2d)
call addfld ('CLDST', (/ 'lev' /), 'A', 'fraction', 'Stratus cloud fraction' )
call addfld ('CONCLD', (/ 'lev' /), 'A', 'fraction', 'Convective cloud cover' )
-
+
call addfld ('CLR_LIQ', (/ 'lev' /), 'A', 'fraction', 'Clear sky fraction for liquid stratus' )
call addfld ('CLR_ICE', (/ 'lev' /), 'A', 'fraction', 'Clear sky fraction for ice stratus' )
@@ -299,7 +298,7 @@ subroutine macrop_driver_init(pbuf2d)
call add_default ('MACPDQ ', history_budget_histfile_num, ' ')
call add_default ('MACPDLIQ ', history_budget_histfile_num, ' ')
call add_default ('MACPDICE ', history_budget_histfile_num, ' ')
-
+
call add_default ('CLDVAPADJ', history_budget_histfile_num, ' ')
call add_default ('CLDLIQLIM', history_budget_histfile_num, ' ')
call add_default ('CLDLIQDET', history_budget_histfile_num, ' ')
@@ -328,14 +327,6 @@ subroutine macrop_driver_init(pbuf2d)
CC_qlst_idx = pbuf_get_index('CC_qlst')
cmfmc_sh_idx = pbuf_get_index('CMFMC_SH')
- if (zmconv_microp) then
- dlfzm_idx = pbuf_get_index('DLFZM')
- difzm_idx = pbuf_get_index('DIFZM')
- dnlfzm_idx = pbuf_get_index('DNLFZM')
- dnifzm_idx = pbuf_get_index('DNIFZM')
- end if
-
-
if (rhminl_opt > 0 .or. rhmini_opt > 0) then
cmfr_det_idx = pbuf_get_index('cmfr_det', istat)
if (istat < 0) call endrun(subname//': macrop option requires cmfr_det in pbuf')
@@ -361,7 +352,7 @@ subroutine macrop_driver_init(pbuf2d)
end if
end if
- ! Init pbuf fields. Note that the fields CLD, CONCLD, QCWAT, LCWAT,
+ ! Init pbuf fields. Note that the fields CLD, CONCLD, QCWAT, LCWAT,
! ICCWAT, and TCWAT are initialized in phys_inidat.
if (is_first_step()) then
call pbuf_set_field(pbuf2d, ast_idx, 0._r8)
@@ -392,13 +383,13 @@ subroutine macrop_driver_tend( &
pbuf, &
det_s, det_ice)
- !-------------------------------------------------------- !
- ! !
+ !-------------------------------------------------------- !
+ ! !
! Purpose: !
! !
! Interface to detrain, cloud fraction and !
! cloud macrophysics subroutines !
- ! !
+ ! !
! Author: A. Gettelman, C. Craig, Oct 2010 !
! based on stratiform_tend by D.B. Coleman 4/2010 !
! !
@@ -438,7 +429,7 @@ subroutine macrop_driver_tend( &
real(r8), intent(in) :: zdu(pcols,pver) ! Detrainment rate from deep convection
- ! These two variables are needed for energy check
+ ! These two variables are needed for energy check
real(r8), intent(out) :: det_s(pcols) ! Integral of detrained static energy from ice
real(r8), intent(out) :: det_ice(pcols) ! Integral of detrained ice for energy check
@@ -525,13 +516,13 @@ subroutine macrop_driver_tend( &
real(r8) ltend(pcols,pver) ! Cloud liquid water tendencies
real(r8) fice(pcols,pver) ! Fractional ice content within cloud
real(r8) fsnow(pcols,pver) ! Fractional snow production
- real(r8) homoo(pcols,pver)
- real(r8) qcreso(pcols,pver)
- real(r8) prcio(pcols,pver)
- real(r8) praio(pcols,pver)
+ real(r8) homoo(pcols,pver)
+ real(r8) qcreso(pcols,pver)
+ real(r8) prcio(pcols,pver)
+ real(r8) praio(pcols,pver)
real(r8) qireso(pcols,pver)
real(r8) ftem(pcols,pver)
- real(r8) pracso (pcols,pver)
+ real(r8) pracso (pcols,pver)
real(r8) dpdlfliq(pcols,pver)
real(r8) dpdlfice(pcols,pver)
real(r8) shdlfliq(pcols,pver)
@@ -575,11 +566,11 @@ subroutine macrop_driver_tend( &
real(r8) qi_inout(pcols,pver)
real(r8) concld_old(pcols,pver)
- ! Note that below 'clr_old' is defined using 'alst_old' not 'ast_old' for full consistency with the
- ! liquid condensation process which is using 'alst' not 'ast'.
+ ! Note that below 'clr_old' is defined using 'alst_old' not 'ast_old' for full consistency with the
+ ! liquid condensation process which is using 'alst' not 'ast'.
! For microconsistency use 'concld_old', since 'alst_old' was computed using 'concld_old'.
! Since convective updraft fractional area is small, it does not matter whether 'concld' or 'concld_old' is used.
- ! Note also that 'clri_old' is defined using 'ast_old' since current microphysics is operating on 'ast_old'
+ ! Note also that 'clri_old' is defined using 'ast_old' since current microphysics is operating on 'ast_old'
real(r8) clrw_old(pcols,pver) ! (1 - concld_old - alst_old)
real(r8) clri_old(pcols,pver) ! (1 - concld_old - ast_old)
@@ -669,7 +660,7 @@ subroutine macrop_driver_tend( &
dlf_ni(:,:) = 0._r8
! ------------------------------------- !
- ! From here, process computation begins !
+ ! From here, process computation begins !
! ------------------------------------- !
! ----------------------------------------------------------------------------- !
@@ -689,23 +680,16 @@ subroutine macrop_driver_tend( &
! If convection scheme can handle this internally, this step is not necssary.
! (2) Assuming a certain effective droplet radius, computes number concentration
! of detrained convective cloud liquid and ice.
- ! (3) If 'cu_det_st = .true' ('false'), detrain convective cloud 'liquid' into
+ ! (3) If 'cu_det_st = .true' ('false'), detrain convective cloud 'liquid' into
! the pre-existing 'liquid' stratus ( mean environment ). The former does
! not involve any macrophysical evaporation while the latter does. This is
- ! a kind of 'targetted' deposition. Then, force in-stratus LWC to be bounded
+ ! a kind of 'targetted' deposition. Then, force in-stratus LWC to be bounded
! by qcst_min and qcst_max in mmacro_pcond.
- ! (4) In contrast to liquid, convective ice is detrained into the environment
+ ! (4) In contrast to liquid, convective ice is detrained into the environment
! and involved in the sublimation. Similar bounds as liquid stratus are imposed.
! This is the key procesure generating upper-level cirrus clouds.
! The unit of dlf : [ kg/kg/s ]
- if (zmconv_microp) then
- call pbuf_get_field(pbuf, dlfzm_idx, dlfzm)
- call pbuf_get_field(pbuf, difzm_idx, difzm)
- call pbuf_get_field(pbuf, dnlfzm_idx, dnlfzm)
- call pbuf_get_field(pbuf, dnifzm_idx, dnifzm)
- end if
-
det_s(:) = 0._r8
det_ice(:) = 0._r8
@@ -729,57 +713,43 @@ subroutine macrop_driver_tend( &
! If detrainment was done elsewhere, still update the variables used for output
! assuming that the temperature split between liquid and ice is the same as assumed
! here.
- if (zmconv_microp) then
- ptend_loc%q(i,k,ixcldliq) = dlfzm(i,k) + dlf2(i,k) * ( 1._r8 - dum1 )
- ptend_loc%q(i,k,ixcldice) = difzm(i,k) + dlf2(i,k) * dum1
-
- ptend_loc%q(i,k,ixnumliq) = dnlfzm(i,k) + 3._r8 * ( dlf2(i,k) * ( 1._r8 - dum1 ) ) &
- / (4._r8*3.14_r8*10.e-6_r8**3*997._r8) ! Shallow Convection
- ptend_loc%q(i,k,ixnumice) = dnifzm(i,k) + 3._r8 * ( dlf2(i,k) * dum1 ) &
- / (4._r8*3.14_r8*50.e-6_r8**3*500._r8) ! Shallow Convection
- ptend_loc%s(i,k) = dlf2(i,k) * dum1 * latice
-
- else
- if (do_detrain) then
+ if (do_detrain) then
ptend_loc%q(i,k,ixcldliq) = dlf(i,k) * ( 1._r8 - dum1 )
ptend_loc%q(i,k,ixcldice) = dlf(i,k) * dum1
! dum2 = dlf(i,k) * ( 1._r8 - dum1 )
ptend_loc%q(i,k,ixnumliq) = 3._r8 * ( max(0._r8, ( dlf(i,k) - dlf2(i,k) )) * ( 1._r8 - dum1 ) ) / &
(4._r8*3.14_r8* 8.e-6_r8**3*997._r8) + & ! Deep Convection
3._r8 * ( dlf2(i,k) * ( 1._r8 - dum1 ) ) / &
- (4._r8*3.14_r8*10.e-6_r8**3*997._r8) ! Shallow Convection
+ (4._r8*3.14_r8*10.e-6_r8**3*997._r8) ! Shallow Convection
! dum2 = dlf(i,k) * dum1
ptend_loc%q(i,k,ixnumice) = 3._r8 * ( max(0._r8, ( dlf(i,k) - dlf2(i,k) )) * dum1 ) / &
(4._r8*3.14_r8*25.e-6_r8**3*500._r8) + & ! Deep Convection
3._r8 * ( dlf2(i,k) * dum1 ) / &
(4._r8*3.14_r8*50.e-6_r8**3*500._r8) ! Shallow Convection
ptend_loc%s(i,k) = dlf(i,k) * dum1 * latice
- else
+ else
ptend_loc%q(i,k,ixcldliq) = 0._r8
ptend_loc%q(i,k,ixcldice) = 0._r8
ptend_loc%q(i,k,ixnumliq) = 0._r8
ptend_loc%q(i,k,ixnumice) = 0._r8
ptend_loc%s(i,k) = 0._r8
- end if
-
-
end if
! Only rliq is saved from deep convection, which is the reserved liquid. We need to keep
! track of the integrals of ice and static energy that is effected from conversion to ice
! so that the energy checker doesn't complain.
det_s(i) = det_s(i) + ptend_loc%s(i,k)*state_loc%pdel(i,k)/gravit
- det_ice(i) = det_ice(i) - ptend_loc%q(i,k,ixcldice)*state_loc%pdel(i,k)/gravit
+ det_ice(i) = det_ice(i) - ptend_loc%q(i,k,ixcldice)*state_loc%pdel(i,k)/gravit
! Targetted detrainment of convective liquid water either directly into the
- ! existing liquid stratus or into the environment.
+ ! existing liquid stratus or into the environment.
if( cu_det_st ) then
dlf_T(i,k) = ptend_loc%s(i,k)/cpair
dlf_qv(i,k) = 0._r8
dlf_ql(i,k) = ptend_loc%q(i,k,ixcldliq)
dlf_qi(i,k) = ptend_loc%q(i,k,ixcldice)
dlf_nl(i,k) = ptend_loc%q(i,k,ixnumliq)
- dlf_ni(i,k) = ptend_loc%q(i,k,ixnumice)
+ dlf_ni(i,k) = ptend_loc%q(i,k,ixnumice)
ptend_loc%q(i,k,ixcldliq) = 0._r8
ptend_loc%q(i,k,ixcldice) = 0._r8
ptend_loc%q(i,k,ixnumliq) = 0._r8
@@ -792,15 +762,9 @@ subroutine macrop_driver_tend( &
dpdlft (i,k) = 0._r8
shdlft (i,k) = 0._r8
else
- if (zmconv_microp) then
- dpdlfliq(i,k) = dlfzm(i,k)
- dpdlfice(i,k) = difzm(i,k)
- dpdlft (i,k) = 0._r8
- else
- dpdlfliq(i,k) = ( dlf(i,k) - dlf2(i,k) ) * ( 1._r8 - dum1 )
- dpdlfice(i,k) = ( dlf(i,k) - dlf2(i,k) ) * ( dum1 )
- dpdlft (i,k) = ( dlf(i,k) - dlf2(i,k) ) * dum1 * latice/cpair
- end if
+ dpdlfliq(i,k) = ( dlf(i,k) - dlf2(i,k) ) * ( 1._r8 - dum1 )
+ dpdlfice(i,k) = ( dlf(i,k) - dlf2(i,k) ) * ( dum1 )
+ dpdlft (i,k) = ( dlf(i,k) - dlf2(i,k) ) * dum1 * latice/cpair
shdlfliq(i,k) = dlf2(i,k) * ( 1._r8 - dum1 )
shdlfice(i,k) = dlf2(i,k) * ( dum1 )
@@ -833,7 +797,7 @@ subroutine macrop_driver_tend( &
! -------------------------------------- !
! ----------------------------------------------------------------------------- !
- ! Treatment of cloud fraction in CAM4 and CAM5 differs !
+ ! Treatment of cloud fraction in CAM4 and CAM5 differs !
! (1) CAM4 !
! . Cumulus AMT = Deep Cumulus AMT ( empirical fcn of mass flux ) + !
! Shallow Cumulus AMT ( empirical fcn of mass flux ) !
@@ -846,7 +810,7 @@ subroutine macrop_driver_tend( &
! . Stratus AMT = fcn of environmental-mean RH ( no Stability Stratus ) !
! . Cumulus and Stratus are non-overlapped with higher priority on Cumulus !
! . Cumulus ( both Deep and Shallow ) has its own LWC and IWC. !
- ! ----------------------------------------------------------------------------- !
+ ! ----------------------------------------------------------------------------- !
concld_old(:ncol,top_lev:pver) = concld(:ncol,top_lev:pver)
@@ -862,22 +826,22 @@ subroutine macrop_driver_tend( &
clri_old(:ncol,:top_lev-1) = 0._r8
do k = top_lev, pver
do i = 1, ncol
- clrw_old(i,k) = max( 0._r8, min( 1._r8, 1._r8 - concld(i,k) - alst(i,k) ) )
- clri_old(i,k) = max( 0._r8, min( 1._r8, 1._r8 - concld(i,k) - ast(i,k) ) )
+ clrw_old(i,k) = max( 0._r8, min( 1._r8, 1._r8 - concld(i,k) - alst(i,k) ) )
+ clri_old(i,k) = max( 0._r8, min( 1._r8, 1._r8 - concld(i,k) - ast(i,k) ) )
end do
end do
if( use_shfrc ) then
call pbuf_get_field(pbuf, shfrc_idx, shfrc )
- else
+ else
allocate(shfrc(pcols,pver))
shfrc(:,:) = 0._r8
endif
- ! CAM5 only uses 'concld' output from the below subroutine.
+ ! CAM5 only uses 'concld' output from the below subroutine.
! Stratus ('ast' = max(alst,aist)) and total cloud fraction ('cld = ast + concld')
- ! will be computed using this updated 'concld' in the stratiform macrophysics
- ! scheme (mmacro_pcond) later below.
+ ! will be computed using this updated 'concld' in the stratiform macrophysics
+ ! scheme (mmacro_pcond) later below.
call t_startf("cldfrc")
@@ -901,10 +865,14 @@ subroutine macrop_driver_tend( &
rdtime = 1._r8/dtime
! Define fractional amount of stratus condensate and precipitation in ice phase.
- ! This uses a ramp ( -30 ~ -10 for fice, -5 ~ 0 for fsnow ).
+ ! This uses a ramp ( -30 ~ -10 for fice, -5 ~ 0 for fsnow ).
! The ramp within convective cloud may be different
- call cldfrc_fice( ncol, state_loc%t, fice, fsnow )
+!REMOVECAM - no longer need these when CAM is retired and pcols no longer exists
+ fice(:,:) = 0._r8
+ fsnow(:,:) = 0._r8
+!REMOVECAM_END
+ call cldfrc_fice( ncol, state_loc%t(:ncol,:), fice(:ncol,:), fsnow(:ncol,:) )
lq(:) = .FALSE.
@@ -918,7 +886,7 @@ subroutine macrop_driver_tend( &
! Initialize local physics_ptend object again
call physics_ptend_init(ptend_loc, state%psetcols, 'macro_park', &
- ls=.true., lq=lq )
+ ls=.true., lq=lq )
! --------------------------------- !
! Liquid Macrop_Driver Macrophysics !
@@ -932,9 +900,9 @@ subroutine macrop_driver_tend( &
nc(:ncol,top_lev:pver) = state_loc%q(:ncol,top_lev:pver,ixnumliq)
ni(:ncol,top_lev:pver) = state_loc%q(:ncol,top_lev:pver,ixnumice)
- ! In CAM5, 'microphysical forcing' ( CC_... ) and 'the other advective forcings' ( ttend, ... )
+ ! In CAM5, 'microphysical forcing' ( CC_... ) and 'the other advective forcings' ( ttend, ... )
! are separately provided into the prognostic microp_driver macrophysics scheme. This is an
- ! attempt to resolve in-cloud and out-cloud forcings.
+ ! attempt to resolve in-cloud and out-cloud forcings.
if( get_nstep() .le. 1 ) then
tcwat(:ncol,top_lev:pver) = state_loc%t(:ncol,top_lev:pver)
@@ -958,7 +926,7 @@ subroutine macrop_driver_tend( &
CC_qlst(:ncol,:) = 0._r8
else
ttend(:ncol,top_lev:pver) = ( state_loc%t(:ncol,top_lev:pver) - tcwat(:ncol,top_lev:pver)) * rdtime &
- - CC_T(:ncol,top_lev:pver)
+ - CC_T(:ncol,top_lev:pver)
qtend(:ncol,top_lev:pver) = ( state_loc%q(:ncol,top_lev:pver,1) - qcwat(:ncol,top_lev:pver)) * rdtime &
- CC_qv(:ncol,top_lev:pver)
ltend(:ncol,top_lev:pver) = ( qc(:ncol,top_lev:pver) + qi(:ncol,top_lev:pver) - lcwat(:ncol,top_lev:pver) ) * rdtime &
@@ -972,7 +940,7 @@ subroutine macrop_driver_tend( &
endif
lmitend(:ncol,top_lev:pver) = ltend(:ncol,top_lev:pver) - itend(:ncol,top_lev:pver)
- t_inout(:ncol,top_lev:pver) = tcwat(:ncol,top_lev:pver)
+ t_inout(:ncol,top_lev:pver) = tcwat(:ncol,top_lev:pver)
qv_inout(:ncol,top_lev:pver) = qcwat(:ncol,top_lev:pver)
ql_inout(:ncol,top_lev:pver) = lcwat(:ncol,top_lev:pver) - iccwat(:ncol,top_lev:pver)
qi_inout(:ncol,top_lev:pver) = iccwat(:ncol,top_lev:pver)
@@ -982,20 +950,20 @@ subroutine macrop_driver_tend( &
! Liquid Microp_Driver Macrophysics.
! The main roles of this subroutines are
! (1) compute net condensation rate of stratiform liquid ( cmeliq )
- ! (2) compute liquid stratus and ice stratus fractions.
+ ! (2) compute liquid stratus and ice stratus fractions.
! Note 'ttend...' are advective tendencies except microphysical process while
- ! 'CC...' are microphysical tendencies.
+ ! 'CC...' are microphysical tendencies.
call mmacro_pcond( lchnk, ncol, dtime, state_loc%pmid, state_loc%pdel, &
- t_inout, qv_inout, ql_inout, qi_inout, nl_inout, ni_inout, &
+ t_inout, qv_inout, ql_inout, qi_inout, nl_inout, ni_inout, &
ttend, qtend, lmitend, itend, nltend, nitend, &
- CC_T, CC_qv, CC_ql, CC_qi, CC_nl, CC_ni, CC_qlst, &
+ CC_T, CC_qv, CC_ql, CC_qi, CC_nl, CC_ni, CC_qlst, &
dlf_T, dlf_qv, dlf_ql, dlf_qi, dlf_nl, dlf_ni, &
concld_old, concld, clrw_old, clri_old, landfrac, snowh, &
tke, qtl_flx, qti_flx, cmfr_det, qlr_det, qir_det, &
tlat, qvlat, qcten, qiten, ncten, niten, &
cmeliq, qvadj, qladj, qiadj, qllim, qilim, &
- cld, alst, aist, qlst, qist, do_cldice )
+ cld, alst, aist, qlst, qist, do_cldice )
! Copy of concld/fice to put in physics buffer
! Below are used only for convective cloud.
@@ -1021,20 +989,20 @@ subroutine macrop_driver_tend( &
! Check to make sure that the macrophysics code is respecting the flags that control
! whether cldwat should be prognosing cloud ice and cloud liquid or not.
- if ((.not. do_cldice) .and. (qiten(i,k) /= 0.0_r8)) then
+ if ((.not. do_cldice) .and. (qiten(i,k) /= 0.0_r8)) then
call endrun("macrop_driver:ERROR - "// &
"Cldwat is configured not to prognose cloud ice, but mmacro_pcond has ice mass tendencies.")
end if
- if ((.not. do_cldice) .and. (niten(i,k) /= 0.0_r8)) then
+ if ((.not. do_cldice) .and. (niten(i,k) /= 0.0_r8)) then
call endrun("macrop_driver:ERROR -"// &
" Cldwat is configured not to prognose cloud ice, but mmacro_pcond has ice number tendencies.")
end if
- if ((.not. do_cldliq) .and. (qcten(i,k) /= 0.0_r8)) then
+ if ((.not. do_cldliq) .and. (qcten(i,k) /= 0.0_r8)) then
call endrun("macrop_driver:ERROR - "// &
"Cldwat is configured not to prognose cloud liquid, but mmacro_pcond has liquid mass tendencies.")
end if
- if ((.not. do_cldliq) .and. (ncten(i,k) /= 0.0_r8)) then
+ if ((.not. do_cldliq) .and. (ncten(i,k) /= 0.0_r8)) then
call endrun("macrop_driver:ERROR - "// &
"Cldwat is configured not to prognose cloud liquid, but mmacro_pcond has liquid number tendencies.")
end if
@@ -1064,7 +1032,7 @@ subroutine macrop_driver_tend( &
call outfld( 'ICECLDF ', aist, pcols, lchnk )
call outfld( 'LIQCLDF ', alst, pcols, lchnk )
- call outfld( 'AST', ast, pcols, lchnk )
+ call outfld( 'AST', ast, pcols, lchnk )
call outfld( 'CONCLD ', concld, pcols, lchnk )
call outfld( 'CLDST ', cldst, pcols, lchnk )
@@ -1075,7 +1043,7 @@ subroutine macrop_driver_tend( &
! calculations and outfld calls for CLDLIQSTR, CLDICESTR, CLDLIQCON, CLDICECON for CFMIP
! initialize local variables
- mr_ccliq = 0._r8 !! not seen by radiation, so setting to 0
+ mr_ccliq = 0._r8 !! not seen by radiation, so setting to 0
mr_ccice = 0._r8 !! not seen by radiation, so setting to 0
mr_lsliq = 0._r8
mr_lsice = 0._r8
@@ -1098,7 +1066,7 @@ subroutine macrop_driver_tend( &
call outfld( 'CLDICECON ', mr_ccice, pcols, lchnk )
! ------------------------------------------------- !
- ! Save equilibrium state variables for macrophysics !
+ ! Save equilibrium state variables for macrophysics !
! at the next time step !
! ------------------------------------------------- !
cldsice = 0._r8
@@ -1125,7 +1093,7 @@ end subroutine macrop_driver_tend
! With CLUBB, we are seeing relative humidity with respect to water
! greater than 1. This should not be happening and is not what the
! microphsyics expects from the macrophysics. As a work around while
-! this issue is investigated in CLUBB, this routine will enfornce a
+! this issue is investigated in CLUBB, this routine will enfornce a
! maximum RHliq of 1 everywhere in the atmosphere. Any excess water will
! be converted into cloud drops.
subroutine liquid_macro_tend(npccn,t,p,qv,qc,nc,xxlv,deltat,stend,qvtend,qctend,nctend,vlen)
@@ -1136,7 +1104,7 @@ subroutine liquid_macro_tend(npccn,t,p,qv,qc,nc,xxlv,deltat,stend,qvtend,qctend,
use cldfrc2m, only: rhmini_const, rhmaxi_const
integer, intent(in) :: vlen
- real(r8), dimension(vlen), intent(in) :: npccn !Activated number of cloud condensation nuclei
+ real(r8), dimension(vlen), intent(in) :: npccn !Activated number of cloud condensation nuclei
real(r8), dimension(vlen), intent(in) :: t !temperature (k)
real(r8), dimension(vlen), intent(in) :: p !pressure (pa)
real(r8), dimension(vlen), intent(in) :: qv !water vapor mixing ratio
@@ -1144,18 +1112,18 @@ subroutine liquid_macro_tend(npccn,t,p,qv,qc,nc,xxlv,deltat,stend,qvtend,qctend,
real(r8), dimension(vlen), intent(in) :: nc !liquid number concentration
real(r8), intent(in) :: xxlv !latent heat of vaporization
real(r8), intent(in) :: deltat !timestep
- real(r8), dimension(vlen), intent(out) :: stend ! 'temperature' tendency
+ real(r8), dimension(vlen), intent(out) :: stend ! 'temperature' tendency
real(r8), dimension(vlen), intent(out) :: qvtend !vapor tendency
real(r8), dimension(vlen), intent(out) :: qctend !liquid mass tendency
- real(r8), dimension(vlen), intent(out) :: nctend !liquid number tendency
+ real(r8), dimension(vlen), intent(out) :: nctend !liquid number tendency
real(r8) :: ESL(vlen)
real(r8) :: QSL(vlen)
- real(r8) :: drop_size_param
+ real(r8) :: drop_size_param
integer :: i
drop_size_param = 3._r8/(4._r8*3.14_r8*6.e-6_r8**3*rhow)
-
+
do i = 1, vlen
stend(i) = 0._r8
qvtend(i) = 0._r8
@@ -1164,18 +1132,18 @@ subroutine liquid_macro_tend(npccn,t,p,qv,qc,nc,xxlv,deltat,stend,qvtend,qctend,
end do
! calculate qsatl from t,p,q
- !$acc data copyin(t,p) copyout(ESL,QSL)
+ !$acc data copyin(t,p) copyout(ESL,QSL)
call wv_sat_qsat_water_vect(t, p, ESL, QSL, vlen)
!$acc end data
do i = 1, vlen
! Don't allow supersaturation with respect to liquid.
if (qv(i) > QSL(i)) then
-
+
qctend(i) = (qv(i) - QSL(i)) / deltat
qvtend(i) = 0._r8 - qctend(i)
stend(i) = qctend(i) * xxlv ! moist static energy tend...[J/kg/s] !
-
+
! If drops exists (more than 1 L-1) and there is condensation,
! do not add to number (= growth), otherwise add 6um drops.
!
diff --git a/src/physics/cam/microp_aero.F90 b/src/physics/cam/microp_aero.F90
index c65abd6157..4961a139a8 100644
--- a/src/physics/cam/microp_aero.F90
+++ b/src/physics/cam/microp_aero.F90
@@ -42,7 +42,7 @@ module microp_aero
use ndrop_bam, only: ndrop_bam_init, ndrop_bam_run, ndrop_bam_ccn
use hetfrz_classnuc_cam, only: hetfrz_classnuc_cam_readnl, hetfrz_classnuc_cam_register, hetfrz_classnuc_cam_init, &
- hetfrz_classnuc_cam_save_cbaero, hetfrz_classnuc_cam_calc
+ hetfrz_classnuc_cam_calc
use cam_history, only: addfld, add_default, outfld
use cam_logfile, only: iulog
@@ -79,7 +79,8 @@ module microp_aero
real(r8) :: npccn_scale ! scaling for activated number
real(r8) :: wsub_scale ! scaling for sub-grid vertical velocity (liquid)
real(r8) :: wsubi_scale ! scaling for sub-grid vertical velocity (ice)
-real(r8) :: wsub_min ! minimum sub-grid vertical velocity (liquid)
+real(r8) :: wsub_min ! minimum sub-grid vertical velocity (liquid) before scale factor
+real(r8) :: wsub_min_asf ! minimum sub-grid vertical velocity (liquid) after scale factor
real(r8) :: wsubi_min ! minimum sub-grid vertical velocity (ice)
! smallest mixing ratio considered in microphysics
@@ -342,7 +343,13 @@ subroutine microp_aero_init(phys_state,pbuf2d)
call add_default ('WSUB ', 1, ' ')
end if
- call hetfrz_classnuc_cam_init(mincld)
+ if (use_hetfrz_classnuc) then
+ if (associated(aero_props_obj)) then
+ call hetfrz_classnuc_cam_init(mincld, aero_props_obj)
+ else
+ call endrun(routine//': cannot use hetfrz_classnuc without prognostic aerosols')
+ endif
+ endif
end subroutine microp_aero_init
@@ -399,20 +406,20 @@ subroutine microp_aero_readnl(nlfile)
character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input
! Namelist variables
- real(r8) :: microp_aero_bulk_scale = unset_r8 ! prescribed aerosol bulk sulfur scale factor
+ real(r8) :: microp_aero_bulk_scale = unset_r8 ! prescribed aerosol bulk sulfur scale factor
real(r8) :: microp_aero_npccn_scale = unset_r8 ! prescribed aerosol bulk sulfur scale factor
- real(r8) :: microp_aero_wsub_scale = unset_r8 ! subgrid vertical velocity (liquid) scale factor
+ real(r8) :: microp_aero_wsub_scale = unset_r8 ! subgrid vertical velocity (liquid) scale factor
real(r8) :: microp_aero_wsubi_scale = unset_r8 ! subgrid vertical velocity (ice) scale factor
- real(r8) :: microp_aero_wsub_min = unset_r8 ! subgrid vertical velocity (liquid) minimum
- real(r8) :: microp_aero_wsubi_min = unset_r8 ! subgrid vertical velocity (ice) minimum
-
+ real(r8) :: microp_aero_wsub_min = unset_r8 ! subgrid vertical velocity (liquid) minimum (before scale factor)
+ real(r8) :: microp_aero_wsub_min_asf = unset_r8 ! subgrid vertical velocity (liquid) minimum (after scale factor)
+ real(r8) :: microp_aero_wsubi_min = unset_r8 ! subgrid vertical velocity (ice) minimum
! Local variables
integer :: unitn, ierr
character(len=*), parameter :: subname = 'microp_aero_readnl'
namelist /microp_aero_nl/ microp_aero_bulk_scale, microp_aero_npccn_scale, microp_aero_wsub_min, &
- microp_aero_wsubi_min, microp_aero_wsub_scale, microp_aero_wsubi_scale
+ microp_aero_wsubi_min, microp_aero_wsub_scale, microp_aero_wsubi_scale, microp_aero_wsub_min_asf
!-----------------------------------------------------------------------------
if (masterproc) then
@@ -440,6 +447,8 @@ subroutine microp_aero_readnl(nlfile)
if (ierr /= 0) call endrun(subname//": FATAL: mpi_bcast: microp_aero_wsubi_scale")
call mpi_bcast(microp_aero_wsub_min, 1, mpi_real8, mstrid, mpicom, ierr)
if (ierr /= 0) call endrun(subname//": FATAL: mpi_bcast: microp_aero_wsub_min")
+ call mpi_bcast(microp_aero_wsub_min_asf, 1, mpi_real8, mstrid, mpicom, ierr)
+ if (ierr /= 0) call endrun(subname//": FATAL: mpi_bcast: microp_aero_wsub_min_asf")
call mpi_bcast(microp_aero_wsubi_min, 1, mpi_real8, mstrid, mpicom, ierr)
if (ierr /= 0) call endrun(subname//": FATAL: mpi_bcast: microp_aero_wsubi_min")
@@ -449,6 +458,7 @@ subroutine microp_aero_readnl(nlfile)
wsub_scale = microp_aero_wsub_scale
wsubi_scale = microp_aero_wsubi_scale
wsub_min = microp_aero_wsub_min
+ wsub_min_asf = microp_aero_wsub_min_asf
wsubi_min = microp_aero_wsubi_min
if(bulk_scale == unset_r8) call endrun(subname//": FATAL: bulk_scale is not set")
@@ -456,6 +466,7 @@ subroutine microp_aero_readnl(nlfile)
if(wsub_scale == unset_r8) call endrun(subname//": FATAL: wsub_scale is not set")
if(wsubi_scale == unset_r8) call endrun(subname//": FATAL: wsubi_scale is not set")
if(wsub_min == unset_r8) call endrun(subname//": FATAL: wsub_min is not set")
+ if(wsub_min_asf == unset_r8) call endrun(subname//": FATAL: wsub_min_asf is not set")
if(wsubi_min == unset_r8) call endrun(subname//": FATAL: wsubi_min is not set")
call nucleate_ice_cam_readnl(nlfile)
@@ -578,11 +589,6 @@ subroutine microp_aero_run ( &
rndst(1:ncol,1:pver,3) = rn_dst3
rndst(1:ncol,1:pver,4) = rn_dst4
- ! save copy of cloud borne aerosols for use in heterogeneous freezing
- if (use_hetfrz_classnuc) then
- call hetfrz_classnuc_cam_save_cbaero(state1, pbuf)
- end if
-
! initialize time-varying parameters
do k = top_lev, pver
do i = 1, ncol
@@ -727,19 +733,15 @@ subroutine microp_aero_run ( &
! liquid clouds. This is the same behavior as CAM5.
if (use_preexisting_ice) then
call dropmixnuc( aero_props_obj, aero_state1_obj, &
- state1, ptend_loc, deltatin, pbuf, wsub, &
+ state1, ptend_loc, deltatin, pbuf, wsub, wsub_min_asf, &
cldn, cldo, cldliqf, nctend_mixnuc, factnum)
else
cldliqf = 1._r8
call dropmixnuc( aero_props_obj, aero_state1_obj, &
- state1, ptend_loc, deltatin, pbuf, wsub, &
+ state1, ptend_loc, deltatin, pbuf, wsub, wsub_min_asf, &
lcldn, lcldo, cldliqf, nctend_mixnuc, factnum)
end if
- ! destroy the aerosol state object
- deallocate(aero_state1_obj)
- nullify(aero_state1_obj)
-
npccn(:ncol,:) = nctend_mixnuc(:ncol,:)
npccn(:ncol,:) = npccn(:ncol,:) * npccn_scale
@@ -853,7 +855,7 @@ subroutine microp_aero_run ( &
! heterogeneous freezing
if (use_hetfrz_classnuc) then
- call hetfrz_classnuc_cam_calc(state1, deltatin, factnum, pbuf)
+ call hetfrz_classnuc_cam_calc(aero_props_obj, aero_state1_obj, state1, deltatin, factnum, pbuf)
end if
@@ -861,7 +863,13 @@ subroutine microp_aero_run ( &
deallocate(factnum)
end if
-end subroutine microp_aero_run
+ if (associated(aero_state1_obj)) then
+ ! destroy the aerosol state object
+ deallocate(aero_state1_obj)
+ nullify(aero_state1_obj)
+ endif
+
+ end subroutine microp_aero_run
!=========================================================================================
diff --git a/src/physics/cam/modal_aer_opt.F90 b/src/physics/cam/modal_aer_opt.F90
deleted file mode 100644
index 5c95c17840..0000000000
--- a/src/physics/cam/modal_aer_opt.F90
+++ /dev/null
@@ -1,1621 +0,0 @@
-module modal_aer_opt
-
-! parameterizes aerosol coefficients using chebychev polynomial
-! parameterize aerosol radiative properties in terms of
-! surface mode wet radius and wet refractive index
-
-! Ghan and Zaveri, JGR 2007.
-
-! uses Wiscombe's (1979) mie scattering code
-
-
-use shr_kind_mod, only: r8 => shr_kind_r8, shr_kind_cl
-use ppgrid, only: pcols, pver, pverp
-use constituents, only: pcnst
-use spmd_utils, only: masterproc
-use ref_pres, only: top_lev => clim_modal_aero_top_lev
-use physconst, only: rhoh2o, rga, rair
-use radconstants, only: nswbands, nlwbands, idx_sw_diag, idx_uv_diag, idx_nir_diag
-use rad_constituents, only: n_diag, rad_cnst_get_call_list, rad_cnst_get_info, rad_cnst_get_aer_mmr, &
- rad_cnst_get_aer_props, rad_cnst_get_mode_props
-use physics_types, only: physics_state
-
-use physics_buffer, only : pbuf_get_index,physics_buffer_desc, pbuf_get_field
-use pio, only: file_desc_t, var_desc_t, pio_inq_dimlen, pio_inq_dimid, pio_inq_varid, &
- pio_get_var, pio_nowrite, pio_closefile
-use cam_pio_utils, only: cam_pio_openfile
-use cam_history, only: addfld, add_default, outfld, horiz_only
-use cam_history_support, only: fillvalue
-use cam_logfile, only: iulog
-use perf_mod, only: t_startf, t_stopf
-use cam_abortutils, only: endrun
-
-use modal_aero_wateruptake, only: modal_aero_wateruptake_dr
-use modal_aero_calcsize, only: modal_aero_calcsize_diag
-
-implicit none
-private
-save
-
-public :: modal_aer_opt_readnl, modal_aer_opt_init, modal_aero_sw, modal_aero_lw
-
-
-character(len=*), parameter :: unset_str = 'UNSET'
-
-! Namelist variables:
-character(shr_kind_cl) :: modal_optics_file = unset_str ! full pathname for modal optics dataset
-character(shr_kind_cl) :: water_refindex_file = unset_str ! full pathname for water refractive index dataset
-
-! Dimension sizes in coefficient arrays used to parameterize aerosol radiative properties
-! in terms of refractive index and wet radius
-integer, parameter :: ncoef=5, prefr=7, prefi=10
-
-real(r8) :: xrmin, xrmax
-
-! refractive index for water read in read_water_refindex
-complex(r8) :: crefwsw(nswbands) ! complex refractive index for water visible
-complex(r8) :: crefwlw(nlwbands) ! complex refractive index for water infrared
-
-! physics buffer indices
-integer :: dgnumwet_idx = -1
-integer :: qaerwat_idx = -1
-
-character(len=4) :: diag(0:n_diag) = (/' ','_d1 ','_d2 ','_d3 ','_d4 ','_d5 ', &
- '_d6 ','_d7 ','_d8 ','_d9 ','_d10'/)
-
-!===============================================================================
-CONTAINS
-!===============================================================================
-
-subroutine modal_aer_opt_readnl(nlfile)
-
- use namelist_utils, only: find_group_name
- use units, only: getunit, freeunit
- use mpishorthand
-
- character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input
-
- ! Local variables
- integer :: unitn, ierr
- character(len=*), parameter :: subname = 'modal_aer_opt_readnl'
-
- namelist /modal_aer_opt_nl/ water_refindex_file
- !-----------------------------------------------------------------------------
-
- if (masterproc) then
- unitn = getunit()
- open( unitn, file=trim(nlfile), status='old' )
- call find_group_name(unitn, 'modal_aer_opt_nl', status=ierr)
- if (ierr == 0) then
- read(unitn, modal_aer_opt_nl, iostat=ierr)
- if (ierr /= 0) then
- call endrun(subname // ':: ERROR reading namelist')
- end if
- end if
- close(unitn)
- call freeunit(unitn)
- end if
-
-#ifdef SPMD
- call mpibcast(water_refindex_file, len(water_refindex_file), mpichar, 0, mpicom)
-#endif
-
-
-end subroutine modal_aer_opt_readnl
-
-!===============================================================================
-
-subroutine modal_aer_opt_init()
-
- use ioFileMod, only: getfil
- use phys_control, only: phys_getopts
-
- ! Local variables
-
- integer :: i, m
- real(r8) :: rmmin, rmmax ! min, max aerosol surface mode radius treated (m)
- character(len=256) :: locfile
-
- logical :: history_amwg ! output the variables used by the AMWG diag package
- logical :: history_aero_optics ! output aerosol optics diagnostics
- logical :: history_dust ! output dust diagnostics
-
- logical :: call_list(0:n_diag)
- integer :: ilist, nmodes, m_ncoef, m_prefr, m_prefi
- integer :: errcode
-
- character(len=*), parameter :: routine='modal_aer_opt_init'
- character(len=10) :: fldname
- character(len=128) :: lngname
-
- !----------------------------------------------------------------------------
-
- rmmin = 0.01e-6_r8
- rmmax = 25.e-6_r8
- xrmin = log(rmmin)
- xrmax = log(rmmax)
-
- ! Check that dimension sizes in the coefficient arrays used to
- ! parameterize aerosol radiative properties are consistent between this
- ! module and the mode physprop files.
- call rad_cnst_get_call_list(call_list)
- do ilist = 0, n_diag
- if (call_list(ilist)) then
- call rad_cnst_get_info(ilist, nmodes=nmodes)
- do m = 1, nmodes
- call rad_cnst_get_mode_props(ilist, m, ncoef=m_ncoef, prefr=m_prefr, prefi=m_prefi)
- if (m_ncoef /= ncoef .or. m_prefr /= prefr .or. m_prefi /= prefi) then
- write(iulog,*) routine//': ERROR - file and module values do not match:'
- write(iulog,*) ' ncoef:', ncoef, m_ncoef
- write(iulog,*) ' prefr:', prefr, m_prefr
- write(iulog,*) ' prefi:', prefi, m_prefi
- call endrun(routine//': ERROR - file and module values do not match')
- end if
- end do
- end if
- end do
-
- ! Initialize physics buffer indices for dgnumwet and qaerwat. Note the implicit assumption
- ! that the loops over modes in the optics calculations will use the values for dgnumwet and qaerwat
- ! that are set in the aerosol_wet_intr code.
- dgnumwet_idx = pbuf_get_index('DGNUMWET',errcode)
- if (errcode < 0) then
- call endrun(routine//' ERROR: cannot find physics buffer field DGNUMWET')
- end if
- qaerwat_idx = pbuf_get_index('QAERWAT',errcode)
- if (errcode < 0) then
- call endrun(routine//' ERROR: cannot find physics buffer field QAERWAT')
- end if
-
- call getfil(water_refindex_file, locfile)
- call read_water_refindex(locfile)
- if (masterproc) write(iulog,*) "modal_aer_opt_init: read water refractive index file:", trim(locfile)
-
- call phys_getopts(history_amwg_out = history_amwg, &
- history_aero_optics_out = history_aero_optics, &
- history_dust_out = history_dust )
-
- ! Add diagnostic fields to history output.
-
- call addfld ('EXTINCT', (/ 'lev' /), 'A','/m','Aerosol extinction 550 nm, day only', &
- flag_xyfill=.true.)
- call addfld ('EXTINCTUV', (/ 'lev' /), 'A','/m','Aerosol extinction 350 nm, day only', &
- flag_xyfill=.true.)
- call addfld ('EXTINCTNIR', (/ 'lev' /), 'A','/m','Aerosol extinction 1020 nm, day only', &
- flag_xyfill=.true.)
- call addfld ('ABSORB', (/ 'lev' /), 'A','/m','Aerosol absorption, day only', &
- flag_xyfill=.true.)
- call addfld ('AODVIS', horiz_only, 'A',' ','Aerosol optical depth 550 nm, day only', &
- flag_xyfill=.true.)
- call addfld ('AODVISst', horiz_only, 'A',' ','Stratospheric aerosol optical depth 550 nm, day only', &
- flag_xyfill=.true.)
- call addfld ('AODUV', horiz_only, 'A',' ','Aerosol optical depth 350 nm, day only', &
- flag_xyfill=.true.)
- call addfld ('AODUVst', horiz_only, 'A',' ','Stratospheric aerosol optical depth 350 nm, day only', &
- flag_xyfill=.true.)
- call addfld ('AODNIR', horiz_only, 'A',' ','Aerosol optical depth 1020 nm, day only', &
- flag_xyfill=.true.)
- call addfld ('AODNIRst', horiz_only, 'A',' ','Stratospheric aerosol optical depth 1020 nm, day only', &
- flag_xyfill=.true.)
- call addfld ('AODABS', horiz_only, 'A',' ','Aerosol absorption optical depth 550 nm, day only', &
- flag_xyfill=.true.)
- call addfld ('AODxASYM', horiz_only, 'A',' ','Aerosol optical depth 550 * asymmetry factor, day only',&
- flag_xyfill=.true.)
- call addfld ('EXTxASYM', (/ 'lev' /), 'A',' ','extinction 550 nm * asymmetry factor, day only', &
- flag_xyfill=.true.)
-
- call addfld ('EXTINCTdn', (/ 'lev' /), 'A','/m','Aerosol extinction 550 nm, day night', &
- flag_xyfill=.true.)
- call addfld ('EXTINCTUVdn', (/ 'lev' /), 'A','/m','Aerosol extinction 350 nm, day night', &
- flag_xyfill=.true.)
- call addfld ('EXTINCTNIRdn', (/ 'lev' /), 'A','/m','Aerosol extinction 1020 nm, day night', &
- flag_xyfill=.true.)
- call addfld ('ABSORBdn', (/ 'lev' /), 'A','/m','Aerosol absorption, day night', &
- flag_xyfill=.true.)
- call addfld ('AODVISdn', horiz_only, 'A',' ','Aerosol optical depth 550 nm, day night', &
- flag_xyfill=.true.)
- call addfld ('AODVISstdn', horiz_only, 'A',' ','Stratospheric aerosol optical depth 550 nm, day night',&
- flag_xyfill=.true.)
- call addfld ('AODUVdn', horiz_only, 'A',' ','Aerosol optical depth 350 nm, day night', &
- flag_xyfill=.true.)
- call addfld ('AODUVstdn', horiz_only, 'A',' ','Stratospheric aerosol optical depth 350 nm, day night',&
- flag_xyfill=.true.)
- call addfld ('AODNIRdn', horiz_only, 'A',' ','Aerosol optical depth 1020 nm, day night', &
- flag_xyfill=.true.)
- call addfld ('AODNIRstdn', horiz_only, 'A',' ','Stratospheric aerosol optical depth 1020 nm, day night',&
- flag_xyfill=.true.)
- call addfld ('AODABSdn', horiz_only, 'A',' ','Aerosol absorption optical depth 550 nm, day night', &
- flag_xyfill=.true.)
- call addfld ('AODxASYMdn', horiz_only, 'A',' ','Aerosol optical depth 550 * asymmetry factor, day night',&
- flag_xyfill=.true.)
- call addfld ('EXTxASYMdn', (/ 'lev' /), 'A',' ','extinction 550 * asymmetry factor, day night', &
- flag_xyfill=.true.)
-
- call rad_cnst_get_info(0, nmodes=nmodes)
-
- do m = 1, nmodes
-
- write(fldname,'(a,i1)') 'BURDEN', m
- write(lngname,'(a,i1)') 'Aerosol burden, day only, mode ', m
- call addfld (fldname, horiz_only, 'A', 'kg/m2', lngname, flag_xyfill=.true.)
- if (m>3 .and. history_aero_optics) then
- call add_default (fldname, 1, ' ')
- endif
-
- write(fldname,'(a,i1)') 'AODMODE', m
- write(lngname,'(a,i1)') 'Aerosol optical depth, day only, 550 nm mode ', m
- call addfld (fldname, horiz_only, 'A', ' ', lngname, flag_xyfill=.true.)
- if (m>3 .and. history_aero_optics) then
- call add_default (fldname, 1, ' ')
- endif
-
- write(fldname,'(a,i1)') 'AODDUST', m
- write(lngname,'(a,i1,a)') 'Aerosol optical depth, day only, 550 nm mode ',m,' from dust'
- call addfld (fldname, horiz_only, 'A', ' ', lngname, flag_xyfill=.true.)
- if (m>3 .and. history_aero_optics) then
- call add_default (fldname, 1, ' ')
- endif
-
- write(fldname,'(a,i1)') 'BURDENdn', m
- write(lngname,'(a,i1)') 'Aerosol burden, day night, mode ', m
- call addfld (fldname, horiz_only, 'A', 'kg/m2', lngname, flag_xyfill=.true.)
- if (m>3 .and. history_aero_optics) then
- call add_default (fldname, 1, ' ')
- endif
-
- write(fldname,'(a,i1)') 'AODdnMODE', m
- write(lngname,'(a,i1)') 'Aerosol optical depth 550 nm, day night, mode ', m
- call addfld (fldname, horiz_only, 'A', ' ', lngname, flag_xyfill=.true.)
- if (m>3 .and. history_aero_optics) then
- call add_default (fldname, 1, ' ')
- endif
-
- write(fldname,'(a,i1)') 'AODdnDUST', m
- write(lngname,'(a,i1,a)') 'Aerosol optical depth 550 nm, day night, mode ',m,' from dust'
- call addfld (fldname, horiz_only, 'A', ' ', lngname, flag_xyfill=.true.)
- if (m>3 .and. history_aero_optics) then
- call add_default (fldname, 1, ' ')
- endif
-
- enddo
-
- call addfld ('AODDUST', horiz_only, 'A',' ', 'Aerosol optical depth 550 nm from dust, day only', &
- flag_xyfill=.true.)
- call addfld ('AODSO4', horiz_only, 'A',' ', 'Aerosol optical depth 550 nm from SO4, day only', &
- flag_xyfill=.true.)
- call addfld ('AODPOM', horiz_only, 'A',' ', 'Aerosol optical depth 550 nm from POM, day only', &
- flag_xyfill=.true.)
- call addfld ('AODSOA', horiz_only, 'A',' ', 'Aerosol optical depth 550 nm from SOA, day only', &
- flag_xyfill=.true.)
- call addfld ('AODBC', horiz_only, 'A',' ', 'Aerosol optical depth 550 nm from BC, day only', &
- flag_xyfill=.true.)
- call addfld ('AODSS', horiz_only, 'A',' ', 'Aerosol optical depth 550 nm from seasalt, day only', &
- flag_xyfill=.true.)
- call addfld ('AODABSBC', horiz_only, 'A',' ', 'Aerosol absorption optical depth 550 nm from BC, day only',&
- flag_xyfill=.true.)
- call addfld ('BURDENDUST', horiz_only, 'A','kg/m2', 'Dust aerosol burden, day only' , &
- flag_xyfill=.true.)
- call addfld ('BURDENSO4', horiz_only, 'A','kg/m2', 'Sulfate aerosol burden, day only' , &
- flag_xyfill=.true.)
- call addfld ('BURDENPOM', horiz_only, 'A','kg/m2', 'POM aerosol burden, day only' , &
- flag_xyfill=.true.)
- call addfld ('BURDENSOA', horiz_only, 'A','kg/m2', 'SOA aerosol burden, day only' , &
- flag_xyfill=.true.)
- call addfld ('BURDENBC', horiz_only, 'A','kg/m2', 'Black carbon aerosol burden, day only', &
- flag_xyfill=.true.)
- call addfld ('BURDENSEASALT', horiz_only, 'A','kg/m2', 'Seasalt aerosol burden, day only' , &
- flag_xyfill=.true.)
- call addfld ('SSAVIS', horiz_only, 'A',' ', 'Aerosol single-scatter albedo, day only', &
- flag_xyfill=.true.)
-
- call addfld ('AODDUSTdn', horiz_only, 'A',' ', 'Aerosol optical depth 550 nm from dust, day night', &
- flag_xyfill=.true.)
- call addfld ('AODSO4dn', horiz_only, 'A',' ', 'Aerosol optical depth 550 nm from SO4, day night', &
- flag_xyfill=.true.)
- call addfld ('AODPOMdn', horiz_only, 'A',' ', 'Aerosol optical depth 550 nm from POM, day night', &
- flag_xyfill=.true.)
- call addfld ('AODSOAdn', horiz_only, 'A',' ', 'Aerosol optical depth 550 nm from SOA, day night', &
- flag_xyfill=.true.)
- call addfld ('AODBCdn', horiz_only, 'A',' ', 'Aerosol optical depth 550 nm from BC, day night', &
- flag_xyfill=.true.)
- call addfld ('AODSSdn', horiz_only, 'A',' ', 'Aerosol optical depth 550 nm from seasalt, day night', &
- flag_xyfill=.true.)
- call addfld ('AODABSBCdn', horiz_only, 'A',' ', 'Aerosol absorption optical depth 550 nm from BC, day night',&
- flag_xyfill=.true.)
- call addfld ('BURDENDUSTdn', horiz_only, 'A','kg/m2', 'Dust aerosol burden, day night' , &
- flag_xyfill=.true.)
- call addfld ('BURDENSO4dn', horiz_only, 'A','kg/m2', 'Sulfate aerosol burden, day night' , &
- flag_xyfill=.true.)
- call addfld ('BURDENPOMdn', horiz_only, 'A','kg/m2', 'POM aerosol burden, day night' , &
- flag_xyfill=.true.)
- call addfld ('BURDENSOAdn', horiz_only, 'A','kg/m2', 'SOA aerosol burden, day night' , &
- flag_xyfill=.true.)
- call addfld ('BURDENBCdn', horiz_only, 'A','kg/m2', 'Black carbon aerosol burden, day night', &
- flag_xyfill=.true.)
- call addfld ('BURDENSEASALTdn', horiz_only, 'A','kg/m2', 'Seasalt aerosol burden, day night' , &
- flag_xyfill=.true.)
- call addfld ('SSAVISdn', horiz_only, 'A',' ', 'Aerosol single-scatter albedo, day night', &
- flag_xyfill=.true.)
-
-
- if (history_amwg) then
- call add_default ('AODDUST1' , 1, ' ')
- call add_default ('AODDUST3' , 1, ' ')
- call add_default ('AODDUST' , 1, ' ')
- call add_default ('AODVIS' , 1, ' ')
- end if
-
- if (history_dust) then
- call add_default ('AODDUST1' , 1, ' ')
- call add_default ('AODDUST2' , 1, ' ')
- call add_default ('AODDUST3' , 1, ' ')
- end if
-
- if (history_aero_optics) then
- call add_default ('AODDUST1' , 1, ' ')
- call add_default ('AODDUST3' , 1, ' ')
- call add_default ('ABSORB' , 1, ' ')
- call add_default ('AODMODE1' , 1, ' ')
- call add_default ('AODMODE2' , 1, ' ')
- call add_default ('AODMODE3' , 1, ' ')
- call add_default ('AODVIS' , 1, ' ')
- call add_default ('AODUV' , 1, ' ')
- call add_default ('AODNIR' , 1, ' ')
- call add_default ('AODABS' , 1, ' ')
- call add_default ('AODABSBC' , 1, ' ')
- call add_default ('AODDUST' , 1, ' ')
- call add_default ('AODSO4' , 1, ' ')
- call add_default ('AODPOM' , 1, ' ')
- call add_default ('AODSOA' , 1, ' ')
- call add_default ('AODBC' , 1, ' ')
- call add_default ('AODSS' , 1, ' ')
- call add_default ('BURDEN1' , 1, ' ')
- call add_default ('BURDEN2' , 1, ' ')
- call add_default ('BURDEN3' , 1, ' ')
- call add_default ('BURDENDUST' , 1, ' ')
- call add_default ('BURDENSO4' , 1, ' ')
- call add_default ('BURDENPOM' , 1, ' ')
- call add_default ('BURDENSOA' , 1, ' ')
- call add_default ('BURDENBC' , 1, ' ')
- call add_default ('BURDENSEASALT', 1, ' ')
- call add_default ('SSAVIS' , 1, ' ')
- call add_default ('EXTINCT' , 1, ' ')
- call add_default ('AODxASYM' , 1, ' ')
- call add_default ('EXTxASYM' , 1, ' ')
-
- call add_default ('AODdnDUST1' , 1, ' ')
- call add_default ('AODdnDUST3' , 1, ' ')
- call add_default ('ABSORBdn' , 1, ' ')
- call add_default ('AODdnMODE1' , 1, ' ')
- call add_default ('AODdnMODE2' , 1, ' ')
- call add_default ('AODdnMODE3' , 1, ' ')
- call add_default ('AODVISdn' , 1, ' ')
- call add_default ('AODUVdn' , 1, ' ')
- call add_default ('AODNIRdn' , 1, ' ')
- call add_default ('AODABSdn' , 1, ' ')
- call add_default ('AODABSBCdn' , 1, ' ')
- call add_default ('AODDUSTdn' , 1, ' ')
- call add_default ('AODSO4dn' , 1, ' ')
- call add_default ('AODPOMdn' , 1, ' ')
- call add_default ('AODSOAdn' , 1, ' ')
- call add_default ('AODBCdn' , 1, ' ')
- call add_default ('AODSSdn' , 1, ' ')
- call add_default ('BURDENdn1' , 1, ' ')
- call add_default ('BURDENdn2' , 1, ' ')
- call add_default ('BURDENdn3' , 1, ' ')
- call add_default ('BURDENDUSTdn' , 1, ' ')
- call add_default ('BURDENSO4dn' , 1, ' ')
- call add_default ('BURDENPOMdn' , 1, ' ')
- call add_default ('BURDENSOAdn' , 1, ' ')
- call add_default ('BURDENBCdn' , 1, ' ')
- call add_default ('BURDENSEASALTdn', 1, ' ')
- call add_default ('SSAVISdn' , 1, ' ')
- call add_default ('EXTINCTdn' , 1, ' ')
- call add_default ('AODxASYMdn' , 1, ' ')
- call add_default ('EXTxASYMdn' , 1, ' ')
- end if
-
- do ilist = 1, n_diag
- if (call_list(ilist)) then
-
- call addfld ('EXTINCT'//diag(ilist), (/ 'lev' /), 'A','/m', &
- 'Aerosol extinction', flag_xyfill=.true.)
- call addfld ('ABSORB'//diag(ilist), (/ 'lev' /), 'A','/m', &
- 'Aerosol absorption', flag_xyfill=.true.)
- call addfld ('AODVIS'//diag(ilist), horiz_only, 'A',' ', &
- 'Aerosol optical depth 550 nm', flag_xyfill=.true.)
- call addfld ('AODVISst'//diag(ilist), horiz_only, 'A',' ', &
- 'Stratospheric aerosol optical depth 550 nm', flag_xyfill=.true.)
- call addfld ('AODABS'//diag(ilist), horiz_only, 'A',' ', &
- 'Aerosol absorption optical depth 550 nm', flag_xyfill=.true.)
-
- call addfld ('EXTINCTdn'//diag(ilist), (/ 'lev' /), 'A','/m',&
- 'Aerosol extinction 550 nm, day night', flag_xyfill=.true.)
- call addfld ('ABSORBdn'//diag(ilist), (/ 'lev' /), 'A','/m',&
- 'Aerosol absorption, day night', flag_xyfill=.true.)
- call addfld ('AODVISdn'//diag(ilist), horiz_only, 'A',' ',&
- 'Aerosol optical depth 550 nm, day night', flag_xyfill=.true.)
- call addfld ('AODVISstdn'//diag(ilist), horiz_only, 'A',' ',&
- 'Stratospheric aerosol optical depth 550 nm, day night', flag_xyfill=.true.)
- call addfld ('AODABSdn'//diag(ilist), horiz_only, 'A',' ',&
- 'Aerosol absorption optical depth 550 nm, day night', flag_xyfill=.true.)
- call addfld ('EXTxASYMdn'//diag(ilist), (/ 'lev' /), 'A',' ',&
- 'extinction 550 * asymmetry factor, day night', flag_xyfill=.true.)
- call addfld ('EXTxASYM'//diag(ilist), (/ 'lev' /), 'A',' ',&
- 'extinction 550 nm * asymmetry factor, day only', flag_xyfill=.true.)
-
- if (history_aero_optics) then
- call add_default ('EXTINCT'//diag(ilist), 1, ' ')
- call add_default ('ABSORB'//diag(ilist), 1, ' ')
- call add_default ('AODVIS'//diag(ilist), 1, ' ')
- call add_default ('AODVISst'//diag(ilist), 1, ' ')
- call add_default ('AODABS'//diag(ilist), 1, ' ')
- end if
-
- end if
- end do
-
-end subroutine modal_aer_opt_init
-
-!===============================================================================
-
-subroutine modal_aero_sw(list_idx, state, pbuf, nnite, idxnite, &
- tauxar, wa, ga, fa)
-
- ! calculates aerosol sw radiative properties
-
- use tropopause, only : tropopause_findChemTrop
-
- integer, intent(in) :: list_idx ! index of the climate or a diagnostic list
- type(physics_state), intent(in), target :: state ! state variables
-
- type(physics_buffer_desc), pointer :: pbuf(:)
- integer, intent(in) :: nnite ! number of night columns
- integer, intent(in) :: idxnite(nnite) ! local column indices of night columns
-
- real(r8), intent(out) :: tauxar(pcols,0:pver,nswbands) ! layer extinction optical depth
- real(r8), intent(out) :: wa(pcols,0:pver,nswbands) ! layer single-scatter albedo
- real(r8), intent(out) :: ga(pcols,0:pver,nswbands) ! asymmetry factor
- real(r8), intent(out) :: fa(pcols,0:pver,nswbands) ! forward scattered fraction
-
- ! Local variables
- integer :: i, ifld, isw, k, l, m, nc, ns
- integer :: lchnk ! chunk id
- integer :: ncol ! number of active columns in the chunk
- integer :: nmodes
- integer :: nspec
- integer :: troplevchem(pcols) ! Chemical tropopause level
- integer :: istat
-
- real(r8) :: mass(pcols,pver) ! layer mass
- real(r8) :: air_density(pcols,pver) ! (kg/m3)
-
- real(r8), pointer :: specmmr(:,:) ! species mass mixing ratio
- real(r8) :: specdens ! species density (kg/m3)
- complex(r8), pointer :: specrefindex(:) ! species refractive index
- character*32 :: spectype ! species type
- real(r8) :: hygro_aer !
-
- real(r8), pointer :: dgnumwet(:,:) ! number mode wet diameter
- real(r8), pointer :: qaerwat(:,:) ! aerosol water (g/g)
-
- real(r8), pointer :: dgnumdry_m(:,:,:) ! number mode dry diameter for all modes
- real(r8), pointer :: dgnumwet_m(:,:,:) ! number mode wet diameter for all modes
- real(r8), pointer :: qaerwat_m(:,:,:) ! aerosol water (g/g) for all modes
- real(r8), pointer :: wetdens_m(:,:,:) !
- real(r8), pointer :: hygro_m(:,:,:) !
- real(r8), pointer :: dryvol_m(:,:,:) !
- real(r8), pointer :: dryrad_m(:,:,:) !
- real(r8), pointer :: drymass_m(:,:,:) !
- real(r8), pointer :: so4dryvol_m(:,:,:) !
- real(r8), pointer :: naer_m(:,:,:) !
-
- real(r8) :: sigma_logr_aer ! geometric standard deviation of number distribution
- real(r8) :: radsurf(pcols,pver) ! aerosol surface mode radius
- real(r8) :: logradsurf(pcols,pver) ! log(aerosol surface mode radius)
- real(r8) :: cheb(ncoef,pcols,pver)
-
- real(r8) :: refr(pcols) ! real part of refractive index
- real(r8) :: refi(pcols) ! imaginary part of refractive index
- complex(r8) :: crefin(pcols) ! complex refractive index
- real(r8), pointer :: refrtabsw(:,:) ! table of real refractive indices for aerosols
- real(r8), pointer :: refitabsw(:,:) ! table of imag refractive indices for aerosols
- real(r8), pointer :: extpsw(:,:,:,:) ! specific extinction
- real(r8), pointer :: abspsw(:,:,:,:) ! specific absorption
- real(r8), pointer :: asmpsw(:,:,:,:) ! asymmetry factor
-
- real(r8) :: vol(pcols) ! volume concentration of aerosol specie (m3/kg)
- real(r8) :: dryvol(pcols) ! volume concentration of aerosol mode (m3/kg)
- real(r8) :: watervol(pcols) ! volume concentration of water in each mode (m3/kg)
- real(r8) :: wetvol(pcols) ! volume concentration of wet mode (m3/kg)
-
- integer :: itab(pcols), jtab(pcols)
- real(r8) :: ttab(pcols), utab(pcols)
- real(r8) :: cext(pcols,ncoef), cabs(pcols,ncoef), casm(pcols,ncoef)
- real(r8) :: pext(pcols) ! parameterized specific extinction (m2/kg)
- real(r8) :: specpext(pcols) ! specific extinction (m2/kg)
- real(r8) :: dopaer(pcols) ! aerosol optical depth in layer
- real(r8) :: pabs(pcols) ! parameterized specific absorption (m2/kg)
- real(r8) :: pasm(pcols) ! parameterized asymmetry factor
- real(r8) :: palb(pcols) ! parameterized single scattering albedo
-
- ! Diagnostics
- real(r8) :: extinct(pcols,pver)
- real(r8) :: extinctnir(pcols,pver)
- real(r8) :: extinctuv(pcols,pver)
- real(r8) :: absorb(pcols,pver)
- real(r8) :: aodvis(pcols) ! extinction optical depth
- real(r8) :: aodvisst(pcols) ! stratospheric extinction optical depth
- real(r8) :: aodabs(pcols) ! absorption optical depth
- real(r8) :: asymvis(pcols) ! asymmetry factor * optical depth
- real(r8) :: asymext(pcols,pver) ! asymmetry factor * extinction
-
- real(r8) :: aodabsbc(pcols) ! absorption optical depth of BC
-
- real(r8) :: ssavis(pcols)
- real(r8) :: dustvol(pcols) ! volume concentration of dust in aerosol mode (m3/kg)
-
- real(r8) :: burden(pcols)
- real(r8) :: burdendust(pcols), burdenso4(pcols), burdenbc(pcols), &
- burdenpom(pcols), burdensoa(pcols), burdenseasalt(pcols)
-
- real(r8) :: aodmode(pcols)
- real(r8) :: dustaodmode(pcols) ! dust aod in aerosol mode
-
- real(r8) :: specrefr, specrefi
- real(r8) :: scatdust(pcols), scatso4(pcols), scatbc(pcols), &
- scatpom(pcols), scatsoa(pcols), scatseasalt(pcols)
- real(r8) :: absdust(pcols), absso4(pcols), absbc(pcols), &
- abspom(pcols), abssoa(pcols), absseasalt(pcols)
- real(r8) :: hygrodust(pcols), hygroso4(pcols), hygrobc(pcols), &
- hygropom(pcols), hygrosoa(pcols), hygroseasalt(pcols)
-
- real(r8) :: scath2o, absh2o, sumscat, sumabs, sumhygro
- real(r8) :: aodc ! aod of component
-
- ! total species AOD
- real(r8) :: dustaod(pcols), so4aod(pcols), bcaod(pcols), &
- pomaod(pcols), soaaod(pcols), seasaltaod(pcols)
-
-
-
-
- logical :: savaervis ! true if visible wavelength (0.55 micron)
- logical :: savaernir ! true if near ir wavelength (~0.88 micron)
- logical :: savaeruv ! true if uv wavelength (~0.35 micron)
-
- real(r8) :: aoduv(pcols) ! extinction optical depth in uv
- real(r8) :: aoduvst(pcols) ! stratospheric extinction optical depth in uv
- real(r8) :: aodnir(pcols) ! extinction optical depth in nir
- real(r8) :: aodnirst(pcols) ! stratospheric extinction optical depth in nir
-
-
- character(len=32) :: outname
-
- ! debug output
- integer, parameter :: nerrmax_dopaer=1000
- integer :: nerr_dopaer = 0
- real(r8) :: volf ! volume fraction of insoluble aerosol
- character(len=*), parameter :: subname = 'modal_aero_sw'
- !----------------------------------------------------------------------------
-
- lchnk = state%lchnk
- ncol = state%ncol
-
- ! initialize output variables
- tauxar(:ncol,:,:) = 0._r8
- wa(:ncol,:,:) = 0._r8
- ga(:ncol,:,:) = 0._r8
- fa(:ncol,:,:) = 0._r8
-
- ! zero'th layer does not contain aerosol
- tauxar(1:ncol,0,:) = 0._r8
- wa(1:ncol,0,:) = 0.925_r8
- ga(1:ncol,0,:) = 0.850_r8
- fa(1:ncol,0,:) = 0.7225_r8
-
- mass(:ncol,:) = state%pdeldry(:ncol,:)*rga
- air_density(:ncol,:) = state%pmid(:ncol,:)/(rair*state%t(:ncol,:))
-
- ! diagnostics for visible band summed over modes
- extinct(1:ncol,:) = 0.0_r8
- absorb(1:ncol,:) = 0.0_r8
- aodvis(1:ncol) = 0.0_r8
- aodvisst(1:ncol) = 0.0_r8
- aodabs(1:ncol) = 0.0_r8
- burdendust(:ncol) = 0.0_r8
- burdenso4(:ncol) = 0.0_r8
- burdenpom(:ncol) = 0.0_r8
- burdensoa(:ncol) = 0.0_r8
- burdenbc(:ncol) = 0.0_r8
- burdenseasalt(:ncol) = 0.0_r8
- ssavis(1:ncol) = 0.0_r8
- asymvis(1:ncol) = 0.0_r8
- asymext(1:ncol,:) = 0.0_r8
-
- aodabsbc(:ncol) = 0.0_r8
- dustaod(:ncol) = 0.0_r8
- so4aod(:ncol) = 0.0_r8
- pomaod(:ncol) = 0.0_r8
- soaaod(:ncol) = 0.0_r8
- bcaod(:ncol) = 0.0_r8
- seasaltaod(:ncol) = 0.0_r8
-
- ! diags for other bands
- extinctuv(1:ncol,:) = 0.0_r8
- extinctnir(1:ncol,:) = 0.0_r8
- aoduv(:ncol) = 0.0_r8
- aodnir(:ncol) = 0.0_r8
- aoduvst(:ncol) = 0.0_r8
- aodnirst(:ncol) = 0.0_r8
- call tropopause_findChemTrop(state, troplevchem)
-
- ! loop over all aerosol modes
- call rad_cnst_get_info(list_idx, nmodes=nmodes)
-
- if (list_idx == 0) then
- ! water uptake and wet radius for the climate list has already been calculated
- call pbuf_get_field(pbuf, dgnumwet_idx, dgnumwet_m)
- call pbuf_get_field(pbuf, qaerwat_idx, qaerwat_m)
- else
- ! If doing a diagnostic calculation then need to calculate the wet radius
- ! and water uptake for the diagnostic modes
- allocate(dgnumdry_m(pcols,pver,nmodes), dgnumwet_m(pcols,pver,nmodes), &
- qaerwat_m(pcols,pver,nmodes), wetdens_m(pcols,pver,nmodes), &
- hygro_m(pcols,pver,nmodes), dryvol_m(pcols,pver,nmodes), &
- dryrad_m(pcols,pver,nmodes), drymass_m(pcols,pver,nmodes), &
- so4dryvol_m(pcols,pver,nmodes), naer_m(pcols,pver,nmodes), stat=istat)
- if (istat > 0) then
- call endrun('modal_aero_sw: allocation FAILURE: arrays for diagnostic calcs')
- end if
- call modal_aero_calcsize_diag(state, pbuf, list_idx, dgnumdry_m, hygro_m, &
- dryvol_m, dryrad_m, drymass_m, so4dryvol_m, naer_m)
- call modal_aero_wateruptake_dr(state, pbuf, list_idx, dgnumdry_m, dgnumwet_m, &
- qaerwat_m, wetdens_m, hygro_m, dryvol_m, dryrad_m, &
- drymass_m, so4dryvol_m, naer_m)
- endif
-
- do m = 1, nmodes
-
- ! diagnostics for visible band for each mode
- burden(:ncol) = 0._r8
- aodmode(1:ncol) = 0.0_r8
- dustaodmode(1:ncol) = 0.0_r8
-
- dgnumwet => dgnumwet_m(:,:,m)
- qaerwat => qaerwat_m(:,:,m)
-
- ! get mode properties
- call rad_cnst_get_mode_props(list_idx, m, sigmag=sigma_logr_aer, refrtabsw=refrtabsw , &
- refitabsw=refitabsw, extpsw=extpsw, abspsw=abspsw, asmpsw=asmpsw)
-
- ! get mode info
- call rad_cnst_get_info(list_idx, m, nspec=nspec)
-
- ! calc size parameter for all columns
- call modal_size_parameters(ncol, sigma_logr_aer, dgnumwet, radsurf, logradsurf, cheb)
-
- do isw = 1, nswbands
- savaervis = (isw .eq. idx_sw_diag)
- savaeruv = (isw .eq. idx_uv_diag)
- savaernir = (isw .eq. idx_nir_diag)
-
- do k = top_lev, pver
-
- ! form bulk refractive index
- crefin(:ncol) = (0._r8, 0._r8)
- dryvol(:ncol) = 0._r8
- dustvol(:ncol) = 0._r8
-
- scatdust(:ncol) = 0._r8
- absdust(:ncol) = 0._r8
- hygrodust(:ncol) = 0._r8
- scatso4(:ncol) = 0._r8
- absso4(:ncol) = 0._r8
- hygroso4(:ncol) = 0._r8
- scatbc(:ncol) = 0._r8
- absbc(:ncol) = 0._r8
- hygrobc(:ncol) = 0._r8
- scatpom(:ncol) = 0._r8
- abspom(:ncol) = 0._r8
- hygropom(:ncol) = 0._r8
- scatsoa(:ncol) = 0._r8
- abssoa(:ncol) = 0._r8
- hygrosoa(:ncol) = 0._r8
- scatseasalt(:ncol) = 0._r8
- absseasalt(:ncol) = 0._r8
- hygroseasalt(:ncol) = 0._r8
-
- ! aerosol species loop
- do l = 1, nspec
- call rad_cnst_get_aer_mmr(list_idx, m, l, 'a', state, pbuf, specmmr)
- call rad_cnst_get_aer_props(list_idx, m, l, density_aer=specdens, &
- refindex_aer_sw=specrefindex, spectype=spectype, &
- hygro_aer=hygro_aer)
-
- do i = 1, ncol
- vol(i) = specmmr(i,k)/specdens
- dryvol(i) = dryvol(i) + vol(i)
- crefin(i) = crefin(i) + vol(i)*specrefindex(isw)
- end do
-
- ! compute some diagnostics for visible band only
- if (savaervis) then
-
- specrefr = real(specrefindex(isw))
- specrefi = aimag(specrefindex(isw))
-
- do i = 1, ncol
- burden(i) = burden(i) + specmmr(i,k)*mass(i,k)
- end do
-
- if (trim(spectype) == 'dust') then
- do i = 1, ncol
- burdendust(i) = burdendust(i) + specmmr(i,k)*mass(i,k)
- dustvol(i) = vol(i)
- scatdust(i) = vol(i)*specrefr
- absdust(i) = -vol(i)*specrefi
- hygrodust(i) = vol(i)*hygro_aer
- end do
- end if
-
- if (trim(spectype) == 'sulfate') then
- do i = 1, ncol
- burdenso4(i) = burdenso4(i) + specmmr(i,k)*mass(i,k)
- scatso4(i) = vol(i)*specrefr
- absso4(i) = -vol(i)*specrefi
- hygroso4(i) = vol(i)*hygro_aer
- end do
- end if
- if (trim(spectype) == 'black-c') then
- do i = 1, ncol
- burdenbc(i) = burdenbc(i) + specmmr(i,k)*mass(i,k)
- scatbc(i) = vol(i)*specrefr
- absbc(i) = -vol(i)*specrefi
- hygrobc(i) = vol(i)*hygro_aer
- end do
- end if
- if (trim(spectype) == 'p-organic') then
- do i = 1, ncol
- burdenpom(i) = burdenpom(i) + specmmr(i,k)*mass(i,k)
- scatpom(i) = vol(i)*specrefr
- abspom(i) = -vol(i)*specrefi
- hygropom(i) = vol(i)*hygro_aer
- end do
- end if
- if (trim(spectype) == 's-organic') then
- do i = 1, ncol
- burdensoa(i) = burdensoa(i) + specmmr(i,k)*mass(i,k)
- scatsoa(i) = vol(i)*specrefr
- abssoa(i) = -vol(i)*specrefi
- hygrosoa(i) = vol(i)*hygro_aer
- end do
- end if
- if (trim(spectype) == 'seasalt') then
- do i = 1, ncol
- burdenseasalt(i) = burdenseasalt(i) + specmmr(i,k)*mass(i,k)
- scatseasalt(i) = vol(i)*specrefr
- absseasalt(i) = -vol(i)*specrefi
- hygroseasalt(i) = vol(i)*hygro_aer
- end do
- end if
-
- end if
- end do ! species loop
-
- do i = 1, ncol
- watervol(i) = qaerwat(i,k)/rhoh2o
- wetvol(i) = watervol(i) + dryvol(i)
- if (watervol(i) < 0._r8) then
- if (abs(watervol(i)) .gt. 1.e-1_r8*wetvol(i)) then
- write(iulog,'(a,2e10.2,a)') 'watervol,wetvol=', &
- watervol(i), wetvol(i), ' in '//subname
- end if
- watervol(i) = 0._r8
- wetvol(i) = dryvol(i)
- end if
-
- ! volume mixing
- crefin(i) = crefin(i) + watervol(i)*crefwsw(isw)
- crefin(i) = crefin(i)/max(wetvol(i),1.e-60_r8)
- refr(i) = real(crefin(i))
- refi(i) = abs(aimag(crefin(i)))
- end do
-
- ! call t_startf('binterp')
-
- ! interpolate coefficients linear in refractive index
- ! first call calcs itab,jtab,ttab,utab
- itab(:ncol) = 0
- call binterp(extpsw(:,:,:,isw), ncol, ncoef, prefr, prefi, &
- refr, refi, refrtabsw(:,isw), refitabsw(:,isw), &
- itab, jtab, ttab, utab, cext)
- call binterp(abspsw(:,:,:,isw), ncol, ncoef, prefr, prefi, &
- refr, refi, refrtabsw(:,isw), refitabsw(:,isw), &
- itab, jtab, ttab, utab, cabs)
- call binterp(asmpsw(:,:,:,isw), ncol, ncoef, prefr, prefi, &
- refr, refi, refrtabsw(:,isw), refitabsw(:,isw), &
- itab, jtab, ttab, utab, casm)
-
- ! call t_stopf('binterp')
-
- ! parameterized optical properties
- do i=1,ncol
-
- if (logradsurf(i,k) .le. xrmax) then
- pext(i) = 0.5_r8*cext(i,1)
- do nc = 2, ncoef
- pext(i) = pext(i) + cheb(nc,i,k)*cext(i,nc)
- enddo
- pext(i) = exp(pext(i))
- else
- pext(i) = 1.5_r8/(radsurf(i,k)*rhoh2o) ! geometric optics
- endif
-
- ! convert from m2/kg water to m2/kg aerosol
- specpext(i) = pext(i)
- pext(i) = pext(i)*wetvol(i)*rhoh2o
- pabs(i) = 0.5_r8*cabs(i,1)
- pasm(i) = 0.5_r8*casm(i,1)
- do nc = 2, ncoef
- pabs(i) = pabs(i) + cheb(nc,i,k)*cabs(i,nc)
- pasm(i) = pasm(i) + cheb(nc,i,k)*casm(i,nc)
- enddo
- pabs(i) = pabs(i)*wetvol(i)*rhoh2o
- pabs(i) = max(0._r8,pabs(i))
- pabs(i) = min(pext(i),pabs(i))
-
- palb(i) = 1._r8-pabs(i)/max(pext(i),1.e-40_r8)
- palb(i) = 1._r8-pabs(i)/max(pext(i),1.e-40_r8)
-
- dopaer(i) = pext(i)*mass(i,k)
- end do
-
- if (savaeruv) then
- do i = 1, ncol
- extinctuv(i,k) = extinctuv(i,k) + dopaer(i)*air_density(i,k)/mass(i,k)
- aoduv(i) = aoduv(i) + dopaer(i)
- if (k.le.troplevchem(i)) then
- aoduvst(i) = aoduvst(i) + dopaer(i)
- end if
- end do
- end if
-
- if (savaernir) then
- do i = 1, ncol
- extinctnir(i,k) = extinctnir(i,k) + dopaer(i)*air_density(i,k)/mass(i,k)
- aodnir(i) = aodnir(i) + dopaer(i)
- if (k.le.troplevchem(i)) then
- aodnirst(i) = aodnirst(i) + dopaer(i)
- end if
- end do
- endif
-
- ! Save aerosol optical depth at longest visible wavelength
- ! sum over layers
- if (savaervis) then
- ! aerosol extinction (/m)
- do i = 1, ncol
- extinct(i,k) = extinct(i,k) + dopaer(i)*air_density(i,k)/mass(i,k)
- absorb(i,k) = absorb(i,k) + pabs(i)*air_density(i,k)
- aodvis(i) = aodvis(i) + dopaer(i)
- aodabs(i) = aodabs(i) + pabs(i)*mass(i,k)
- aodmode(i) = aodmode(i) + dopaer(i)
- ssavis(i) = ssavis(i) + dopaer(i)*palb(i)
- asymvis(i) = asymvis(i) + dopaer(i)*pasm(i)
- asymext(i,k) = asymext(i,k) + dopaer(i)*pasm(i)*air_density(i,k)/mass(i,k)
- if (k.le.troplevchem(i)) then
- aodvisst(i) = aodvisst(i) + dopaer(i)
- end if
-
- if (wetvol(i) > 1.e-40_r8) then
-
- dustaodmode(i) = dustaodmode(i) + dopaer(i)*dustvol(i)/wetvol(i)
-
- ! partition optical depth into contributions from each constituent
- ! assume contribution is proportional to refractive index X volume
-
- scath2o = watervol(i)*real(crefwsw(isw))
- absh2o = -watervol(i)*aimag(crefwsw(isw))
- sumscat = scatso4(i) + scatpom(i) + scatsoa(i) + scatbc(i) + &
- scatdust(i) + scatseasalt(i) + scath2o
- sumabs = absso4(i) + abspom(i) + abssoa(i) + absbc(i) + &
- absdust(i) + absseasalt(i) + absh2o
- sumhygro = hygroso4(i) + hygropom(i) + hygrosoa(i) + hygrobc(i) + &
- hygrodust(i) + hygroseasalt(i)
-
- scatdust(i) = (scatdust(i) + scath2o*hygrodust(i)/sumhygro)/sumscat
- absdust(i) = (absdust(i) + absh2o*hygrodust(i)/sumhygro)/sumabs
-
- scatso4(i) = (scatso4(i) + scath2o*hygroso4(i)/sumhygro)/sumscat
- absso4(i) = (absso4(i) + absh2o*hygroso4(i)/sumhygro)/sumabs
-
- scatpom(i) = (scatpom(i) + scath2o*hygropom(i)/sumhygro)/sumscat
- abspom(i) = (abspom(i) + absh2o*hygropom(i)/sumhygro)/sumabs
-
- scatsoa(i) = (scatsoa(i) + scath2o*hygrosoa(i)/sumhygro)/sumscat
- abssoa(i) = (abssoa(i) + absh2o*hygrosoa(i)/sumhygro)/sumabs
-
- scatbc(i) = (scatbc(i) + scath2o*hygrobc(i)/sumhygro)/sumscat
- absbc(i) = (absbc(i) + absh2o*hygrobc(i)/sumhygro)/sumabs
-
- scatseasalt(i) = (scatseasalt(i) + scath2o*hygroseasalt(i)/sumhygro)/sumscat
- absseasalt(i) = (absseasalt(i) + absh2o*hygroseasalt(i)/sumhygro)/sumabs
-
- aodabsbc(i) = aodabsbc(i) + absbc(i)*dopaer(i)*(1.0_r8-palb(i))
-
- aodc = (absdust(i)*(1.0_r8 - palb(i)) + palb(i)*scatdust(i))*dopaer(i)
- dustaod(i) = dustaod(i) + aodc
-
- aodc = (absso4(i)*(1.0_r8 - palb(i)) + palb(i)*scatso4(i))*dopaer(i)
- so4aod(i) = so4aod(i) + aodc
-
- aodc = (abspom(i)*(1.0_r8 - palb(i)) + palb(i)*scatpom(i))*dopaer(i)
- pomaod(i) = pomaod(i) + aodc
-
- aodc = (abssoa(i)*(1.0_r8 - palb(i)) + palb(i)*scatsoa(i))*dopaer(i)
- soaaod(i) = soaaod(i) + aodc
-
- aodc = (absbc(i)*(1.0_r8 - palb(i)) + palb(i)*scatbc(i))*dopaer(i)
- bcaod(i) = bcaod(i) + aodc
-
- aodc = (absseasalt(i)*(1.0_r8 - palb(i)) + palb(i)*scatseasalt(i))*dopaer(i)
- seasaltaod(i) = seasaltaod(i) + aodc
-
- endif
-
- end do
- endif
-
- do i = 1, ncol
-
- if ((dopaer(i) <= -1.e-10_r8) .or. (dopaer(i) >= 30._r8)) then
-
- if (dopaer(i) <= -1.e-10_r8) then
- write(iulog,*) "ERROR: Negative aerosol optical depth &
- &in this layer."
- else
- write(iulog,*) "WARNING: Aerosol optical depth is &
- &unreasonably high in this layer."
- end if
-
- write(iulog,*) 'dopaer(', i, ',', k, ',', m, ',', lchnk, ')=', dopaer(i)
- ! write(iulog,*) 'itab,jtab,ttab,utab=',itab(i),jtab(i),ttab(i),utab(i)
- write(iulog,*) 'k=', k, ' pext=', pext(i), ' specext=', specpext(i)
- write(iulog,*) 'wetvol=', wetvol(i), ' dryvol=', dryvol(i), ' watervol=', watervol(i)
- ! write(iulog,*) 'cext=',(cext(i,l),l=1,ncoef)
- ! write(iulog,*) 'crefin=',crefin(i)
- write(iulog,*) 'nspec=', nspec
- ! write(iulog,*) 'cheb=', (cheb(nc,m,i,k),nc=2,ncoef)
- do l = 1, nspec
- call rad_cnst_get_aer_mmr(list_idx, m, l, 'a', state, pbuf, specmmr)
- call rad_cnst_get_aer_props(list_idx, m, l, density_aer=specdens, &
- refindex_aer_sw=specrefindex)
- volf = specmmr(i,k)/specdens
- write(iulog,*) 'l=', l, 'vol(l)=', volf
- write(iulog,*) 'isw=', isw, 'specrefindex(isw)=', specrefindex(isw)
- write(iulog,*) 'specdens=', specdens
- end do
-
- nerr_dopaer = nerr_dopaer + 1
-! if (nerr_dopaer >= nerrmax_dopaer) then
- if (dopaer(i) < -1.e-10_r8) then
- write(iulog,*) '*** halting in '//subname//' after nerr_dopaer =', nerr_dopaer
- call endrun('exit from '//subname)
- end if
-
- end if
- end do
-
- do i=1,ncol
- tauxar(i,k,isw) = tauxar(i,k,isw) + dopaer(i)
- wa(i,k,isw) = wa(i,k,isw) + dopaer(i)*palb(i)
- ga(i,k,isw) = ga(i,k,isw) + dopaer(i)*palb(i)*pasm(i)
- fa(i,k,isw) = fa(i,k,isw) + dopaer(i)*palb(i)*pasm(i)*pasm(i)
- end do
-
- end do ! pver
-
- end do ! sw bands
-
- ! mode diagnostics
- ! The diagnostics are currently only output for the climate list. Code mods will
- ! be necessary to provide output for the rad_diag lists.
- if (list_idx == 0) then
-
- write(outname,'(a,i1)') 'BURDENdn', m
- call outfld(trim(outname), burden, pcols, lchnk)
-
- write(outname,'(a,i1)') 'AODdnMODE', m
- call outfld(trim(outname), aodmode, pcols, lchnk)
-
- write(outname,'(a,i1)') 'AODdnDUST', m
- call outfld(trim(outname), dustaodmode, pcols, lchnk)
-
- do i = 1, nnite
- burden(idxnite(i)) = fillvalue
- aodmode(idxnite(i)) = fillvalue
- dustaodmode(idxnite(i)) = fillvalue
- end do
-
- write(outname,'(a,i1)') 'BURDEN', m
- call outfld(trim(outname), burden, pcols, lchnk)
-
- write(outname,'(a,i1)') 'AODMODE', m
- call outfld(trim(outname), aodmode, pcols, lchnk)
-
- write(outname,'(a,i1)') 'AODDUST', m
- call outfld(trim(outname), dustaodmode, pcols, lchnk)
-
- end if
-
- end do ! nmodes
-
- if (list_idx > 0) then
- deallocate(dgnumdry_m)
- deallocate(dgnumwet_m)
- deallocate(qaerwat_m)
- deallocate(wetdens_m)
- deallocate(hygro_m)
- deallocate(dryvol_m)
- deallocate(dryrad_m)
- deallocate(drymass_m)
- deallocate(so4dryvol_m)
- deallocate(naer_m)
- end if
-
- ! Output visible band diagnostics for quantities summed over the modes
- ! These fields are put out for diagnostic lists as well as the climate list.
-
- call outfld('EXTINCTdn'//diag(list_idx), extinct, pcols, lchnk)
- call outfld('ABSORBdn'//diag(list_idx), absorb, pcols, lchnk)
- call outfld('AODVISdn'//diag(list_idx), aodvis, pcols, lchnk)
- call outfld('AODABSdn'//diag(list_idx), aodabs, pcols, lchnk)
- call outfld('AODVISstdn'//diag(list_idx), aodvisst,pcols, lchnk)
- call outfld('EXTxASYMdn'//diag(list_idx), asymext, pcols, lchnk)
-
- do i = 1, nnite
- extinct(idxnite(i),:) = fillvalue
- absorb(idxnite(i),:) = fillvalue
- aodvis(idxnite(i)) = fillvalue
- aodabs(idxnite(i)) = fillvalue
- aodvisst(idxnite(i)) = fillvalue
- asymext(idxnite(i),:) = fillvalue
- end do
-
- call outfld('EXTINCT'//diag(list_idx), extinct, pcols, lchnk)
- call outfld('ABSORB'//diag(list_idx), absorb, pcols, lchnk)
- call outfld('AODVIS'//diag(list_idx), aodvis, pcols, lchnk)
- call outfld('AODABS'//diag(list_idx), aodabs, pcols, lchnk)
- call outfld('AODVISst'//diag(list_idx), aodvisst,pcols, lchnk)
- call outfld('EXTxASYM'//diag(list_idx), asymext, pcols, lchnk)
-
- ! These diagnostics are output only for climate list
- if (list_idx == 0) then
- do i = 1, ncol
- if (aodvis(i) > 1.e-10_r8) then
- ssavis(i) = ssavis(i)/aodvis(i)
- else
- ssavis(i) = 0.925_r8
- endif
- end do
-
- call outfld('SSAVISdn', ssavis, pcols, lchnk)
- call outfld('AODxASYMdn', asymvis, pcols, lchnk)
-
- call outfld('EXTINCTUVdn', extinctuv, pcols, lchnk)
- call outfld('EXTINCTNIRdn', extinctnir, pcols, lchnk)
- call outfld('AODUVdn', aoduv, pcols, lchnk)
- call outfld('AODNIRdn', aodnir, pcols, lchnk)
- call outfld('AODUVstdn', aoduvst, pcols, lchnk)
- call outfld('AODNIRstdn', aodnirst, pcols, lchnk)
-
- call outfld('BURDENDUSTdn', burdendust, pcols, lchnk)
- call outfld('BURDENSO4dn' , burdenso4, pcols, lchnk)
- call outfld('BURDENPOMdn' , burdenpom, pcols, lchnk)
- call outfld('BURDENSOAdn' , burdensoa, pcols, lchnk)
- call outfld('BURDENBCdn' , burdenbc, pcols, lchnk)
- call outfld('BURDENSEASALTdn', burdenseasalt, pcols, lchnk)
-
- call outfld('AODABSBCdn', aodabsbc, pcols, lchnk)
-
- call outfld('AODDUSTdn', dustaod, pcols, lchnk)
- call outfld('AODSO4dn', so4aod, pcols, lchnk)
- call outfld('AODPOMdn', pomaod, pcols, lchnk)
- call outfld('AODSOAdn', soaaod, pcols, lchnk)
- call outfld('AODBCdn', bcaod, pcols, lchnk)
- call outfld('AODSSdn', seasaltaod, pcols, lchnk)
-
-
- do i = 1, nnite
- ssavis(idxnite(i)) = fillvalue
- asymvis(idxnite(i)) = fillvalue
-
- aoduv(idxnite(i)) = fillvalue
- aodnir(idxnite(i)) = fillvalue
- aoduvst(idxnite(i)) = fillvalue
- aodnirst(idxnite(i)) = fillvalue
- extinctuv(idxnite(i),:) = fillvalue
- extinctnir(idxnite(i),:) = fillvalue
-
- burdendust(idxnite(i)) = fillvalue
- burdenso4(idxnite(i)) = fillvalue
- burdenpom(idxnite(i)) = fillvalue
- burdensoa(idxnite(i)) = fillvalue
- burdenbc(idxnite(i)) = fillvalue
- burdenseasalt(idxnite(i)) = fillvalue
-
- aodabsbc(idxnite(i)) = fillvalue
-
- dustaod(idxnite(i)) = fillvalue
- so4aod(idxnite(i)) = fillvalue
- pomaod(idxnite(i)) = fillvalue
- soaaod(idxnite(i)) = fillvalue
- bcaod(idxnite(i)) = fillvalue
- seasaltaod(idxnite(i)) = fillvalue
- end do
-
- call outfld('SSAVIS', ssavis, pcols, lchnk)
- call outfld('AODxASYM', asymvis, pcols, lchnk)
-
- call outfld('EXTINCTUV', extinctuv, pcols, lchnk)
- call outfld('EXTINCTNIR', extinctnir, pcols, lchnk)
- call outfld('AODUV', aoduv, pcols, lchnk)
- call outfld('AODNIR', aodnir, pcols, lchnk)
- call outfld('AODUVst', aoduvst, pcols, lchnk)
- call outfld('AODNIRst', aodnirst, pcols, lchnk)
-
- call outfld('BURDENDUST', burdendust, pcols, lchnk)
- call outfld('BURDENSO4' , burdenso4, pcols, lchnk)
- call outfld('BURDENPOM' , burdenpom, pcols, lchnk)
- call outfld('BURDENSOA' , burdensoa, pcols, lchnk)
- call outfld('BURDENBC' , burdenbc, pcols, lchnk)
- call outfld('BURDENSEASALT', burdenseasalt, pcols, lchnk)
-
- call outfld('AODABSBC', aodabsbc, pcols, lchnk)
-
- call outfld('AODDUST', dustaod, pcols, lchnk)
- call outfld('AODSO4', so4aod, pcols, lchnk)
- call outfld('AODPOM', pomaod, pcols, lchnk)
- call outfld('AODSOA', soaaod, pcols, lchnk)
- call outfld('AODBC', bcaod, pcols, lchnk)
- call outfld('AODSS', seasaltaod, pcols, lchnk)
- end if
-
-end subroutine modal_aero_sw
-
-!===============================================================================
-
-subroutine modal_aero_lw(list_idx, state, pbuf, tauxar)
-
- ! calculates aerosol lw radiative properties
-
- integer, intent(in) :: list_idx ! index of the climate or a diagnostic list
- type(physics_state), intent(in), target :: state ! state variables
-
- type(physics_buffer_desc), pointer :: pbuf(:)
-
- real(r8), intent(out) :: tauxar(pcols,pver,nlwbands) ! layer absorption optical depth
-
- ! Local variables
- integer :: i, ifld, ilw, k, l, m, nc, ns
- integer :: lchnk ! chunk id
- integer :: ncol ! number of active columns in the chunk
- integer :: nmodes
- integer :: nspec
- integer :: istat
-
- real(r8), pointer :: dgnumwet(:,:) ! wet number mode diameter (m)
- real(r8), pointer :: qaerwat(:,:) ! aerosol water (g/g)
-
- real(r8), pointer :: dgnumdry_m(:,:,:) ! number mode dry diameter for all modes
- real(r8), pointer :: dgnumwet_m(:,:,:) ! number mode wet diameter for all modes
- real(r8), pointer :: qaerwat_m(:,:,:) ! aerosol water (g/g) for all modes
- real(r8), pointer :: wetdens_m(:,:,:) !
- real(r8), pointer :: hygro_m(:,:,:) !
- real(r8), pointer :: dryvol_m(:,:,:) !
- real(r8), pointer :: dryrad_m(:,:,:) !
- real(r8), pointer :: drymass_m(:,:,:) !
- real(r8), pointer :: so4dryvol_m(:,:,:) !
- real(r8), pointer :: naer_m(:,:,:) !
-
- real(r8) :: sigma_logr_aer ! geometric standard deviation of number distribution
- real(r8) :: alnsg_amode ! log of geometric standard deviation of number distribution
- real(r8) :: xrad(pcols)
- real(r8) :: cheby(ncoef,pcols,pver) ! chebychef polynomials
-
- real(r8) :: mass(pcols,pver) ! layer mass
-
- real(r8), pointer :: specmmr(:,:) ! species mass mixing ratio
- real(r8) :: specdens ! species density (kg/m3)
- complex(r8), pointer :: specrefindex(:) ! species refractive index
-
- real(r8) :: vol(pcols) ! volume concentration of aerosol specie (m3/kg)
- real(r8) :: dryvol(pcols) ! volume concentration of aerosol mode (m3/kg)
- real(r8) :: wetvol(pcols) ! volume concentration of wet mode (m3/kg)
- real(r8) :: watervol(pcols) ! volume concentration of water in each mode (m3/kg)
- real(r8) :: refr(pcols) ! real part of refractive index
- real(r8) :: refi(pcols) ! imaginary part of refractive index
- complex(r8) :: crefin(pcols) ! complex refractive index
- real(r8), pointer :: refrtablw(:,:) ! table of real refractive indices for aerosols
- real(r8), pointer :: refitablw(:,:) ! table of imag refractive indices for aerosols
- real(r8), pointer :: absplw(:,:,:,:) ! specific absorption
-
- integer :: itab(pcols), jtab(pcols)
- real(r8) :: ttab(pcols), utab(pcols)
- real(r8) :: cabs(pcols,ncoef)
- real(r8) :: pabs(pcols) ! parameterized specific absorption (m2/kg)
- real(r8) :: dopaer(pcols) ! aerosol optical depth in layer
-
- integer, parameter :: nerrmax_dopaer=1000
- integer :: nerr_dopaer = 0
- real(r8) :: volf ! volume fraction of insoluble aerosol
-
- character(len=*), parameter :: subname = 'modal_aero_lw'
- !----------------------------------------------------------------------------
-
- lchnk = state%lchnk
- ncol = state%ncol
-
- ! initialize output variables
- tauxar(:ncol,:,:) = 0._r8
-
- ! dry mass in each cell
- mass(:ncol,:) = state%pdeldry(:ncol,:)*rga
-
- ! loop over all aerosol modes
- call rad_cnst_get_info(list_idx, nmodes=nmodes)
-
- if (list_idx == 0) then
- ! water uptake and wet radius for the climate list has already been calculated
- call pbuf_get_field(pbuf, dgnumwet_idx, dgnumwet_m)
- call pbuf_get_field(pbuf, qaerwat_idx, qaerwat_m)
- else
- ! If doing a diagnostic calculation then need to calculate the wet radius
- ! and water uptake for the diagnostic modes
- allocate(dgnumdry_m(pcols,pver,nmodes), dgnumwet_m(pcols,pver,nmodes), &
- qaerwat_m(pcols,pver,nmodes), wetdens_m(pcols,pver,nmodes), &
- hygro_m(pcols,pver,nmodes), dryvol_m(pcols,pver,nmodes), &
- dryrad_m(pcols,pver,nmodes), drymass_m(pcols,pver,nmodes), &
- so4dryvol_m(pcols,pver,nmodes), naer_m(pcols,pver,nmodes), stat=istat)
-
- if (istat > 0) then
- call endrun('modal_aero_lw: allocation FAILURE: arrays for diagnostic calcs')
- end if
- call modal_aero_calcsize_diag(state, pbuf, list_idx, dgnumdry_m, hygro_m, &
- dryvol_m, dryrad_m, drymass_m, so4dryvol_m, naer_m)
- call modal_aero_wateruptake_dr(state, pbuf, list_idx, dgnumdry_m, dgnumwet_m, &
- qaerwat_m, wetdens_m, hygro_m, dryvol_m, dryrad_m, &
- drymass_m, so4dryvol_m, naer_m)
- endif
-
- do m = 1, nmodes
-
- dgnumwet => dgnumwet_m(:,:,m)
- qaerwat => qaerwat_m(:,:,m)
-
- ! get mode properties
- call rad_cnst_get_mode_props(list_idx, m, sigmag=sigma_logr_aer, refrtablw=refrtablw , &
- refitablw=refitablw, absplw=absplw)
-
- ! get mode info
- call rad_cnst_get_info(list_idx, m, nspec=nspec)
-
- ! calc size parameter for all columns
- ! this is the same calculation that's done in modal_size_parameters, but there
- ! some intermediate results are saved and the chebyshev polynomials are stored
- ! in a array with different index order. Could be unified.
- do k = top_lev, pver
- do i = 1, ncol
- alnsg_amode = log( sigma_logr_aer )
- ! convert from number diameter to surface area
- xrad(i) = log(0.5_r8*dgnumwet(i,k)) + 2.0_r8*alnsg_amode*alnsg_amode
- ! normalize size parameter
- xrad(i) = max(xrad(i), xrmin)
- xrad(i) = min(xrad(i), xrmax)
- xrad(i) = (2*xrad(i)-xrmax-xrmin)/(xrmax-xrmin)
- ! chebyshev polynomials
- cheby(1,i,k) = 1.0_r8
- cheby(2,i,k) = xrad(i)
- do nc = 3, ncoef
- cheby(nc,i,k) = 2.0_r8*xrad(i)*cheby(nc-1,i,k)-cheby(nc-2,i,k)
- end do
- end do
- end do
-
- do ilw = 1, nlwbands
-
- do k = top_lev, pver
-
- ! form bulk refractive index. Use volume mixing for infrared
- crefin(:ncol) = (0._r8, 0._r8)
- dryvol(:ncol) = 0._r8
-
- ! aerosol species loop
- do l = 1, nspec
- call rad_cnst_get_aer_mmr(list_idx, m, l, 'a', state, pbuf, specmmr)
- call rad_cnst_get_aer_props(list_idx, m, l, density_aer=specdens, &
- refindex_aer_lw=specrefindex)
-
- do i = 1, ncol
- vol(i) = specmmr(i,k)/specdens
- dryvol(i) = dryvol(i) + vol(i)
- crefin(i) = crefin(i) + vol(i)*specrefindex(ilw)
- end do
- end do
-
- do i = 1, ncol
- watervol(i) = qaerwat(i,k)/rhoh2o
- wetvol(i) = watervol(i) + dryvol(i)
- if (watervol(i) < 0.0_r8) then
- if (abs(watervol(i)) .gt. 1.e-1_r8*wetvol(i)) then
- write(iulog,*) 'watervol,wetvol,dryvol=',watervol(i),wetvol(i),dryvol(i),' in '//subname
- end if
- watervol(i) = 0._r8
- wetvol(i) = dryvol(i)
- end if
-
- crefin(i) = crefin(i) + watervol(i)*crefwlw(ilw)
- if (wetvol(i) > 1.e-40_r8) crefin(i) = crefin(i)/wetvol(i)
- refr(i) = real(crefin(i))
- refi(i) = aimag(crefin(i))
- end do
-
- ! interpolate coefficients linear in refractive index
- ! first call calcs itab,jtab,ttab,utab
- itab(:ncol) = 0
- call binterp(absplw(:,:,:,ilw), ncol, ncoef, prefr, prefi, &
- refr, refi, refrtablw(:,ilw), refitablw(:,ilw), &
- itab, jtab, ttab, utab, cabs)
-
- ! parameterized optical properties
- do i = 1, ncol
- pabs(i) = 0.5_r8*cabs(i,1)
- do nc = 2, ncoef
- pabs(i) = pabs(i) + cheby(nc,i,k)*cabs(i,nc)
- end do
- pabs(i) = pabs(i)*wetvol(i)*rhoh2o
- pabs(i) = max(0._r8,pabs(i))
- dopaer(i) = pabs(i)*mass(i,k)
- end do
-
- do i = 1, ncol
-
- if ((dopaer(i) <= -1.e-10_r8) .or. (dopaer(i) >= 20._r8)) then
-
- if (dopaer(i) <= -1.e-10_r8) then
- write(iulog,*) "ERROR: Negative aerosol optical depth &
- &in this layer."
- else
- write(iulog,*) "WARNING: Aerosol optical depth is &
- &unreasonably high in this layer."
- end if
-
- write(iulog,*) 'dopaer(',i,',',k,',',m,',',lchnk,')=', dopaer(i)
- write(iulog,*) 'k=',k,' pabs=', pabs(i)
- write(iulog,*) 'wetvol=',wetvol(i),' dryvol=',dryvol(i), &
- ' watervol=',watervol(i)
- write(iulog,*) 'cabs=', (cabs(i,l),l=1,ncoef)
- write(iulog,*) 'crefin=', crefin(i)
- write(iulog,*) 'nspec=', nspec
- do l = 1,nspec
- call rad_cnst_get_aer_mmr(list_idx, m, l, 'a', state, pbuf, specmmr)
- call rad_cnst_get_aer_props(list_idx, m, l, density_aer=specdens, &
- refindex_aer_lw=specrefindex)
- volf = specmmr(i,k)/specdens
- write(iulog,*) 'l=',l,'vol(l)=',volf
- write(iulog,*) 'ilw=',ilw,' specrefindex(ilw)=',specrefindex(ilw)
- write(iulog,*) 'specdens=',specdens
- end do
-
- nerr_dopaer = nerr_dopaer + 1
- if (nerr_dopaer >= nerrmax_dopaer .or. dopaer(i) < -1.e-10_r8) then
- write(iulog,*) '*** halting in '//subname//' after nerr_dopaer =', nerr_dopaer
- call endrun()
- end if
-
- end if
- end do
-
- do i = 1, ncol
- tauxar(i,k,ilw) = tauxar(i,k,ilw) + dopaer(i)
- end do
-
- end do ! k = top_lev, pver
-
- end do ! nlwbands
-
- end do ! m = 1, nmodes
-
- if (list_idx > 0) then
- deallocate(dgnumdry_m)
- deallocate(dgnumwet_m)
- deallocate(qaerwat_m)
- deallocate(wetdens_m)
- deallocate(hygro_m)
- deallocate(dryvol_m)
- deallocate(dryrad_m)
- deallocate(drymass_m)
- deallocate(so4dryvol_m)
- deallocate(naer_m)
- end if
-
-end subroutine modal_aero_lw
-
-!===============================================================================
-! Private routines
-!===============================================================================
-
-subroutine read_water_refindex(infilename)
-
- ! read water refractive index file and set module data
-
- character*(*), intent(in) :: infilename ! modal optics filename
-
- ! Local variables
-
- integer :: i, ierr
- type(file_desc_t) :: ncid ! pio file handle
- integer :: did ! dimension ids
- integer :: dimlen ! dimension lengths
- type(var_desc_t) :: vid ! variable ids
- real(r8) :: refrwsw(nswbands), refiwsw(nswbands) ! real, imaginary ref index for water visible
- real(r8) :: refrwlw(nlwbands), refiwlw(nlwbands) ! real, imaginary ref index for water infrared
- !----------------------------------------------------------------------------
-
- ! open file
- call cam_pio_openfile(ncid, infilename, PIO_NOWRITE)
-
- ! inquire dimensions. Check that file values match parameter values.
-
- ierr = pio_inq_dimid(ncid, 'lw_band', did)
- ierr = pio_inq_dimlen(ncid, did, dimlen)
- if (dimlen .ne. nlwbands) then
- write(iulog,*) 'lw_band len=', dimlen, ' from ', infilename, ' ne nlwbands=', nlwbands
- call endrun('read_modal_optics: bad lw_band value')
- endif
-
- ierr = pio_inq_dimid(ncid, 'sw_band', did)
- ierr = pio_inq_dimlen(ncid, did, dimlen)
- if (dimlen .ne. nswbands) then
- write(iulog,*) 'sw_band len=', dimlen, ' from ', infilename, ' ne nswbands=', nswbands
- call endrun('read_modal_optics: bad sw_band value')
- endif
-
- ! read variables
- ierr = pio_inq_varid(ncid, 'refindex_real_water_sw', vid)
- ierr = pio_get_var(ncid, vid, refrwsw)
-
- ierr = pio_inq_varid(ncid, 'refindex_im_water_sw', vid)
- ierr = pio_get_var(ncid, vid, refiwsw)
-
- ierr = pio_inq_varid(ncid, 'refindex_real_water_lw', vid)
- ierr = pio_get_var(ncid, vid, refrwlw)
-
- ierr = pio_inq_varid(ncid, 'refindex_im_water_lw', vid)
- ierr = pio_get_var(ncid, vid, refiwlw)
-
- ! set complex representation of refractive indices as module data
- do i = 1, nswbands
- crefwsw(i) = cmplx(refrwsw(i), abs(refiwsw(i)),kind=r8)
- end do
- do i = 1, nlwbands
- crefwlw(i) = cmplx(refrwlw(i), abs(refiwlw(i)),kind=r8)
- end do
-
- call pio_closefile(ncid)
-
-end subroutine read_water_refindex
-
-!===============================================================================
-
-subroutine modal_size_parameters(ncol, sigma_logr_aer, dgnumwet, radsurf, logradsurf, cheb)
-
- integer, intent(in) :: ncol
- real(r8), intent(in) :: sigma_logr_aer ! geometric standard deviation of number distribution
- real(r8), intent(in) :: dgnumwet(:,:) ! aerosol wet number mode diameter (m)
- real(r8), intent(out) :: radsurf(:,:) ! aerosol surface mode radius
- real(r8), intent(out) :: logradsurf(:,:) ! log(aerosol surface mode radius)
- real(r8), intent(out) :: cheb(:,:,:)
-
- integer :: i, k, nc
- real(r8) :: alnsg_amode
- real(r8) :: explnsigma
- real(r8) :: xrad(pcols) ! normalized aerosol radius
- !-------------------------------------------------------------------------------
-
- alnsg_amode = log(sigma_logr_aer)
- explnsigma = exp(2.0_r8*alnsg_amode*alnsg_amode)
-
- do k = top_lev, pver
- do i = 1, ncol
- ! convert from number mode diameter to surface area
- radsurf(i,k) = 0.5_r8*dgnumwet(i,k)*explnsigma
- logradsurf(i,k) = log(radsurf(i,k))
- ! normalize size parameter
- xrad(i) = max(logradsurf(i,k),xrmin)
- xrad(i) = min(xrad(i),xrmax)
- xrad(i) = (2._r8*xrad(i)-xrmax-xrmin)/(xrmax-xrmin)
- ! chebyshev polynomials
- cheb(1,i,k) = 1._r8
- cheb(2,i,k) = xrad(i)
- do nc = 3, ncoef
- cheb(nc,i,k) = 2._r8*xrad(i)*cheb(nc-1,i,k)-cheb(nc-2,i,k)
- end do
- end do
- end do
-
-end subroutine modal_size_parameters
-
-!===============================================================================
-
- subroutine binterp(table,ncol,km,im,jm,x,y,xtab,ytab,ix,jy,t,u,out)
-
- ! bilinear interpolation of table
- !
- implicit none
- integer im,jm,km,ncol
- real(r8) table(km,im,jm),xtab(im),ytab(jm),out(pcols,km)
- integer i,ix(pcols),ip1,j,jy(pcols),jp1,k,ic,ip1m(pcols),jp1m(pcols),ixc,jyc
- real(r8) x(pcols),dx,t(pcols),y(pcols),dy,u(pcols),tu(pcols),tuc(pcols),tcu(pcols),tcuc(pcols)
-
- if(ix(1).gt.0) go to 30
- if(im.gt.1)then
- do ic=1,ncol
- do i=1,im
- if(x(ic).lt.xtab(i))go to 10
- enddo
- 10 ix(ic)=max0(i-1,1)
- ip1=min(ix(ic)+1,im)
- dx=(xtab(ip1)-xtab(ix(ic)))
- if(abs(dx).gt.1.e-20_r8)then
- t(ic)=(x(ic)-xtab(ix(ic)))/dx
- else
- t(ic)=0._r8
- endif
- end do
- else
- ix(:ncol)=1
- t(:ncol)=0._r8
- endif
- if(jm.gt.1)then
- do ic=1,ncol
- do j=1,jm
- if(y(ic).lt.ytab(j))go to 20
- enddo
- 20 jy(ic)=max0(j-1,1)
- jp1=min(jy(ic)+1,jm)
- dy=(ytab(jp1)-ytab(jy(ic)))
- if(abs(dy).gt.1.e-20_r8)then
- u(ic)=(y(ic)-ytab(jy(ic)))/dy
- else
- u(ic)=0._r8
- endif
- end do
- else
- jy(:ncol)=1
- u(:ncol)=0._r8
- endif
- 30 continue
- do ic=1,ncol
- tu(ic)=t(ic)*u(ic)
- tuc(ic)=t(ic)-tu(ic)
- tcuc(ic)=1._r8-tuc(ic)-u(ic)
- tcu(ic)=u(ic)-tu(ic)
- jp1m(ic)=min(jy(ic)+1,jm)
- ip1m(ic)=min(ix(ic)+1,im)
- enddo
- do ic=1,ncol
- jyc=jy(ic)
- ixc=ix(ic)
- jp1=jp1m(ic)
- ip1=ip1m(ic)
- do k=1,km
- out(ic,k) = tcuc(ic) * table(k,ixc,jyc) + tuc(ic) * table(k,ip1,jyc) + &
- tu(ic) * table(k,ip1,jp1) + tcu(ic) * table(k,ixc,jp1)
- end do
- end do
- return
- end subroutine binterp
-
-end module modal_aer_opt
diff --git a/src/physics/cam/ndrop.F90 b/src/physics/cam/ndrop.F90
index 55de7de42d..9eea87d218 100644
--- a/src/physics/cam/ndrop.F90
+++ b/src/physics/cam/ndrop.F90
@@ -172,7 +172,7 @@ end subroutine ndrop_init
!===============================================================================
subroutine dropmixnuc( aero_props, aero_state, &
- state, ptend, dtmicro, pbuf, wsub, &
+ state, ptend, dtmicro, pbuf, wsub, wmixmin, &
cldn, cldo, cldliqf, tendnd, factnum, from_spcam)
! vertical diffusion and nucleation of cloud droplets
@@ -183,6 +183,7 @@ subroutine dropmixnuc( aero_props, aero_state, &
type(physics_state), target, intent(in) :: state
type(physics_ptend), intent(out) :: ptend
real(r8), intent(in) :: dtmicro ! time step for microphysics (s)
+ real(r8), intent(in) :: wmixmin ! minimum turbulence vertical velocity (m/s)
type(physics_buffer_desc), pointer :: pbuf(:)
@@ -221,9 +222,7 @@ subroutine dropmixnuc( aero_props, aero_state, &
real(r8) :: raertend(pver) ! tendency of aerosol mass, number mixing ratios
real(r8) :: qqcwtend(pver) ! tendency of cloudborne aerosol mass, number mixing ratios
-
real(r8), parameter :: zkmin = 0.01_r8, zkmax = 100._r8
- real(r8), parameter :: wmixmin = 0.1_r8 ! minimum turbulence vertical velocity (m/s)
integer :: i, k, l, m, mm, n
integer :: km1, kp1
integer :: nnew, nsav, ntemp
diff --git a/src/physics/cam/nucleate_ice_cam.F90 b/src/physics/cam/nucleate_ice_cam.F90
index 4abd115826..922e871b72 100644
--- a/src/physics/cam/nucleate_ice_cam.F90
+++ b/src/physics/cam/nucleate_ice_cam.F90
@@ -482,11 +482,7 @@ subroutine nucleate_ice_cam_calc( &
ni => state%q(:,:,numice_idx)
pmid => state%pmid
- do k = top_lev, pver
- do i = 1, ncol
- rho(i,k) = pmid(i,k)/(rair*t(i,k))
- end do
- end do
+ rho(:ncol,:) = pmid(:ncol,:)/(rair*t(:ncol,:))
if (clim_modal_aero) then
diff --git a/src/physics/cam/phys_control.F90 b/src/physics/cam/phys_control.F90
index f760bdf34a..92ccac1335 100644
--- a/src/physics/cam/phys_control.F90
+++ b/src/physics/cam/phys_control.F90
@@ -56,9 +56,8 @@ module phys_control
logical :: history_aerosol = .false. ! output the MAM aerosol variables and tendencies
logical :: history_aero_optics = .false. ! output the aerosol
logical :: history_eddy = .false. ! output the eddy variables
-logical :: history_budget = .false. ! output tendencies and state variables for CAM4
- ! temperature, water vapor, cloud ice and cloud
- ! liquid budgets.
+logical :: history_budget = .false. ! output tendencies and state variables for T, water vapor,
+ ! cloud ice and cloud liquid budgets
logical :: convproc_do_aer = .false. ! switch for new convective scavenging treatment for modal aerosols
integer :: history_budget_histfile_num = 1 ! output history file number for budget fields
@@ -73,6 +72,8 @@ module phys_control
logical :: history_chemspecies_srf = .false.
logical :: do_clubb_sgs
+logical :: do_hb_above_clubb = .false. ! enable HB vertical mixing above clubb top
+
! Check validity of physics_state objects in physics_update.
logical :: state_debug_checks = .false.
@@ -137,7 +138,7 @@ subroutine phys_ctl_readnl(nlfile)
do_clubb_sgs, state_debug_checks, use_hetfrz_classnuc, use_gw_oro, use_gw_front, &
use_gw_front_igw, use_gw_convect_dp, use_gw_convect_sh, cld_macmic_num_steps, &
offline_driver, convproc_do_aer, cam_snapshot_before_num, cam_snapshot_after_num, &
- cam_take_snapshot_before, cam_take_snapshot_after, cam_physics_mesh, use_hemco
+ cam_take_snapshot_before, cam_take_snapshot_after, cam_physics_mesh, use_hemco, do_hb_above_clubb
!-----------------------------------------------------------------------------
if (masterproc) then
@@ -200,6 +201,7 @@ subroutine phys_ctl_readnl(nlfile)
call mpi_bcast(cam_take_snapshot_before, len(cam_take_snapshot_before), mpi_character, masterprocid, mpicom, ierr)
call mpi_bcast(cam_take_snapshot_after, len(cam_take_snapshot_after), mpi_character, masterprocid, mpicom, ierr)
call mpi_bcast(cam_physics_mesh, len(cam_physics_mesh), mpi_character, masterprocid, mpicom, ierr)
+ call mpi_bcast(do_hb_above_clubb, 1, mpi_logical, masterprocid, mpicom, ierr)
call mpi_bcast(use_hemco, 1, mpi_logical, masterprocid, mpicom, ierr)
use_spcam = ( cam_physpkg_is('spcam_sam1mom') &
@@ -258,6 +260,12 @@ subroutine phys_ctl_readnl(nlfile)
end if
end if
+ ! do_hb_above_clubb requires that CLUBB is being used
+ if (do_hb_above_clubb .and. .not. do_clubb_sgs) then
+ write(iulog,*)'do_hb_above_clubb requires CLUBB to be active'
+ call endrun('do_hb_above_clubb incompatible with do_clubb_sgs = .false.')
+ endif
+
! Macro/micro co-substepping support.
if (cld_macmic_num_steps > 1) then
if (microp_scheme /= "MG" .or. (macrop_scheme /= "park" .and. macrop_scheme /= "CLUBB_SGS")) then
@@ -316,7 +324,7 @@ subroutine phys_getopts(deep_scheme_out, shallow_scheme_out, eddy_scheme_out, mi
cam_chempkg_out, prog_modal_aero_out, macrop_scheme_out, &
do_clubb_sgs_out, use_spcam_out, state_debug_checks_out, cld_macmic_num_steps_out, &
offline_driver_out, convproc_do_aer_out, cam_snapshot_before_num_out, cam_snapshot_after_num_out,&
- cam_take_snapshot_before_out, cam_take_snapshot_after_out, physics_grid_out, use_hemco_out)
+ cam_take_snapshot_before_out, cam_take_snapshot_after_out, physics_grid_out, do_hb_above_clubb_out)
!-----------------------------------------------------------------------
! Purpose: Return runtime settings
! deep_scheme_out : deep convection scheme
@@ -364,7 +372,7 @@ subroutine phys_getopts(deep_scheme_out, shallow_scheme_out, eddy_scheme_out, mi
character(len=32), intent(out), optional :: cam_take_snapshot_before_out
character(len=32), intent(out), optional :: cam_take_snapshot_after_out
character(len=cl), intent(out), optional :: physics_grid_out
- logical, intent(out), optional :: use_hemco_out
+ logical, intent(out), optional :: do_hb_above_clubb_out
if ( present(deep_scheme_out ) ) deep_scheme_out = deep_scheme
if ( present(shallow_scheme_out ) ) shallow_scheme_out = shallow_scheme
@@ -404,7 +412,7 @@ subroutine phys_getopts(deep_scheme_out, shallow_scheme_out, eddy_scheme_out, mi
if ( present(cam_take_snapshot_before_out) ) cam_take_snapshot_before_out = cam_take_snapshot_before
if ( present(cam_take_snapshot_after_out ) ) cam_take_snapshot_after_out = cam_take_snapshot_after
if ( present(physics_grid_out ) ) physics_grid_out = cam_physics_mesh
- if ( present(use_hemco_out ) ) use_hemco_out = use_hemco
+ if ( present(do_hb_above_clubb_out ) ) do_hb_above_clubb_out = do_hb_above_clubb
end subroutine phys_getopts
diff --git a/src/physics/cam/phys_grid.F90 b/src/physics/cam/phys_grid.F90
index 712421550d..ca1670e4c2 100644
--- a/src/physics/cam/phys_grid.F90
+++ b/src/physics/cam/phys_grid.F90
@@ -498,6 +498,9 @@ subroutine phys_grid_init( )
! column surface area (from dynamics)
real(r8), dimension(:), pointer :: area_d
+ ! column surface areawt (from dynamics)
+ real(r8), dimension(:), pointer :: areawt_d
+
! column integration weight (from dynamics)
real(r8), dimension(:), allocatable :: wght_d
@@ -1147,7 +1150,6 @@ subroutine phys_grid_init( )
! Note that if the dycore is using the same points as the physics grid,
! it will have already set up 'lat' and 'lon' axes for the physics grid
! However, these will be in the dynamics decomposition
-
if (unstructured) then
lon_coord => horiz_coord_create('lon', 'ncol', num_global_phys_cols, &
'longitude', 'degrees_east', 1, size(lonvals), lonvals, &
@@ -1188,13 +1190,13 @@ subroutine phys_grid_init( )
do i = 1, size(copy_attributes)
call cam_grid_attribute_copy(copy_gridname, 'physgrid', copy_attributes(i))
end do
-
if ((.not. cam_grid_attr_exists('physgrid', 'area')) .and. unstructured) then
! Physgrid always needs an area attribute. If we did not inherit one
! from the dycore (i.e., physics and dynamics are on different grids),
! create that attribute here (unstructured grids only, physgrid is
! not supported for structured grids).
allocate(area_d(size(grid_map, 2)))
+ allocate(areawt_d(size(grid_map, 2)))
p = 0
do lcid = begchunk, endchunk
ncols = lchunks(lcid)%ncols
@@ -1203,16 +1205,21 @@ subroutine phys_grid_init( )
cid = lchunks(lcid)%cid
do i = 1, chunks(cid)%ncols
area_d(p + i) = lchunks(lcid)%area(i)
+ areawt_d(p + i) = lchunks(lcid)%wght(i)
end do
if (pcols > ncols) then
! Need to set these to detect unused columns
area_d(p+ncols+1:p+pcols) = 0.0_r8
+ areawt_d(p+ncols+1:p+pcols) = 0.0_r8
end if
p = p + pcols
end do
call cam_grid_attribute_register('physgrid', 'area', &
'physics column areas', 'ncol', area_d, map=grid_map(3,:))
+ call cam_grid_attribute_register('physgrid', 'areawt', &
+ 'physics column area wts', 'ncol', areawt_d, map=grid_map(3,:))
nullify(area_d) ! Belongs to attribute now
+ nullify(areawt_d) ! Belongs to attribute now
end if
! Cleanup pointers (they belong to the grid now)
nullify(grid_map)
diff --git a/src/physics/cam/phys_grid_ctem.F90 b/src/physics/cam/phys_grid_ctem.F90
index e2d0cb5c71..6863799864 100644
--- a/src/physics/cam/phys_grid_ctem.F90
+++ b/src/physics/cam/phys_grid_ctem.F90
@@ -140,7 +140,7 @@ subroutine phys_grid_ctem_reg
real(r8), parameter :: latrad0 = -pi*0.5_r8
real(r8), parameter :: fourpi = pi*4._r8
- integer, parameter :: ctem_zavg_phys_decomp = 201 ! Must be unique within CAM
+ integer, parameter :: ctem_zavg_phys_decomp = 333 ! Must be unique within CAM
if (.not.do_tem_diags) return
@@ -207,11 +207,15 @@ subroutine phys_grid_ctem_init
if (.not.do_tem_diags) return
- call addfld ('VTHzaphys',(/'lev'/), 'A', 'K m s-1','Meridional Heat Flux:', gridname='ctem_zavg_phys')
- call addfld ('WTHzaphys',(/'lev'/), 'A', 'K m s-1','Vertical Heat Flux:', gridname='ctem_zavg_phys')
- call addfld ('UVzaphys', (/'lev'/), 'A', 'm2 s-2', 'Meridional Flux of Zonal Momentum', gridname='ctem_zavg_phys')
- call addfld ('UWzaphys', (/'lev'/), 'A', 'm2 s-2', 'Vertical Flux of Zonal Momentum', gridname='ctem_zavg_phys')
- call addfld ('THphys', (/'lev'/), 'A', 'K', 'Potential temp', gridname='physgrid' )
+ call addfld ('Uzm', (/'lev'/), 'A','m s-1', 'Zonal-Mean zonal wind', gridname='ctem_zavg_phys' )
+ call addfld ('Vzm', (/'lev'/), 'A','m s-1', 'Zonal-Mean meridional wind', gridname='ctem_zavg_phys' )
+ call addfld ('Wzm', (/'lev'/), 'A','m s-1', 'Zonal-Mean vertical wind', gridname='ctem_zavg_phys' )
+ call addfld ('THzm', (/'lev'/), 'A','K', 'Zonal-Mean potential temp', gridname='ctem_zavg_phys' )
+ call addfld ('VTHzm',(/'lev'/), 'A','K m s-1','Meridional Heat Flux:', gridname='ctem_zavg_phys')
+ call addfld ('WTHzm',(/'lev'/), 'A','K m s-1','Vertical Heat Flux:', gridname='ctem_zavg_phys')
+ call addfld ('UVzm', (/'lev'/), 'A','m2 s-2', 'Meridional Flux of Zonal Momentum', gridname='ctem_zavg_phys')
+ call addfld ('UWzm', (/'lev'/), 'A','m2 s-2', 'Vertical Flux of Zonal Momentum', gridname='ctem_zavg_phys')
+ call addfld ('THphys',(/'lev'/), 'A', 'K', 'Potential temp', gridname='physgrid' )
end subroutine phys_grid_ctem_init
@@ -251,6 +255,11 @@ subroutine phys_grid_ctem_diags(phys_state)
real(r8) :: vthza(nzalat,pver)
real(r8) :: wthza(nzalat,pver)
+ real(r8) :: uza(nzalat,pver)
+ real(r8) :: vza(nzalat,pver)
+ real(r8) :: wza(nzalat,pver)
+ real(r8) :: thza(nzalat,pver)
+
real(r8) :: sheight(pcols,pver) ! pressure scale height (m)
if (.not.do_calc()) return
@@ -311,12 +320,26 @@ subroutine phys_grid_ctem_diags(phys_state)
if (any(abs(vthza)>1.e20_r8)) call endrun(prefix//'bad values in vthza')
if (any(abs(wthza)>1.e20_r8)) call endrun(prefix//'bad values in wthza')
+ call ZAobj%binAvg(uzm, uza)
+ call ZAobj%binAvg(vzm, vza)
+ call ZAobj%binAvg(wzm, wza)
+ call ZAobj%binAvg(thzm, thza)
+
+ if (any(abs(uza)>1.e20_r8)) call endrun(prefix//'bad values in uza')
+ if (any(abs(vza)>1.e20_r8)) call endrun(prefix//'bad values in vza')
+ if (any(abs(wza)>1.e20_r8)) call endrun(prefix//'bad values in wza')
+ if (any(abs(thza)>1.e20_r8)) call endrun(prefix//'bad values in thza')
+
! diagnostic output
do j = 1,nzalat
- call outfld('UVzaphys',uvza(j,:),1,j)
- call outfld('UWzaphys',uwza(j,:),1,j)
- call outfld('VTHzaphys',vthza(j,:),1,j)
- call outfld('WTHzaphys',wthza(j,:),1,j)
+ call outfld('Uzm',uza(j,:),1,j)
+ call outfld('Vzm',vza(j,:),1,j)
+ call outfld('Wzm',wza(j,:),1,j)
+ call outfld('THzm',thza(j,:),1,j)
+ call outfld('UVzm',uvza(j,:),1,j)
+ call outfld('UWzm',uwza(j,:),1,j)
+ call outfld('VTHzm',vthza(j,:),1,j)
+ call outfld('WTHzm',wthza(j,:),1,j)
end do
contains
diff --git a/src/physics/cam/physics_types.F90 b/src/physics/cam/physics_types.F90
index dcda2e8906..9b0c23d2ff 100644
--- a/src/physics/cam/physics_types.F90
+++ b/src/physics/cam/physics_types.F90
@@ -6,7 +6,7 @@ module physics_types
use shr_kind_mod, only: r8 => shr_kind_r8
use ppgrid, only: pcols, pver
use constituents, only: pcnst, qmin, cnst_name, cnst_get_ind
- use geopotential, only: geopotential_dse, geopotential_t
+ use geopotential, only: geopotential_t
use physconst, only: zvir, gravit, cpair, rair
use air_composition, only: cpairv, rairv
use phys_grid, only: get_ncols_p, get_rlon_all_p, get_rlat_all_p, get_gcol_all_p
@@ -18,8 +18,6 @@ module physics_types
implicit none
private ! Make default type private to the module
- logical, parameter :: adjust_te = .FALSE.
-
! Public types:
public physics_state
@@ -210,10 +208,11 @@ subroutine physics_update(state, ptend, dt, tend)
!-----------------------------------------------------------------------
! Update the state and or tendency structure with the parameterization tendencies
!-----------------------------------------------------------------------
- use scamMod, only: scm_crm_mode, single_column
- use phys_control, only: phys_getopts
- use cam_thermo, only: cam_thermo_update ! Routine which updates physconst variables (WACCM-X)
- use qneg_module, only: qneg3
+ use scamMod, only: scm_crm_mode, single_column
+ use phys_control, only: phys_getopts
+ use cam_thermo, only: cam_thermo_dry_air_update ! Routine which updates physconst variables (WACCM-X)
+ use air_composition, only: dry_air_species_num
+ use qneg_module , only: qneg3
!------------------------------Arguments--------------------------------
type(physics_ptend), intent(inout) :: ptend ! Parameterization tendencies
@@ -377,9 +376,8 @@ subroutine physics_update(state, ptend, dt, tend)
!------------------------------------------------------------------------
! Get indices for molecular weights and call WACCM-X cam_thermo_update
!------------------------------------------------------------------------
- if ( waccmx_is('ionosphere') .or. waccmx_is('neutral') ) then
- call cam_thermo_update(state%q, state%t, state%lchnk, state%ncol, &
- to_moist_factor=state%pdeldry(:ncol,:)/state%pdel(:ncol,:) )
+ if (dry_air_species_num>0) then
+ call cam_thermo_dry_air_update(state%q, state%t, state%lchnk, state%ncol)
endif
!-----------------------------------------------------------------------
@@ -426,7 +424,7 @@ subroutine physics_update(state, ptend, dt, tend)
if (ptend%ls .or. ptend%lq(1)) then
call geopotential_t ( &
state%lnpint, state%lnpmid, state%pint , state%pmid , state%pdel , state%rpdel , &
- state%t , state%q(:,:,1), rairv_loc(:,:), gravit , zvirv , &
+ state%t , state%q(:,:,:), rairv_loc(:,:), gravit , zvirv , &
state%zi , state%zm , ncol )
! update dry static energy for use in next process
do k = ptend%top_level, ptend%bot_level
@@ -1192,7 +1190,10 @@ subroutine physics_cnst_limit(state)
end subroutine physics_cnst_limit
!===============================================================================
- subroutine physics_dme_adjust(state, tend, qini, dt)
+ subroutine physics_dme_adjust(state, tend, qini, liqini, iceini, dt)
+ use air_composition, only: dry_air_species_num,thermodynamic_active_species_num
+ use air_composition, only: thermodynamic_active_species_idx
+ use dycore, only: dycore_is
!-----------------------------------------------------------------------
!
! Purpose: Adjust the dry mass in each layer back to the value of physics input state
@@ -1224,6 +1225,8 @@ subroutine physics_dme_adjust(state, tend, qini, dt)
type(physics_state), intent(inout) :: state
type(physics_tend ), intent(inout) :: tend
real(r8), intent(in ) :: qini(pcols,pver) ! initial specific humidity
+ real(r8), intent(in ) :: liqini(pcols,pver) ! initial total liquid
+ real(r8), intent(in ) :: iceini(pcols,pver) ! initial total ice
real(r8), intent(in ) :: dt ! model physics timestep
!
!---------------------------Local workspace-----------------------------
@@ -1238,16 +1241,18 @@ subroutine physics_dme_adjust(state, tend, qini, dt)
real(r8) :: zvirv(pcols,pver) ! Local zvir array pointer
+ real(r8) :: tot_water (pcols,2) ! total water (initial, present)
+ real(r8) :: tot_water_chg(pcols) ! total water change
+
+
real(r8),allocatable :: cpairv_loc(:,:)
+ integer :: m_cnst
!
!-----------------------------------------------------------------------
if (state%psetcols .ne. pcols) then
call endrun('physics_dme_adjust: cannot pass in a state which has sub-columns')
end if
- if (adjust_te) then
- call endrun('physics_dme_adjust: must update code based on the "correct" energy before turning on "adjust_te"')
- end if
lchnk = state%lchnk
ncol = state%ncol
@@ -1255,76 +1260,57 @@ subroutine physics_dme_adjust(state, tend, qini, dt)
! adjust dry mass in each layer back to input value, while conserving
! constituents, momentum, and total energy
state%ps(:ncol) = state%pint(:ncol,1)
- do k = 1, pver
- ! adjusment factor is just change in water vapor
- fdq(:ncol) = 1._r8 + state%q(:ncol,k,1) - qini(:ncol,k)
-
- ! adjust constituents to conserve mass in each layer
- do m = 1, pcnst
+ !
+ ! original code for backwards compatability with FV and EUL
+ !
+ if (.not.(dycore_is('MPAS') .or. dycore_is('SE'))) then
+ do k = 1, pver
+
+ ! adjusment factor is just change in water vapor
+ fdq(:ncol) = 1._r8 + state%q(:ncol,k,1) - qini(:ncol,k)
+
+ ! adjust constituents to conserve mass in each layer
+ do m = 1, pcnst
state%q(:ncol,k,m) = state%q(:ncol,k,m) / fdq(:ncol)
- end do
-
- if (adjust_te) then
- ! compute specific total energy of unadjusted state (J/kg)
- te(:ncol) = state%s(:ncol,k) + 0.5_r8*(state%u(:ncol,k)**2 + state%v(:ncol,k)**2)
-
- ! recompute initial u,v from the new values and the tendencies
- utmp(:ncol) = state%u(:ncol,k) - dt * tend%dudt(:ncol,k)
- vtmp(:ncol) = state%v(:ncol,k) - dt * tend%dvdt(:ncol,k)
- ! adjust specific total energy and specific momentum (velocity) to conserve each
- te (:ncol) = te (:ncol) / fdq(:ncol)
- state%u(:ncol,k) = state%u(:ncol,k ) / fdq(:ncol)
- state%v(:ncol,k) = state%v(:ncol,k ) / fdq(:ncol)
- ! compute adjusted u,v tendencies
- tend%dudt(:ncol,k) = (state%u(:ncol,k) - utmp(:ncol)) / dt
- tend%dvdt(:ncol,k) = (state%v(:ncol,k) - vtmp(:ncol)) / dt
-
- ! compute adjusted static energy
- state%s(:ncol,k) = te(:ncol) - 0.5_r8*(state%u(:ncol,k)**2 + state%v(:ncol,k)**2)
- end if
-
-! compute new total pressure variables
- state%pdel (:ncol,k ) = state%pdel(:ncol,k ) * fdq(:ncol)
- state%ps(:ncol) = state%ps(:ncol) + state%pdel(:ncol,k)
- state%pint (:ncol,k+1) = state%pint(:ncol,k ) + state%pdel(:ncol,k)
- state%lnpint(:ncol,k+1) = log(state%pint(:ncol,k+1))
- state%rpdel (:ncol,k ) = 1._r8/ state%pdel(:ncol,k )
- end do
-
+ end do
+ ! compute new total pressure variables
+ state%pdel (:ncol,k ) = state%pdel(:ncol,k ) * fdq(:ncol)
+ state%ps(:ncol) = state%ps(:ncol) + state%pdel(:ncol,k)
+ state%pint (:ncol,k+1) = state%pint(:ncol,k ) + state%pdel(:ncol,k)
+ state%lnpint(:ncol,k+1) = log(state%pint(:ncol,k+1))
+ state%rpdel (:ncol,k ) = 1._r8/ state%pdel(:ncol,k )
+ end do
+ else
+ do k = 1, pver
+ tot_water(:ncol,1) = qini(:ncol,k) +liqini(:ncol,k)+iceini(:ncol,k) !initial total H2O
+ tot_water(:ncol,2) = 0.0_r8
+ do m_cnst=dry_air_species_num+1,thermodynamic_active_species_num
+ m = thermodynamic_active_species_idx(m_cnst)
+ tot_water(:ncol,2) = tot_water(:ncol,2)+state%q(:ncol,k,m)
+ end do
+ fdq(:ncol) = 1._r8 + tot_water(:ncol,2) - tot_water(:ncol,1)
+ ! adjust constituents to conserve mass in each layer
+ do m = 1, pcnst
+ state%q(:ncol,k,m) = state%q(:ncol,k,m) / fdq(:ncol)
+ end do
+ ! compute new total pressure variables
+ state%pdel (:ncol,k ) = state%pdel(:ncol,k ) * fdq(:ncol)
+ state%ps(:ncol) = state%ps(:ncol) + state%pdel(:ncol,k)
+ state%pint (:ncol,k+1) = state%pint(:ncol,k ) + state%pdel(:ncol,k)
+ state%lnpint(:ncol,k+1) = log(state%pint(:ncol,k+1))
+ state%rpdel (:ncol,k ) = 1._r8/ state%pdel(:ncol,k )
+ !note that mid-level variables (e.g. pmid) are not recomputed
+ end do
+ endif
if ( waccmx_is('ionosphere') .or. waccmx_is('neutral') ) then
zvirv(:,:) = shr_const_rwv / rairv(:,:,state%lchnk) - 1._r8
else
zvirv(:,:) = zvir
endif
-! compute new T,z from new s,q,dp
- if (adjust_te) then
-
-! cpairv_loc needs to be allocated to a size which matches state and ptend
-! If psetcols == pcols, cpairv is the correct size and just copy into cpairv_loc
-! If psetcols > pcols and all cpairv match cpair, then assign the constant cpair
-
- allocate(cpairv_loc(state%psetcols,pver))
- if (state%psetcols == pcols) then
- cpairv_loc(:,:) = cpairv(:,:,state%lchnk)
- else if (state%psetcols > pcols .and. all(cpairv(:,:,:) == cpair)) then
- cpairv_loc(:,:) = cpair
- else
- call endrun('physics_dme_adjust: cpairv is not allowed to vary when subcolumns are turned on')
- end if
-
- call geopotential_dse(state%lnpint, state%lnpmid, state%pint, &
- state%pmid , state%pdel , state%rpdel, &
- state%s , state%q(:,:,1), state%phis , rairv(:,:,state%lchnk), &
- gravit, cpairv_loc(:,:), zvirv, &
- state%t , state%zi , state%zm , ncol)
-
- deallocate(cpairv_loc)
-
- end if
-
end subroutine physics_dme_adjust
+
!-----------------------------------------------------------------------
!===============================================================================
@@ -1537,7 +1523,7 @@ end subroutine set_dry_to_wet
subroutine physics_state_alloc(state,lchnk,psetcols)
- use infnan, only : inf, assignment(=)
+ use infnan, only: inf, assignment(=)
! allocate the individual state components
diff --git a/src/physics/cam/physpkg.F90 b/src/physics/cam/physpkg.F90
index 4eb73818f8..c7d5b2524b 100644
--- a/src/physics/cam/physpkg.F90
+++ b/src/physics/cam/physpkg.F90
@@ -13,7 +13,7 @@ module physpkg
use shr_kind_mod, only: r8 => shr_kind_r8
use spmd_utils, only: masterproc
- use physconst, only: latvap, latice, rh2o
+ use physconst, only: latvap, latice
use physics_types, only: physics_state, physics_tend, physics_state_set_grid, &
physics_ptend, physics_tend_init, physics_update, &
physics_type_alloc, physics_ptend_dealloc,&
@@ -21,7 +21,7 @@ module physpkg
use phys_grid, only: get_ncols_p
use phys_gmean, only: gmean_mass
use ppgrid, only: begchunk, endchunk, pcols, pver, pverp, psubcols
- use constituents, only: pcnst, cnst_name, cnst_get_ind
+ use constituents, only: pcnst, cnst_get_ind
use camsrfexch, only: cam_out_t, cam_in_t
use cam_control_mod, only: ideal_phys, adiabatic
@@ -32,6 +32,8 @@ module physpkg
use cam_logfile, only: iulog
use camsrfexch, only: cam_export
+ use phys_control, only: use_hemco ! Use Harmonized Emissions Component (HEMCO)
+
use modal_aero_calcsize, only: modal_aero_calcsize_init, modal_aero_calcsize_diag, modal_aero_calcsize_reg
use modal_aero_wateruptake, only: modal_aero_wateruptake_init, modal_aero_wateruptake_dr, modal_aero_wateruptake_reg
@@ -63,7 +65,6 @@ module physpkg
logical :: state_debug_checks ! Debug physics_state.
logical :: clim_modal_aero ! climate controled by prognostic or prescribed modal aerosols
logical :: prog_modal_aero ! Prognostic modal aerosols present
- logical :: use_hemco ! Use Harmonized Emissions Component (HEMCO)
! Physics buffer index
integer :: teout_idx = 0
@@ -75,6 +76,8 @@ module physpkg
integer :: qini_idx = 0
integer :: cldliqini_idx = 0
integer :: cldiceini_idx = 0
+ integer :: totliqini_idx = 0
+ integer :: toticeini_idx = 0
integer :: prec_str_idx = 0
integer :: snow_str_idx = 0
@@ -110,11 +113,11 @@ subroutine phys_register
use physics_buffer, only: pbuf_init_time, pbuf_cam_snapshot_register
use physics_buffer, only: pbuf_add_field, dtype_r8, pbuf_register_subcol
use shr_kind_mod, only: r8 => shr_kind_r8
- use spmd_utils, only: masterproc
- use constituents, only: pcnst, cnst_add, cnst_chk_dim, cnst_name
+ use constituents, only: pcnst, cnst_add, cnst_chk_dim
use cam_control_mod, only: moist_physics
use chemistry, only: chem_register
+ use mo_lightning, only: lightning_register
use cloud_fraction, only: cldfrc_register
use rk_stratiform, only: rk_stratiform_register
use microp_driver, only: microp_driver_register
@@ -122,7 +125,7 @@ subroutine phys_register
use macrop_driver, only: macrop_driver_register
use clubb_intr, only: clubb_register_cam
use conv_water, only: conv_water_register
- use physconst, only: mwdry, cpair, mwh2o, cpwv
+ use physconst, only: mwh2o, cpwv
use tracers, only: tracers_register
use check_energy, only: check_energy_register
use carma_intr, only: carma_register
@@ -137,7 +140,6 @@ subroutine phys_register
use flux_avg, only: flux_avg_register
use iondrag, only: iondrag_register
use waccmx_phys_intr, only: waccmx_phys_ion_elec_temp_reg
- use string_utils, only: to_lower
use prescribed_ozone, only: prescribed_ozone_register
use prescribed_volcaero,only: prescribed_volcaero_register
use prescribed_strataero,only: prescribed_strataero_register
@@ -178,8 +180,7 @@ subroutine phys_register
cam_take_snapshot_before_out= cam_take_snapshot_before, &
cam_take_snapshot_after_out = cam_take_snapshot_after, &
cam_snapshot_before_num_out = cam_snapshot_before_num, &
- cam_snapshot_after_num_out = cam_snapshot_after_num, &
- use_hemco_out = use_hemco)
+ cam_snapshot_after_num_out = cam_snapshot_after_num)
subcol_scheme = subcol_get_scheme()
@@ -210,6 +211,8 @@ subroutine phys_register
call pbuf_add_field('QINI', 'physpkg', dtype_r8, (/pcols,pver/), qini_idx)
call pbuf_add_field('CLDLIQINI', 'physpkg', dtype_r8, (/pcols,pver/), cldliqini_idx)
call pbuf_add_field('CLDICEINI', 'physpkg', dtype_r8, (/pcols,pver/), cldiceini_idx)
+ call pbuf_add_field('TOTLIQINI', 'physpkg', dtype_r8, (/pcols,pver/), totliqini_idx)
+ call pbuf_add_field('TOTICEINI', 'physpkg', dtype_r8, (/pcols,pver/), toticeini_idx)
! check energy package
call check_energy_register
@@ -270,6 +273,9 @@ subroutine phys_register
! register chemical constituents including aerosols ...
call chem_register()
+ ! add prognostic lightning flash freq pbuf fld
+ call lightning_register()
+
! co2 constituents
call co2_register()
@@ -348,12 +354,9 @@ subroutine phys_register
call offline_driver_reg()
- if(use_hemco) then
- ! initialize harmonized emissions component (HEMCO). this will add
- ! pbuf fields so must go before pbuf_initialize. also, it must go
- ! before pbuf_cam_snapshot_register as pbuf fields are registered within
- ! hcoi_chunk_init here.
- call hcoi_chunk_init()
+ if (use_hemco) then
+ ! initialize harmonized emissions component (HEMCO)
+ call HCOI_Chunk_Init()
endif
! This needs to be last as it requires all pbuf fields to be added
@@ -370,7 +373,7 @@ end subroutine phys_register
subroutine phys_inidat( cam_out, pbuf2d )
use cam_abortutils, only: endrun
- use physics_buffer, only: pbuf_get_index, pbuf_get_field, physics_buffer_desc, pbuf_set_field, dyn_time_lvls
+ use physics_buffer, only: pbuf_get_index, physics_buffer_desc, pbuf_set_field, dyn_time_lvls
use cam_initfiles, only: initial_file_get_id, topo_file_get_id
@@ -386,11 +389,10 @@ subroutine phys_inidat( cam_out, pbuf2d )
type(cam_out_t), intent(inout) :: cam_out(begchunk:endchunk)
type(physics_buffer_desc), pointer :: pbuf2d(:,:)
- integer :: lchnk, m, n, i, k, ncol
+ integer :: lchnk, m, n, ncol
type(file_desc_t), pointer :: fh_ini, fh_topo
character(len=8) :: fieldname
real(r8), pointer :: tptr(:,:), tptr_2(:,:), tptr3d(:,:,:), tptr3d_2(:,:,:)
- real(r8), pointer :: qpert(:,:)
character(len=11) :: subname='phys_inidat' ! subroutine name
integer :: tpert_idx, qpert_idx, pblh_idx
@@ -717,9 +719,7 @@ subroutine phys_init( phys_state, phys_tend, pbuf2d, cam_in, cam_out )
!-----------------------------------------------------------------------
use physics_buffer, only: physics_buffer_desc, pbuf_initialize, pbuf_get_index
- use physconst, only: rair, cpair, gravit, stebol, tmelt, &
- latvap, latice, rh2o, rhoh2o, pstd, zvir, &
- karman, rhodair
+ use physconst, only: rair, cpair, gravit, zvir, karman
use cam_thermo, only: cam_thermo_init
use ref_pres, only: pref_edge, pref_mid
@@ -727,6 +727,7 @@ subroutine phys_init( phys_state, phys_tend, pbuf2d, cam_in, cam_out )
use cam_control_mod, only: initial_run
use check_energy, only: check_energy_init
use chemistry, only: chem_init
+ use mo_lightning, only: lightning_init
use prescribed_ozone, only: prescribed_ozone_init
use prescribed_ghg, only: prescribed_ghg_init
use prescribed_aero, only: prescribed_aero_init
@@ -759,14 +760,13 @@ subroutine phys_init( phys_state, phys_tend, pbuf2d, cam_in, cam_out )
use pbl_utils, only: pbl_utils_init
use vertical_diffusion, only: vertical_diffusion_init
use phys_debug_util, only: phys_debug_init
- use phys_debug, only: phys_debug_state_init
use rad_constituents, only: rad_cnst_init
use aer_rad_props, only: aer_rad_props_init
use subcol, only: subcol_init
use qbo, only: qbo_init
use qneg_module, only: qneg_init
use lunar_tides, only: lunar_tides_init
- use iondrag, only: iondrag_init, do_waccm_ions
+ use iondrag, only: iondrag_init
#if ( defined OFFLINE_DYN )
use metdata, only: metdata_phys_init
#endif
@@ -784,6 +784,9 @@ subroutine phys_init( phys_state, phys_tend, pbuf2d, cam_in, cam_out )
use cam_history, only: addfld, register_vector_field, add_default
use phys_control, only: phys_getopts
use phys_grid_ctem, only: phys_grid_ctem_init
+ use cam_budget, only: cam_budget_init
+
+ use ccpp_constituent_prop_mod, only: ccpp_const_props_init
! Input/output arguments
type(physics_state), pointer :: phys_state(:)
@@ -801,7 +804,6 @@ subroutine phys_init( phys_state, phys_tend, pbuf2d, cam_in, cam_out )
! temperature, water vapor, cloud
! ice, cloud liquid, U, V
integer :: history_budget_histfile_num ! output history file number for budget fields
-
!-----------------------------------------------------------------------
call physics_type_alloc(phys_state, phys_tend, begchunk, endchunk, pcols)
@@ -869,6 +871,9 @@ subroutine phys_init( phys_state, phys_tend, pbuf2d, cam_in, cam_out )
! Prognostic chemistry.
call chem_init(phys_state,pbuf2d)
+ ! Lightning flash frq and NOx prod
+ call lightning_init( pbuf2d )
+
! Prescribed tracers
call prescribed_ozone_init()
call prescribed_ghg_init()
@@ -975,6 +980,10 @@ subroutine phys_init( phys_state, phys_tend, pbuf2d, cam_in, cam_out )
end if
+ ! Initialize CAM CCPP constituent properties array
+ ! for use in CCPP-ized physics schemes:
+ call ccpp_const_props_init()
+
! Initialize qneg3 and qneg4
call qneg_init()
@@ -984,6 +993,9 @@ subroutine phys_init( phys_state, phys_tend, pbuf2d, cam_in, cam_out )
! Initialize the snapshot capability
call cam_snapshot_init(cam_in, cam_out, pbuf2d, begchunk)
+ ! Initialize the budget capability
+ call cam_budget_init()
+
! addfld calls for U, V tendency budget variables that are output in
! tphysac, tphysbc
call addfld ( 'UTEND_DCONV', (/ 'lev' /), 'A', 'm/s2', 'Zonal wind tendency by deep convection')
@@ -1081,7 +1093,6 @@ subroutine phys_run1(phys_state, ztodt, phys_tend, pbuf2d, cam_in, cam_out)
#if ( defined OFFLINE_DYN )
use metdata, only: get_met_srf1
#endif
- use hemco_interface, only: HCOI_Chunk_Run
!
! Input arguments
!
@@ -1100,7 +1111,6 @@ subroutine phys_run1(phys_state, ztodt, phys_tend, pbuf2d, cam_in, cam_out)
!---------------------------Local workspace-----------------------------
!
integer :: c ! indices
- integer :: ncol ! number of columns
integer :: nstep ! current timestep number
logical :: use_spcam
type(physics_buffer_desc), pointer :: phys_buffer_chunk(:)
@@ -1125,10 +1135,6 @@ subroutine phys_run1(phys_state, ztodt, phys_tend, pbuf2d, cam_in, cam_out)
call check_energy_gmean(phys_state, pbuf2d, ztodt, nstep)
call t_stopf ('chk_en_gmean')
- call t_stopf ('physpkg_st1')
-
- call t_startf ('physpkg_st1')
-
call pbuf_allocate(pbuf2d, 'physpkg')
call diag_allocate()
@@ -1144,12 +1150,6 @@ subroutine phys_run1(phys_state, ztodt, phys_tend, pbuf2d, cam_in, cam_out)
call gmean_mass ('before tphysbc DRY', phys_state)
#endif
- if(use_hemco) then
- !----------------------------------------------------------
- ! run hemco (first phase)
- !----------------------------------------------------------
- call HCOI_Chunk_Run(cam_in, phys_state, pbuf2d, phase=1)
- endif
!-----------------------------------------------------------------------
! Tendency physics before flux coupler invocation
@@ -1218,7 +1218,6 @@ subroutine phys_run2(phys_state, ztodt, phys_tend, pbuf2d, cam_out, &
use physics_buffer, only: physics_buffer_desc, pbuf_get_chunk, pbuf_deallocate, pbuf_update_tim_idx
use mo_lightning, only: lightning_no_prod
use cam_diagnostics, only: diag_deallocate, diag_surf
- use physconst, only: stebol, latvap
use carma_intr, only: carma_accumulate_stats
use spmd_utils, only: mpicom
use iop_forcing, only: scam_use_iop_srf
@@ -1263,6 +1262,7 @@ subroutine phys_run2(phys_state, ztodt, phys_tend, pbuf2d, cam_out, &
if(use_hemco) then
!----------------------------------------------------------
! run hemco (phase 2 before chemistry)
+ ! only phase 2 is used currently for HEMCO-CESM
!----------------------------------------------------------
call HCOI_Chunk_Run(cam_in, phys_state, pbuf2d, phase=2)
endif
@@ -1278,9 +1278,9 @@ subroutine phys_run2(phys_state, ztodt, phys_tend, pbuf2d, cam_out, &
!
call get_met_srf2( cam_in )
#endif
- ! Set lightning production of NO
+ ! lightning flash freq and prod rate of NOx
call t_startf ('lightning_no_prod')
- call lightning_no_prod( phys_state, pbuf2d, cam_in )
+ call lightning_no_prod( phys_state, pbuf2d, cam_in )
call t_stopf ('lightning_no_prod')
call t_barrierf('sync_ac_physics', mpicom)
@@ -1408,7 +1408,7 @@ subroutine tphysac (ztodt, cam_in, &
use aero_model, only: aero_model_drydep
use carma_intr, only: carma_emission_tend, carma_timestep_tend
use carma_flags_mod, only: carma_do_aerosol, carma_do_emission
- use check_energy, only: check_energy_chng, calc_te_and_aam_budgets
+ use check_energy, only: check_energy_chng, tot_energy_phys
use check_energy, only: check_tracers_data, check_tracers_init, check_tracers_chng
use time_manager, only: get_nstep
use cam_abortutils, only: endrun
@@ -1422,14 +1422,17 @@ subroutine tphysac (ztodt, cam_in, &
use perf_mod
use flux_avg, only: flux_avg_run
use unicon_cam, only: unicon_cam_org_diags
- use cam_history, only: hist_fld_active, outfld
+ use cam_history, only: outfld
use qneg_module, only: qneg4
use co2_cycle, only: co2_cycle_set_ptend
use nudging, only: Nudge_Model,Nudge_ON,nudging_timestep_tend
use cam_snapshot, only: cam_snapshot_all_outfld_tphysac
use cam_snapshot_common,only: cam_snapshot_ptend_outfld
use lunar_tides, only: lunar_tides_tend
-
+ use cam_thermo, only: cam_thermo_water_update
+ use cam_budget, only: thermo_budget_history
+ use dyn_tests_utils, only: vc_dycore, vc_height, vc_dry_pressure
+ use air_composition, only: cpairv, cp_or_cv_dycore
!
! Arguments
!
@@ -1449,30 +1452,24 @@ subroutine tphysac (ztodt, cam_in, &
!
type(physics_ptend) :: ptend ! indivdual parameterization tendencies
- integer :: nstep ! current timestep number
- real(r8) :: zero(pcols) ! array of zeros
+ integer :: nstep ! current timestep number
+ real(r8) :: zero(pcols) ! array of zeros
- integer :: lchnk ! chunk identifier
- integer :: ncol ! number of atmospheric columns
- integer i,k,m ! Longitude, level indices
- integer :: yr, mon, day, tod ! components of a date
- integer :: ixcldice, ixcldliq ! constituent indices for cloud liquid and ice water.
+ integer :: lchnk ! chunk identifier
+ integer :: ncol ! number of atmospheric columns
+ integer :: i,k ! Longitude, level indices
integer :: ixq
- logical :: labort ! abort flag
+ logical :: labort ! abort flag
- real(r8) tvm(pcols,pver) ! virtual temperature
- real(r8) prect(pcols) ! total precipitation
real(r8) surfric(pcols) ! surface friction velocity
real(r8) obklen(pcols) ! Obukhov length
real(r8) :: fh2o(pcols) ! h2o flux to balance source from methane chemistry
real(r8) :: flx_heat(pcols) ! Heat flux for check_energy_chng.
- real(r8) :: tmp_q (pcols,pver) ! tmp space
- real(r8) :: tmp_cldliq(pcols,pver) ! tmp space
- real(r8) :: tmp_cldice(pcols,pver) ! tmp space
real(r8) :: tmp_trac (pcols,pver,pcnst) ! tmp space
real(r8) :: tmp_pdel (pcols,pver) ! tmp space
real(r8) :: tmp_ps (pcols) ! tmp space
+ real(r8) :: scaling(pcols,pver)
logical :: moist_mixing_ratio_dycore
! physics buffer fields for total energy and mass adjustment
@@ -1482,6 +1479,8 @@ subroutine tphysac (ztodt, cam_in, &
real(r8), pointer, dimension(:,:) :: qini
real(r8), pointer, dimension(:,:) :: cldliqini
real(r8), pointer, dimension(:,:) :: cldiceini
+ real(r8), pointer, dimension(:,:) :: totliqini
+ real(r8), pointer, dimension(:,:) :: toticeini
real(r8), pointer, dimension(:,:) :: dtcore
real(r8), pointer, dimension(:,:) :: dqcore
real(r8), pointer, dimension(:,:) :: ducore
@@ -1516,6 +1515,8 @@ subroutine tphysac (ztodt, cam_in, &
call pbuf_get_field(pbuf, qini_idx, qini)
call pbuf_get_field(pbuf, cldliqini_idx, cldliqini)
call pbuf_get_field(pbuf, cldiceini_idx, cldiceini)
+ call pbuf_get_field(pbuf, totliqini_idx, totliqini)
+ call pbuf_get_field(pbuf, toticeini_idx, toticeini)
ifld = pbuf_get_index('CLD')
call pbuf_get_field(pbuf, ifld, cld, start=(/1,1,itim_old/),kount=(/pcols,pver,1/))
@@ -1621,6 +1622,7 @@ subroutine tphysac (ztodt, cam_in, &
call chem_timestep_tend(state, ptend, cam_in, cam_out, ztodt, &
pbuf, fh2o=fh2o)
+
if ( (trim(cam_take_snapshot_after) == "chem_timestep_tend") .and. &
(trim(cam_take_snapshot_before) == trim(cam_take_snapshot_after))) then
call cam_snapshot_ptend_outfld(ptend, lchnk)
@@ -1856,8 +1858,8 @@ subroutine tphysac (ztodt, cam_in, &
fh2o, surfric, obklen, flx_heat)
end if
- call calc_te_and_aam_budgets(state, 'phAP')
- call calc_te_and_aam_budgets(state, 'dyAP',vc=vc_dycore)
+ call tot_energy_phys(state, 'phAP')
+ call tot_energy_phys(state, 'dyAP',vc=vc_dycore)
!---------------------------------------------------------------------------------
! Enforce charge neutrality after O+ change from ionos_tend
@@ -1888,7 +1890,9 @@ subroutine tphysac (ztodt, cam_in, &
!-------------- Energy budget checks vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
! Save total energy for global fixer in next timestep
-
+ !
+ ! This call must be after the last parameterization and call to physics_update
+ !
call pbuf_set_field(pbuf, teout_idx, state%te_cur(:,dyn_te_idx), (/1,itim_old/),(/pcols,1/))
if (shallow_scheme .eq. 'UNICON') then
@@ -1907,62 +1911,73 @@ subroutine tphysac (ztodt, cam_in, &
call unicon_cam_org_diags(state, pbuf)
end if
- moist_mixing_ratio_dycore = dycore_is('LR').or. dycore_is('FV3')
!
! FV: convert dry-type mixing ratios to moist here because physics_dme_adjust
! assumes moist. This is done in p_d_coupling for other dynamics. Bundy, Feb 2004.
- if (moist_mixing_ratio_dycore) call set_dry_to_wet(state) ! Physics had dry, dynamics wants moist
-
- ! Scale dry mass and energy (does nothing if dycore is EUL or SLD)
- call cnst_get_ind('CLDLIQ', ixcldliq)
- call cnst_get_ind('CLDICE', ixcldice)
-
- tmp_q (:ncol,:pver) = state%q(:ncol,:pver,1)
- tmp_cldliq(:ncol,:pver) = state%q(:ncol,:pver,ixcldliq)
- tmp_cldice(:ncol,:pver) = state%q(:ncol,:pver,ixcldice)
+ moist_mixing_ratio_dycore = dycore_is('LR').or. dycore_is('FV3')
+ !
+ ! update cp/cv for energy computation based in updated water variables
+ !
+ call cam_thermo_water_update(state%q(:ncol,:,:), lchnk, ncol, vc_dycore,&
+ to_dry_factor=state%pdel(:ncol,:)/state%pdeldry(:ncol,:))
! for dry mixing ratio dycore, physics_dme_adjust is called for energy diagnostic purposes only.
! So, save off tracers
- if (.not.moist_mixing_ratio_dycore.and.&
- (hist_fld_active('SE_phAM').or.hist_fld_active('KE_phAM').or.hist_fld_active('WV_phAM').or.&
- hist_fld_active('WL_phAM').or.hist_fld_active('WI_phAM').or.hist_fld_active('MR_phAM').or.&
- hist_fld_active('MO_phAM'))) then
- tmp_trac(:ncol,:pver,:pcnst) = state%q(:ncol,:pver,:pcnst)
- tmp_pdel(:ncol,:pver) = state%pdel(:ncol,:pver)
- tmp_ps(:ncol) = state%ps(:ncol)
-
+ if (.not.moist_mixing_ratio_dycore) then
+ !
+ ! for dry-mixing ratio based dycores dme_adjust takes place in the dynamical core
+ !
+ ! only compute dme_adjust for diagnostics purposes
+ !
+ if (thermo_budget_history) then
+ tmp_trac(:ncol,:pver,:pcnst) = state%q(:ncol,:pver,:pcnst)
+ tmp_pdel(:ncol,:pver) = state%pdel(:ncol,:pver)
+ tmp_ps(:ncol) = state%ps(:ncol)
+ call physics_dme_adjust(state, tend, qini, totliqini, toticeini, ztodt)
+ call tot_energy_phys(state, 'phAM')
+ call tot_energy_phys(state, 'dyAM', vc=vc_dycore)
+ ! Restore pre-"physics_dme_adjust" tracers
+ state%q(:ncol,:pver,:pcnst) = tmp_trac(:ncol,:pver,:pcnst)
+ state%pdel(:ncol,:pver) = tmp_pdel(:ncol,:pver)
+ state%ps(:ncol) = tmp_ps(:ncol)
+ end if
+ else
+ !
+ ! for moist-mixing ratio based dycores
+ !
+ ! Note: this operation will NOT be reverted with set_wet_to_dry after set_dry_to_wet call
+ !
call set_dry_to_wet(state)
- call physics_dme_adjust(state, tend, qini, ztodt)
-
- call calc_te_and_aam_budgets(state, 'phAM')
- call calc_te_and_aam_budgets(state, 'dyAM',vc=vc_dycore)
- ! Restore pre-"physics_dme_adjust" tracers
- state%q(:ncol,:pver,:pcnst) = tmp_trac(:ncol,:pver,:pcnst)
- state%pdel(:ncol,:pver) = tmp_pdel(:ncol,:pver)
- state%ps(:ncol) = tmp_ps(:ncol)
- end if
-
- if (moist_mixing_ratio_dycore) then
-
if (trim(cam_take_snapshot_before) == "physics_dme_adjust") then
- call cam_snapshot_all_outfld_tphysac(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf,&
+ call cam_snapshot_all_outfld_tphysac(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf,&
fh2o, surfric, obklen, flx_heat)
end if
-
- call physics_dme_adjust(state, tend, qini, ztodt)
-
+ call physics_dme_adjust(state, tend, qini, totliqini, toticeini, ztodt)
if (trim(cam_take_snapshot_after) == "physics_dme_adjust") then
- call cam_snapshot_all_outfld_tphysac(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf,&
- fh2o, surfric, obklen, flx_heat)
+ call cam_snapshot_all_outfld_tphysac(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf,&
+ fh2o, surfric, obklen, flx_heat)
end if
- call calc_te_and_aam_budgets(state, 'phAM')
- call calc_te_and_aam_budgets(state, 'dyAM',vc=vc_dycore)
+ call tot_energy_phys(state, 'phAM')
+ call tot_energy_phys(state, 'dyAM', vc=vc_dycore)
endif
-!!! REMOVE THIS CALL, SINCE ONLY Q IS BEING ADJUSTED. WON'T BALANCE ENERGY. TE IS SAVED BEFORE THIS
-!!! call check_energy_chng(state, tend, "drymass", nstep, ztodt, zero, zero, zero, zero)
+ if (vc_dycore == vc_height.or.vc_dycore == vc_dry_pressure) then
+ !
+ ! MPAS and SE specific scaling of temperature for enforcing energy consistency
+ ! (and to make sure that temperature dependent diagnostic tendencies
+ ! are computed correctly; e.g. dtcore)
+ !
+ scaling(1:ncol,:) = cpairv(:ncol,:,lchnk)/cp_or_cv_dycore(:ncol,:,lchnk)
+ state%T(1:ncol,:) = state%temp_ini(1:ncol,:)+&
+ scaling(1:ncol,:)*(state%T(1:ncol,:)-state%temp_ini(1:ncol,:))
+ tend%dtdt(:ncol,:) = scaling(:ncol,:)*tend%dtdt(:ncol,:)
+ !
+ ! else: do nothing for dycores with energy consistent with CAM physics
+ !
+ end if
+
! store T, U, and V in buffer for use in computing dynamics T-tendency in next timestep
do k = 1,pver
@@ -1987,8 +2002,7 @@ subroutine tphysac (ztodt, cam_in, &
endif
endif
- call diag_phys_tend_writeout (state, pbuf, tend, ztodt, tmp_q, tmp_cldliq, tmp_cldice, &
- qini, cldliqini, cldiceini)
+ call diag_phys_tend_writeout (state, pbuf, tend, ztodt, qini, cldliqini, cldiceini)
call clybry_fam_set( ncol, lchnk, map2chm, state%q, pbuf )
@@ -2037,18 +2051,20 @@ subroutine tphysbc (ztodt, state, &
use physics_types, only: physics_state, physics_tend, physics_ptend, &
physics_update, physics_ptend_init, physics_ptend_sum, &
physics_state_check, physics_ptend_scale, &
- phys_te_idx, dyn_te_idx
+ dyn_te_idx
use cam_diagnostics, only: diag_conv_tend_ini, diag_phys_writeout, diag_conv, diag_export, diag_state_b4_phys_write
use cam_diagnostics, only: diag_clip_tend_writeout
use cam_history, only: outfld
- use physconst, only: cpair, latvap
+ use physconst, only: latvap
use constituents, only: pcnst, qmin, cnst_get_ind
+ use air_composition, only: thermodynamic_active_species_liq_num,thermodynamic_active_species_liq_idx
+ use air_composition, only: thermodynamic_active_species_ice_num,thermodynamic_active_species_ice_idx
use convect_deep, only: convect_deep_tend, convect_deep_tend_2, deep_scheme_does_scav_trans
use time_manager, only: is_first_step, get_nstep
use convect_shallow, only: convect_shallow_tend
use check_energy, only: check_energy_chng, check_energy_fix, check_energy_timestep_init
use check_energy, only: check_tracers_data, check_tracers_init, check_tracers_chng
- use check_energy, only: calc_te_and_aam_budgets
+ use check_energy, only: tot_energy_phys
use dycore, only: dycore_is
use aero_model, only: aero_model_wetdep
use carma_intr, only: carma_wetdep_tend, carma_timestep_tend
@@ -2117,6 +2133,7 @@ subroutine tphysbc (ztodt, state, &
integer :: i ! column indicex
integer :: ixcldice, ixcldliq, ixq ! constituent indices for cloud liquid and ice water.
+ integer :: m, m_cnst
! for macro/micro co-substepping
integer :: macmic_it ! iteration variables
real(r8) :: cld_macmic_ztodt ! modified timestep
@@ -2130,6 +2147,8 @@ subroutine tphysbc (ztodt, state, &
real(r8), pointer, dimension(:,:) :: qini
real(r8), pointer, dimension(:,:) :: cldliqini
real(r8), pointer, dimension(:,:) :: cldiceini
+ real(r8), pointer, dimension(:,:) :: totliqini
+ real(r8), pointer, dimension(:,:) :: toticeini
real(r8), pointer, dimension(:,:) :: dtcore
real(r8), pointer, dimension(:,:) :: dqcore
real(r8), pointer, dimension(:,:) :: ducore
@@ -2178,8 +2197,6 @@ subroutine tphysbc (ztodt, state, &
type(check_tracers_data):: tracerint ! energy integrals and cummulative boundary fluxes
real(r8) :: zero_tracers(pcols,pcnst)
- logical :: lq(pcnst)
-
!-----------------------------------------------------------------------
call t_startf('bc_init')
@@ -2205,6 +2222,8 @@ subroutine tphysbc (ztodt, state, &
call pbuf_get_field(pbuf, qini_idx, qini)
call pbuf_get_field(pbuf, cldliqini_idx, cldliqini)
call pbuf_get_field(pbuf, cldiceini_idx, cldiceini)
+ call pbuf_get_field(pbuf, totliqini_idx, totliqini)
+ call pbuf_get_field(pbuf, toticeini_idx, toticeini)
call pbuf_get_field(pbuf, dtcore_idx, dtcore, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) )
call pbuf_get_field(pbuf, dqcore_idx, dqcore, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) )
@@ -2250,16 +2269,16 @@ subroutine tphysbc (ztodt, state, &
!===================================================
call t_startf('energy_fixer')
- call calc_te_and_aam_budgets(state, 'phBF')
- call calc_te_and_aam_budgets(state, 'dyBF',vc=vc_dycore)
+ call tot_energy_phys(state, 'phBF')
+ call tot_energy_phys(state, 'dyBF',vc=vc_dycore)
if (.not.dycore_is('EUL')) then
call check_energy_fix(state, ptend, nstep, flx_heat)
call physics_update(state, ptend, ztodt, tend)
call check_energy_chng(state, tend, "chkengyfix", nstep, ztodt, zero, zero, zero, flx_heat)
call outfld( 'EFIX', flx_heat , pcols, lchnk )
end if
- call calc_te_and_aam_budgets(state, 'phBP')
- call calc_te_and_aam_budgets(state, 'dyBP',vc=vc_dycore)
+ call tot_energy_phys(state, 'phBP')
+ call tot_energy_phys(state, 'dyBP',vc=vc_dycore)
! Save state for convective tendency calculations.
call diag_conv_tend_ini(state, pbuf)
@@ -2270,6 +2289,18 @@ subroutine tphysbc (ztodt, state, &
cldliqini(:ncol,:pver) = state%q(:ncol,:pver,ixcldliq)
cldiceini(:ncol,:pver) = state%q(:ncol,:pver,ixcldice)
+ totliqini(:ncol,:pver) = 0.0_r8
+ do m_cnst=1,thermodynamic_active_species_liq_num
+ m = thermodynamic_active_species_liq_idx(m_cnst)
+ totliqini(:ncol,:pver) = totliqini(:ncol,:pver)+state%q(:ncol,:pver,m)
+ end do
+ toticeini(:ncol,:pver) = 0.0_r8
+ do m_cnst=1,thermodynamic_active_species_ice_num
+ m = thermodynamic_active_species_ice_idx(m_cnst)
+ toticeini(:ncol,:pver) = toticeini(:ncol,:pver)+state%q(:ncol,:pver,m)
+ end do
+
+
call outfld('TEOUT', teout , pcols, lchnk )
call outfld('TEINP', state%te_ini(:,dyn_te_idx), pcols, lchnk )
call outfld('TEFIX', state%te_cur(:,dyn_te_idx), pcols, lchnk )
@@ -2892,7 +2923,6 @@ subroutine phys_timestep_init(phys_state, cam_in, cam_out, pbuf2d)
! datasets.
!
!-----------------------------------------------------------------------------------
- use shr_kind_mod, only: r8 => shr_kind_r8
use chemistry, only: chem_timestep_init
use chem_surfvals, only: chem_surfvals_set
use physics_types, only: physics_state
diff --git a/src/physics/cam/rad_constituents.F90 b/src/physics/cam/rad_constituents.F90
index ced2c35cfa..2863197669 100644
--- a/src/physics/cam/rad_constituents.F90
+++ b/src/physics/cam/rad_constituents.F90
@@ -2,9 +2,9 @@ module rad_constituents
!------------------------------------------------------------------------------------------------
!
-! Provide constituent distributions and properties to the radiation and
+! Provide constituent distributions and properties to the radiation and
! cloud microphysics routines.
-!
+!
! The logic to control which constituents are used in the climate calculations
! and which are used in diagnostic radiation calculations is contained in this module.
!
@@ -115,7 +115,7 @@ module rad_constituents
! type to provide access to the data parsed from the rad_climate and rad_diag_* strings
type :: rad_cnst_namelist_t
integer :: ncnst
- character(len= 1), pointer :: source(:) ! 'A' for state (advected), 'N' for pbuf (non-advected),
+ character(len= 1), pointer :: source(:) ! 'A' for state (advected), 'N' for pbuf (non-advected),
! 'M' for mode, 'Z' for zero
character(len= 64), pointer :: camname(:) ! name registered in pbuf or constituents
character(len=cs1), pointer :: radname(:) ! radname is the name as identfied in radiation,
@@ -127,7 +127,7 @@ module rad_constituents
type(rad_cnst_namelist_t) :: namelist(0:N_DIAG) ! gas, bulk aerosol, and modal components used in
! climate/diagnostic calculations
-logical :: active_calls(0:N_DIAG) ! active_calls(i) is true if the i-th call to radiation is
+logical :: active_calls(0:N_DIAG) ! active_calls(i) is true if the i-th call to radiation is
! specified. Note that the 0th call is for the climate
! calculation which is always made.
@@ -184,7 +184,7 @@ module rad_constituents
! values for constituents with requested value of zero
-real(r8), allocatable, target :: zero_cols(:,:)
+real(r8), allocatable, target :: zero_cols(:,:)
! define generic interface routines
interface rad_cnst_get_info
@@ -299,7 +299,7 @@ subroutine rad_cnst_readnl(nlfile)
! Mode definition stings
call parse_mode_defs(mode_defs, modes)
-
+
! Lists of externally mixed entities for climate and diagnostic calculations
do i = 0,N_DIAG
select case (i)
@@ -331,7 +331,7 @@ subroutine rad_cnst_readnl(nlfile)
! were there any constituents specified for the nth diagnostic call?
! if so, radiation will make a call with those consituents
active_calls(:) = (namelist(:)%ncnst > 0)
-
+
! Initialize the gas and aerosol lists with the information from the
! namelist. This is done here so that this information is available via
! the query functions at the time when the register methods are called.
@@ -470,13 +470,13 @@ subroutine rad_cnst_get_gas(list_idx, gasname, state, pbuf, mmr)
write(iulog,*) subname//': list_idx =', list_idx
call endrun(subname//': list_idx out of bounds')
endif
-
+
lchnk = state%lchnk
- ! Get index of gas in internal arrays. rad_gas_index will abort if the
+ ! Get index of gas in internal arrays. rad_gas_index will abort if the
! specified gasname is not recognized by the radiative transfer code.
igas = rad_gas_index(trim(gasname))
-
+
! Get data source
source = list%gas(igas)%source
idx = list%gas(igas)%idx
@@ -516,10 +516,10 @@ function rad_cnst_num_name(list_idx, spc_name_in, num_name_out, mode_out, spec_o
character(len= 32) :: spec_name
found = .false.
-
+
m_list => ma_list(list_idx)
nmodes = m_list%nmodes
-
+
do n = 1,nmodes
mm = m_list%idx(n)
nspecs = modes%comps(mm)%nspec
@@ -629,7 +629,7 @@ subroutine rad_cnst_get_info(list_idx, gasnames, aernames, &
! get index of O3 in gas list
igas = rad_gas_index('O3')
-
+
! Get data source
source = g_list%gas(igas)%source
@@ -1054,7 +1054,7 @@ subroutine init_mode_comps(modes)
modes%comps(m)%camname_mmr_c(ispec), routine)
! get physprop ID
- modes%comps(m)%idx_props(ispec) = physprop_get_id(modes%comps(m)%props(ispec))
+ modes%comps(m)%idx_props(ispec) = physprop_get_id(modes%comps(m)%props(ispec))
if (modes%comps(m)%idx_props(ispec) == -1) then
call endrun(routine//' : ERROR idx not found for '//trim(modes%comps(m)%props(ispec)))
end if
@@ -1079,7 +1079,7 @@ integer function get_cam_idx(source, name, routine)
integer :: idx
integer :: errcode
!-----------------------------------------------------------------------------
-
+
if (source(1:1) == 'N') then
idx = pbuf_get_index(trim(name),errcode)
@@ -1103,7 +1103,7 @@ integer function get_cam_idx(source, name, routine)
call endrun(routine//' ERROR: invalid source for specie '//trim(name))
end if
-
+
get_cam_idx = idx
end function get_cam_idx
@@ -1112,7 +1112,7 @@ end function get_cam_idx
subroutine list_init1(namelist, gaslist, aerlist, ma_list)
- ! Initialize the gas and bulk and modal aerosol lists with the
+ ! Initialize the gas and bulk and modal aerosol lists with the
! entities specified in the climate or diagnostic lists.
! This first phase initialization just sets the information that
@@ -1180,7 +1180,7 @@ subroutine list_init1(namelist, gaslist, aerlist, ma_list)
end if
! Add component to appropriate list (gas, modal or bulk aerosol)
- if (namelist%type(ii) == 'A') then
+ if (namelist%type(ii) == 'A') then
! Add to bulk aerosol list
ba_idx = ba_idx + 1
@@ -1189,7 +1189,7 @@ subroutine list_init1(namelist, gaslist, aerlist, ma_list)
aerlist%aer(ba_idx)%camname = namelist%camname(ii)
aerlist%aer(ba_idx)%physprop_file = namelist%radname(ii)
- else if (namelist%type(ii) == 'M') then
+ else if (namelist%type(ii) == 'M') then
! Add to modal aerosol list
ma_idx = ma_idx + 1
@@ -1209,7 +1209,7 @@ subroutine list_init1(namelist, gaslist, aerlist, ma_list)
! Also save the name of the physprop file
ma_list%physprop_files(ma_idx) = namelist%radname(ii)
- else
+ else
! Add to gas list
@@ -1388,7 +1388,7 @@ end subroutine rad_aer_diag_init
subroutine parse_mode_defs(nl_in, modes)
! Parse the mode definition specifiers. The specifiers are of the form:
- !
+ !
! 'mode_name:mode_type:=',
! 'source_num_a:camname_num_a:source_num_c:camname_num_c:num_mr:+',
! 'source_mmr_a:camname_mmr_a:source_mmr_c:camname_mmr_c:spec_type:prop_file[:+]'[,]
@@ -1422,7 +1422,7 @@ subroutine parse_mode_defs(nl_in, modes)
! associated field for the prop_file. There can only be one entry
! with the num_mr type in a mode definition.
! prop_file -- For aerosol species this is a filename, which is
- ! identified by a ".nc" suffix. The file contains optical and
+ ! identified by a ".nc" suffix. The file contains optical and
! other physical properties of the aerosol.
!
! A mode definition must contain only 1 string for the number mixing ratio components
@@ -1448,7 +1448,7 @@ subroutine parse_mode_defs(nl_in, modes)
character(len=32) :: tmp_name_c
character(len=32) :: tmp_type
!-------------------------------------------------------------------------
-
+
! Determine number of modes defined by counting number of strings that are
! terminated by ':='
! (algorithm stops counting at first blank element).
@@ -1458,7 +1458,7 @@ subroutine parse_mode_defs(nl_in, modes)
if (len_trim(nl_in(m)) == 0) exit
nstr = nstr + 1
-
+
! There are no fields in the input strings in which a blank character is allowed.
! To simplify the parsing go through the input strings and remove blanks.
tmpstr = adjustl(nl_in(m))
@@ -1489,7 +1489,7 @@ subroutine parse_mode_defs(nl_in, modes)
write(iulog,*) routine//': ERROR: cannot allocate storage for modes. nmodes=', nmodes
call endrun(routine//': ERROR allocating storage for modes')
end if
-
+
mcur = 1 ! index of current string being processed
@@ -1512,7 +1512,7 @@ subroutine parse_mode_defs(nl_in, modes)
nspec = nspec + 1
mcur = mcur + 1
end do
-
+
! a mode must have at least one specie
if (nspec == 0) call parse_error('mode must have at least one specie', nl_in(mbeg))
@@ -1549,7 +1549,7 @@ subroutine parse_mode_defs(nl_in, modes)
! return to first string in mode definition
mcur = mbeg
tmpstr = nl_in(mcur)
-
+
! mode name
ipos = index(tmpstr, ':')
if (ipos < 2) call parse_error('mode name not found', tmpstr)
@@ -1693,7 +1693,7 @@ subroutine check_specie_type(str, ib, ie)
character(len=*), intent(in) :: str
integer, intent(in) :: ib, ie
-
+
integer :: i
do i = 1, num_spec_types
@@ -1710,7 +1710,7 @@ subroutine check_mode_type(str, ib, ie)
character(len=*), intent(in) :: str
integer, intent(in) :: ib, ie ! begin, end character of mode type substring
-
+
integer :: i
do i = 1, num_mode_types
@@ -1739,7 +1739,7 @@ subroutine parse_rad_specifier(specifier, namelist_data)
! radname -- For gases this is a name that identifies the constituent to the
! radiative transfer codes. These names are contained in the
! radconstants module. For aerosols this is a filename, which is
-! identified by a ".nc" suffix. The file contains optical and
+! identified by a ".nc" suffix. The file contains optical and
! other physical properties of the aerosol.
!
! This code also identifies whether the constituent is a gas or an aerosol
@@ -1759,11 +1759,11 @@ subroutine parse_rad_specifier(specifier, namelist_data)
character(len=cs1) :: radname(n_rad_cnst)
character(len=1) :: type(n_rad_cnst)
!-------------------------------------------------------------------------
-
+
number = 0
parse_loop: do i = 1, n_rad_cnst
- if ( len_trim(specifier(i)) == 0 ) then
+ if ( len_trim(specifier(i)) == 0 ) then
exit parse_loop
endif
@@ -1784,12 +1784,12 @@ subroutine parse_rad_specifier(specifier, namelist_data)
! locate the ':' separating camname from radname
j = scan(tmpstr, ':')
-
+
camname(i) = tmpstr(:j-1)
radname(i) = tmpstr(j+1:)
! determine the type of constituent
- if (source(i) == 'M') then
+ if (source(i) == 'M') then
type(i) = 'M'
else if(index(radname(i),".nc") .gt. 0) then
type(i) = 'A'
@@ -1797,7 +1797,7 @@ subroutine parse_rad_specifier(specifier, namelist_data)
type(i) = 'G'
end if
- number = number+1
+ number = number+1
end do parse_loop
namelist_data%ncnst = number
@@ -1876,7 +1876,7 @@ end subroutine rad_cnst_get_aer_mmr_by_idx
subroutine rad_cnst_get_mam_mmr_by_idx(list_idx, mode_idx, spec_idx, phase, state, pbuf, mmr)
! Return pointer to mass mixing ratio for the modal aerosol specie from the specified
- ! climate or diagnostic list.
+ ! climate or diagnostic list.
! Arguments
integer, intent(in) :: list_idx ! index of the climate or a diagnostic list
@@ -1950,7 +1950,7 @@ subroutine rad_cnst_get_mam_mmr_idx(mode_idx, spec_idx, idx)
! Return constituent index of mam specie mass mixing ratio for aerosol modes in
! the climate list.
- ! This is a special routine to allow direct access to information in the
+ ! This is a special routine to allow direct access to information in the
! constituent array inside physics parameterizations that have been passed,
! and are operating over the entire constituent array. The interstitial phase
! is assumed since that's what is contained in the constituent array.
@@ -1994,7 +1994,7 @@ end subroutine rad_cnst_get_mam_mmr_idx
subroutine rad_cnst_get_mode_num(list_idx, mode_idx, phase, state, pbuf, num)
! Return pointer to number mixing ratio for the aerosol mode from the specified
- ! climate or diagnostic list.
+ ! climate or diagnostic list.
! Arguments
integer, intent(in) :: list_idx ! index of the climate or a diagnostic list
@@ -2061,7 +2061,7 @@ subroutine rad_cnst_get_mode_num_idx(mode_idx, cnst_idx)
! Return constituent index of mode number mixing ratio for the aerosol mode in
! the climate list.
- ! This is a special routine to allow direct access to information in the
+ ! This is a special routine to allow direct access to information in the
! constituent array inside physics parameterizations that have been passed,
! and are operating over the entire constituent array. The interstitial phase
! is assumed since that's what is contained in the constituent array.
@@ -2116,7 +2116,7 @@ integer function rad_cnst_get_aer_idx(list_idx, aer_name)
type(aerlist_t), pointer :: aerlist
character(len=*), parameter :: subname = "rad_cnst_get_aer_idx"
!-------------------------------------------------------------------------
-
+
if (list_idx >= 0 .and. list_idx <= N_DIAG) then
aerlist => aerosollist(list_idx)
else
@@ -2134,7 +2134,7 @@ integer function rad_cnst_get_aer_idx(list_idx, aer_name)
end do
if (aer_idx == -1) call endrun(subname//": ERROR - name not found")
-
+
rad_cnst_get_aer_idx = aer_idx
end function rad_cnst_get_aer_idx
@@ -2160,30 +2160,30 @@ subroutine rad_cnst_get_aer_props_by_idx(list_idx, &
integer, intent(in) :: list_idx ! index of the climate or a diagnostic list
integer, intent(in) :: aer_idx ! index of the aerosol
character(len=ot_length), optional, intent(out) :: opticstype
- real(r8), optional, pointer :: sw_hygro_ext(:,:)
- real(r8), optional, pointer :: sw_hygro_ssa(:,:)
- real(r8), optional, pointer :: sw_hygro_asm(:,:)
- real(r8), optional, pointer :: lw_hygro_ext(:,:)
+ real(r8), optional, pointer :: sw_hygro_ext(:,:)
+ real(r8), optional, pointer :: sw_hygro_ssa(:,:)
+ real(r8), optional, pointer :: sw_hygro_asm(:,:)
+ real(r8), optional, pointer :: lw_hygro_ext(:,:)
real(r8), optional, pointer :: sw_nonhygro_ext(:)
real(r8), optional, pointer :: sw_nonhygro_ssa(:)
real(r8), optional, pointer :: sw_nonhygro_asm(:)
real(r8), optional, pointer :: sw_nonhygro_scat(:)
real(r8), optional, pointer :: sw_nonhygro_ascat(:)
- real(r8), optional, pointer :: lw_ext(:)
+ real(r8), optional, pointer :: lw_ext(:)
complex(r8), optional, pointer :: refindex_aer_sw(:)
complex(r8), optional, pointer :: refindex_aer_lw(:)
- character(len=20), optional, intent(out) :: aername
+ character(len=20), optional, intent(out) :: aername
real(r8), optional, intent(out) :: density_aer
real(r8), optional, intent(out) :: hygro_aer
- real(r8), optional, intent(out) :: dryrad_aer
- real(r8), optional, intent(out) :: dispersion_aer
- real(r8), optional, intent(out) :: num_to_mass_aer
+ real(r8), optional, intent(out) :: dryrad_aer
+ real(r8), optional, intent(out) :: dispersion_aer
+ real(r8), optional, intent(out) :: num_to_mass_aer
- real(r8), optional, pointer :: r_sw_ext(:,:)
- real(r8), optional, pointer :: r_sw_scat(:,:)
- real(r8), optional, pointer :: r_sw_ascat(:,:)
- real(r8), optional, pointer :: r_lw_abs(:,:)
- real(r8), optional, pointer :: mu(:)
+ real(r8), optional, pointer :: r_sw_ext(:,:)
+ real(r8), optional, pointer :: r_sw_scat(:,:)
+ real(r8), optional, pointer :: r_sw_ascat(:,:)
+ real(r8), optional, pointer :: r_lw_abs(:,:)
+ real(r8), optional, pointer :: mu(:)
! Local variables
integer :: id
@@ -2259,31 +2259,31 @@ subroutine rad_cnst_get_mam_props_by_idx(list_idx, &
integer, intent(in) :: mode_idx ! mode index
integer, intent(in) :: spec_idx ! index of specie in the mode
character(len=ot_length), optional, intent(out) :: opticstype
- real(r8), optional, pointer :: sw_hygro_ext(:,:)
- real(r8), optional, pointer :: sw_hygro_ssa(:,:)
- real(r8), optional, pointer :: sw_hygro_asm(:,:)
- real(r8), optional, pointer :: lw_hygro_ext(:,:)
+ real(r8), optional, pointer :: sw_hygro_ext(:,:)
+ real(r8), optional, pointer :: sw_hygro_ssa(:,:)
+ real(r8), optional, pointer :: sw_hygro_asm(:,:)
+ real(r8), optional, pointer :: lw_hygro_ext(:,:)
real(r8), optional, pointer :: sw_nonhygro_ext(:)
real(r8), optional, pointer :: sw_nonhygro_ssa(:)
real(r8), optional, pointer :: sw_nonhygro_asm(:)
real(r8), optional, pointer :: sw_nonhygro_scat(:)
real(r8), optional, pointer :: sw_nonhygro_ascat(:)
- real(r8), optional, pointer :: lw_ext(:)
+ real(r8), optional, pointer :: lw_ext(:)
complex(r8), optional, pointer :: refindex_aer_sw(:)
complex(r8), optional, pointer :: refindex_aer_lw(:)
- real(r8), optional, pointer :: r_sw_ext(:,:)
- real(r8), optional, pointer :: r_sw_scat(:,:)
- real(r8), optional, pointer :: r_sw_ascat(:,:)
- real(r8), optional, pointer :: r_lw_abs(:,:)
- real(r8), optional, pointer :: mu(:)
+ real(r8), optional, pointer :: r_sw_ext(:,:)
+ real(r8), optional, pointer :: r_sw_scat(:,:)
+ real(r8), optional, pointer :: r_sw_ascat(:,:)
+ real(r8), optional, pointer :: r_lw_abs(:,:)
+ real(r8), optional, pointer :: mu(:)
- character(len=20), optional, intent(out) :: aername
+ character(len=20), optional, intent(out) :: aername
real(r8), optional, intent(out) :: density_aer
real(r8), optional, intent(out) :: hygro_aer
- real(r8), optional, intent(out) :: dryrad_aer
- real(r8), optional, intent(out) :: dispersion_aer
- real(r8), optional, intent(out) :: num_to_mass_aer
+ real(r8), optional, intent(out) :: dryrad_aer
+ real(r8), optional, intent(out) :: dispersion_aer
+ real(r8), optional, intent(out) :: num_to_mass_aer
character(len=32), optional, intent(out) :: spectype
! Local variables
@@ -2352,7 +2352,7 @@ end subroutine rad_cnst_get_mam_props_by_idx
!================================================================================================
-subroutine rad_cnst_get_mode_props(list_idx, mode_idx, &
+subroutine rad_cnst_get_mode_props(list_idx, mode_idx, opticstype, &
extpsw, abspsw, asmpsw, absplw, refrtabsw, &
refitabsw, refrtablw, refitablw, ncoef, prefr, &
prefi, sigmag, dgnum, dgnumlo, dgnumhi, &
@@ -2366,7 +2366,7 @@ subroutine rad_cnst_get_mode_props(list_idx, mode_idx, &
! Arguments
integer, intent(in) :: list_idx ! index of the climate or a diagnostic list
integer, intent(in) :: mode_idx ! mode index
-
+ character(len=ot_length), optional, intent(out) :: opticstype
real(r8), optional, pointer :: extpsw(:,:,:,:)
real(r8), optional, pointer :: abspsw(:,:,:,:)
real(r8), optional, pointer :: asmpsw(:,:,:,:)
@@ -2407,6 +2407,7 @@ subroutine rad_cnst_get_mode_props(list_idx, mode_idx, &
! Get the physprop index for the requested mode
id = mlist%idx_props(mode_idx)
+ if (present(opticstype)) call physprop_get(id, opticstype=opticstype)
if (present(extpsw)) call physprop_get(id, extpsw=extpsw)
if (present(abspsw)) call physprop_get(id, abspsw=abspsw)
if (present(asmpsw)) call physprop_get(id, asmpsw=asmpsw)
diff --git a/src/physics/cam/ref_pres.F90 b/src/physics/cam/ref_pres.F90
index 742652db11..f0d5994b81 100644
--- a/src/physics/cam/ref_pres.F90
+++ b/src/physics/cam/ref_pres.F90
@@ -1,14 +1,14 @@
module ref_pres
!--------------------------------------------------------------------------
-!
+!
! Provides access to reference pressures for use by the physics
! parameterizations. The pressures are provided by the dynamical core
! since it determines the grid used by the physics.
-!
+!
! Note that the init method for this module is called before the init
! method in physpkg; therefore, most physics modules can use these
! reference pressures during their init phases.
-!
+!
!--------------------------------------------------------------------------
use shr_kind_mod, only: r8=>shr_kind_r8
@@ -25,7 +25,7 @@ module ref_pres
! surface pressure ('eta' coordinate)
real(r8), protected :: ptop_ref ! Top of model
-real(r8), protected :: psurf_ref ! Surface pressure
+real(r8), protected :: psurf_ref ! reference pressure
! Number of top levels using pure pressure representation
integer, protected :: num_pr_lev
diff --git a/src/physics/cam/rk_stratiform.F90 b/src/physics/cam/rk_stratiform.F90
index 5d165acc40..84607a20b7 100644
--- a/src/physics/cam/rk_stratiform.F90
+++ b/src/physics/cam/rk_stratiform.F90
@@ -2,7 +2,7 @@ module rk_stratiform
!-------------------------------------------------------------------------------------------------------
!
-! Provides the CAM interface to the Rasch and Kristjansson (RK)
+! Provides the CAM interface to the Rasch and Kristjansson (RK)
! prognostic cloud microphysics, and the cam3/4 macrophysics.
!
!-------------------------------------------------------------------------------------------------------
@@ -27,26 +27,26 @@ module rk_stratiform
public :: rk_stratiform_tend
public :: rk_stratiform_readnl
-! Physics buffer indices
+! Physics buffer indices
integer :: landm_idx = 0
-integer :: qcwat_idx = 0
-integer :: lcwat_idx = 0
-integer :: tcwat_idx = 0
+integer :: qcwat_idx = 0
+integer :: lcwat_idx = 0
+integer :: tcwat_idx = 0
-integer :: cld_idx = 0
-integer :: ast_idx = 0
-integer :: concld_idx = 0
-integer :: fice_idx = 0
+integer :: cld_idx = 0
+integer :: ast_idx = 0
+integer :: concld_idx = 0
+integer :: fice_idx = 0
-integer :: qme_idx = 0
-integer :: prain_idx = 0
-integer :: nevapr_idx = 0
+integer :: qme_idx = 0
+integer :: prain_idx = 0
+integer :: nevapr_idx = 0
integer :: wsedl_idx = 0
-integer :: rei_idx = 0
-integer :: rel_idx = 0
+integer :: rei_idx = 0
+integer :: rel_idx = 0
integer :: shfrc_idx = 0
integer :: cmfmc_sh_idx = 0
@@ -92,8 +92,8 @@ subroutine rk_stratiform_readnl(nlfile)
character(len=*), parameter :: subname = 'rk_stratiform_readnl'
! Namelist variables
- real(r8) :: rk_strat_icritw = unset_r8 ! icritw = threshold for autoconversion of warm ice
- real(r8) :: rk_strat_icritc = unset_r8 ! icritc = threshold for autoconversion of cold ice
+ real(r8) :: rk_strat_icritw = unset_r8 ! icritw = threshold for autoconversion of warm ice
+ real(r8) :: rk_strat_icritc = unset_r8 ! icritc = threshold for autoconversion of cold ice
real(r8) :: rk_strat_conke = unset_r8 ! conke = tunable constant for evaporation of precip
real(r8) :: rk_strat_r3lcrit = unset_r8 ! r3lcrit = critical radius where liq conversion begins
real(r8) :: rk_strat_polstrat_rhmin = unset_r8 ! condensation threadhold in polar stratosphere
@@ -144,7 +144,7 @@ subroutine rk_stratiform_register
use constituents, only: cnst_add, pcnst
use physconst, only: mwh2o, cpair
-
+
use physics_buffer, only : pbuf_add_field, dtype_r8, dyn_time_lvls
!-----------------------------------------------------------------------
@@ -166,7 +166,7 @@ subroutine rk_stratiform_register
call pbuf_add_field('AST', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), ast_idx)
call pbuf_add_field('CONCLD', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), concld_idx)
- call pbuf_add_field('FICE', 'physpkg', dtype_r8, (/pcols,pver/), fice_idx)
+ call pbuf_add_field('FICE', 'physpkg', dtype_r8, (/pcols,pver/), fice_idx)
call pbuf_add_field('QME', 'physpkg', dtype_r8, (/pcols,pver/), qme_idx)
call pbuf_add_field('PRAIN', 'physpkg', dtype_r8, (/pcols,pver/), prain_idx)
@@ -186,8 +186,8 @@ end subroutine rk_stratiform_register
function rk_stratiform_implements_cnst(name)
- !----------------------------------------------------------------------------- !
- ! !
+ !----------------------------------------------------------------------------- !
+ ! !
! Return true if specified constituent is implemented by this package !
! !
!----------------------------------------------------------------------------- !
@@ -208,7 +208,7 @@ subroutine rk_stratiform_init_cnst(name, latvals, lonvals, mask, q)
!----------------------------------------------------------------------- !
! !
! Initialize the cloud water mixing ratios (liquid and ice), if they are !
- ! not read from the initial file !
+ ! not read from the initial file !
! !
!----------------------------------------------------------------------- !
@@ -237,7 +237,7 @@ subroutine rk_stratiform_init()
!-------------------------------------------- !
! !
! Initialize the cloud water parameterization !
- ! !
+ ! !
!-------------------------------------------- !
use physics_buffer, only: physics_buffer_desc, pbuf_get_index
@@ -247,7 +247,7 @@ subroutine rk_stratiform_init()
use phys_control, only: cam_physpkg_is
use physconst, only: tmelt, rhodair, rh2o
use cldwat, only: inimc
-
+
integer :: m, mm
logical :: history_amwg ! output the variables used by the AMWG diag package
logical :: history_aerosol ! Output the MAM aerosol tendencies
@@ -258,7 +258,7 @@ subroutine rk_stratiform_init()
!-----------------------------------------------------------------------
call phys_getopts( history_aerosol_out = history_aerosol , &
- history_amwg_out = history_amwg , &
+ history_amwg_out = history_amwg , &
history_budget_out = history_budget , &
history_budget_histfile_num_out = history_budget_histfile_num)
@@ -268,7 +268,7 @@ subroutine rk_stratiform_init()
if( convect_shallow_use_shfrc() ) then
use_shfrc = .true.
shfrc_idx = pbuf_get_index('shfrc')
- else
+ else
use_shfrc = .false.
endif
@@ -326,7 +326,7 @@ subroutine rk_stratiform_init()
call addfld ('ICWMR', (/ 'lev' /), 'A', 'kg/kg' , 'Prognostic in-cloud water mixing ratio' )
call addfld ('ICIMR', (/ 'lev' /), 'A', 'kg/kg' , 'Prognostic in-cloud ice mixing ratio' )
call addfld ('PCSNOW', horiz_only , 'A', 'm/s' , 'Snow fall from prognostic clouds' )
-
+
call addfld ('DQSED', (/ 'lev' /), 'A', 'kg/kg/s' , 'Water vapor tendency from cloud sedimentation' )
call addfld ('DLSED', (/ 'lev' /), 'A', 'kg/kg/s' , 'Cloud liquid tendency from sedimentation' )
call addfld ('DISED', (/ 'lev' /), 'A', 'kg/kg/s' , 'Cloud ice tendency from sedimentation' )
@@ -339,7 +339,7 @@ subroutine rk_stratiform_init()
call addfld ('CNVCLD', horiz_only, 'A', 'fraction', 'Vertically integrated convective cloud amount' )
call addfld ('CLDST', (/ 'lev' /), 'A', 'fraction', 'Stratus cloud fraction' )
call addfld ('CONCLD', (/ 'lev' /), 'A', 'fraction', 'Convective cloud cover' )
-
+
call addfld ('AST', (/ 'lev' /), 'A','fraction' , 'Stratus cloud fraction' )
call addfld ('LIQCLDF', (/ 'lev' /), 'A', 'fraction', 'Stratus Liquid cloud fraction' )
call addfld ('ICECLDF', (/ 'lev' /), 'A', 'fraction', 'Stratus ICE cloud fraction' )
@@ -420,11 +420,11 @@ subroutine rk_stratiform_tend( &
dlf2, rliq, cmfmc, ts, &
sst, zdu)
- !-------------------------------------------------------- !
- ! !
+ !-------------------------------------------------------- !
+ ! !
! Interface to sedimentation, detrain, cloud fraction and !
! cloud macro - microphysics subroutines !
- ! !
+ ! !
!-------------------------------------------------------- !
use cloud_fraction, only: cldfrc, cldfrc_fice
@@ -475,7 +475,7 @@ subroutine rk_stratiform_tend( &
! Physics buffer fields
real(r8), pointer :: landm(:) ! Land fraction ramped over water
- real(r8), pointer :: prec_str(:) ! [Total] Sfc flux of precip from stratiform [ m/s ]
+ real(r8), pointer :: prec_str(:) ! [Total] Sfc flux of precip from stratiform [ m/s ]
real(r8), pointer :: snow_str(:) ! [Total] Sfc flux of snow from stratiform [ m/s ]
real(r8), pointer :: prec_sed(:) ! Surface flux of total cloud water from sedimentation
real(r8), pointer :: snow_sed(:) ! Surface flux of cloud ice from sedimentation
@@ -517,12 +517,12 @@ subroutine rk_stratiform_tend( &
real(r8) :: clc(pcols) ! Column convective cloud amount
real(r8) :: relhum(pcols,pver) ! RH, output to determine drh/da
real(r8) :: rhu00(pcols,pver)
- real(r8) :: rhu002(pcols,pver) ! Same as rhu00 but for perturbed rh
+ real(r8) :: rhu002(pcols,pver) ! Same as rhu00 but for perturbed rh
real(r8) :: rhdfda(pcols,pver)
real(r8) :: cld2(pcols,pver) ! Same as cld but for perturbed rh
- real(r8) :: concld2(pcols,pver) ! Same as concld but for perturbed rh
- real(r8) :: cldst2(pcols,pver) ! Same as cldst but for perturbed rh
- real(r8) :: relhum2(pcols,pver) ! RH after perturbation
+ real(r8) :: concld2(pcols,pver) ! Same as concld but for perturbed rh
+ real(r8) :: cldst2(pcols,pver) ! Same as cldst but for perturbed rh
+ real(r8) :: relhum2(pcols,pver) ! RH after perturbation
real(r8) :: icecldf(pcols,pver) ! Ice cloud fraction
real(r8) :: liqcldf(pcols,pver) ! Liquid cloud fraction (combined into cloud)
real(r8) :: icecldf_out(pcols,pver) ! Ice cloud fraction
@@ -547,11 +547,11 @@ subroutine rk_stratiform_tend( &
real(r8) :: repartht(pcols,pver) ! Heating rate due to phase repartition of input precip
real(r8) :: icimr(pcols,pver) ! In cloud ice mixing ratio
real(r8) :: icwmr(pcols,pver) ! In cloud water mixing ratio
- real(r8) :: fwaut(pcols,pver)
- real(r8) :: fsaut(pcols,pver)
- real(r8) :: fracw(pcols,pver)
- real(r8) :: fsacw(pcols,pver)
- real(r8) :: fsaci(pcols,pver)
+ real(r8) :: fwaut(pcols,pver)
+ real(r8) :: fsaut(pcols,pver)
+ real(r8) :: fracw(pcols,pver)
+ real(r8) :: fsacw(pcols,pver)
+ real(r8) :: fsaci(pcols,pver)
real(r8) :: cmeice(pcols,pver) ! Rate of cond-evap of ice within the cloud
real(r8) :: cmeliq(pcols,pver) ! Rate of cond-evap of liq within the cloud
real(r8) :: ice2pr(pcols,pver) ! Rate of conversion of ice to precip
@@ -569,8 +569,8 @@ subroutine rk_stratiform_tend( &
real(r8) :: psacio(pcols,pver) ! RK accretion of cloud ice by snow (1/s)
real(r8) :: iwc(pcols,pver) ! Grid box average ice water content
- real(r8) :: lwc(pcols,pver) ! Grid box average liquid water content
-
+ real(r8) :: lwc(pcols,pver) ! Grid box average liquid water content
+
logical :: lq(pcnst)
integer :: troplev(pcols)
real(r8) :: rlat(pcols)
@@ -598,7 +598,7 @@ subroutine rk_stratiform_tend( &
call pbuf_get_field(pbuf, ast_idx, ast, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) )
call pbuf_get_field(pbuf, fice_idx, fice)
-
+
call pbuf_get_field(pbuf, cmfmc_sh_idx, cmfmc_sh)
call pbuf_get_field(pbuf, prec_str_idx, prec_str)
@@ -616,7 +616,7 @@ subroutine rk_stratiform_tend( &
call pbuf_get_field(pbuf, rei_idx, rei)
call pbuf_get_field(pbuf, wsedl_idx, wsedl)
-
+
! check that qcwat and tcwat were initialized; if not then do it now.
if (qcwat(1,1) == huge(1._r8)) then
qcwat(:ncol,:) = state%q(:ncol,:,1)
@@ -636,16 +636,16 @@ subroutine rk_stratiform_tend( &
! ------------- !
! Allow the cloud liquid drops and ice particles to sediment.
- ! This is done before adding convectively detrained cloud water,
+ ! This is done before adding convectively detrained cloud water,
! because the phase of the detrained water is unknown.
call t_startf('stratiform_sediment')
call cld_sediment_vel( ncol, &
icefrac, landfrac, ocnfrac, state1%pmid, state1%pdel, state1%t, &
- cld, state1%q(:,:,ixcldliq), state1%q(:,:,ixcldice), &
+ cld, state1%q(:,:,ixcldliq), state1%q(:,:,ixcldice), &
pvliq, pvice, landm, snowh )
-
+
wsedl(:ncol,:pver) = pvliq(:ncol,:pver)/gravit/(state1%pmid(:ncol,:pver)/(287.15_r8*state1%t(:ncol,:pver)))
lq(:) = .FALSE.
@@ -680,7 +680,7 @@ subroutine rk_stratiform_tend( &
call physics_ptend_init(ptend_all, state%psetcols, 'stratiform')
call physics_ptend_sum( ptend_loc, ptend_all, ncol )
- ! Update physics state type state1 with ptend_loc
+ ! Update physics state type state1 with ptend_loc
call physics_update( state1, ptend_loc, dtime )
call t_stopf('stratiform_sediment')
@@ -695,13 +695,13 @@ subroutine rk_stratiform_tend( &
! Put all of the detraining cloud water from convection into the large scale cloud.
! It all goes in liquid for the moment.
- ! Strictly speaking, this approach is detraining all the cconvective water into
+ ! Strictly speaking, this approach is detraining all the cconvective water into
! the environment, not the large-scale cloud.
lq(:) = .FALSE.
lq(ixcldliq) = .TRUE.
call physics_ptend_init( ptend_loc, state1%psetcols, 'pcwdetrain', lq=lq)
-
+
do k = 1, pver
do i = 1, state1%ncol
ptend_loc%q(i,k,ixcldliq) = dlf(i,k)
@@ -725,7 +725,7 @@ subroutine rk_stratiform_tend( &
! -------------------------------------- !
! ----------------------------------------------------------------------------- !
- ! Treatment of cloud fraction in CAM4 and CAM5 differs !
+ ! Treatment of cloud fraction in CAM4 and CAM5 differs !
! (1) CAM4 !
! . Cumulus AMT = Deep Cumulus AMT ( empirical fcn of mass flux ) + !
! Shallow Cumulus AMT ( empirical fcn of mass flux ) !
@@ -738,7 +738,7 @@ subroutine rk_stratiform_tend( &
! . Stratus AMT = fcn of environmental-mean RH ( no Stability Stratus ) !
! . Cumulus and Stratus are non-overlapped with higher priority on Cumulus !
! . Cumulus ( both Deep and Shallow ) has its own LWC and IWC. !
- ! ----------------------------------------------------------------------------- !
+ ! ----------------------------------------------------------------------------- !
if( use_shfrc ) then
call pbuf_get_field(pbuf, shfrc_idx, shfrc )
@@ -748,8 +748,8 @@ subroutine rk_stratiform_tend( &
endif
! Stratus ('ast' = max(alst,aist)) and total cloud fraction ('cld = ast + concld')
- ! will be computed using this updated 'concld' in the stratiform macrophysics
- ! scheme (mmacro_pcond) later below.
+ ! will be computed using this updated 'concld' in the stratiform macrophysics
+ ! scheme (mmacro_pcond) later below.
call t_startf("cldfrc")
call cldfrc( lchnk, ncol, pbuf, &
@@ -759,7 +759,7 @@ subroutine rk_stratiform_tend( &
cmfmc, cmfmc_sh, landfrac,snowh, concld, cldst, &
ts, sst, state1%pint(:,pverp), zdu, ocnfrac, rhu00, &
state1%q(:,:,ixcldice), icecldf, liqcldf, &
- relhum, 0 )
+ relhum, 0 )
! Re-calculate cloud with perturbed rh add call cldfrc to estimate rhdfda.
@@ -770,7 +770,7 @@ subroutine rk_stratiform_tend( &
cmfmc, cmfmc_sh, landfrac, snowh, concld2, cldst2, &
ts, sst, state1%pint(:,pverp), zdu, ocnfrac, rhu002, &
state1%q(:,:,ixcldice), icecldf2, liqcldf2, &
- relhum2, 1 )
+ relhum2, 1 )
call t_stopf("cldfrc")
@@ -785,7 +785,7 @@ subroutine rk_stratiform_tend( &
! Under certain circumstances, rh+ cause cld not to changed
! when at an upper limit, or w/ strong subsidence
if( ( cld2(i,k) - cld(i,k) ) < 1.e-4_r8 ) then
- rhdfda(i,k) = 0.01_r8*relhum(i,k)*1.e+4_r8
+ rhdfda(i,k) = 0.01_r8*relhum(i,k)*1.e+4_r8
else
rhdfda(i,k) = 0.01_r8*relhum(i,k)/(cld2(i,k)-cld(i,k))
endif
@@ -802,13 +802,17 @@ subroutine rk_stratiform_tend( &
rdtime = 1._r8/dtime
! Define fractional amount of stratus condensate and precipitation in ice phase.
- ! This uses a ramp ( -30 ~ -10 for fice, -5 ~ 0 for fsnow ).
+ ! This uses a ramp ( -30 ~ -10 for fice, -5 ~ 0 for fsnow ).
! The ramp within convective cloud may be different
- call cldfrc_fice(ncol, state1%t, fice, fsnow)
+!REMOVECAM - no longer need these when CAM is retired and pcols no longer exists
+ fice(:,:) = 0._r8
+ fsnow(:,:) = 0._r8
+!REMOVECAM_END
+ call cldfrc_fice(ncol, state1%t(1:ncol,:), fice(1:ncol,:), fsnow(1:ncol,:))
- ! Perform repartitioning of stratiform condensate.
- ! Corresponding heating tendency will be added later.
+ ! Perform repartitioning of stratiform condensate.
+ ! Corresponding heating tendency will be added later.
lq(:) = .FALSE.
lq(ixcldice) = .true.
@@ -830,7 +834,7 @@ subroutine rk_stratiform_tend( &
repartht(:ncol,:pver) = (latice/dtime) * ( state1%q(:ncol,:pver,ixcldice) - repartht(:ncol,:pver) )
- ! Non-micro and non-macrophysical external advective forcings to compute net condensation rate.
+ ! Non-micro and non-macrophysical external advective forcings to compute net condensation rate.
! Note that advective forcing of condensate is aggregated into liquid phase.
qtend(:ncol,:pver) = ( state1%q(:ncol,:pver,1) - qcwat(:ncol,:pver) ) * rdtime
@@ -869,7 +873,7 @@ subroutine rk_stratiform_tend( &
ptend_loc%q(i,k,ixcldliq) = qme(i,k)*(1._r8-fice(i,k)) - liq2pr(i,k)
end do
end do
-
+
do k = 1, pver
do i = 1, ncol
ast(i,k) = cld(i,k)
@@ -960,7 +964,7 @@ subroutine rk_stratiform_tend( &
cmfmc, cmfmc_sh, landfrac, snowh, concld, cldst, &
ts, sst, state1%pint(:,pverp), zdu, ocnfrac, rhu00, &
state1%q(:,:,ixcldice), icecldf, liqcldf, &
- relhum, 0 )
+ relhum, 0 )
call t_stopf("cldfrc")
endif
@@ -968,7 +972,7 @@ subroutine rk_stratiform_tend( &
call outfld( 'CONCLD ', concld, pcols, lchnk )
call outfld( 'CLDST ', cldst, pcols, lchnk )
call outfld( 'CNVCLD ', clc, pcols, lchnk )
- call outfld( 'AST', ast, pcols, lchnk )
+ call outfld( 'AST', ast, pcols, lchnk )
do k = 1, pver
do i = 1, ncol
@@ -1000,7 +1004,7 @@ subroutine rk_stratiform_tend( &
tcwat(:ncol,k) = state1%t(:ncol,k)
lcwat(:ncol,k) = state1%q(:ncol,k,ixcldice) + state1%q(:ncol,k,ixcldliq)
end do
-
+
! Cloud water and ice particle sizes, saved in physics buffer for radiation
call cldefr( lchnk, ncol, landfrac, state1%t, rel, rei, state1%ps, state1%pmid, landm, icefrac, snowh )
@@ -1025,7 +1029,7 @@ subroutine debug_microphys_1(state1,ptend,i,k, &
use physconst, only: tmelt
implicit none
-
+
integer, intent(in) :: i,k
type(physics_state), intent(in) :: state1 ! local copy of the state variable
type(physics_ptend), intent(in) :: ptend ! local copy of the ptend variable
@@ -1058,11 +1062,11 @@ subroutine debug_microphys_1(state1,ptend,i,k, &
wv = 0
wi = 0
wlf = 0
- wvf = 0
+ wvf = 0
wif = 0
- write(iulog,*)
+ write(iulog,*)
write(iulog,*) ' input state, t, q, l, i ', k, state1%t(i,k), state1%q(i,k,1), state1%q(i,k,ixcldliq), state1%q(i,k,ixcldice)
write(iulog,*) ' rain, snow, total from components before accumulation ', qr1, qs1, qr1+qs1
write(iulog,*) ' total precip before accumulation ', k, pr1
@@ -1143,7 +1147,7 @@ subroutine debug_microphys_1(state1,ptend,i,k, &
! + evapheat(i,k) + prfzheat(i,k) + meltheat(i,k)
res = qs1+qr1-pr1
- w4 = max(abs(qs1),abs(qr1),abs(pr1))
+ w4 = max(abs(qs1),abs(qr1),abs(pr1))
if (w4.gt.0._r8) then
if (res/w4.gt.1.e-14_r8) then
write(iulog,*) ' imbalance in precips calculated two ways '
@@ -1173,14 +1177,14 @@ subroutine debug_microphys_2(state1,&
use ppgrid, only: pver
use physconst, only: tmelt
use physics_types, only: physics_state
-
+
implicit none
type(physics_state), intent(in) :: state1 ! local copy of the state variable
real(r8), intent(in) :: snow_pcw(pcols)
- real(r8), intent(in) :: fsaut(pcols,pver)
- real(r8), intent(in) :: fsacw(pcols,pver)
- real(r8), intent(in) :: fsaci(pcols,pver)
+ real(r8), intent(in) :: fsaut(pcols,pver)
+ real(r8), intent(in) :: fsacw(pcols,pver)
+ real(r8), intent(in) :: fsaci(pcols,pver)
real(r8), intent(in) :: meltheat(pcols,pver) ! heating rate due to phase change of precip
@@ -1189,7 +1193,7 @@ subroutine debug_microphys_2(state1,&
ncol = state1%ncol
lchnk = state1%lchnk
-
+
do i = 1,ncol
if (snow_pcw(i) .gt. 0.01_r8/8.64e4_r8 .and. state1%t(i,pver) .gt. tmelt) then
write(iulog,*) ' stratiform: snow, temp, ', i, lchnk, &
@@ -1201,7 +1205,7 @@ subroutine debug_microphys_2(state1,&
write(iulog,*) ' meltheat ', meltheat(i,:)
call endrun ('STRATIFORM_TEND')
endif
-
+
if (snow_pcw(i)*8.64e4_r8 .lt. -1.e-5_r8) then
write(iulog,*) ' neg snow ', snow_pcw(i)*8.64e4_r8
write(iulog,*) ' stratiform: snow_pcw, temp, ', i, lchnk, &
@@ -1214,7 +1218,7 @@ subroutine debug_microphys_2(state1,&
call endrun ('STRATIFORM_TEND')
endif
end do
-
+
end subroutine debug_microphys_2
end module rk_stratiform
diff --git a/src/physics/cam/vertical_diffusion.F90 b/src/physics/cam/vertical_diffusion.F90
index dd2cc721f3..224d87e3a0 100644
--- a/src/physics/cam/vertical_diffusion.F90
+++ b/src/physics/cam/vertical_diffusion.F90
@@ -72,7 +72,6 @@ module vertical_diffusion
use ref_pres, only : do_molec_diff, nbot_molec
use phys_control, only : phys_getopts
use time_manager, only : is_first_step
-
implicit none
private
save
@@ -129,6 +128,9 @@ module vertical_diffusion
integer :: taubljx_idx = -1
integer :: taubljy_idx = -1
+! pbuf field for clubb top above which HB (Holtslag Boville) scheme may be enabled
+integer :: clubbtop_idx = -1
+
logical :: diff_cnsrv_mass_check ! do mass conservation check
logical :: do_iss ! switch for implicit turbulent surface stress
logical :: prog_modal_aero = .false. ! set true if prognostic modal aerosols are present
@@ -137,6 +139,7 @@ module vertical_diffusion
logical :: do_pbl_diags = .false.
logical :: waccmx_mode = .false.
+logical :: do_hb_above_clubb = .false.
contains
@@ -284,7 +287,7 @@ subroutine vertical_diffusion_init(pbuf2d)
integer :: nbot_eddy ! Bottom interface level to which eddy vertical diffusion is applied ( = pver )
integer :: k ! Vertical loop index
- real(r8), parameter :: ntop_eddy_pres = 1.e-5_r8 ! Pressure below which eddy diffusion is not done in WACCM-X. (Pa)
+ real(r8), parameter :: ntop_eddy_pres = 1.e-7_r8 ! Pressure below which eddy diffusion is not done in WACCM-X. (Pa)
integer :: im, l, m, nmodes, nspec
@@ -389,6 +392,8 @@ subroutine vertical_diffusion_init(pbuf2d)
if (masterproc) write(iulog, fmt='(a,i3,5x,a,i3)') 'NTOP_EDDY =', ntop_eddy, 'NBOT_EDDY =', nbot_eddy
+ call phys_getopts(do_hb_above_clubb_out=do_hb_above_clubb)
+
select case ( eddy_scheme )
case ( 'diag_TKE', 'SPCAM_m2005' )
if( masterproc ) write(iulog,*) &
@@ -401,6 +406,18 @@ subroutine vertical_diffusion_init(pbuf2d)
call addfld('HB_ri', (/ 'lev' /), 'A', 'no', 'Richardson Number (HB Scheme), I' )
case ( 'CLUBB_SGS' )
do_pbl_diags = .true.
+ call init_hb_diff(gravit, cpair, ntop_eddy, nbot_eddy, pref_mid, karman, eddy_scheme)
+ !
+ ! run HB scheme where CLUBB is not active when running cam_dev or cam6 physics
+ ! else init_hb_diff is called just for diagnostic purposes
+ !
+ if (do_hb_above_clubb) then
+ if( masterproc ) then
+ write(iulog,*) 'vertical_diffusion_init: '
+ write(iulog,*) 'eddy_diffusivity scheme where CLUBB is not active: Holtslag and Boville'
+ end if
+ call addfld('HB_ri', (/ 'lev' /), 'A', 'no', 'Richardson Number (HB Scheme), I' )
+ end if
end select
! ------------------------------------------- !
@@ -599,6 +616,11 @@ subroutine vertical_diffusion_init(pbuf2d)
kvh_idx = pbuf_get_index('kvh')
end if
+ if (do_hb_above_clubb) then
+ ! pbuf field denoting top of clubb
+ clubbtop_idx = pbuf_get_index('clubbtop')
+ end if
+
! Initialization of some pbuf fields
if (is_first_step()) then
! Initialization of pbuf fields tke, kvh, kvm are done in phys_inidat
@@ -658,7 +680,7 @@ subroutine vertical_diffusion_tend( &
use trb_mtn_stress_cam, only : trb_mtn_stress_tend
use beljaars_drag_cam, only : beljaars_drag_tend
use eddy_diff_cam, only : eddy_diff_tend
- use hb_diff, only : compute_hb_diff
+ use hb_diff, only : compute_hb_diff, compute_hb_free_atm_diff
use wv_saturation, only : qsat
use molec_diff, only : compute_molec_diff, vd_lu_qdecomp
use constituents, only : qmincg, qmin, cnst_type
@@ -839,6 +861,7 @@ subroutine vertical_diffusion_tend( &
real(r8) :: tauy(pcols)
real(r8) :: shflux(pcols)
real(r8) :: cflux(pcols,pcnst)
+ integer, pointer :: clubbtop(:) ! (pcols)
logical :: lq(pcnst)
@@ -979,42 +1002,67 @@ subroutine vertical_diffusion_tend( &
! Modification : We may need to use 'taux' instead of 'tautotx' here, for
! consistency with the previous HB scheme.
- call compute_hb_diff( lchnk , ncol , &
- th , state%t , state%q , state%zm , state%zi, &
- state%pmid, state%u , state%v , tautotx , tautoty , &
- cam_in%shf, cam_in%cflx(:,1), obklen , ustar , pblh , &
- kvm , kvh , kvq , cgh , cgs , &
- tpert , qpert , cldn , cam_in%ocnfrac , tke , &
+
+ call compute_hb_diff(ncol , &
+ th , state%t , state%q , state%zm , state%zi , &
+ state%pmid, state%u , state%v , tautotx , tautoty , &
+ cam_in%shf, cam_in%cflx(:,1), obklen , ustar , pblh , &
+ kvm , kvh , kvq , cgh , cgs , &
+ tpert , qpert , cldn , cam_in%ocnfrac , tke , &
ri , &
- eddy_scheme )
+ eddy_scheme)
call outfld( 'HB_ri', ri, pcols, lchnk )
case ( 'CLUBB_SGS' )
-
- ! CLUBB has only a bare-bones placeholder here. If using CLUBB, the
- ! PBL diffusion will happen before coupling, so vertical_diffusion
- ! is only handling other things, e.g. some boundary conditions, tms,
- ! and molecular diffusion.
-
- call virtem(ncol, th(:ncol,pver),state%q(:ncol,pver,1), thvs(:ncol))
-
- call calc_ustar( ncol, state%t(:ncol,pver), state%pmid(:ncol,pver), &
- cam_in%wsx(:ncol), cam_in%wsy(:ncol), rrho(:ncol), ustar(:ncol))
- ! Use actual qflux, not lhf/latvap as was done previously
- call calc_obklen( ncol, th(:ncol,pver), thvs(:ncol), cam_in%cflx(:ncol,1), &
- cam_in%shf(:ncol), rrho(:ncol), ustar(:ncol), &
- khfs(:ncol), kqfs(:ncol), kbfs(:ncol), obklen(:ncol))
-
- ! These tendencies all applied elsewhere.
- kvm = 0._r8
- kvh = 0._r8
- kvq = 0._r8
-
- ! Not defined since PBL is not actually running here.
- cgh = 0._r8
- cgs = 0._r8
-
+ !
+ ! run HB scheme where CLUBB is not active when running cam_dev
+ !
+ if (do_hb_above_clubb) then
+ call compute_hb_free_atm_diff( ncol , &
+ th , state%t , state%q , state%zm , &
+ state%pmid, state%u , state%v , tautotx , tautoty , &
+ cam_in%shf, cam_in%cflx(:,1), obklen , ustar , &
+ kvm , kvh , kvq , cgh , cgs , &
+ ri )
+
+ call pbuf_get_field(pbuf, clubbtop_idx, clubbtop)
+ !
+ ! zero out HB where CLUBB is active
+ !
+ do i=1,ncol
+ do k=clubbtop(i),pverp
+ kvm(i,k) = 0.0_r8
+ kvh(i,k) = 0.0_r8
+ kvq(i,k) = 0.0_r8
+ cgs(i,k) = 0.0_r8
+ cgh(i,k) = 0.0_r8
+ end do
+ end do
+
+ call outfld( 'HB_ri', ri, pcols, lchnk )
+ else
+ ! CLUBB has only a bare-bones placeholder here. If using CLUBB, the
+ ! PBL diffusion will happen before coupling, so vertical_diffusion
+ ! is only handling other things, e.g. some boundary conditions, tms,
+ ! and molecular diffusion.
+
+ call virtem(ncol, th(:ncol,pver),state%q(:ncol,pver,1), thvs(:ncol))
+
+ call calc_ustar( ncol, state%t(:ncol,pver), state%pmid(:ncol,pver), &
+ cam_in%wsx(:ncol), cam_in%wsy(:ncol), rrho(:ncol), ustar(:ncol))
+ ! Use actual qflux, not lhf/latvap as was done previously
+ call calc_obklen( ncol, th(:ncol,pver), thvs(:ncol), cam_in%cflx(:ncol,1), &
+ cam_in%shf(:ncol), rrho(:ncol), ustar(:ncol), &
+ khfs(:ncol), kqfs(:ncol), kbfs(:ncol), obklen(:ncol))
+ ! These tendencies all applied elsewhere.
+ kvm = 0._r8
+ kvh = 0._r8
+ kvq = 0._r8
+ ! Not defined since PBL is not actually running here.
+ cgh = 0._r8
+ cgs = 0._r8
+ end if
end select
call outfld( 'ustar', ustar(:), pcols, lchnk )
@@ -1060,9 +1108,9 @@ subroutine vertical_diffusion_tend( &
call outfld( 'slv_pre_PBL ', slv_prePBL, pcols, lchnk )
call outfld( 'u_pre_PBL ', state%u, pcols, lchnk )
call outfld( 'v_pre_PBL ', state%v, pcols, lchnk )
- call outfld( 'qv_pre_PBL ', state%q(:ncol,:,1), pcols, lchnk )
- call outfld( 'ql_pre_PBL ', state%q(:ncol,:,ixcldliq), pcols, lchnk )
- call outfld( 'qi_pre_PBL ', state%q(:ncol,:,ixcldice), pcols, lchnk )
+ call outfld( 'qv_pre_PBL ', state%q(:,:,1), pcols, lchnk )
+ call outfld( 'ql_pre_PBL ', state%q(:,:,ixcldliq), pcols, lchnk )
+ call outfld( 'qi_pre_PBL ', state%q(:,:,ixcldice), pcols, lchnk )
call outfld( 't_pre_PBL ', state%t, pcols, lchnk )
call outfld( 'rh_pre_PBL ', ftem_prePBL, pcols, lchnk )
@@ -1424,11 +1472,11 @@ subroutine vertical_diffusion_tend( &
call outfld( 'vflx_cg_PBL' , vflx_cg, pcols, lchnk )
call outfld( 'slten_PBL' , slten, pcols, lchnk )
call outfld( 'qtten_PBL' , qtten, pcols, lchnk )
- call outfld( 'uten_PBL' , ptend%u(:ncol,:), pcols, lchnk )
- call outfld( 'vten_PBL' , ptend%v(:ncol,:), pcols, lchnk )
- call outfld( 'qvten_PBL' , ptend%q(:ncol,:,1), pcols, lchnk )
- call outfld( 'qlten_PBL' , ptend%q(:ncol,:,ixcldliq), pcols, lchnk )
- call outfld( 'qiten_PBL' , ptend%q(:ncol,:,ixcldice), pcols, lchnk )
+ call outfld( 'uten_PBL' , ptend%u, pcols, lchnk )
+ call outfld( 'vten_PBL' , ptend%v, pcols, lchnk )
+ call outfld( 'qvten_PBL' , ptend%q(:,:,1), pcols, lchnk )
+ call outfld( 'qlten_PBL' , ptend%q(:,:,ixcldliq), pcols, lchnk )
+ call outfld( 'qiten_PBL' , ptend%q(:,:,ixcldice), pcols, lchnk )
call outfld( 'tten_PBL' , tten, pcols, lchnk )
call outfld( 'rhten_PBL' , rhten, pcols, lchnk )
diff --git a/src/physics/cam/zm_conv.F90 b/src/physics/cam/zm_conv.F90
deleted file mode 100644
index 6305f6ba6d..0000000000
--- a/src/physics/cam/zm_conv.F90
+++ /dev/null
@@ -1,4825 +0,0 @@
-module zm_conv
-
-!---------------------------------------------------------------------------------
-! Purpose:
-!
-! Interface from Zhang-McFarlane convection scheme, includes evaporation of convective
-! precip from the ZM scheme
-!
-! Apr 2006: RBN: Code added to perform a dilute ascent for closure of the CM mass flux
-! based on an entraining plume a la Raymond and Blythe (1992)
-!
-! Author: Byron Boville, from code in tphysbc
-!
-!---------------------------------------------------------------------------------
- use shr_kind_mod, only: r8 => shr_kind_r8
- use spmd_utils, only: masterproc
- use ppgrid, only: pcols, pver, pverp
- use cloud_fraction, only: cldfrc_fice
- use physconst, only: cpair, epsilo, gravit, latice, latvap, tmelt, rair, &
- cpwv, cpliq, rh2o
- use cam_abortutils, only: endrun
- use cam_logfile, only: iulog
- use zm_microphysics, only: zm_mphy, zm_aero_t, zm_conv_t
- use cam_history, only: outfld
-
- implicit none
-
- save
- private ! Make default type private to the module
-!
-! PUBLIC: interfaces
-!
- public zm_convi ! ZM schemea
- public zm_convr ! ZM schemea
- public zm_conv_evap ! evaporation of precip from ZM schemea
- public convtran ! convective transport
- public momtran ! convective momentum transport
-
-!
-! Private data
-!
- real(r8) rl ! wg latent heat of vaporization.
- real(r8) cpres ! specific heat at constant pressure in j/kg-degk.
- real(r8) :: capelmt ! namelist configurable:
- ! threshold value for cape for deep convection.
- real(r8) :: ke ! Tunable evaporation efficiency set from namelist input zmconv_ke
- real(r8) :: ke_lnd
- real(r8) :: c0_lnd ! set from namelist input zmconv_c0_lnd
- real(r8) :: c0_ocn ! set from namelist input zmconv_c0_ocn
- integer :: num_cin ! set from namelist input zmconv_num_cin
- ! The number of negative buoyancy regions that are allowed
- ! before the convection top and CAPE calculations are completed.
- logical :: zm_org
- real(r8) tau ! convective time scale
- real(r8),parameter :: c1 = 6.112_r8
- real(r8),parameter :: c2 = 17.67_r8
- real(r8),parameter :: c3 = 243.5_r8
- real(r8) :: tfreez
- real(r8) :: eps1
- real(r8) :: momcu
- real(r8) :: momcd
-
- logical :: zmconv_microp
-
- logical :: no_deep_pbl ! default = .false.
- ! no_deep_pbl = .true. eliminates deep convection entirely within PBL
-
-
-!moved from moistconvection.F90
- real(r8) :: rgrav ! reciprocal of grav
- real(r8) :: rgas ! gas constant for dry air
- real(r8) :: grav ! = gravit
- real(r8) :: cp ! = cpres = cpair
-
- integer limcnv ! top interface level limit for convection
-
- logical :: lparcel_pbl ! Switch to turn on mixing of parcel MSE air, and picking launch level to be the top of the PBL.
-
-
- real(r8) :: tiedke_add ! namelist configurable
- real(r8) :: dmpdz_param ! namelist configurable
-
-contains
-
-
-subroutine zm_convi(limcnv_in, zmconv_c0_lnd, zmconv_c0_ocn, zmconv_ke, zmconv_ke_lnd, &
- zmconv_momcu, zmconv_momcd, zmconv_num_cin, zmconv_org, &
- zmconv_microp_in, no_deep_pbl_in, zmconv_tiedke_add, &
- zmconv_capelmt, zmconv_dmpdz, zmconv_parcel_pbl, zmconv_tau)
-
- integer, intent(in) :: limcnv_in ! top interface level limit for convection
- integer, intent(in) :: zmconv_num_cin ! Number negative buoyancy regions that are allowed
- ! before the convection top and CAPE calculations are completed.
- real(r8),intent(in) :: zmconv_c0_lnd
- real(r8),intent(in) :: zmconv_c0_ocn
- real(r8),intent(in) :: zmconv_ke
- real(r8),intent(in) :: zmconv_ke_lnd
- real(r8),intent(in) :: zmconv_momcu
- real(r8),intent(in) :: zmconv_momcd
- logical :: zmconv_org
- logical, intent(in) :: zmconv_microp_in
- logical, intent(in) :: no_deep_pbl_in ! no_deep_pbl = .true. eliminates ZM convection entirely within PBL
- real(r8),intent(in) :: zmconv_tiedke_add
- real(r8),intent(in) :: zmconv_capelmt
- real(r8),intent(in) :: zmconv_dmpdz
- logical, intent(in) :: zmconv_parcel_pbl ! Should the parcel properties include PBL mixing?
- real(r8),intent(in) :: zmconv_tau
-
- ! Initialization of ZM constants
- limcnv = limcnv_in
- tfreez = tmelt
- eps1 = epsilo
- rl = latvap
- cpres = cpair
- rgrav = 1.0_r8/gravit
- rgas = rair
- grav = gravit
- cp = cpres
-
- c0_lnd = zmconv_c0_lnd
- c0_ocn = zmconv_c0_ocn
- num_cin = zmconv_num_cin
- ke = zmconv_ke
- ke_lnd = zmconv_ke_lnd
- zm_org = zmconv_org
- momcu = zmconv_momcu
- momcd = zmconv_momcd
-
- zmconv_microp = zmconv_microp_in
-
- tiedke_add = zmconv_tiedke_add
- capelmt = zmconv_capelmt
- dmpdz_param = zmconv_dmpdz
- no_deep_pbl = no_deep_pbl_in
- lparcel_pbl = zmconv_parcel_pbl
-
- tau = zmconv_tau
-
- if ( masterproc ) then
- write(iulog,*) 'tuning parameters zm_convi: tau',tau
- write(iulog,*) 'tuning parameters zm_convi: c0_lnd',c0_lnd, ', c0_ocn', c0_ocn
- write(iulog,*) 'tuning parameters zm_convi: num_cin', num_cin
- write(iulog,*) 'tuning parameters zm_convi: ke',ke
- write(iulog,*) 'tuning parameters zm_convi: no_deep_pbl',no_deep_pbl
- write(iulog,*) 'tuning parameters zm_convi: zm_capelmt', capelmt
- write(iulog,*) 'tuning parameters zm_convi: zm_dmpdz', dmpdz_param
- write(iulog,*) 'tuning parameters zm_convi: zm_tiedke_add', tiedke_add
- write(iulog,*) 'tuning parameters zm_convi: zm_parcel_pbl', lparcel_pbl
- endif
-
- if (masterproc) write(iulog,*)'**** ZM: DILUTE Buoyancy Calculation ****'
-
-end subroutine zm_convi
-
-
-
-subroutine zm_convr(lchnk ,ncol , &
- t ,qh ,prec ,jctop ,jcbot , &
- pblh ,zm ,geos ,zi ,qtnd , &
- heat ,pap ,paph ,dpp , &
- delt ,mcon ,cme ,cape , &
- tpert ,dlf ,pflx ,zdu ,rprd , &
- mu ,md ,du ,eu ,ed , &
- dp ,dsubcld ,jt ,maxg ,ideep , &
- ql ,rliq ,landfrac, &
- org ,orgt ,org2d , &
- dif ,dnlf ,dnif ,conv , &
- aero , rice)
-!-----------------------------------------------------------------------
-!
-! Purpose:
-! Main driver for zhang-mcfarlane convection scheme
-!
-! Method:
-! performs deep convective adjustment based on mass-flux closure
-! algorithm.
-!
-! Author:guang jun zhang, m.lazare, n.mcfarlane. CAM Contact: P. Rasch
-!
-! This is contributed code not fully standardized by the CAM core group.
-! All variables have been typed, where most are identified in comments
-! The current procedure will be reimplemented in a subsequent version
-! of the CAM where it will include a more straightforward formulation
-! and will make use of the standard CAM nomenclature
-!
-!-----------------------------------------------------------------------
- use phys_control, only: cam_physpkg_is
-
-!
-! ************************ index of variables **********************
-!
-! wg * alpha array of vertical differencing used (=1. for upstream).
-! w * cape convective available potential energy.
-! wg * capeg gathered convective available potential energy.
-! c * capelmt threshold value for cape for deep convection.
-! ic * cpres specific heat at constant pressure in j/kg-degk.
-! i * dpp
-! ic * delt length of model time-step in seconds.
-! wg * dp layer thickness in mbs (between upper/lower interface).
-! wg * dqdt mixing ratio tendency at gathered points.
-! wg * dsdt dry static energy ("temp") tendency at gathered points.
-! wg * dudt u-wind tendency at gathered points.
-! wg * dvdt v-wind tendency at gathered points.
-! wg * dsubcld layer thickness in mbs between lcl and maxi.
-! ic * grav acceleration due to gravity in m/sec2.
-! wg * du detrainment in updraft. specified in mid-layer
-! wg * ed entrainment in downdraft.
-! wg * eu entrainment in updraft.
-! wg * hmn moist static energy.
-! wg * hsat saturated moist static energy.
-! w * ideep holds position of gathered points vs longitude index.
-! ic * pver number of model levels.
-! wg * j0 detrainment initiation level index.
-! wg * jd downdraft initiation level index.
-! ic * jlatpr gaussian latitude index for printing grids (if needed).
-! wg * jt top level index of deep cumulus convection.
-! w * lcl base level index of deep cumulus convection.
-! wg * lclg gathered values of lcl.
-! w * lel index of highest theoretical convective plume.
-! wg * lelg gathered values of lel.
-! w * lon index of onset level for deep convection.
-! w * maxi index of level with largest moist static energy.
-! wg * maxg gathered values of maxi.
-! wg * mb cloud base mass flux.
-! wg * mc net upward (scaled by mb) cloud mass flux.
-! wg * md downward cloud mass flux (positive up).
-! wg * mu upward cloud mass flux (positive up). specified
-! at interface
-! ic * msg number of missing moisture levels at the top of model.
-! w * p grid slice of ambient mid-layer pressure in mbs.
-! i * pblt row of pbl top indices.
-! w * pcpdh scaled surface pressure.
-! w * pf grid slice of ambient interface pressure in mbs.
-! wg * pg grid slice of gathered values of p.
-! w * q grid slice of mixing ratio.
-! wg * qd grid slice of mixing ratio in downdraft.
-! wg * qg grid slice of gathered values of q.
-! i/o * qh grid slice of specific humidity.
-! w * qh0 grid slice of initial specific humidity.
-! wg * qhat grid slice of upper interface mixing ratio.
-! wg * ql grid slice of cloud liquid water.
-! wg * qs grid slice of saturation mixing ratio.
-! w * qstp grid slice of parcel temp. saturation mixing ratio.
-! wg * qstpg grid slice of gathered values of qstp.
-! wg * qu grid slice of mixing ratio in updraft.
-! ic * rgas dry air gas constant.
-! wg * rl latent heat of vaporization.
-! w * s grid slice of scaled dry static energy (t+gz/cp).
-! wg * sd grid slice of dry static energy in downdraft.
-! wg * sg grid slice of gathered values of s.
-! wg * shat grid slice of upper interface dry static energy.
-! wg * su grid slice of dry static energy in updraft.
-! i/o * t
-! o * jctop row of top-of-deep-convection indices passed out.
-! O * jcbot row of base of cloud indices passed out.
-! wg * tg grid slice of gathered values of t.
-! w * tl row of parcel temperature at lcl.
-! wg * tlg grid slice of gathered values of tl.
-! w * tp grid slice of parcel temperatures.
-! wg * tpg grid slice of gathered values of tp.
-! i/o * u grid slice of u-wind (real).
-! wg * ug grid slice of gathered values of u.
-! i/o * utg grid slice of u-wind tendency (real).
-! i/o * v grid slice of v-wind (real).
-! w * va work array re-used by called subroutines.
-! wg * vg grid slice of gathered values of v.
-! i/o * vtg grid slice of v-wind tendency (real).
-! i * w grid slice of diagnosed large-scale vertical velocity.
-! w * z grid slice of ambient mid-layer height in metres.
-! w * zf grid slice of ambient interface height in metres.
-! wg * zfg grid slice of gathered values of zf.
-! wg * zg grid slice of gathered values of z.
-!
-!-----------------------------------------------------------------------
-!
-! multi-level i/o fields:
-! i => input arrays.
-! i/o => input/output arrays.
-! w => work arrays.
-! wg => work arrays operating only on gathered points.
-! ic => input data constants.
-! c => data constants pertaining to subroutine itself.
-!
-! input arguments
-!
- integer, intent(in) :: lchnk ! chunk identifier
- integer, intent(in) :: ncol ! number of atmospheric columns
-
- real(r8), intent(in) :: t(pcols,pver) ! grid slice of temperature at mid-layer.
- real(r8), intent(in) :: qh(pcols,pver) ! grid slice of specific humidity.
- real(r8), intent(in) :: pap(pcols,pver)
- real(r8), intent(in) :: paph(pcols,pver+1)
- real(r8), intent(in) :: dpp(pcols,pver) ! local sigma half-level thickness (i.e. dshj).
- real(r8), intent(in) :: zm(pcols,pver)
- real(r8), intent(in) :: geos(pcols)
- real(r8), intent(in) :: zi(pcols,pver+1)
- real(r8), intent(in) :: pblh(pcols)
- real(r8), intent(in) :: tpert(pcols)
- real(r8), intent(in) :: landfrac(pcols) ! RBN Landfrac
-
- type(zm_conv_t), intent(inout) :: conv
- type(zm_aero_t), intent(inout) :: aero ! aerosol object. intent(inout) because the
- ! gathered arrays are set here
- ! before passing object
- ! to microphysics
-! output arguments
-!
- real(r8), intent(out) :: qtnd(pcols,pver) ! specific humidity tendency (kg/kg/s)
- real(r8), intent(out) :: heat(pcols,pver) ! heating rate (dry static energy tendency, W/kg)
- real(r8), intent(out) :: mcon(pcols,pverp)
- real(r8), intent(out) :: dlf(pcols,pver) ! scattrd version of the detraining cld h2o tend
- real(r8), intent(out) :: pflx(pcols,pverp) ! scattered precip flux at each level
- real(r8), intent(out) :: cme(pcols,pver)
- real(r8), intent(out) :: cape(pcols) ! w convective available potential energy.
- real(r8), intent(out) :: zdu(pcols,pver)
- real(r8), intent(out) :: rprd(pcols,pver) ! rain production rate
- real(r8), intent(out) :: dif(pcols,pver) ! detrained convective cloud ice mixing ratio.
- real(r8), intent(out) :: dnlf(pcols,pver) ! detrained convective cloud water num concen.
- real(r8), intent(out) :: dnif(pcols,pver) ! detrained convective cloud ice num concen.
-
-! move these vars from local storage to output so that convective
-! transports can be done in outside of conv_cam.
- real(r8), intent(out) :: mu(pcols,pver)
- real(r8), intent(out) :: eu(pcols,pver)
- real(r8), intent(out) :: du(pcols,pver)
- real(r8), intent(out) :: md(pcols,pver)
- real(r8), intent(out) :: ed(pcols,pver)
- real(r8), intent(out) :: dp(pcols,pver) ! wg layer thickness in mbs (between upper/lower interface).
- real(r8), intent(out) :: dsubcld(pcols) ! wg layer thickness in mbs between lcl and maxi.
- real(r8), intent(out) :: jctop(pcols) ! o row of top-of-deep-convection indices passed out.
- real(r8), intent(out) :: jcbot(pcols) ! o row of base of cloud indices passed out.
- real(r8), intent(out) :: prec(pcols)
- real(r8), intent(out) :: rliq(pcols) ! reserved liquid (not yet in cldliq) for energy integrals
- real(r8), intent(out) :: rice(pcols) ! reserved ice (not yet in cldce) for energy integrals
-
- integer, intent(out) :: ideep(pcols) ! column indices of gathered points
-
- type(zm_conv_t) :: loc_conv
-
- real(r8), pointer :: org(:,:) ! Only used if zm_org is true
- real(r8), pointer :: orgt(:,:) ! Only used if zm_org is true
- real(r8), pointer :: org2d(:,:) ! Only used if zm_org is true
-
- real(r8) zs(pcols)
- real(r8) dlg(pcols,pver) ! gathrd version of the detraining cld h2o tend
- real(r8) pflxg(pcols,pverp) ! gather precip flux at each level
- real(r8) cug(pcols,pver) ! gathered condensation rate
-
- real(r8) evpg(pcols,pver) ! gathered evap rate of rain in downdraft
- real(r8) orgavg(pcols)
- real(r8) dptot(pcols)
- real(r8) mumax(pcols)
- integer jt(pcols) ! wg top level index of deep cumulus convection.
- integer maxg(pcols) ! wg gathered values of maxi.
- integer lengath
-! diagnostic field used by chem/wetdep codes
- real(r8) ql(pcols,pver) ! wg grid slice of cloud liquid water.
-!
- real(r8) pblt(pcols) ! i row of pbl top indices.
-
-
-
-
-!
-!-----------------------------------------------------------------------
-!
-! general work fields (local variables):
-!
- real(r8) q(pcols,pver) ! w grid slice of mixing ratio.
- real(r8) p(pcols,pver) ! w grid slice of ambient mid-layer pressure in mbs.
- real(r8) z(pcols,pver) ! w grid slice of ambient mid-layer height in metres.
- real(r8) s(pcols,pver) ! w grid slice of scaled dry static energy (t+gz/cp).
- real(r8) tp(pcols,pver) ! w grid slice of parcel temperatures.
- real(r8) zf(pcols,pver+1) ! w grid slice of ambient interface height in metres.
- real(r8) pf(pcols,pver+1) ! w grid slice of ambient interface pressure in mbs.
- real(r8) qstp(pcols,pver) ! w grid slice of parcel temp. saturation mixing ratio.
-
- real(r8) tl(pcols) ! w row of parcel temperature at lcl.
-
- integer lcl(pcols) ! w base level index of deep cumulus convection.
- integer lel(pcols) ! w index of highest theoretical convective plume.
- integer lon(pcols) ! w index of onset level for deep convection.
- integer maxi(pcols) ! w index of level with largest moist static energy.
-
- real(r8) precip
-!
-! gathered work fields:
-!
- real(r8) qg(pcols,pver) ! wg grid slice of gathered values of q.
- real(r8) tg(pcols,pver) ! w grid slice of temperature at interface.
- real(r8) pg(pcols,pver) ! wg grid slice of gathered values of p.
- real(r8) zg(pcols,pver) ! wg grid slice of gathered values of z.
- real(r8) sg(pcols,pver) ! wg grid slice of gathered values of s.
- real(r8) tpg(pcols,pver) ! wg grid slice of gathered values of tp.
- real(r8) zfg(pcols,pver+1) ! wg grid slice of gathered values of zf.
- real(r8) qstpg(pcols,pver) ! wg grid slice of gathered values of qstp.
- real(r8) ug(pcols,pver) ! wg grid slice of gathered values of u.
- real(r8) vg(pcols,pver) ! wg grid slice of gathered values of v.
- real(r8) cmeg(pcols,pver)
-
- real(r8) rprdg(pcols,pver) ! wg gathered rain production rate
- real(r8) capeg(pcols) ! wg gathered convective available potential energy.
- real(r8) tlg(pcols) ! wg grid slice of gathered values of tl.
- real(r8) landfracg(pcols) ! wg grid slice of landfrac
-
- integer lclg(pcols) ! wg gathered values of lcl.
- integer lelg(pcols)
-!
-! work fields arising from gathered calculations.
-!
- real(r8) dqdt(pcols,pver) ! wg mixing ratio tendency at gathered points.
- real(r8) dsdt(pcols,pver) ! wg dry static energy ("temp") tendency at gathered points.
-! real(r8) alpha(pcols,pver) ! array of vertical differencing used (=1. for upstream).
- real(r8) sd(pcols,pver) ! wg grid slice of dry static energy in downdraft.
- real(r8) qd(pcols,pver) ! wg grid slice of mixing ratio in downdraft.
- real(r8) mc(pcols,pver) ! wg net upward (scaled by mb) cloud mass flux.
- real(r8) qhat(pcols,pver) ! wg grid slice of upper interface mixing ratio.
- real(r8) qu(pcols,pver) ! wg grid slice of mixing ratio in updraft.
- real(r8) su(pcols,pver) ! wg grid slice of dry static energy in updraft.
- real(r8) qs(pcols,pver) ! wg grid slice of saturation mixing ratio.
- real(r8) shat(pcols,pver) ! wg grid slice of upper interface dry static energy.
- real(r8) hmn(pcols,pver) ! wg moist static energy.
- real(r8) hsat(pcols,pver) ! wg saturated moist static energy.
- real(r8) qlg(pcols,pver)
- real(r8) dudt(pcols,pver) ! wg u-wind tendency at gathered points.
- real(r8) dvdt(pcols,pver) ! wg v-wind tendency at gathered points.
-! real(r8) ud(pcols,pver)
-! real(r8) vd(pcols,pver)
-
-
-
-
-
-
-
- real(r8) qldeg(pcols,pver) ! cloud liquid water mixing ratio for detrainment (kg/kg)
- real(r8) mb(pcols) ! wg cloud base mass flux.
-
- integer jlcl(pcols)
- integer j0(pcols) ! wg detrainment initiation level index.
- integer jd(pcols) ! wg downdraft initiation level index.
-
- real(r8) delt ! length of model time-step in seconds.
-
- integer i
- integer ii
- integer k, kk, l, m
-
- integer msg ! ic number of missing moisture levels at the top of model.
- real(r8) qdifr
- real(r8) sdifr
-
- real(r8), parameter :: dcon = 25.e-6_r8
- real(r8), parameter :: mucon = 5.3_r8
- real(r8) negadq
- logical doliq
-
-
-!
-!--------------------------Data statements------------------------------
-
-!
-! Set internal variable "msg" (convection limit) to "limcnv-1"
-!
- msg = limcnv - 1
-!
-! initialize necessary arrays.
-! zero out variables not used in cam
-!
-
- if (zm_org) then
- orgt(:,:) = 0._r8
- end if
-
- qtnd(:,:) = 0._r8
- heat(:,:) = 0._r8
- mcon(:,:) = 0._r8
- rliq(:ncol) = 0._r8
- rice(:ncol) = 0._r8
-
- if (zmconv_microp) then
- allocate( &
- loc_conv%frz(pcols,pver), &
- loc_conv%sprd(pcols,pver), &
- loc_conv%wu(pcols,pver), &
- loc_conv%qi(pcols,pver), &
- loc_conv%qliq(pcols,pver), &
- loc_conv%qice(pcols,pver), &
- loc_conv%qrain(pcols,pver), &
- loc_conv%qsnow(pcols,pver), &
- loc_conv%di(pcols,pver), &
- loc_conv%dnl(pcols,pver), &
- loc_conv%dni(pcols,pver), &
- loc_conv%qnl(pcols,pver), &
- loc_conv%qni(pcols,pver), &
- loc_conv%qnr(pcols,pver), &
- loc_conv%qns(pcols,pver), &
- loc_conv%qide(pcols,pver), &
- loc_conv%qncde(pcols,pver), &
- loc_conv%qnide(pcols,pver), &
- loc_conv%autolm(pcols,pver), &
- loc_conv%accrlm(pcols,pver), &
- loc_conv%bergnm(pcols,pver), &
- loc_conv%fhtimm(pcols,pver), &
- loc_conv%fhtctm(pcols,pver), &
- loc_conv%fhmlm(pcols,pver), &
- loc_conv%hmpim(pcols,pver), &
- loc_conv%accslm(pcols,pver), &
- loc_conv%dlfm(pcols,pver), &
- loc_conv%cmel(pcols,pver), &
- loc_conv%autoln(pcols,pver), &
- loc_conv%accrln(pcols,pver), &
- loc_conv%bergnn(pcols,pver), &
- loc_conv%fhtimn(pcols,pver), &
- loc_conv%fhtctn(pcols,pver), &
- loc_conv%fhmln(pcols,pver), &
- loc_conv%accsln(pcols,pver), &
- loc_conv%activn(pcols,pver), &
- loc_conv%dlfn(pcols,pver), &
- loc_conv%autoim(pcols,pver), &
- loc_conv%accsim(pcols,pver), &
- loc_conv%difm(pcols,pver), &
- loc_conv%cmei(pcols,pver), &
- loc_conv%nuclin(pcols,pver), &
- loc_conv%autoin(pcols,pver), &
- loc_conv%accsin(pcols,pver), &
- loc_conv%hmpin(pcols,pver), &
- loc_conv%difn(pcols,pver), &
- loc_conv%trspcm(pcols,pver), &
- loc_conv%trspcn(pcols,pver), &
- loc_conv%trspim(pcols,pver), &
- loc_conv%trspin(pcols,pver), &
- loc_conv%lambdadpcu(pcols,pver), &
- loc_conv%mudpcu(pcols,pver), &
- loc_conv%dcape(pcols) )
- end if
-
-!
-! initialize convective tendencies
-!
- prec(:ncol) = 0._r8
- do k = 1,pver
- do i = 1,ncol
- dqdt(i,k) = 0._r8
- dsdt(i,k) = 0._r8
- dudt(i,k) = 0._r8
- dvdt(i,k) = 0._r8
- pflx(i,k) = 0._r8
- pflxg(i,k) = 0._r8
- cme(i,k) = 0._r8
- rprd(i,k) = 0._r8
- zdu(i,k) = 0._r8
- ql(i,k) = 0._r8
- qlg(i,k) = 0._r8
- dlf(i,k) = 0._r8
- dlg(i,k) = 0._r8
- qldeg(i,k) = 0._r8
-
- dif(i,k) = 0._r8
- dnlf(i,k) = 0._r8
- dnif(i,k) = 0._r8
-
- end do
- end do
-
- if (zmconv_microp) then
- do k = 1,pver
- do i = 1,ncol
- loc_conv%qliq(i,k) = 0._r8
- loc_conv%qice(i,k) = 0._r8
- loc_conv%di(i,k) = 0._r8
- loc_conv%qrain(i,k)= 0._r8
- loc_conv%qsnow(i,k)= 0._r8
- loc_conv%dnl(i,k) = 0._r8
- loc_conv%dni(i,k) = 0._r8
- loc_conv%wu(i,k) = 0._r8
- loc_conv%qnl(i,k) = 0._r8
- loc_conv%qni(i,k) = 0._r8
- loc_conv%qnr(i,k) = 0._r8
- loc_conv%qns(i,k) = 0._r8
- loc_conv%frz(i,k) = 0._r8
- loc_conv%sprd(i,k) = 0._r8
- loc_conv%qide(i,k) = 0._r8
- loc_conv%qncde(i,k) = 0._r8
- loc_conv%qnide(i,k) = 0._r8
-
- loc_conv%autolm(i,k) = 0._r8
- loc_conv%accrlm(i,k) = 0._r8
- loc_conv%bergnm(i,k) = 0._r8
- loc_conv%fhtimm(i,k) = 0._r8
- loc_conv%fhtctm(i,k) = 0._r8
- loc_conv%fhmlm (i,k) = 0._r8
- loc_conv%hmpim (i,k) = 0._r8
- loc_conv%accslm(i,k) = 0._r8
- loc_conv%dlfm (i,k) = 0._r8
-
- loc_conv%autoln(i,k) = 0._r8
- loc_conv%accrln(i,k) = 0._r8
- loc_conv%bergnn(i,k) = 0._r8
- loc_conv%fhtimn(i,k) = 0._r8
- loc_conv%fhtctn(i,k) = 0._r8
- loc_conv%fhmln (i,k) = 0._r8
- loc_conv%accsln(i,k) = 0._r8
- loc_conv%activn(i,k) = 0._r8
- loc_conv%dlfn (i,k) = 0._r8
- loc_conv%cmel (i,k) = 0._r8
-
- loc_conv%autoim(i,k) = 0._r8
- loc_conv%accsim(i,k) = 0._r8
- loc_conv%difm (i,k) = 0._r8
- loc_conv%cmei (i,k) = 0._r8
-
- loc_conv%nuclin(i,k) = 0._r8
- loc_conv%autoin(i,k) = 0._r8
- loc_conv%accsin(i,k) = 0._r8
- loc_conv%hmpin (i,k) = 0._r8
- loc_conv%difn (i,k) = 0._r8
-
- loc_conv%trspcm(i,k) = 0._r8
- loc_conv%trspcn(i,k) = 0._r8
- loc_conv%trspim(i,k) = 0._r8
- loc_conv%trspin(i,k) = 0._r8
-
- conv%qi(i,k) = 0._r8
- conv%frz(i,k) = 0._r8
- conv%sprd(i,k) = 0._r8
- conv%qi(i,k) = 0._r8
- conv%qliq(i,k) = 0._r8
- conv%qice(i,k) = 0._r8
- conv%qnl(i,k) = 0._r8
- conv%qni(i,k) = 0._r8
- conv%qnr(i,k) = 0._r8
- conv%qns(i,k) = 0._r8
- conv%qrain(i,k) = 0._r8
- conv%qsnow(i,k) = 0._r8
- conv%wu(i,k) = 0._r8
-
- conv%autolm(i,k) = 0._r8
- conv%accrlm(i,k) = 0._r8
- conv%bergnm(i,k) = 0._r8
- conv%fhtimm(i,k) = 0._r8
- conv%fhtctm(i,k) = 0._r8
- conv%fhmlm (i,k) = 0._r8
- conv%hmpim (i,k) = 0._r8
- conv%accslm(i,k) = 0._r8
- conv%dlfm (i,k) = 0._r8
-
- conv%autoln(i,k) = 0._r8
- conv%accrln(i,k) = 0._r8
- conv%bergnn(i,k) = 0._r8
- conv%fhtimn(i,k) = 0._r8
- conv%fhtctn(i,k) = 0._r8
- conv%fhmln (i,k) = 0._r8
- conv%accsln(i,k) = 0._r8
- conv%activn(i,k) = 0._r8
- conv%dlfn (i,k) = 0._r8
- conv%cmel (i,k) = 0._r8
-
- conv%autoim(i,k) = 0._r8
- conv%accsim(i,k) = 0._r8
- conv%difm (i,k) = 0._r8
- conv%cmei (i,k) = 0._r8
-
- conv%nuclin(i,k) = 0._r8
- conv%autoin(i,k) = 0._r8
- conv%accsin(i,k) = 0._r8
- conv%hmpin (i,k) = 0._r8
- conv%difn (i,k) = 0._r8
-
- conv%trspcm(i,k) = 0._r8
- conv%trspcn(i,k) = 0._r8
- conv%trspim(i,k) = 0._r8
- conv%trspin(i,k) = 0._r8
-
- end do
- end do
-
- conv%lambdadpcu = (mucon + 1._r8)/dcon
- conv%mudpcu = mucon
- loc_conv%lambdadpcu = conv%lambdadpcu
- loc_conv%mudpcu = conv%mudpcu
-
- end if
-
- do i = 1,ncol
- pflx(i,pverp) = 0
- pflxg(i,pverp) = 0
- end do
-!
- do i = 1,ncol
- pblt(i) = pver
- dsubcld(i) = 0._r8
-
-
- jctop(i) = pver
- jcbot(i) = 1
-
- end do
-
- if (zmconv_microp) then
- do i = 1,ncol
- conv%dcape(i) = 0._r8
- loc_conv%dcape(i) = 0._r8
- end do
- end if
-
- if (zm_org) then
-! compute vertical average here
- orgavg(:) = 0._r8
- dptot(:) = 0._r8
-
- do k = 1, pver
- do i = 1,ncol
- if (org(i,k) .gt. 0) then
- orgavg(i) = orgavg(i)+dpp(i,k)*org(i,k)
- dptot(i) = dptot(i)+dpp(i,k)
- endif
- enddo
- enddo
-
- do i = 1,ncol
- if (dptot(i) .gt. 0) then
- orgavg(i) = orgavg(i)/dptot(i)
- endif
- enddo
-
- do k = 1, pver
- do i = 1, ncol
- org2d(i,k) = orgavg(i)
- enddo
- enddo
-
- endif
-
-!
-! calculate local pressure (mbs) and height (m) for both interface
-! and mid-layer locations.
-!
- do i = 1,ncol
- zs(i) = geos(i)*rgrav
- pf(i,pver+1) = paph(i,pver+1)*0.01_r8
- zf(i,pver+1) = zi(i,pver+1) + zs(i)
- end do
- do k = 1,pver
- do i = 1,ncol
- p(i,k) = pap(i,k)*0.01_r8
- pf(i,k) = paph(i,k)*0.01_r8
- z(i,k) = zm(i,k) + zs(i)
- zf(i,k) = zi(i,k) + zs(i)
- end do
- end do
-!
- do k = pver - 1,msg + 1,-1
- do i = 1,ncol
- if (abs(z(i,k)-zs(i)-pblh(i)) < (zf(i,k)-zf(i,k+1))*0.5_r8) pblt(i) = k
- end do
- end do
-!
-! store incoming specific humidity field for subsequent calculation
-! of precipitation (through change in storage).
-! define dry static energy (normalized by cp).
-!
- do k = 1,pver
- do i = 1,ncol
- q(i,k) = qh(i,k)
- s(i,k) = t(i,k) + (grav/cpres)*z(i,k)
- tp(i,k)=0.0_r8
- shat(i,k) = s(i,k)
- qhat(i,k) = q(i,k)
- end do
- end do
-
- do i = 1,ncol
- capeg(i) = 0._r8
- lclg(i) = 1
- lelg(i) = pver
- maxg(i) = 1
- tlg(i) = 400._r8
- dsubcld(i) = 0._r8
- end do
-
- if( cam_physpkg_is('cam3')) then
-
- ! For cam3 physics package, call non-dilute
-
- call buoyan(lchnk ,ncol , &
- q ,t ,p ,z ,pf , &
- tp ,qstp ,tl ,rl ,cape , &
- pblt ,lcl ,lel ,lon ,maxi , &
- rgas ,grav ,cpres ,msg , &
- tpert )
- else
-
- ! Evaluate Tparcel, qs(Tparcel), buoyancy and CAPE,
- ! lcl, lel, parcel launch level at index maxi()=hmax
-
- call buoyan_dilute(lchnk ,ncol , &
- q ,t ,p ,z ,pf , &
- tp ,qstp ,tl ,rl ,cape , &
- pblt ,lcl ,lel ,lon ,maxi , &
- rgas ,grav ,cpres ,msg , &
- zi ,zs ,tpert , org2d , landfrac)
- end if
-
-!
-! determine whether grid points will undergo some deep convection
-! (ideep=1) or not (ideep=0), based on values of cape,lcl,lel
-! (require cape.gt. 0 and lel capelmt) then
- lengath = lengath + 1
- ideep(lengath) = i
- end if
- end do
-
- if (lengath.eq.0) return
-!
-! obtain gathered arrays necessary for ensuing calculations.
-!
- do k = 1,pver
- do i = 1,lengath
- dp(i,k) = 0.01_r8*dpp(ideep(i),k)
- qg(i,k) = q(ideep(i),k)
- tg(i,k) = t(ideep(i),k)
- pg(i,k) = p(ideep(i),k)
- zg(i,k) = z(ideep(i),k)
- sg(i,k) = s(ideep(i),k)
- tpg(i,k) = tp(ideep(i),k)
- zfg(i,k) = zf(ideep(i),k)
- qstpg(i,k) = qstp(ideep(i),k)
- ug(i,k) = 0._r8
- vg(i,k) = 0._r8
- end do
- end do
-
- if (zmconv_microp) then
-
- if (aero%scheme == 'modal') then
-
- do m = 1, aero%nmodes
-
- do k = 1,pver
- do i = 1,lengath
- aero%numg_a(i,k,m) = aero%num_a(m)%val(ideep(i),k)
- aero%dgnumg(i,k,m) = aero%dgnum(m)%val(ideep(i),k)
- end do
- end do
-
- do l = 1, aero%nspec(m)
- do k = 1,pver
- do i = 1,lengath
- aero%mmrg_a(i,k,l,m) = aero%mmr_a(l,m)%val(ideep(i),k)
- end do
- end do
- end do
-
- end do
-
- else if (aero%scheme == 'bulk') then
-
- do m = 1, aero%nbulk
- do k = 1,pver
- do i = 1,lengath
- aero%mmrg_bulk(i,k,m) = aero%mmr_bulk(m)%val(ideep(i),k)
- end do
- end do
- end do
-
- end if
-
- end if
-
-!
- do i = 1,lengath
- zfg(i,pver+1) = zf(ideep(i),pver+1)
- end do
- do i = 1,lengath
- capeg(i) = cape(ideep(i))
- lclg(i) = lcl(ideep(i))
- lelg(i) = lel(ideep(i))
- maxg(i) = maxi(ideep(i))
- tlg(i) = tl(ideep(i))
- landfracg(i) = landfrac(ideep(i))
- end do
-!
-! calculate sub-cloud layer pressure "thickness" for use in
-! closure and tendency routines.
-!
- do k = msg + 1,pver
- do i = 1,lengath
- if (k >= maxg(i)) then
- dsubcld(i) = dsubcld(i) + dp(i,k)
- end if
- end do
- end do
-!
-! define array of factors (alpha) which defines interfacial
-! values, as well as interfacial values for (q,s) used in
-! subsequent routines.
-!
- do k = msg + 2,pver
- do i = 1,lengath
-! alpha(i,k) = 0.5
- sdifr = 0._r8
- qdifr = 0._r8
- if (sg(i,k) > 0._r8 .or. sg(i,k-1) > 0._r8) &
- sdifr = abs((sg(i,k)-sg(i,k-1))/max(sg(i,k-1),sg(i,k)))
- if (qg(i,k) > 0._r8 .or. qg(i,k-1) > 0._r8) &
- qdifr = abs((qg(i,k)-qg(i,k-1))/max(qg(i,k-1),qg(i,k)))
- if (sdifr > 1.E-6_r8) then
- shat(i,k) = log(sg(i,k-1)/sg(i,k))*sg(i,k-1)*sg(i,k)/(sg(i,k-1)-sg(i,k))
- else
- shat(i,k) = 0.5_r8* (sg(i,k)+sg(i,k-1))
- end if
- if (qdifr > 1.E-6_r8) then
- qhat(i,k) = log(qg(i,k-1)/qg(i,k))*qg(i,k-1)*qg(i,k)/(qg(i,k-1)-qg(i,k))
- else
- qhat(i,k) = 0.5_r8* (qg(i,k)+qg(i,k-1))
- end if
- end do
- end do
-!
-! obtain cloud properties.
-!
-
- call cldprp(lchnk , &
- qg ,tg ,ug ,vg ,pg , &
- zg ,sg ,mu ,eu ,du , &
- md ,ed ,sd ,qd ,mc , &
- qu ,su ,zfg ,qs ,hmn , &
- hsat ,shat ,qlg , &
- cmeg ,maxg ,lelg ,jt ,jlcl , &
- maxg ,j0 ,jd ,rl ,lengath , &
- rgas ,grav ,cpres ,msg , &
- pflxg ,evpg ,cug ,rprdg ,limcnv ,landfracg , &
- qldeg ,aero ,loc_conv,qhat )
-
- if (zmconv_microp) then
- do i = 1,lengath
- capeg(i) = capeg(i)+ loc_conv%dcape(i)
- end do
- end if
-
-!
-! convert detrainment from units of "1/m" to "1/mb".
-!
-
- do k = msg + 1,pver
- do i = 1,lengath
- du (i,k) = du (i,k)* (zfg(i,k)-zfg(i,k+1))/dp(i,k)
- eu (i,k) = eu (i,k)* (zfg(i,k)-zfg(i,k+1))/dp(i,k)
- ed (i,k) = ed (i,k)* (zfg(i,k)-zfg(i,k+1))/dp(i,k)
- cug (i,k) = cug (i,k)* (zfg(i,k)-zfg(i,k+1))/dp(i,k)
- cmeg (i,k) = cmeg (i,k)* (zfg(i,k)-zfg(i,k+1))/dp(i,k)
- rprdg(i,k) = rprdg(i,k)* (zfg(i,k)-zfg(i,k+1))/dp(i,k)
- evpg (i,k) = evpg (i,k)* (zfg(i,k)-zfg(i,k+1))/dp(i,k)
- end do
- end do
-
- if (zmconv_microp) then
- do k = msg + 1,pver
- do i = 1,lengath
- loc_conv%sprd(i,k) = loc_conv%sprd(i,k)* (zfg(i,k)-zfg(i,k+1))/dp(i,k)
- loc_conv%frz (i,k) = loc_conv%frz (i,k)* (zfg(i,k)-zfg(i,k+1))/dp(i,k)
- end do
- end do
- end if
-
- call closure(lchnk , &
- qg ,tg ,pg ,zg ,sg , &
- tpg ,qs ,qu ,su ,mc , &
- du ,mu ,md ,qd ,sd , &
- qhat ,shat ,dp ,qstpg ,zfg , &
- qlg ,dsubcld ,mb ,capeg ,tlg , &
- lclg ,lelg ,jt ,maxg ,1 , &
- lengath ,rgas ,grav ,cpres ,rl , &
- msg ,capelmt )
-!
-! limit cloud base mass flux to theoretical upper bound.
-!
- do i=1,lengath
- mumax(i) = 0
- end do
- do k=msg + 2,pver
- do i=1,lengath
- mumax(i) = max(mumax(i), mu(i,k)/dp(i,k))
- end do
- end do
-
- do i=1,lengath
- if (mumax(i) > 0._r8) then
- mb(i) = min(mb(i),0.5_r8/(delt*mumax(i)))
- else
- mb(i) = 0._r8
- endif
- end do
- ! If no_deep_pbl = .true., don't allow convection entirely
- ! within PBL (suggestion of Bjorn Stevens, 8-2000)
-
- if (no_deep_pbl) then
- do i=1,lengath
- if (zm(ideep(i),jt(i)) < pblh(ideep(i))) mb(i) = 0
- end do
- end if
-
- if (zmconv_microp) then
- do k=msg+1,pver
- do i=1,lengath
- loc_conv%sprd(i,k) = loc_conv%sprd(i,k)*mb(i)
- loc_conv%frz (i,k) = loc_conv%frz (i,k)*mb(i)
- end do
- end do
- end if
-
- do k=msg+1,pver
- do i=1,lengath
- mu (i,k) = mu (i,k)*mb(i)
- md (i,k) = md (i,k)*mb(i)
- mc (i,k) = mc (i,k)*mb(i)
- du (i,k) = du (i,k)*mb(i)
- eu (i,k) = eu (i,k)*mb(i)
- ed (i,k) = ed (i,k)*mb(i)
- cmeg (i,k) = cmeg (i,k)*mb(i)
- rprdg(i,k) = rprdg(i,k)*mb(i)
- cug (i,k) = cug (i,k)*mb(i)
- evpg (i,k) = evpg (i,k)*mb(i)
- pflxg(i,k+1)= pflxg(i,k+1)*mb(i)*100._r8/grav
-
-
- if ( zmconv_microp .and. mb(i).eq.0._r8) then
- qlg (i,k) = 0._r8
- loc_conv%qliq (i,k) = 0._r8
- loc_conv%qice (i,k) = 0._r8
- loc_conv%qrain(i,k) = 0._r8
- loc_conv%qsnow(i,k) = 0._r8
- loc_conv%wu(i,k) = 0._r8
- loc_conv%qnl (i,k) = 0._r8
- loc_conv%qni (i,k) = 0._r8
- loc_conv%qnr (i,k) = 0._r8
- loc_conv%qns (i,k) = 0._r8
-
- loc_conv%autolm(i,k) = 0._r8
- loc_conv%accrlm(i,k) = 0._r8
- loc_conv%bergnm(i,k) = 0._r8
- loc_conv%fhtimm(i,k) = 0._r8
- loc_conv%fhtctm(i,k) = 0._r8
- loc_conv%fhmlm (i,k) = 0._r8
- loc_conv%hmpim (i,k) = 0._r8
- loc_conv%accslm(i,k) = 0._r8
- loc_conv%dlfm (i,k) = 0._r8
-
- loc_conv%autoln(i,k) = 0._r8
- loc_conv%accrln(i,k) = 0._r8
- loc_conv%bergnn(i,k) = 0._r8
- loc_conv%fhtimn(i,k) = 0._r8
- loc_conv%fhtctn(i,k) = 0._r8
- loc_conv%fhmln (i,k) = 0._r8
- loc_conv%accsln(i,k) = 0._r8
- loc_conv%activn(i,k) = 0._r8
- loc_conv%dlfn (i,k) = 0._r8
- loc_conv%cmel (i,k) = 0._r8
-
- loc_conv%autoim(i,k) = 0._r8
- loc_conv%accsim(i,k) = 0._r8
- loc_conv%difm (i,k) = 0._r8
- loc_conv%cmei (i,k) = 0._r8
-
- loc_conv%nuclin(i,k) = 0._r8
- loc_conv%autoin(i,k) = 0._r8
- loc_conv%accsin(i,k) = 0._r8
- loc_conv%hmpin (i,k) = 0._r8
- loc_conv%difn (i,k) = 0._r8
-
- loc_conv%trspcm(i,k) = 0._r8
- loc_conv%trspcn(i,k) = 0._r8
- loc_conv%trspim(i,k) = 0._r8
- loc_conv%trspin(i,k) = 0._r8
- end if
- end do
- end do
-!
-! compute temperature and moisture changes due to convection.
-!
- call q1q2_pjr(lchnk , &
- dqdt ,dsdt ,qg ,qs ,qu , &
- su ,du ,qhat ,shat ,dp , &
- mu ,md ,sd ,qd ,qldeg , &
- dsubcld ,jt ,maxg ,1 ,lengath , &
- cpres ,rl ,msg , &
- dlg ,evpg ,cug , &
- loc_conv )
-!
-! gather back temperature and mixing ratio.
-!
-
- if (zmconv_microp) then
- do k = msg + 1,pver
- do i = 1,lengath
- if (dqdt(i,k)*2._r8*delt+qg(i,k)<0._r8) then
- negadq = (dqdt(i,k)+0.5_r8*qg(i,k)/delt)/0.9999_r8
- dqdt(i,k) = dqdt(i,k)-negadq
-
- do kk=k,jt(i),-1
- if (negadq<0._r8) then
- if (rprdg(i,kk)> -negadq*dp(i,k)/dp(i,kk)) then
- dsdt(i,k) = dsdt(i,k) + negadq*rl/cpres
- if (rprdg(i,kk)>loc_conv%sprd(i,kk)) then
- if(rprdg(i,kk)-loc_conv%sprd(i,kk)<-negadq*dp(i,k)/dp(i,kk)) then
- dsdt(i,k) = dsdt(i,k) + (negadq+ (rprdg(i,kk)-loc_conv%sprd(i,kk))*dp(i,kk)/dp(i,k))*latice/cpres
- loc_conv%sprd(i,kk) = negadq*dp(i,k)/dp(i,kk)+rprdg(i,kk)
- end if
- else
- loc_conv%sprd(i,kk) = loc_conv%sprd(i,kk)+negadq*dp(i,k)/dp(i,kk)
- dsdt(i,k) = dsdt(i,k) + negadq*latice/cpres
- end if
- rprdg(i,kk) = rprdg(i,kk)+negadq*dp(i,k)/dp(i,kk)
- negadq = 0._r8
- else
- negadq = rprdg(i,kk)*dp(i,kk)/dp(i,k)+negadq
- dsdt(i,k) = dsdt(i,k) - rprdg(i,kk)*rl/cpres*dp(i,kk)/dp(i,k)
- if (rprdg(i,kk)>loc_conv%sprd(i,kk)) then
- dsdt(i,k) = dsdt(i,k) - loc_conv%sprd(i,kk)*latice/cpres*dp(i,kk)/dp(i,k)
- loc_conv%sprd(i,kk) = 0._r8
- else
- dsdt(i,k) = dsdt(i,k) -rprdg(i,kk)*latice/cpres*dp(i,kk)/dp(i,k)
- loc_conv%sprd(i,kk)= loc_conv%sprd(i,kk)- rprdg(i,kk)
- end if
- rprdg(i,kk) = 0._r8
- end if
-
- if (dlg(i,kk)>loc_conv%di(i,kk)) then
- doliq= .true.
- else
- doliq= .false.
- end if
-
- if (negadq<0._r8) then
- if (doliq) then
- if (dlg(i,kk)> -negadq*dp(i,k)/dp(i,kk)) then
- dsdt(i,k) = dsdt(i,k) + negadq*rl/cpres
- loc_conv%dnl(i,kk) = loc_conv%dnl(i,kk)*(1._r8+negadq*dp(i,k)/dp(i,kk)/dlg(i,kk))
- dlg(i,kk) = dlg(i,kk)+negadq*dp(i,k)/dp(i,kk)
- negadq = 0._r8
- else
- negadq = negadq + dlg(i,kk)*dp(i,kk)/dp(i,k)
- dsdt(i,k) = dsdt(i,k) - dlg(i,kk)*dp(i,kk)/dp(i,k)*rl/cpres
- dlg(i,kk) = 0._r8
- loc_conv%dnl(i,kk) = 0._r8
- end if
- else
- if (loc_conv%di(i,kk)> -negadq*dp(i,k)/dp(i,kk)) then
- dsdt(i,k) = dsdt(i,k) + negadq*(rl+latice)/cpres
- loc_conv%dni(i,kk) = loc_conv%dni(i,kk)*(1._r8+negadq*dp(i,k)/dp(i,kk)/loc_conv%di(i,kk))
- loc_conv%di(i,kk) = loc_conv%di(i,kk)+negadq*dp(i,k)/dp(i,kk)
- negadq = 0._r8
- else
- negadq = negadq + loc_conv%di(i,kk)*dp(i,kk)/dp(i,k)
- dsdt(i,k) = dsdt(i,k) - loc_conv%di(i,kk)*dp(i,kk)/dp(i,k)*(rl+latice)/cpres
- loc_conv%di(i,kk) = 0._r8
- loc_conv%dni(i,kk) = 0._r8
- end if
- doliq= .false.
- end if
- end if
- if (negadq<0._r8 .and. doliq ) then
- if (dlg(i,kk)> -negadq*dp(i,k)/dp(i,kk)) then
- dsdt(i,k) = dsdt(i,k) + negadq*rl/cpres
- loc_conv%dnl(i,kk) = loc_conv%dnl(i,kk)*(1._r8+negadq*dp(i,k)/dp(i,kk)/dlg(i,kk))
- dlg(i,kk) = dlg(i,kk)+negadq*dp(i,k)/dp(i,kk)
- negadq = 0._r8
- else
- negadq = negadq + dlg(i,kk)*dp(i,kk)/dp(i,k)
- dsdt(i,k) = dsdt(i,k) - dlg(i,kk)*dp(i,kk)/dp(i,k)*rl/cpres
- dlg(i,kk) = 0._r8
- loc_conv%dnl(i,kk) = 0._r8
- end if
- end if
-
- end if
- end do
-
- if (negadq<0._r8) then
- dqdt(i,k) = dqdt(i,k) + negadq
- end if
-
- end if
- end do
- end do
- end if
-
- do k = msg + 1,pver
- do i = 1,lengath
-!
-! q is updated to compute net precip.
-!
- q(ideep(i),k) = qh(ideep(i),k) + 2._r8*delt*dqdt(i,k)
- qtnd(ideep(i),k) = dqdt (i,k)
- cme (ideep(i),k) = cmeg (i,k)
- rprd(ideep(i),k) = rprdg(i,k)
- zdu (ideep(i),k) = du (i,k)
- mcon(ideep(i),k) = mc (i,k)
- heat(ideep(i),k) = dsdt (i,k)*cpres
- dlf (ideep(i),k) = dlg (i,k)
- pflx(ideep(i),k) = pflxg(i,k)
- ql (ideep(i),k) = qlg (i,k)
- end do
- end do
-
- if (zmconv_microp) then
- do k = msg + 1,pver
- do i = 1,lengath
- dif (ideep(i),k) = loc_conv%di (i,k)
- dnlf(ideep(i),k) = loc_conv%dnl (i,k)
- dnif(ideep(i),k) = loc_conv%dni (i,k)
-
- conv%qi (ideep(i),k) = loc_conv%qice(i,k)
- conv%frz(ideep(i),k) = loc_conv%frz(i,k)*latice/cpres
- conv%sprd(ideep(i),k) = loc_conv%sprd(i,k)
- conv%wu (ideep(i),k) = loc_conv%wu (i,k)
- conv%qliq(ideep(i),k) = loc_conv%qliq (i,k)
- conv%qice(ideep(i),k) = loc_conv%qice (i,k)
- conv%qrain(ideep(i),k) = loc_conv%qrain (i,k)
- conv%qsnow(ideep(i),k) = loc_conv%qsnow (i,k)
- conv%qnl(ideep(i),k) = loc_conv%qnl(i,k)
- conv%qni(ideep(i),k) = loc_conv%qni(i,k)
- conv%qnr(ideep(i),k) = loc_conv%qnr(i,k)
- conv%qns(ideep(i),k) = loc_conv%qns(i,k)
-
- conv%autolm(ideep(i),k) = loc_conv%autolm(i,k)
- conv%accrlm(ideep(i),k) = loc_conv%accrlm(i,k)
- conv%bergnm(ideep(i),k) = loc_conv%bergnm(i,k)
- conv%fhtimm(ideep(i),k) = loc_conv%fhtimm(i,k)
- conv%fhtctm(ideep(i),k) = loc_conv%fhtctm(i,k)
- conv%fhmlm (ideep(i),k) = loc_conv%fhmlm (i,k)
- conv%hmpim (ideep(i),k) = loc_conv%hmpim (i,k)
- conv%accslm(ideep(i),k) = loc_conv%accslm(i,k)
- conv%dlfm (ideep(i),k) = loc_conv%dlfm (i,k)
-
- conv%autoln(ideep(i),k) = loc_conv%autoln(i,k)
- conv%accrln(ideep(i),k) = loc_conv%accrln(i,k)
- conv%bergnn(ideep(i),k) = loc_conv%bergnn(i,k)
- conv%fhtimn(ideep(i),k) = loc_conv%fhtimn(i,k)
- conv%fhtctn(ideep(i),k) = loc_conv%fhtctn(i,k)
- conv%fhmln (ideep(i),k) = loc_conv%fhmln (i,k)
- conv%accsln(ideep(i),k) = loc_conv%accsln(i,k)
- conv%activn(ideep(i),k) = loc_conv%activn(i,k)
- conv%dlfn (ideep(i),k) = loc_conv%dlfn (i,k)
- conv%cmel (ideep(i),k) = loc_conv%cmel (i,k)
-
- conv%autoim(ideep(i),k) = loc_conv%autoim(i,k)
- conv%accsim(ideep(i),k) = loc_conv%accsim(i,k)
- conv%difm (ideep(i),k) = loc_conv%difm (i,k)
- conv%cmei (ideep(i),k) = loc_conv%cmei (i,k)
-
- conv%nuclin(ideep(i),k) = loc_conv%nuclin(i,k)
- conv%autoin(ideep(i),k) = loc_conv%autoin(i,k)
- conv%accsin(ideep(i),k) = loc_conv%accsin(i,k)
- conv%hmpin (ideep(i),k) = loc_conv%hmpin (i,k)
- conv%difn (ideep(i),k) = loc_conv%difn (i,k)
-
- conv%trspcm(ideep(i),k) = loc_conv%trspcm(i,k)
- conv%trspcn(ideep(i),k) = loc_conv%trspcn(i,k)
- conv%trspim(ideep(i),k) = loc_conv%trspim(i,k)
- conv%trspin(ideep(i),k) = loc_conv%trspin(i,k)
- conv%lambdadpcu(ideep(i),k) = loc_conv%lambdadpcu(i,k)
- conv%mudpcu(ideep(i),k) = loc_conv%mudpcu(i,k)
-
- end do
- end do
-
- do k = msg + 1,pver
- do i = 1,ncol
-
- !convert it from units of "kg/kg" to "g/m3"
-
- if(k.lt.pver) then
- conv%qice (i,k) = 0.5_r8*(conv%qice(i,k)+conv%qice(i,k+1))
- conv%qliq (i,k) = 0.5_r8*(conv%qliq(i,k)+conv%qliq(i,k+1))
- conv%qrain (i,k) = 0.5_r8*(conv%qrain(i,k)+conv%qrain(i,k+1))
- conv%qsnow (i,k) = 0.5_r8*(conv%qsnow(i,k)+conv%qsnow(i,k+1))
- conv%qni (i,k) = 0.5_r8*(conv%qni(i,k)+conv%qni(i,k+1))
- conv%qnl (i,k) = 0.5_r8*(conv%qnl(i,k)+conv%qnl(i,k+1))
- conv%qnr (i,k) = 0.5_r8*(conv%qnr(i,k)+conv%qnr(i,k+1))
- conv%qns (i,k) = 0.5_r8*(conv%qns(i,k)+conv%qns(i,k+1))
- conv%wu(i,k) = 0.5_r8*(conv%wu(i,k)+conv%wu(i,k+1))
- end if
-
- if (t(i,k).gt. 273.15_r8 .and. t(i,k-1).le.273.15_r8) then
- conv%qice (i,k-1) = conv%qice (i,k-1) + conv%qice (i,k)
- conv%qice (i,k) = 0._r8
- conv%qni (i,k-1) = conv%qni (i,k-1) + conv%qni (i,k)
- conv%qni (i,k) = 0._r8
- conv%qsnow (i,k-1) = conv%qsnow (i,k-1) + conv%qsnow (i,k)
- conv%qsnow (i,k) = 0._r8
- conv%qns (i,k-1) = conv%qns (i,k-1) + conv%qns (i,k)
- conv%qns (i,k) = 0._r8
- end if
-
- conv%qice (i,k) = conv%qice(i,k) * pap(i,k)/t(i,k)/rgas *1000._r8
- conv%qliq (i,k) = conv%qliq(i,k) * pap(i,k)/t(i,k)/rgas *1000._r8
- conv%qrain (i,k) = conv%qrain(i,k) * pap(i,k)/t(i,k)/rgas *1000._r8
- conv%qsnow (i,k) = conv%qsnow(i,k) * pap(i,k)/t(i,k)/rgas *1000._r8
- conv%qni (i,k) = conv%qni(i,k) * pap(i,k)/t(i,k)/rgas
- conv%qnl (i,k) = conv%qnl(i,k) * pap(i,k)/t(i,k)/rgas
- conv%qnr (i,k) = conv%qnr(i,k) * pap(i,k)/t(i,k)/rgas
- conv%qns (i,k) = conv%qns(i,k) * pap(i,k)/t(i,k)/rgas
- end do
- end do
- end if
-
-!
- do i = 1,lengath
- jctop(ideep(i)) = jt(i)
- jcbot(ideep(i)) = maxg(i)
- pflx(ideep(i),pverp) = pflxg(i,pverp)
- end do
-
- if (zmconv_microp) then
- do i = 1,lengath
- conv%dcape(ideep(i)) = loc_conv%dcape(i)
- end do
- end if
-
-! Compute precip by integrating change in water vapor minus detrained cloud water
- do k = pver,msg + 1,-1
- do i = 1,ncol
- prec(i) = prec(i) - dpp(i,k)* (q(i,k)-qh(i,k)) - dpp(i,k)*(dlf(i,k)+dif(i,k))*2._r8*delt
- end do
- end do
-
-! obtain final precipitation rate in m/s.
- do i = 1,ncol
- prec(i) = rgrav*max(prec(i),0._r8)/ (2._r8*delt)/1000._r8
- end do
-
-! Compute reserved liquid (not yet in cldliq) for energy integrals.
-! Treat rliq as flux out bottom, to be added back later.
- do k = 1, pver
- do i = 1, ncol
- rliq(i) = rliq(i) + (dlf(i,k)+dif(i,k))*dpp(i,k)/gravit
- rice(i) = rice(i) + dif(i,k)*dpp(i,k)/gravit
- end do
- end do
- rliq(:ncol) = rliq(:ncol) /1000._r8
- rice(:ncol) = rice(:ncol) /1000._r8
-
- if (zmconv_microp) then
- deallocate( &
- loc_conv%frz, &
- loc_conv%sprd, &
- loc_conv%wu, &
- loc_conv%qi, &
- loc_conv%qliq, &
- loc_conv%qice, &
- loc_conv%qrain, &
- loc_conv%qsnow, &
- loc_conv%di, &
- loc_conv%dnl, &
- loc_conv%dni, &
- loc_conv%qnl, &
- loc_conv%qni, &
- loc_conv%qnr, &
- loc_conv%qns, &
- loc_conv%qide, &
- loc_conv%qncde, &
- loc_conv%qnide, &
- loc_conv%autolm, &
- loc_conv%accrlm, &
- loc_conv%bergnm, &
- loc_conv%fhtimm, &
- loc_conv%fhtctm, &
- loc_conv%fhmlm, &
- loc_conv%hmpim, &
- loc_conv%accslm, &
- loc_conv%dlfm, &
- loc_conv%cmel, &
- loc_conv%autoln, &
- loc_conv%accrln, &
- loc_conv%bergnn, &
- loc_conv%fhtimn, &
- loc_conv%fhtctn, &
- loc_conv%fhmln, &
- loc_conv%accsln, &
- loc_conv%activn, &
- loc_conv%dlfn, &
- loc_conv%autoim, &
- loc_conv%accsim, &
- loc_conv%difm, &
- loc_conv%cmei, &
- loc_conv%nuclin, &
- loc_conv%autoin, &
- loc_conv%accsin, &
- loc_conv%hmpin, &
- loc_conv%difn, &
- loc_conv%trspcm, &
- loc_conv%trspcn, &
- loc_conv%trspim, &
- loc_conv%trspin, &
- loc_conv%lambdadpcu, &
- loc_conv%mudpcu, &
- loc_conv%dcape )
- end if
-
- return
-end subroutine zm_convr
-
-!===============================================================================
-subroutine zm_conv_evap(ncol,lchnk, &
- t,pmid,pdel,q, &
- landfrac, &
- tend_s, tend_s_snwprd, tend_s_snwevmlt, tend_q, &
- prdprec, cldfrc, deltat, &
- prec, snow, ntprprd, ntsnprd, flxprec, flxsnow, prdsnow)
-
-
-!-----------------------------------------------------------------------
-! Compute tendencies due to evaporation of rain from ZM scheme
-!--
-! Compute the total precipitation and snow fluxes at the surface.
-! Add in the latent heat of fusion for snow formation and melt, since it not dealt with
-! in the Zhang-MacFarlane parameterization.
-! Evaporate some of the precip directly into the environment using a Sundqvist type algorithm
-!-----------------------------------------------------------------------
-
- use wv_saturation, only: qsat
- use phys_grid, only: get_rlat_all_p
-
-!------------------------------Arguments--------------------------------
- integer,intent(in) :: ncol, lchnk ! number of columns and chunk index
- real(r8),intent(in), dimension(pcols,pver) :: t ! temperature (K)
- real(r8),intent(in), dimension(pcols,pver) :: pmid ! midpoint pressure (Pa)
- real(r8),intent(in), dimension(pcols,pver) :: pdel ! layer thickness (Pa)
- real(r8),intent(in), dimension(pcols,pver) :: q ! water vapor (kg/kg)
- real(r8),intent(in), dimension(pcols) :: landfrac
- real(r8),intent(inout), dimension(pcols,pver) :: tend_s ! heating rate (J/kg/s)
- real(r8),intent(inout), dimension(pcols,pver) :: tend_q ! water vapor tendency (kg/kg/s)
- real(r8),intent(out ), dimension(pcols,pver) :: tend_s_snwprd ! Heating rate of snow production
- real(r8),intent(out ), dimension(pcols,pver) :: tend_s_snwevmlt ! Heating rate of evap/melting of snow
-
-
-
- real(r8), intent(in ) :: prdprec(pcols,pver)! precipitation production (kg/ks/s)
- real(r8), intent(in ) :: cldfrc(pcols,pver) ! cloud fraction
- real(r8), intent(in ) :: deltat ! time step
-
- real(r8), intent(inout) :: prec(pcols) ! Convective-scale preciptn rate
- real(r8), intent(out) :: snow(pcols) ! Convective-scale snowfall rate
-
- real(r8), optional, intent(in), allocatable :: prdsnow(:,:) ! snow production (kg/ks/s)
-
-!
-!---------------------------Local storage-------------------------------
-
- real(r8) :: es (pcols,pver) ! Saturation vapor pressure
- real(r8) :: fice (pcols,pver) ! ice fraction in precip production
- real(r8) :: fsnow_conv(pcols,pver) ! snow fraction in precip production
- real(r8) :: qs (pcols,pver) ! saturation specific humidity
- real(r8),intent(out) :: flxprec(pcols,pverp) ! Convective-scale flux of precip at interfaces (kg/m2/s)
- real(r8),intent(out) :: flxsnow(pcols,pverp) ! Convective-scale flux of snow at interfaces (kg/m2/s)
- real(r8),intent(out) :: ntprprd(pcols,pver) ! net precip production in layer
- real(r8),intent(out) :: ntsnprd(pcols,pver) ! net snow production in layer
- real(r8) :: work1 ! temp variable (pjr)
- real(r8) :: work2 ! temp variable (pjr)
-
- real(r8) :: evpvint(pcols) ! vertical integral of evaporation
- real(r8) :: evpprec(pcols) ! evaporation of precipitation (kg/kg/s)
- real(r8) :: evpsnow(pcols) ! evaporation of snowfall (kg/kg/s)
- real(r8) :: snowmlt(pcols) ! snow melt tendency in layer
- real(r8) :: flxsntm(pcols) ! flux of snow into layer, after melting
-
- real(r8) :: kemask
- real(r8) :: evplimit ! temp variable for evaporation limits
- real(r8) :: rlat(pcols)
- real(r8) :: dum
- real(r8) :: omsm
-
- integer :: i,k ! longitude,level indices
- logical :: old_snow
-
-
-!-----------------------------------------------------------------------
-
- ! If prdsnow is passed in and allocated, then use it in the calculation, otherwise
- ! use the old snow calculation
- old_snow=.true.
- if (present(prdsnow)) then
- if (allocated(prdsnow)) then
- old_snow=.false.
- end if
- end if
-
-! convert input precip to kg/m2/s
- prec(:ncol) = prec(:ncol)*1000._r8
-
-! determine saturation vapor pressure
- do k = 1,pver
- call qsat(t(1:ncol,k), pmid(1:ncol,k), es(1:ncol,k), qs(1:ncol,k), ncol)
- end do
-! determine ice fraction in rain production (use cloud water parameterization fraction at present)
- call cldfrc_fice(ncol, t, fice, fsnow_conv)
-
-! zero the flux integrals on the top boundary
- flxprec(:ncol,1) = 0._r8
- flxsnow(:ncol,1) = 0._r8
- evpvint(:ncol) = 0._r8
- omsm=0.9999_r8
-
- do k = 1, pver
- do i = 1, ncol
-
-! Melt snow falling into layer, if necessary.
- if( old_snow ) then
- if (t(i,k) > tmelt) then
- flxsntm(i) = 0._r8
- snowmlt(i) = flxsnow(i,k) * gravit/ pdel(i,k)
- else
- flxsntm(i) = flxsnow(i,k)
- snowmlt(i) = 0._r8
- end if
- else
- ! make sure melting snow doesn't reduce temperature below threshold
- if (t(i,k) > tmelt) then
- dum = -latice/cpres*flxsnow(i,k)*gravit/pdel(i,k)*deltat
- if (t(i,k) + dum .le. tmelt) then
- dum = (t(i,k)-tmelt)*cpres/latice/deltat
- dum = dum/(flxsnow(i,k)*gravit/pdel(i,k))
- dum = max(0._r8,dum)
- dum = min(1._r8,dum)
- else
- dum = 1._r8
- end if
- dum = dum*omsm
- flxsntm(i) = flxsnow(i,k)*(1.0_r8-dum)
- snowmlt(i) = dum*flxsnow(i,k)*gravit/ pdel(i,k)
- else
- flxsntm(i) = flxsnow(i,k)
- snowmlt(i) = 0._r8
- end if
- end if
-
-! relative humidity depression must be > 0 for evaporation
- evplimit = max(1._r8 - q(i,k)/qs(i,k), 0._r8)
-
- if (zm_org) then
- kemask = ke * (1._r8 - landfrac(i)) + ke_lnd * landfrac(i)
- else
- kemask = ke
- endif
-
-! total evaporation depends on flux in the top of the layer
-! flux prec is the net production above layer minus evaporation into environmet
- evpprec(i) = kemask * (1._r8 - cldfrc(i,k)) * evplimit * sqrt(flxprec(i,k))
-!**********************************************************
-!! evpprec(i) = 0. ! turn off evaporation for now
-!**********************************************************
-
-! Don't let evaporation supersaturate layer (approx). Layer may already be saturated.
-! Currently does not include heating/cooling change to qs
- evplimit = max(0._r8, (qs(i,k)-q(i,k)) / deltat)
-
-! Don't evaporate more than is falling into the layer - do not evaporate rain formed
-! in this layer but if precip production is negative, remove from the available precip
-! Negative precip production occurs because of evaporation in downdrafts.
-!!$ evplimit = flxprec(i,k) * gravit / pdel(i,k) + min(prdprec(i,k), 0.)
- evplimit = min(evplimit, flxprec(i,k) * gravit / pdel(i,k))
-
-! Total evaporation cannot exceed input precipitation
- evplimit = min(evplimit, (prec(i) - evpvint(i)) * gravit / pdel(i,k))
-
- evpprec(i) = min(evplimit, evpprec(i))
- if( .not.old_snow ) then
- evpprec(i) = max(0._r8, evpprec(i))
- evpprec(i) = evpprec(i)*omsm
- end if
-
-
-! evaporation of snow depends on snow fraction of total precipitation in the top after melting
- if (flxprec(i,k) > 0._r8) then
-! evpsnow(i) = evpprec(i) * flxsntm(i) / flxprec(i,k)
-! prevent roundoff problems
- work1 = min(max(0._r8,flxsntm(i)/flxprec(i,k)),1._r8)
- evpsnow(i) = evpprec(i) * work1
- else
- evpsnow(i) = 0._r8
- end if
-
-! vertically integrated evaporation
- evpvint(i) = evpvint(i) + evpprec(i) * pdel(i,k)/gravit
-
-! net precip production is production - evaporation
- ntprprd(i,k) = prdprec(i,k) - evpprec(i)
-! net snow production is precip production * ice fraction - evaporation - melting
-!pjrworks ntsnprd(i,k) = prdprec(i,k)*fice(i,k) - evpsnow(i) - snowmlt(i)
-!pjrwrks2 ntsnprd(i,k) = prdprec(i,k)*fsnow_conv(i,k) - evpsnow(i) - snowmlt(i)
-! the small amount added to flxprec in the work1 expression has been increased from
-! 1e-36 to 8.64e-11 (1e-5 mm/day). This causes the temperature based partitioning
-! scheme to be used for small flxprec amounts. This is to address error growth problems.
-
- if( old_snow ) then
- if (flxprec(i,k).gt.0._r8) then
- work1 = min(max(0._r8,flxsnow(i,k)/flxprec(i,k)),1._r8)
- else
- work1 = 0._r8
- endif
-
- work2 = max(fsnow_conv(i,k), work1)
- if (snowmlt(i).gt.0._r8) work2 = 0._r8
-! work2 = fsnow_conv(i,k)
- ntsnprd(i,k) = prdprec(i,k)*work2 - evpsnow(i) - snowmlt(i)
- tend_s_snwprd (i,k) = prdprec(i,k)*work2*latice
- tend_s_snwevmlt(i,k) = - ( evpsnow(i) + snowmlt(i) )*latice
- else
- ntsnprd(i,k) = prdsnow(i,k) - min(flxsnow(i,k)*gravit/pdel(i,k), evpsnow(i)+snowmlt(i))
- tend_s_snwprd (i,k) = prdsnow(i,k)*latice
- tend_s_snwevmlt(i,k) = -min(flxsnow(i,k)*gravit/pdel(i,k), evpsnow(i)+snowmlt(i) )*latice
- end if
-
-! precipitation fluxes
- flxprec(i,k+1) = flxprec(i,k) + ntprprd(i,k) * pdel(i,k)/gravit
- flxsnow(i,k+1) = flxsnow(i,k) + ntsnprd(i,k) * pdel(i,k)/gravit
-
-! protect against rounding error
- flxprec(i,k+1) = max(flxprec(i,k+1), 0._r8)
- flxsnow(i,k+1) = max(flxsnow(i,k+1), 0._r8)
-! more protection (pjr)
-! flxsnow(i,k+1) = min(flxsnow(i,k+1), flxprec(i,k+1))
-
-! heating (cooling) and moistening due to evaporation
-! - latent heat of vaporization for precip production has already been accounted for
-! - snow is contained in prec
- if( old_snow ) then
- tend_s(i,k) =-evpprec(i)*latvap + ntsnprd(i,k)*latice
- else
- tend_s(i,k) =-evpprec(i)*latvap + tend_s_snwevmlt(i,k)
- end if
- tend_q(i,k) = evpprec(i)
- end do
- end do
-
-! set output precipitation rates (m/s)
- prec(:ncol) = flxprec(:ncol,pver+1) / 1000._r8
- snow(:ncol) = flxsnow(:ncol,pver+1) / 1000._r8
-
-!**********************************************************
-!!$ tend_s(:ncol,:) = 0. ! turn heating off
-!**********************************************************
-
- end subroutine zm_conv_evap
-
-
-
-subroutine convtran(lchnk , &
- doconvtran,q ,ncnst ,mu ,md , &
- du ,eu ,ed ,dp ,dsubcld , &
- jt ,mx ,ideep ,il1g ,il2g , &
- nstep ,fracis ,dqdt ,dpdry ,dt)
-!-----------------------------------------------------------------------
-!
-! Purpose:
-! Convective transport of trace species
-!
-! Mixing ratios may be with respect to either dry or moist air
-!
-! Method:
-!
-!
-!
-! Author: P. Rasch
-!
-!-----------------------------------------------------------------------
- use shr_kind_mod, only: r8 => shr_kind_r8
- use constituents, only: cnst_get_type_byind
- use ppgrid
-
- implicit none
-!-----------------------------------------------------------------------
-!
-! Input arguments
-!
- integer, intent(in) :: lchnk ! chunk identifier
- integer, intent(in) :: ncnst ! number of tracers to transport
- logical, intent(in) :: doconvtran(ncnst) ! flag for doing convective transport
- real(r8), intent(in) :: q(pcols,pver,ncnst) ! Tracer array including moisture
- real(r8), intent(in) :: mu(pcols,pver) ! Mass flux up
- real(r8), intent(in) :: md(pcols,pver) ! Mass flux down
- real(r8), intent(in) :: du(pcols,pver) ! Mass detraining from updraft
- real(r8), intent(in) :: eu(pcols,pver) ! Mass entraining from updraft
- real(r8), intent(in) :: ed(pcols,pver) ! Mass entraining from downdraft
- real(r8), intent(in) :: dp(pcols,pver) ! Delta pressure between interfaces
- real(r8), intent(in) :: dsubcld(pcols) ! Delta pressure from cloud base to sfc
- real(r8), intent(in) :: fracis(pcols,pver,ncnst) ! fraction of tracer that is insoluble
-
- integer, intent(in) :: jt(pcols) ! Index of cloud top for each column
- integer, intent(in) :: mx(pcols) ! Index of cloud top for each column
- integer, intent(in) :: ideep(pcols) ! Gathering array
- integer, intent(in) :: il1g ! Gathered min lon indices over which to operate
- integer, intent(in) :: il2g ! Gathered max lon indices over which to operate
- integer, intent(in) :: nstep ! Time step index
-
- real(r8), intent(in) :: dpdry(pcols,pver) ! Delta pressure between interfaces
-
- real(r8), intent(in) :: dt ! 2 delta t (model time increment)
-
-! input/output
-
- real(r8), intent(out) :: dqdt(pcols,pver,ncnst) ! Tracer tendency array
-
-!--------------------------Local Variables------------------------------
-
- integer i ! Work index
- integer k ! Work index
- integer kbm ! Highest altitude index of cloud base
- integer kk ! Work index
- integer kkp1 ! Work index
- integer km1 ! Work index
- integer kp1 ! Work index
- integer ktm ! Highest altitude index of cloud top
- integer m ! Work index
-
- real(r8) cabv ! Mix ratio of constituent above
- real(r8) cbel ! Mix ratio of constituent below
- real(r8) cdifr ! Normalized diff between cabv and cbel
- real(r8) chat(pcols,pver) ! Mix ratio in env at interfaces
- real(r8) cond(pcols,pver) ! Mix ratio in downdraft at interfaces
- real(r8) const(pcols,pver) ! Gathered tracer array
- real(r8) fisg(pcols,pver) ! gathered insoluble fraction of tracer
- real(r8) conu(pcols,pver) ! Mix ratio in updraft at interfaces
- real(r8) dcondt(pcols,pver) ! Gathered tend array
- real(r8) small ! A small number
- real(r8) mbsth ! Threshold for mass fluxes
- real(r8) mupdudp ! A work variable
- real(r8) minc ! A work variable
- real(r8) maxc ! A work variable
- real(r8) fluxin ! A work variable
- real(r8) fluxout ! A work variable
- real(r8) netflux ! A work variable
-
- real(r8) dutmp(pcols,pver) ! Mass detraining from updraft
- real(r8) eutmp(pcols,pver) ! Mass entraining from updraft
- real(r8) edtmp(pcols,pver) ! Mass entraining from downdraft
- real(r8) dptmp(pcols,pver) ! Delta pressure between interfaces
- real(r8) total(pcols)
- real(r8) negadt,qtmp
-
-!-----------------------------------------------------------------------
-!
- small = 1.e-36_r8
-! mbsth is the threshold below which we treat the mass fluxes as zero (in mb/s)
- mbsth = 1.e-15_r8
-
-! Find the highest level top and bottom levels of convection
- ktm = pver
- kbm = pver
- do i = il1g, il2g
- ktm = min(ktm,jt(i))
- kbm = min(kbm,mx(i))
- end do
-
-! Loop ever each constituent
- do m = 2, ncnst
- if (doconvtran(m)) then
-
- if (cnst_get_type_byind(m).eq.'dry') then
- do k = 1,pver
- do i =il1g,il2g
- dptmp(i,k) = dpdry(i,k)
- dutmp(i,k) = du(i,k)*dp(i,k)/dpdry(i,k)
- eutmp(i,k) = eu(i,k)*dp(i,k)/dpdry(i,k)
- edtmp(i,k) = ed(i,k)*dp(i,k)/dpdry(i,k)
- end do
- end do
- else
- do k = 1,pver
- do i =il1g,il2g
- dptmp(i,k) = dp(i,k)
- dutmp(i,k) = du(i,k)
- eutmp(i,k) = eu(i,k)
- edtmp(i,k) = ed(i,k)
- end do
- end do
- endif
-! dptmp = dp
-
-! Gather up the constituent and set tend to zero
- do k = 1,pver
- do i =il1g,il2g
- const(i,k) = q(ideep(i),k,m)
- fisg(i,k) = fracis(ideep(i),k,m)
- end do
- end do
-
-! From now on work only with gathered data
-
-! Interpolate environment tracer values to interfaces
- do k = 1,pver
- km1 = max(1,k-1)
- do i = il1g, il2g
- minc = min(const(i,km1),const(i,k))
- maxc = max(const(i,km1),const(i,k))
- if (minc < 0) then
- cdifr = 0._r8
- else
- cdifr = abs(const(i,k)-const(i,km1))/max(maxc,small)
- endif
-
-! If the two layers differ significantly use a geometric averaging
-! procedure
- if (cdifr > 1.E-6_r8) then
- cabv = max(const(i,km1),maxc*1.e-12_r8)
- cbel = max(const(i,k),maxc*1.e-12_r8)
- chat(i,k) = log(cabv/cbel)/(cabv-cbel)*cabv*cbel
-
- else ! Small diff, so just arithmetic mean
- chat(i,k) = 0.5_r8* (const(i,k)+const(i,km1))
- end if
-
-! Provisional up and down draft values
- conu(i,k) = chat(i,k)
- cond(i,k) = chat(i,k)
-
-! provisional tends
- dcondt(i,k) = 0._r8
-
- end do
- end do
-
-! Do levels adjacent to top and bottom
- k = 2
- km1 = 1
- kk = pver
- do i = il1g,il2g
- mupdudp = mu(i,kk) + dutmp(i,kk)*dptmp(i,kk)
- if (mupdudp > mbsth) then
- conu(i,kk) = (+eutmp(i,kk)*fisg(i,kk)*const(i,kk)*dptmp(i,kk))/mupdudp
- endif
- if (md(i,k) < -mbsth) then
- cond(i,k) = (-edtmp(i,km1)*fisg(i,km1)*const(i,km1)*dptmp(i,km1))/md(i,k)
- endif
- end do
-
-! Updraft from bottom to top
- do kk = pver-1,1,-1
- kkp1 = min(pver,kk+1)
- do i = il1g,il2g
- mupdudp = mu(i,kk) + dutmp(i,kk)*dptmp(i,kk)
- if (mupdudp > mbsth) then
- conu(i,kk) = ( mu(i,kkp1)*conu(i,kkp1)+eutmp(i,kk)*fisg(i,kk)* &
- const(i,kk)*dptmp(i,kk) )/mupdudp
- endif
- end do
- end do
-
-! Downdraft from top to bottom
- do k = 3,pver
- km1 = max(1,k-1)
- do i = il1g,il2g
- if (md(i,k) < -mbsth) then
- cond(i,k) = ( md(i,km1)*cond(i,km1)-edtmp(i,km1)*fisg(i,km1)*const(i,km1) &
- *dptmp(i,km1) )/md(i,k)
- endif
- end do
- end do
-
-
- do k = ktm,pver
- km1 = max(1,k-1)
- kp1 = min(pver,k+1)
- do i = il1g,il2g
-
-! version 1 hard to check for roundoff errors
-! dcondt(i,k) =
-! $ +(+mu(i,kp1)* (conu(i,kp1)-chat(i,kp1))
-! $ -mu(i,k)* (conu(i,k)-chat(i,k))
-! $ +md(i,kp1)* (cond(i,kp1)-chat(i,kp1))
-! $ -md(i,k)* (cond(i,k)-chat(i,k))
-! $ )/dp(i,k)
-
-! version 2 hard to limit fluxes
-! fluxin = mu(i,kp1)*conu(i,kp1) + mu(i,k)*chat(i,k)
-! $ -(md(i,k) *cond(i,k) + md(i,kp1)*chat(i,kp1))
-! fluxout = mu(i,k)*conu(i,k) + mu(i,kp1)*chat(i,kp1)
-! $ -(md(i,kp1)*cond(i,kp1) + md(i,k)*chat(i,k))
-
-! version 3 limit fluxes outside convection to mass in appropriate layer
-! these limiters are probably only safe for positive definite quantitities
-! it assumes that mu and md already satify a courant number limit of 1
- fluxin = mu(i,kp1)*conu(i,kp1)+ mu(i,k)*min(chat(i,k),const(i,km1)) &
- -(md(i,k) *cond(i,k) + md(i,kp1)*min(chat(i,kp1),const(i,kp1)))
- fluxout = mu(i,k)*conu(i,k) + mu(i,kp1)*min(chat(i,kp1),const(i,k)) &
- -(md(i,kp1)*cond(i,kp1) + md(i,k)*min(chat(i,k),const(i,k)))
-
- netflux = fluxin - fluxout
- if (abs(netflux) < max(fluxin,fluxout)*1.e-12_r8) then
- netflux = 0._r8
- endif
- dcondt(i,k) = netflux/dptmp(i,k)
- end do
- end do
-! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-!
- do k = kbm,pver
- km1 = max(1,k-1)
- do i = il1g,il2g
- if (k == mx(i)) then
-
-! version 1
-! dcondt(i,k) = (1./dsubcld(i))*
-! $ (-mu(i,k)*(conu(i,k)-chat(i,k))
-! $ -md(i,k)*(cond(i,k)-chat(i,k))
-! $ )
-
-! version 2
-! fluxin = mu(i,k)*chat(i,k) - md(i,k)*cond(i,k)
-! fluxout = mu(i,k)*conu(i,k) - md(i,k)*chat(i,k)
-! version 3
- fluxin = mu(i,k)*min(chat(i,k),const(i,km1)) - md(i,k)*cond(i,k)
- fluxout = mu(i,k)*conu(i,k) - md(i,k)*min(chat(i,k),const(i,k))
-
- netflux = fluxin - fluxout
- if (abs(netflux) < max(fluxin,fluxout)*1.e-12_r8) then
- netflux = 0._r8
- endif
-! dcondt(i,k) = netflux/dsubcld(i)
- dcondt(i,k) = netflux/dptmp(i,k)
- else if (k > mx(i)) then
-! dcondt(i,k) = dcondt(i,k-1)
- dcondt(i,k) = 0._r8
- end if
- end do
- end do
-
- if (zmconv_microp) then
- do i = il1g,il2g
- do k = jt(i),mx(i)
- if (dcondt(i,k)*dt+const(i,k)<0._r8) then
- negadt = dcondt(i,k)+const(i,k)/dt
- dcondt(i,k) = -const(i,k)/dt
- do kk= k+1, mx(i)
- if (negadt<0._r8 .and. dcondt(i,kk)*dt+const(i,kk)>0._r8 ) then
- qtmp = dcondt(i,kk)+negadt*dptmp(i,k)/dptmp(i,kk)
- if (qtmp*dt+const(i,kk)>0._r8) then
- dcondt(i,kk)= qtmp
- negadt=0._r8
- else
- negadt= negadt+(const(i,kk)/dt+dcondt(i,kk))*dptmp(i,kk)/dptmp(i,k)
- dcondt(i,kk)= -const(i,kk)/dt
- end if
-
- end if
- end do
- do kk= k-1, jt(i), -1
- if (negadt<0._r8 .and. dcondt(i,kk)*dt+const(i,kk)>0._r8 ) then
- qtmp = dcondt(i,kk)+negadt*dptmp(i,k)/dptmp(i,kk)
- if (qtmp*dt+const(i,kk)>0._r8) then
- dcondt(i,kk)= qtmp
- negadt=0._r8
- else
- negadt= negadt+(const(i,kk)/dt+dcondt(i,kk))*dptmp(i,kk)/dptmp(i,k)
- dcondt(i,kk)= -const(i,kk)/dt
- end if
- end if
- end do
-
- if (negadt<0._r8) then
- dcondt(i,k) = dcondt(i,k) + negadt
- end if
- end if
- end do
- end do
- end if
-
-
-! Initialize to zero everywhere, then scatter tendency back to full array
- dqdt(:,:,m) = 0._r8
- do k = 1,pver
- kp1 = min(pver,k+1)
- do i = il1g,il2g
- dqdt(ideep(i),k,m) = dcondt(i,k)
- end do
- end do
-
- end if ! for doconvtran
-
- end do
-
- return
-end subroutine convtran
-
-!=========================================================================================
-
-subroutine momtran(lchnk, ncol, &
- domomtran,q ,ncnst ,mu ,md , &
- du ,eu ,ed ,dp ,dsubcld , &
- jt ,mx ,ideep ,il1g ,il2g , &
- nstep ,dqdt ,pguall ,pgdall, icwu, icwd, dt, seten )
-!-----------------------------------------------------------------------
-!
-! Purpose:
-! Convective transport of momentum
-!
-! Mixing ratios may be with respect to either dry or moist air
-!
-! Method:
-! Based on the convtran subroutine by P. Rasch
-!
-!
-! Author: J. Richter and P. Rasch
-!
-!-----------------------------------------------------------------------
- use shr_kind_mod, only: r8 => shr_kind_r8
- use constituents, only: cnst_get_type_byind
- use ppgrid
-
- implicit none
-!-----------------------------------------------------------------------
-!
-! Input arguments
-!
- integer, intent(in) :: lchnk ! chunk identifier
- integer, intent(in) :: ncol ! number of atmospheric columns
- integer, intent(in) :: ncnst ! number of tracers to transport
- logical, intent(in) :: domomtran(ncnst) ! flag for doing convective transport
- real(r8), intent(in) :: q(pcols,pver,ncnst) ! Wind array
- real(r8), intent(in) :: mu(pcols,pver) ! Mass flux up
- real(r8), intent(in) :: md(pcols,pver) ! Mass flux down
- real(r8), intent(in) :: du(pcols,pver) ! Mass detraining from updraft
- real(r8), intent(in) :: eu(pcols,pver) ! Mass entraining from updraft
- real(r8), intent(in) :: ed(pcols,pver) ! Mass entraining from downdraft
- real(r8), intent(in) :: dp(pcols,pver) ! Delta pressure between interfaces
- real(r8), intent(in) :: dsubcld(pcols) ! Delta pressure from cloud base to sfc
- real(r8), intent(in) :: dt ! time step in seconds : 2*delta_t
-
- integer, intent(in) :: jt(pcols) ! Index of cloud top for each column
- integer, intent(in) :: mx(pcols) ! Index of cloud top for each column
- integer, intent(in) :: ideep(pcols) ! Gathering array
- integer, intent(in) :: il1g ! Gathered min lon indices over which to operate
- integer, intent(in) :: il2g ! Gathered max lon indices over which to operate
- integer, intent(in) :: nstep ! Time step index
-
-
-
-! input/output
-
- real(r8), intent(out) :: dqdt(pcols,pver,ncnst) ! Tracer tendency array
-
-!--------------------------Local Variables------------------------------
-
- integer i ! Work index
- integer k ! Work index
- integer kbm ! Highest altitude index of cloud base
- integer kk ! Work index
- integer kkp1 ! Work index
- integer kkm1 ! Work index
- integer km1 ! Work index
- integer kp1 ! Work index
- integer ktm ! Highest altitude index of cloud top
- integer m ! Work index
- integer ii ! Work index
-
- real(r8) cabv ! Mix ratio of constituent above
- real(r8) cbel ! Mix ratio of constituent below
- real(r8) cdifr ! Normalized diff between cabv and cbel
- real(r8) chat(pcols,pver) ! Mix ratio in env at interfaces
- real(r8) cond(pcols,pver) ! Mix ratio in downdraft at interfaces
- real(r8) const(pcols,pver) ! Gathered wind array
- real(r8) conu(pcols,pver) ! Mix ratio in updraft at interfaces
- real(r8) dcondt(pcols,pver) ! Gathered tend array
- real(r8) mbsth ! Threshold for mass fluxes
- real(r8) mupdudp ! A work variable
- real(r8) minc ! A work variable
- real(r8) maxc ! A work variable
- real(r8) fluxin ! A work variable
- real(r8) fluxout ! A work variable
- real(r8) netflux ! A work variable
-
- real(r8) sum ! sum
- real(r8) sum2 ! sum2
-
- real(r8) mududp(pcols,pver) ! working variable
- real(r8) mddudp(pcols,pver) ! working variable
-
- real(r8) pgu(pcols,pver) ! Pressure gradient term for updraft
- real(r8) pgd(pcols,pver) ! Pressure gradient term for downdraft
-
- real(r8),intent(out) :: pguall(pcols,pver,ncnst) ! Apparent force from updraft PG
- real(r8),intent(out) :: pgdall(pcols,pver,ncnst) ! Apparent force from downdraft PG
-
- real(r8),intent(out) :: icwu(pcols,pver,ncnst) ! In-cloud winds in updraft
- real(r8),intent(out) :: icwd(pcols,pver,ncnst) ! In-cloud winds in downdraft
-
- real(r8),intent(out) :: seten(pcols,pver) ! Dry static energy tendency
- real(r8) gseten(pcols,pver) ! Gathered dry static energy tendency
-
- real(r8) mflux(pcols,pverp,ncnst) ! Gathered momentum flux
-
- real(r8) wind0(pcols,pver,ncnst) ! gathered wind before time step
- real(r8) windf(pcols,pver,ncnst) ! gathered wind after time step
- real(r8) fkeb, fket, ketend_cons, ketend, utop, ubot, vtop, vbot, gset2
-
-
-!-----------------------------------------------------------------------
-!
-
-! Initialize outgoing fields
- pguall(:,:,:) = 0.0_r8
- pgdall(:,:,:) = 0.0_r8
-! Initialize in-cloud winds to environmental wind
- icwu(:ncol,:,:) = q(:ncol,:,:)
- icwd(:ncol,:,:) = q(:ncol,:,:)
-
-! Initialize momentum flux and final winds
- mflux(:,:,:) = 0.0_r8
- wind0(:,:,:) = 0.0_r8
- windf(:,:,:) = 0.0_r8
-
-! Initialize dry static energy
-
- seten(:,:) = 0.0_r8
- gseten(:,:) = 0.0_r8
-
-! mbsth is the threshold below which we treat the mass fluxes as zero (in mb/s)
- mbsth = 1.e-15_r8
-
-! Find the highest level top and bottom levels of convection
- ktm = pver
- kbm = pver
- do i = il1g, il2g
- ktm = min(ktm,jt(i))
- kbm = min(kbm,mx(i))
- end do
-
-! Loop ever each wind component
- do m = 1, ncnst !start at m = 1 to transport momentum
- if (domomtran(m)) then
-
-! Gather up the winds and set tend to zero
- do k = 1,pver
- do i =il1g,il2g
- const(i,k) = q(ideep(i),k,m)
- wind0(i,k,m) = const(i,k)
- end do
- end do
-
-
-! From now on work only with gathered data
-
-! Interpolate winds to interfaces
-
- do k = 1,pver
- km1 = max(1,k-1)
- do i = il1g, il2g
-
- ! use arithmetic mean
- chat(i,k) = 0.5_r8* (const(i,k)+const(i,km1))
-
-! Provisional up and down draft values
- conu(i,k) = chat(i,k)
- cond(i,k) = chat(i,k)
-
-! provisional tends
- dcondt(i,k) = 0._r8
-
- end do
- end do
-
-
-!
-! Pressure Perturbation Term
-!
-
- !Top boundary: assume mu is zero
-
- k=1
- pgu(:il2g,k) = 0.0_r8
- pgd(:il2g,k) = 0.0_r8
-
- do k=2,pver-1
- km1 = max(1,k-1)
- kp1 = min(pver,k+1)
- do i = il1g,il2g
-
- !interior points
-
- mududp(i,k) = ( mu(i,k) * (const(i,k)- const(i,km1))/dp(i,km1) &
- + mu(i,kp1) * (const(i,kp1) - const(i,k))/dp(i,k))
-
- pgu(i,k) = - momcu * 0.5_r8 * mududp(i,k)
-
-
- mddudp(i,k) = ( md(i,k) * (const(i,k)- const(i,km1))/dp(i,km1) &
- + md(i,kp1) * (const(i,kp1) - const(i,k))/dp(i,k))
-
- pgd(i,k) = - momcd * 0.5_r8 * mddudp(i,k)
-
-
- end do
- end do
-
- ! bottom boundary
- k = pver
- km1 = max(1,k-1)
- do i=il1g,il2g
-
- mududp(i,k) = mu(i,k) * (const(i,k)- const(i,km1))/dp(i,km1)
- pgu(i,k) = - momcu * mududp(i,k)
-
- mddudp(i,k) = md(i,k) * (const(i,k)- const(i,km1))/dp(i,km1)
-
- pgd(i,k) = - momcd * mddudp(i,k)
-
- end do
-
-
-!
-! In-cloud velocity calculations
-!
-
-! Do levels adjacent to top and bottom
- k = 2
- km1 = 1
- kk = pver
- kkm1 = max(1,kk-1)
- do i = il1g,il2g
- mupdudp = mu(i,kk) + du(i,kk)*dp(i,kk)
- if (mupdudp > mbsth) then
-
- conu(i,kk) = (+eu(i,kk)*const(i,kk)*dp(i,kk)+pgu(i,kk)*dp(i,kk))/mupdudp
- endif
- if (md(i,k) < -mbsth) then
- cond(i,k) = (-ed(i,km1)*const(i,km1)*dp(i,km1))-pgd(i,km1)*dp(i,km1)/md(i,k)
- endif
-
-
- end do
-
-
-
-! Updraft from bottom to top
- do kk = pver-1,1,-1
- kkm1 = max(1,kk-1)
- kkp1 = min(pver,kk+1)
- do i = il1g,il2g
- mupdudp = mu(i,kk) + du(i,kk)*dp(i,kk)
- if (mupdudp > mbsth) then
-
- conu(i,kk) = ( mu(i,kkp1)*conu(i,kkp1)+eu(i,kk)* &
- const(i,kk)*dp(i,kk)+pgu(i,kk)*dp(i,kk))/mupdudp
- endif
- end do
-
- end do
-
-
-! Downdraft from top to bottom
- do k = 3,pver
- km1 = max(1,k-1)
- do i = il1g,il2g
- if (md(i,k) < -mbsth) then
-
- cond(i,k) = ( md(i,km1)*cond(i,km1)-ed(i,km1)*const(i,km1) &
- *dp(i,km1)-pgd(i,km1)*dp(i,km1) )/md(i,k)
-
- endif
- end do
- end do
-
-
- sum = 0._r8
- sum2 = 0._r8
-
-
- do k = ktm,pver
- km1 = max(1,k-1)
- kp1 = min(pver,k+1)
- do i = il1g,il2g
- ii = ideep(i)
-
-! version 1 hard to check for roundoff errors
- dcondt(i,k) = &
- +(mu(i,kp1)* (conu(i,kp1)-chat(i,kp1)) &
- -mu(i,k)* (conu(i,k)-chat(i,k)) &
- +md(i,kp1)* (cond(i,kp1)-chat(i,kp1)) &
- -md(i,k)* (cond(i,k)-chat(i,k)) &
- )/dp(i,k)
-
- end do
- end do
-
- ! dcont for bottom layer
- !
- do k = kbm,pver
- km1 = max(1,k-1)
- do i = il1g,il2g
- if (k == mx(i)) then
-
- ! version 1
- dcondt(i,k) = (1._r8/dp(i,k))* &
- (-mu(i,k)*(conu(i,k)-chat(i,k)) &
- -md(i,k)*(cond(i,k)-chat(i,k)) &
- )
- end if
- end do
- end do
-
-! Initialize to zero everywhere, then scatter tendency back to full array
- dqdt(:,:,m) = 0._r8
-
- do k = 1,pver
- do i = il1g,il2g
- ii = ideep(i)
- dqdt(ii,k,m) = dcondt(i,k)
- ! Output apparent force on the mean flow from pressure gradient
- pguall(ii,k,m) = -pgu(i,k)
- pgdall(ii,k,m) = -pgd(i,k)
- icwu(ii,k,m) = conu(i,k)
- icwd(ii,k,m) = cond(i,k)
- end do
- end do
-
- ! Calculate momentum flux in units of mb*m/s2
-
- do k = ktm,pver
- do i = il1g,il2g
- ii = ideep(i)
- mflux(i,k,m) = &
- -mu(i,k)* (conu(i,k)-chat(i,k)) &
- -md(i,k)* (cond(i,k)-chat(i,k))
- end do
- end do
-
-
- ! Calculate winds at the end of the time step
-
- do k = ktm,pver
- do i = il1g,il2g
- ii = ideep(i)
- km1 = max(1,k-1)
- kp1 = k+1
- windf(i,k,m) = const(i,k) - (mflux(i,kp1,m) - mflux(i,k,m)) * dt /dp(i,k)
-
- end do
- end do
-
- end if ! for domomtran
- end do
-
- ! Need to add an energy fix to account for the dissipation of kinetic energy
- ! Formulation follows from Boville and Bretherton (2003)
- ! formulation by PJR
-
- do k = ktm,pver
- km1 = max(1,k-1)
- kp1 = min(pver,k+1)
- do i = il1g,il2g
-
- ii = ideep(i)
-
- ! calculate the KE fluxes at top and bot of layer
- ! based on a discrete approximation to b&b eq(35) F_KE = u*F_u + v*F_v at interface
- utop = (wind0(i,k,1)+wind0(i,km1,1))/2._r8
- vtop = (wind0(i,k,2)+wind0(i,km1,2))/2._r8
- ubot = (wind0(i,kp1,1)+wind0(i,k,1))/2._r8
- vbot = (wind0(i,kp1,2)+wind0(i,k,2))/2._r8
- fket = utop*mflux(i,k,1) + vtop*mflux(i,k,2) ! top of layer
- fkeb = ubot*mflux(i,k+1,1) + vbot*mflux(i,k+1,2) ! bot of layer
-
- ! divergence of these fluxes should give a conservative redistribution of KE
- ketend_cons = (fket-fkeb)/dp(i,k)
-
- ! tendency in kinetic energy resulting from the momentum transport
- ketend = ((windf(i,k,1)**2 + windf(i,k,2)**2) - (wind0(i,k,1)**2 + wind0(i,k,2)**2))*0.5_r8/dt
-
- ! the difference should be the dissipation
- gset2 = ketend_cons - ketend
- gseten(i,k) = gset2
-
- end do
-
- end do
-
- ! Scatter dry static energy to full array
- do k = 1,pver
- do i = il1g,il2g
- ii = ideep(i)
- seten(ii,k) = gseten(i,k)
-
- end do
- end do
-
- return
-end subroutine momtran
-
-!=========================================================================================
-
-subroutine buoyan(lchnk ,ncol , &
- q ,t ,p ,z ,pf , &
- tp ,qstp ,tl ,rl ,cape , &
- pblt ,lcl ,lel ,lon ,mx , &
- rd ,grav ,cp ,msg , &
- tpert )
-!-----------------------------------------------------------------------
-!
-! Purpose:
-!
-!
-! Method:
-!
-!
-!
-! Author:
-! This is contributed code not fully standardized by the CCM core group.
-! The documentation has been enhanced to the degree that we are able.
-! Reviewed: P. Rasch, April 1996
-!
-!-----------------------------------------------------------------------
- implicit none
-!-----------------------------------------------------------------------
-!
-! input arguments
-!
- integer, intent(in) :: lchnk ! chunk identifier
- integer, intent(in) :: ncol ! number of atmospheric columns
-
- real(r8), intent(in) :: q(pcols,pver) ! spec. humidity
- real(r8), intent(in) :: t(pcols,pver) ! temperature
- real(r8), intent(in) :: p(pcols,pver) ! pressure
- real(r8), intent(in) :: z(pcols,pver) ! height
- real(r8), intent(in) :: pf(pcols,pver+1) ! pressure at interfaces
- real(r8), intent(in) :: pblt(pcols) ! index of pbl depth
- real(r8), intent(in) :: tpert(pcols) ! perturbation temperature by pbl processes
-
-!
-! output arguments
-!
- real(r8), intent(out) :: tp(pcols,pver) ! parcel temperature
- real(r8), intent(out) :: qstp(pcols,pver) ! saturation mixing ratio of parcel
- real(r8), intent(out) :: tl(pcols) ! parcel temperature at lcl
- real(r8), intent(out) :: cape(pcols) ! convective aval. pot. energy.
- integer lcl(pcols) !
- integer lel(pcols) !
- integer lon(pcols) ! level of onset of deep convection
- integer mx(pcols) ! level of max moist static energy
-!
-!--------------------------Local Variables------------------------------
-!
- real(r8) capeten(pcols,num_cin) ! provisional value of cape
- real(r8) tv(pcols,pver) !
- real(r8) tpv(pcols,pver) !
- real(r8) buoy(pcols,pver)
-
- real(r8) a1(pcols)
- real(r8) a2(pcols)
- real(r8) estp(pcols)
- real(r8) pl(pcols)
- real(r8) plexp(pcols)
- real(r8) hmax(pcols)
- real(r8) hmn(pcols)
- real(r8) y(pcols)
-
- logical plge600(pcols)
- integer knt(pcols)
- integer lelten(pcols,num_cin)
-
- real(r8) cp
- real(r8) e
- real(r8) grav
-
- integer i
- integer k
- integer msg
- integer n
-
- real(r8) rd
- real(r8) rl
-!
-!-----------------------------------------------------------------------
-!
- do n = 1,num_cin
- do i = 1,ncol
- lelten(i,n) = pver
- capeten(i,n) = 0._r8
- end do
- end do
-!
- do i = 1,ncol
- lon(i) = pver
- knt(i) = 0
- lel(i) = pver
- mx(i) = lon(i)
- cape(i) = 0._r8
- hmax(i) = 0._r8
- end do
-
- tp(:ncol,:) = t(:ncol,:)
- qstp(:ncol,:) = q(:ncol,:)
-
-!!! RBN - Initialize tv and buoy for output.
-!!! tv=tv : tpv=tpv : qstp=q : buoy=0.
- tv(:ncol,:) = t(:ncol,:) *(1._r8+1.608_r8*q(:ncol,:))/ (1._r8+q(:ncol,:))
- tpv(:ncol,:) = tv(:ncol,:)
- buoy(:ncol,:) = 0._r8
-
-!
-! set "launching" level(mx) to be at maximum moist static energy.
-! search for this level stops at planetary boundary layer top.
-!
- do k = pver,msg + 1,-1
- do i = 1,ncol
- hmn(i) = cp*t(i,k) + grav*z(i,k) + rl*q(i,k)
- if (k >= nint(pblt(i)) .and. k <= lon(i) .and. hmn(i) > hmax(i)) then
- hmax(i) = hmn(i)
- mx(i) = k
- end if
- end do
- end do
-
-!
- do i = 1,ncol
- lcl(i) = mx(i)
- e = p(i,mx(i))*q(i,mx(i))/ (eps1+q(i,mx(i)))
- tl(i) = 2840._r8/ (3.5_r8*log(t(i,mx(i)))-log(e)-4.805_r8) + 55._r8
- if (tl(i) < t(i,mx(i))) then
- plexp(i) = (1._r8/ (0.2854_r8* (1._r8-0.28_r8*q(i,mx(i)))))
- pl(i) = p(i,mx(i))* (tl(i)/t(i,mx(i)))**plexp(i)
- else
- tl(i) = t(i,mx(i))
- pl(i) = p(i,mx(i))
- end if
- end do
-
-!
-! calculate lifting condensation level (lcl).
-!
- do k = pver,msg + 2,-1
- do i = 1,ncol
- if (k <= mx(i) .and. (p(i,k) > pl(i) .and. p(i,k-1) <= pl(i))) then
- lcl(i) = k - 1
- end if
- end do
- end do
-!
-! if lcl is above the nominal level of non-divergence (600 mbs),
-! no deep convection is permitted (ensuing calculations
-! skipped and cape retains initialized value of zero).
-!
- do i = 1,ncol
- plge600(i) = pl(i).ge.600._r8
- end do
-!
-! initialize parcel properties in sub-cloud layer below lcl.
-!
- do k = pver,msg + 1,-1
- do i=1,ncol
- if (k > lcl(i) .and. k <= mx(i) .and. plge600(i)) then
- tv(i,k) = t(i,k)* (1._r8+1.608_r8*q(i,k))/ (1._r8+q(i,k))
- qstp(i,k) = q(i,mx(i))
- tp(i,k) = t(i,mx(i))* (p(i,k)/p(i,mx(i)))**(0.2854_r8* (1._r8-0.28_r8*q(i,mx(i))))
-!
-! buoyancy is increased by 0.5 k as in tiedtke
-!
-!-jjh tpv (i,k)=tp(i,k)*(1.+1.608*q(i,mx(i)))/
-!-jjh 1 (1.+q(i,mx(i)))
- tpv(i,k) = (tp(i,k)+tpert(i))*(1._r8+1.608_r8*q(i,mx(i)))/ (1._r8+q(i,mx(i)))
- buoy(i,k) = tpv(i,k) - tv(i,k) + tiedke_add
- end if
- end do
- end do
-
-!
-! define parcel properties at lcl (i.e. level immediately above pl).
-!
- do k = pver,msg + 1,-1
- do i=1,ncol
- if (k == lcl(i) .and. plge600(i)) then
- tv(i,k) = t(i,k)* (1._r8+1.608_r8*q(i,k))/ (1._r8+q(i,k))
- qstp(i,k) = q(i,mx(i))
- tp(i,k) = tl(i)* (p(i,k)/pl(i))**(0.2854_r8* (1._r8-0.28_r8*qstp(i,k)))
-! estp(i) =exp(21.656_r8 - 5418._r8/tp(i,k))
-! use of different formulas for es has about 1 g/kg difference
-! in qs at t= 300k, and 0.02 g/kg at t=263k, with the formula
-! above giving larger qs.
- call qsat_hPa(tp(i,k), p(i,k), estp(i), qstp(i,k))
- a1(i) = cp / rl + qstp(i,k) * (1._r8+ qstp(i,k) / eps1) * rl * eps1 / &
- (rd * tp(i,k) ** 2)
- a2(i) = .5_r8* (qstp(i,k)* (1._r8+2._r8/eps1*qstp(i,k))* &
- (1._r8+qstp(i,k)/eps1)*eps1**2*rl*rl/ &
- (rd**2*tp(i,k)**4)-qstp(i,k)* &
- (1._r8+qstp(i,k)/eps1)*2._r8*eps1*rl/ &
- (rd*tp(i,k)**3))
- a1(i) = 1._r8/a1(i)
- a2(i) = -a2(i)*a1(i)**3
- y(i) = q(i,mx(i)) - qstp(i,k)
- tp(i,k) = tp(i,k) + a1(i)*y(i) + a2(i)*y(i)**2
- call qsat_hPa(tp(i,k), p(i,k), estp(i), qstp(i,k))
-!
-! buoyancy is increased by 0.5 k in cape calculation.
-! dec. 9, 1994
-!-jjh tpv(i,k) =tp(i,k)*(1.+1.608*qstp(i,k))/(1.+q(i,mx(i)))
-!
- tpv(i,k) = (tp(i,k)+tpert(i))* (1._r8+1.608_r8*qstp(i,k)) / (1._r8+q(i,mx(i)))
- buoy(i,k) = tpv(i,k) - tv(i,k) + tiedke_add
- end if
- end do
- end do
-!
-! main buoyancy calculation.
-!
- do k = pver - 1,msg + 1,-1
- do i=1,ncol
- if (k < lcl(i) .and. plge600(i)) then
- tv(i,k) = t(i,k)* (1._r8+1.608_r8*q(i,k))/ (1._r8+q(i,k))
- qstp(i,k) = qstp(i,k+1)
- tp(i,k) = tp(i,k+1)* (p(i,k)/p(i,k+1))**(0.2854_r8* (1._r8-0.28_r8*qstp(i,k)))
- call qsat_hPa(tp(i,k), p(i,k), estp(i), qstp(i,k))
- a1(i) = cp/rl + qstp(i,k)* (1._r8+qstp(i,k)/eps1)*rl*eps1/ (rd*tp(i,k)**2)
- a2(i) = .5_r8* (qstp(i,k)* (1._r8+2._r8/eps1*qstp(i,k))* &
- (1._r8+qstp(i,k)/eps1)*eps1**2*rl*rl/ &
- (rd**2*tp(i,k)**4)-qstp(i,k)* &
- (1._r8+qstp(i,k)/eps1)*2._r8*eps1*rl/ &
- (rd*tp(i,k)**3))
- a1(i) = 1._r8/a1(i)
- a2(i) = -a2(i)*a1(i)**3
- y(i) = qstp(i,k+1) - qstp(i,k)
- tp(i,k) = tp(i,k) + a1(i)*y(i) + a2(i)*y(i)**2
- call qsat_hPa(tp(i,k), p(i,k), estp(i), qstp(i,k))
-!-jjh tpv(i,k) =tp(i,k)*(1.+1.608*qstp(i,k))/
-!jt (1.+q(i,mx(i)))
- tpv(i,k) = (tp(i,k)+tpert(i))* (1._r8+1.608_r8*qstp(i,k))/(1._r8+q(i,mx(i)))
- buoy(i,k) = tpv(i,k) - tv(i,k) + tiedke_add
- end if
- end do
- end do
-
-!
- do k = msg + 2,pver
- do i = 1,ncol
- if (k < lcl(i) .and. plge600(i)) then
- if (buoy(i,k+1) > 0._r8 .and. buoy(i,k) <= 0._r8) then
- knt(i) = min(5,knt(i) + 1)
- lelten(i,knt(i)) = k
- end if
- end if
- end do
- end do
-!
-! calculate convective available potential energy (cape).
-!
- do n = 1,5
- do k = msg + 1,pver
- do i = 1,ncol
- if (plge600(i) .and. k <= mx(i) .and. k > lelten(i,n)) then
- capeten(i,n) = capeten(i,n) + rd*buoy(i,k)*log(pf(i,k+1)/pf(i,k))
- end if
- end do
- end do
- end do
-!
-! find maximum cape from all possible tentative capes from
-! one sounding,
-! and use it as the final cape, april 26, 1995
-!
- do n = 1,5
- do i = 1,ncol
- if (capeten(i,n) > cape(i)) then
- cape(i) = capeten(i,n)
- lel(i) = lelten(i,n)
- end if
- end do
- end do
-!
-! put lower bound on cape for diagnostic purposes.
-!
- do i = 1,ncol
- cape(i) = max(cape(i), 0._r8)
- end do
-!
- return
-end subroutine buoyan
-
-subroutine cldprp(lchnk , &
- q ,t ,u ,v ,p , &
- z ,s ,mu ,eu ,du , &
- md ,ed ,sd ,qd ,mc , &
- qu ,su ,zf ,qst ,hmn , &
- hsat ,shat ,ql , &
- cmeg ,jb ,lel ,jt ,jlcl , &
- mx ,j0 ,jd ,rl ,il2g , &
- rd ,grav ,cp ,msg , &
- pflx ,evp ,cu ,rprd ,limcnv ,landfrac, &
- qcde ,aero ,loc_conv,qhat )
-
-!-----------------------------------------------------------------------
-!
-! Purpose:
-!
-!
-! Method:
-! may 09/91 - guang jun zhang, m.lazare, n.mcfarlane.
-! original version cldprop.
-!
-! Author: See above, modified by P. Rasch
-! This is contributed code not fully standardized by the CCM core group.
-!
-! this code is very much rougher than virtually anything else in the CCM
-! there are debug statements left strewn about and code segments disabled
-! these are to facilitate future development. We expect to release a
-! cleaner code in a future release
-!
-! the documentation has been enhanced to the degree that we are able
-!
-!-----------------------------------------------------------------------
-
- implicit none
-
-!------------------------------------------------------------------------------
-!
-! Input arguments
-!
- integer, intent(in) :: lchnk ! chunk identifier
-
- real(r8), intent(in) :: q(pcols,pver) ! spec. humidity of env
- real(r8), intent(in) :: t(pcols,pver) ! temp of env
- real(r8), intent(in) :: p(pcols,pver) ! pressure of env
- real(r8), intent(in) :: z(pcols,pver) ! height of env
- real(r8), intent(in) :: s(pcols,pver) ! normalized dry static energy of env
- real(r8), intent(in) :: zf(pcols,pverp) ! height of interfaces
- real(r8), intent(in) :: u(pcols,pver) ! zonal velocity of env
- real(r8), intent(in) :: v(pcols,pver) ! merid. velocity of env
-
- real(r8), intent(in) :: landfrac(pcols) ! RBN Landfrac
-
- integer, intent(in) :: jb(pcols) ! updraft base level
- integer, intent(in) :: lel(pcols) ! updraft launch level
- integer, intent(out) :: jt(pcols) ! updraft plume top
- integer, intent(out) :: jlcl(pcols) ! updraft lifting cond level
- integer, intent(in) :: mx(pcols) ! updraft base level (same is jb)
- integer, intent(out) :: j0(pcols) ! level where updraft begins detraining
- integer, intent(out) :: jd(pcols) ! level of downdraft
- integer, intent(in) :: limcnv ! convection limiting level
- integer, intent(in) :: il2g !CORE GROUP REMOVE
- integer, intent(in) :: msg ! missing moisture vals (always 0)
- real(r8), intent(in) :: rl ! latent heat of vap
- real(r8), intent(in) :: shat(pcols,pver) ! interface values of dry stat energy
- real(r8), intent(in) :: qhat(pcols,pver) ! wg grid slice of upper interface mixing ratio.
- type(zm_aero_t), intent(in) :: aero ! aerosol object
-
-!
-! output
-!
- real(r8), intent(out) :: rprd(pcols,pver) ! rate of production of precip at that layer
- real(r8), intent(out) :: du(pcols,pver) ! detrainement rate of updraft
- real(r8), intent(out) :: ed(pcols,pver) ! entrainment rate of downdraft
- real(r8), intent(out) :: eu(pcols,pver) ! entrainment rate of updraft
- real(r8), intent(out) :: hmn(pcols,pver) ! moist stat energy of env
- real(r8), intent(out) :: hsat(pcols,pver) ! sat moist stat energy of env
- real(r8), intent(out) :: mc(pcols,pver) ! net mass flux
- real(r8), intent(out) :: md(pcols,pver) ! downdraft mass flux
- real(r8), intent(out) :: mu(pcols,pver) ! updraft mass flux
- real(r8), intent(out) :: pflx(pcols,pverp) ! precipitation flux thru layer
- real(r8), intent(out) :: qd(pcols,pver) ! spec humidity of downdraft
- real(r8), intent(out) :: ql(pcols,pver) ! liq water of updraft
- real(r8), intent(out) :: qst(pcols,pver) ! saturation mixing ratio of env.
- real(r8), intent(out) :: qu(pcols,pver) ! spec hum of updraft
- real(r8), intent(out) :: sd(pcols,pver) ! normalized dry stat energy of downdraft
- real(r8), intent(out) :: su(pcols,pver) ! normalized dry stat energy of updraft
- real(r8), intent(out) :: qcde(pcols,pver) ! cloud water mixing ratio for detrainment (kg/kg)
-
- type(zm_conv_t) :: loc_conv
-
- real(r8) rd ! gas constant for dry air
- real(r8) grav ! gravity
- real(r8) cp ! heat capacity of dry air
-
-!
-! Local workspace
-!
- real(r8) gamma(pcols,pver)
- real(r8) dz(pcols,pver)
- real(r8) iprm(pcols,pver)
- real(r8) hu(pcols,pver)
- real(r8) hd(pcols,pver)
- real(r8) eps(pcols,pver)
- real(r8) f(pcols,pver)
- real(r8) k1(pcols,pver)
- real(r8) i2(pcols,pver)
- real(r8) ihat(pcols,pver)
- real(r8) i3(pcols,pver)
- real(r8) idag(pcols,pver)
- real(r8) i4(pcols,pver)
- real(r8) qsthat(pcols,pver)
- real(r8) hsthat(pcols,pver)
- real(r8) gamhat(pcols,pver)
- real(r8) cu(pcols,pver)
- real(r8) evp(pcols,pver)
- real(r8) cmeg(pcols,pver)
- real(r8) qds(pcols,pver)
-! RBN For c0mask
- real(r8) c0mask(pcols)
-
- real(r8) hmin(pcols)
- real(r8) expdif(pcols)
- real(r8) expnum(pcols)
- real(r8) ftemp(pcols)
- real(r8) eps0(pcols)
- real(r8) rmue(pcols)
- real(r8) zuef(pcols)
- real(r8) zdef(pcols)
- real(r8) epsm(pcols)
- real(r8) ratmjb(pcols)
- real(r8) est(pcols)
- real(r8) totpcp(pcols)
- real(r8) totevp(pcols)
- real(r8) alfa(pcols)
- real(r8) ql1
- real(r8) tu
- real(r8) estu
- real(r8) qstu
-
- real(r8) small
- real(r8) mdt
-
- real(r8) fice(pcols,pver) ! ice fraction in precip production
- real(r8) tug(pcols,pver)
-
- real(r8) tvuo(pcols,pver) ! updraft virtual T w/o freezing heating
- real(r8) tvu(pcols,pver) ! updraft virtual T with freezing heating
- real(r8) totfrz(pcols)
- real(r8) frz (pcols,pver) ! rate of freezing
- integer jto(pcols) ! updraft plume old top
- integer tmplel(pcols)
-
- integer iter, itnum
- integer m
-
- integer khighest
- integer klowest
- integer kount
- integer i,k
-
- logical doit(pcols)
- logical done(pcols)
-!
-!------------------------------------------------------------------------------
-!
- if (zmconv_microp) then
- loc_conv%autolm(:il2g,:) = 0._r8
- loc_conv%accrlm(:il2g,:) = 0._r8
- loc_conv%bergnm(:il2g,:) = 0._r8
- loc_conv%fhtimm(:il2g,:) = 0._r8
- loc_conv%fhtctm(:il2g,:) = 0._r8
- loc_conv%fhmlm (:il2g,:) = 0._r8
- loc_conv%hmpim (:il2g,:) = 0._r8
- loc_conv%accslm(:il2g,:) = 0._r8
- loc_conv%dlfm (:il2g,:) = 0._r8
-
- loc_conv%autoln(:il2g,:) = 0._r8
- loc_conv%accrln(:il2g,:) = 0._r8
- loc_conv%bergnn(:il2g,:) = 0._r8
- loc_conv%fhtimn(:il2g,:) = 0._r8
- loc_conv%fhtctn(:il2g,:) = 0._r8
- loc_conv%fhmln (:il2g,:) = 0._r8
- loc_conv%accsln(:il2g,:) = 0._r8
- loc_conv%activn(:il2g,:) = 0._r8
- loc_conv%dlfn (:il2g,:) = 0._r8
-
- loc_conv%autoim(:il2g,:) = 0._r8
- loc_conv%accsim(:il2g,:) = 0._r8
- loc_conv%difm (:il2g,:) = 0._r8
-
- loc_conv%nuclin(:il2g,:) = 0._r8
- loc_conv%autoin(:il2g,:) = 0._r8
- loc_conv%accsin(:il2g,:) = 0._r8
- loc_conv%hmpin (:il2g,:) = 0._r8
- loc_conv%difn (:il2g,:) = 0._r8
-
- loc_conv%trspcm(:il2g,:) = 0._r8
- loc_conv%trspcn(:il2g,:) = 0._r8
- loc_conv%trspim(:il2g,:) = 0._r8
- loc_conv%trspin(:il2g,:) = 0._r8
-
- loc_conv%dcape (:il2g) = 0._r8
-
- end if
-
- do i = 1,il2g
- ftemp(i) = 0._r8
- expnum(i) = 0._r8
- expdif(i) = 0._r8
- c0mask(i) = c0_ocn * (1._r8-landfrac(i)) + c0_lnd * landfrac(i)
- end do
-!
-!jr Change from msg+1 to 1 to prevent blowup
-!
- do k = 1,pver
- do i = 1,il2g
- dz(i,k) = zf(i,k) - zf(i,k+1)
- end do
- end do
-
-!
-! initialize many output and work variables to zero
-!
- pflx(:il2g,1) = 0
-
- do k = 1,pver
- do i = 1,il2g
- k1(i,k) = 0._r8
- i2(i,k) = 0._r8
- i3(i,k) = 0._r8
- i4(i,k) = 0._r8
- mu(i,k) = 0._r8
- f(i,k) = 0._r8
- eps(i,k) = 0._r8
- eu(i,k) = 0._r8
- du(i,k) = 0._r8
- ql(i,k) = 0._r8
- cu(i,k) = 0._r8
- evp(i,k) = 0._r8
- cmeg(i,k) = 0._r8
- qds(i,k) = q(i,k)
- md(i,k) = 0._r8
- ed(i,k) = 0._r8
- sd(i,k) = s(i,k)
- qd(i,k) = q(i,k)
- mc(i,k) = 0._r8
- qu(i,k) = q(i,k)
- su(i,k) = s(i,k)
- call qsat_hPa(t(i,k), p(i,k), est(i), qst(i,k))
-
- if ( p(i,k)-est(i) <= 0._r8 ) then
- qst(i,k) = 1.0_r8
- end if
-
- gamma(i,k) = qst(i,k)*(1._r8 + qst(i,k)/eps1)*eps1*rl/(rd*t(i,k)**2)*rl/cp
- hmn(i,k) = cp*t(i,k) + grav*z(i,k) + rl*q(i,k)
- hsat(i,k) = cp*t(i,k) + grav*z(i,k) + rl*qst(i,k)
- hu(i,k) = hmn(i,k)
- hd(i,k) = hmn(i,k)
- rprd(i,k) = 0._r8
-
- fice(i,k) = 0._r8
- tug(i,k) = 0._r8
- qcde(i,k) = 0._r8
- tvuo(i,k) = (shat(i,k) - grav/cp*zf(i,k))*(1._r8 + 0.608_r8*qhat(i,k))
- tvu(i,k) = tvuo(i,k)
- frz(i,k) = 0._r8
-
- end do
- end do
- if (zmconv_microp) then
- do k = 1,pver
- do i = 1,il2g
- loc_conv%sprd(i,k) = 0._r8
- loc_conv%wu(i,k) = 0._r8
- loc_conv%cmel(i,k) = 0._r8
- loc_conv%cmei(i,k) = 0._r8
- loc_conv%qliq(i,k) = 0._r8
- loc_conv%qice(i,k) = 0._r8
- loc_conv%qnl(i,k) = 0._r8
- loc_conv%qni(i,k) = 0._r8
- loc_conv%qide(i,k) = 0._r8
- loc_conv%qncde(i,k) = 0._r8
- loc_conv%qnide(i,k) = 0._r8
- loc_conv%qnr(i,k) = 0._r8
- loc_conv%qns(i,k) = 0._r8
- loc_conv%qrain(i,k)= 0._r8
- loc_conv%qsnow(i,k)= 0._r8
- loc_conv%frz(i,k) = 0._r8
- end do
- end do
- end if
-!
-!jr Set to zero things which make this routine blow up
-!
- do k=1,msg
- do i=1,il2g
- rprd(i,k) = 0._r8
- end do
- end do
-!
-! interpolate the layer values of qst, hsat and gamma to
-! layer interfaces
-!
- do k = 1, msg+1
- do i = 1,il2g
- hsthat(i,k) = hsat(i,k)
- qsthat(i,k) = qst(i,k)
- gamhat(i,k) = gamma(i,k)
- end do
- end do
- do i = 1,il2g
- totpcp(i) = 0._r8
- totevp(i) = 0._r8
- end do
- do k = msg + 2,pver
- do i = 1,il2g
- if (abs(qst(i,k-1)-qst(i,k)) > 1.E-6_r8) then
- qsthat(i,k) = log(qst(i,k-1)/qst(i,k))*qst(i,k-1)*qst(i,k)/ (qst(i,k-1)-qst(i,k))
- else
- qsthat(i,k) = qst(i,k)
- end if
- hsthat(i,k) = cp*shat(i,k) + rl*qsthat(i,k)
- if (abs(gamma(i,k-1)-gamma(i,k)) > 1.E-6_r8) then
- gamhat(i,k) = log(gamma(i,k-1)/gamma(i,k))*gamma(i,k-1)*gamma(i,k)/ &
- (gamma(i,k-1)-gamma(i,k))
- else
- gamhat(i,k) = gamma(i,k)
- end if
- end do
- end do
-!
-! initialize cloud top to highest plume top.
-!jr changed hard-wired 4 to limcnv+1 (not to exceed pver)
-!
- jt(:) = pver
- do i = 1,il2g
- jt(i) = max(lel(i),limcnv+1)
- jt(i) = min(jt(i),pver)
- jd(i) = pver
- jlcl(i) = lel(i)
- hmin(i) = 1.E6_r8
- end do
-!
-! find the level of minimum hsat, where detrainment starts
-!
-
- do k = msg + 1,pver
- do i = 1,il2g
- if (hsat(i,k) <= hmin(i) .and. k >= jt(i) .and. k <= jb(i)) then
- hmin(i) = hsat(i,k)
- j0(i) = k
- end if
- end do
- end do
- do i = 1,il2g
- j0(i) = min(j0(i),jb(i)-2)
- j0(i) = max(j0(i),jt(i)+2)
-!
-! Fix from Guang Zhang to address out of bounds array reference
-!
- j0(i) = min(j0(i),pver)
- end do
-!
-! Initialize certain arrays inside cloud
-!
- do k = msg + 1,pver
- do i = 1,il2g
- if (k >= jt(i) .and. k <= jb(i)) then
- hu(i,k) = hmn(i,mx(i)) + cp*tiedke_add
- su(i,k) = s(i,mx(i)) + tiedke_add
- end if
- end do
- end do
-!
-! *********************************************************
-! compute taylor series for approximate eps(z) below
-! *********************************************************
-!
- do k = pver - 1,msg + 1,-1
- do i = 1,il2g
- if (k < jb(i) .and. k >= jt(i)) then
- k1(i,k) = k1(i,k+1) + (hmn(i,mx(i))-hmn(i,k))*dz(i,k)
- ihat(i,k) = 0.5_r8* (k1(i,k+1)+k1(i,k))
- i2(i,k) = i2(i,k+1) + ihat(i,k)*dz(i,k)
- idag(i,k) = 0.5_r8* (i2(i,k+1)+i2(i,k))
- i3(i,k) = i3(i,k+1) + idag(i,k)*dz(i,k)
- iprm(i,k) = 0.5_r8* (i3(i,k+1)+i3(i,k))
- i4(i,k) = i4(i,k+1) + iprm(i,k)*dz(i,k)
- end if
- end do
- end do
-!
-! re-initialize hmin array for ensuing calculation.
-!
- do i = 1,il2g
- hmin(i) = 1.E6_r8
- end do
- do k = msg + 1,pver
- do i = 1,il2g
- if (k >= j0(i) .and. k <= jb(i) .and. hmn(i,k) <= hmin(i)) then
- hmin(i) = hmn(i,k)
- expdif(i) = hmn(i,mx(i)) - hmin(i)
- end if
- end do
- end do
-!
-! *********************************************************
-! compute approximate eps(z) using above taylor series
-! *********************************************************
-!
- do k = msg + 2,pver
- do i = 1,il2g
- expnum(i) = 0._r8
- ftemp(i) = 0._r8
- if (k < jt(i) .or. k >= jb(i)) then
- k1(i,k) = 0._r8
- expnum(i) = 0._r8
- else
- expnum(i) = hmn(i,mx(i)) - (hsat(i,k-1)*(zf(i,k)-z(i,k)) + &
- hsat(i,k)* (z(i,k-1)-zf(i,k)))/(z(i,k-1)-z(i,k))
- end if
- if ((expdif(i) > 100._r8 .and. expnum(i) > 0._r8) .and. &
- k1(i,k) > expnum(i)*dz(i,k)) then
- ftemp(i) = expnum(i)/k1(i,k)
- f(i,k) = ftemp(i) + i2(i,k)/k1(i,k)*ftemp(i)**2 + &
- (2._r8*i2(i,k)**2-k1(i,k)*i3(i,k))/k1(i,k)**2* &
- ftemp(i)**3 + (-5._r8*k1(i,k)*i2(i,k)*i3(i,k)+ &
- 5._r8*i2(i,k)**3+k1(i,k)**2*i4(i,k))/ &
- k1(i,k)**3*ftemp(i)**4
- f(i,k) = max(f(i,k),0._r8)
- f(i,k) = min(f(i,k),0.0002_r8)
- end if
- end do
- end do
- do i = 1,il2g
- if (j0(i) < jb(i)) then
- if (f(i,j0(i)) < 1.E-6_r8 .and. f(i,j0(i)+1) > f(i,j0(i))) j0(i) = j0(i) + 1
- end if
- end do
- do k = msg + 2,pver
- do i = 1,il2g
- if (k >= jt(i) .and. k <= j0(i)) then
- f(i,k) = max(f(i,k),f(i,k-1))
- end if
- end do
- end do
- do i = 1,il2g
- eps0(i) = f(i,j0(i))
- eps(i,jb(i)) = eps0(i)
- end do
-!
-! This is set to match the Rasch and Kristjansson paper
-!
- do k = pver,msg + 1,-1
- do i = 1,il2g
- if (k >= j0(i) .and. k <= jb(i)) then
- eps(i,k) = f(i,j0(i))
- end if
- end do
- end do
- do k = pver,msg + 1,-1
- do i = 1,il2g
- if (k < j0(i) .and. k >= jt(i)) eps(i,k) = f(i,k)
- end do
- end do
-
- if (zmconv_microp) then
- itnum = 2
- else
- itnum = 1
- end if
-
- do iter=1, itnum
-
- if (zmconv_microp) then
- do k = pver,msg + 1,-1
- do i = 1,il2g
- cu(i,k) = 0._r8
- loc_conv%qliq(i,k) = 0._r8
- loc_conv%qice(i,k) = 0._r8
- ql(i,k) = 0._r8
- loc_conv%frz(i,k) = 0._r8
- end do
- end do
- do i = 1,il2g
- totpcp(i) = 0._r8
- hu(i,jb(i)) = hmn(i,jb(i)) + cp*tiedke_add
- end do
-
- end if
-
-!
-! specify the updraft mass flux mu, entrainment eu, detrainment du
-! and moist static energy hu.
-! here and below mu, eu,du, md and ed are all normalized by mb
-!
- do i = 1,il2g
- if (eps0(i) > 0._r8) then
- mu(i,jb(i)) = 1._r8
- eu(i,jb(i)) = mu(i,jb(i))/dz(i,jb(i))
- end if
- if (zmconv_microp) then
- tmplel(i) = lel(i)
- else
- tmplel(i) = jt(i)
- end if
- end do
- do k = pver,msg + 1,-1
- do i = 1,il2g
- if (eps0(i) > 0._r8 .and. (k >= tmplel(i) .and. k < jb(i))) then
- zuef(i) = zf(i,k) - zf(i,jb(i))
- rmue(i) = (1._r8/eps0(i))* (exp(eps(i,k+1)*zuef(i))-1._r8)/zuef(i)
- mu(i,k) = (1._r8/eps0(i))* (exp(eps(i,k )*zuef(i))-1._r8)/zuef(i)
- eu(i,k) = (rmue(i)-mu(i,k+1))/dz(i,k)
- du(i,k) = (rmue(i)-mu(i,k))/dz(i,k)
- end if
- end do
- end do
-
- khighest = pverp
- klowest = 1
- do i=1,il2g
- khighest = min(khighest,lel(i))
- klowest = max(klowest,jb(i))
- end do
- do k = klowest-1,khighest,-1
- do i = 1,il2g
- if (k <= jb(i)-1 .and. k >= lel(i) .and. eps0(i) > 0._r8) then
- if (mu(i,k) < 0.02_r8) then
- hu(i,k) = hmn(i,k)
- mu(i,k) = 0._r8
- eu(i,k) = 0._r8
- du(i,k) = mu(i,k+1)/dz(i,k)
- else
- if (zmconv_microp) then
- hu(i,k) = (mu(i,k+1)*hu(i,k+1) + dz(i,k)*(eu(i,k)*hmn(i,k) + &
- latice*frz(i,k)))/(mu(i,k)+ dz(i,k)*du(i,k))
- else
- hu(i,k) = mu(i,k+1)/mu(i,k)*hu(i,k+1) + &
- dz(i,k)/mu(i,k)* (eu(i,k)*hmn(i,k)- du(i,k)*hsat(i,k))
- end if
- end if
- end if
- end do
- end do
-!
-! reset cloud top index beginning from two layers above the
-! cloud base (i.e. if cloud is only one layer thick, top is not reset
-!
- do i=1,il2g
- doit(i) = .true.
- totfrz(i)= 0._r8
- do k = pver,msg + 1,-1
- totfrz(i)= totfrz(i)+ frz(i,k)*dz(i,k)
- end do
- end do
- do k=klowest-2,khighest-1,-1
- do i=1,il2g
- if (doit(i) .and. k <= jb(i)-2 .and. k >= lel(i)-1) then
- if (hu(i,k) <= hsthat(i,k) .and. hu(i,k+1) > hsthat(i,k+1) &
- .and. mu(i,k) >= 0.02_r8) then
- if (hu(i,k)-hsthat(i,k) < -2000._r8) then
- jt(i) = k + 1
- doit(i) = .false.
- else
- jt(i) = k
- doit(i) = .false.
- end if
- else if ( (hu(i,k) > hu(i,jb(i)) .and. totfrz(i)<=0._r8) .or. mu(i,k) < 0.02_r8) then
- jt(i) = k + 1
- doit(i) = .false.
- end if
- end if
- end do
- end do
-
- if (iter == 1) jto(:) = jt(:)
-
- do k = pver,msg + 1,-1
- do i = 1,il2g
- if (k >= lel(i) .and. k <= jt(i) .and. eps0(i) > 0._r8) then
- mu(i,k) = 0._r8
- eu(i,k) = 0._r8
- du(i,k) = 0._r8
- hu(i,k) = hmn(i,k)
- end if
- if (k == jt(i) .and. eps0(i) > 0._r8) then
- du(i,k) = mu(i,k+1)/dz(i,k)
- eu(i,k) = 0._r8
- mu(i,k) = 0._r8
- end if
- end do
- end do
-
- do i = 1,il2g
- done(i) = .false.
- end do
- kount = 0
- do k = pver,msg + 2,-1
- do i = 1,il2g
- if (k == jb(i) .and. eps0(i) > 0._r8) then
- qu(i,k) = q(i,mx(i))
- su(i,k) = (hu(i,k)-rl*qu(i,k))/cp
- end if
- if (( .not. done(i) .and. k > jt(i) .and. k < jb(i)) .and. eps0(i) > 0._r8) then
- su(i,k) = mu(i,k+1)/mu(i,k)*su(i,k+1) + &
- dz(i,k)/mu(i,k)* (eu(i,k)-du(i,k))*s(i,k)
- qu(i,k) = mu(i,k+1)/mu(i,k)*qu(i,k+1) + dz(i,k)/mu(i,k)* (eu(i,k)*q(i,k)- &
- du(i,k)*qst(i,k))
- tu = su(i,k) - grav/cp*zf(i,k)
- call qsat_hPa(tu, (p(i,k)+p(i,k-1))/2._r8, estu, qstu)
- if (qu(i,k) >= qstu) then
- jlcl(i) = k
- kount = kount + 1
- done(i) = .true.
- end if
- end if
- end do
- if (kount >= il2g) goto 690
- end do
-690 continue
- do k = msg + 2,pver
- do i = 1,il2g
- if ((k > jt(i) .and. k <= jlcl(i)) .and. eps0(i) > 0._r8) then
- su(i,k) = shat(i,k) + (hu(i,k)-hsthat(i,k))/(cp* (1._r8+gamhat(i,k)))
- qu(i,k) = qsthat(i,k) + gamhat(i,k)*(hu(i,k)-hsthat(i,k))/ &
- (rl* (1._r8+gamhat(i,k)))
- end if
- end do
- end do
-
-! compute condensation in updraft
- if (zmconv_microp) then
- tmplel(:il2g) = jlcl(:il2g)+1
- else
- tmplel(:il2g) = jb(:il2g)
- end if
-
- do k = pver,msg + 2,-1
- do i = 1,il2g
- if (k >= jt(i) .and. k < tmplel(i) .and. eps0(i) > 0._r8) then
- if (zmconv_microp) then
- cu(i,k) = ((mu(i,k)*su(i,k)-mu(i,k+1)*su(i,k+1))/ &
- dz(i,k)- eu(i,k)*s(i,k)+du(i,k)*su(i,k))/(rl/cp) &
- - latice*frz(i,k)/rl
- else
-
- cu(i,k) = ((mu(i,k)*su(i,k)-mu(i,k+1)*su(i,k+1))/ &
- dz(i,k)- (eu(i,k)-du(i,k))*s(i,k))/(rl/cp)
- end if
- if (k == jt(i)) cu(i,k) = 0._r8
- cu(i,k) = max(0._r8,cu(i,k))
- end if
- end do
- end do
-
-
- if (zmconv_microp) then
-
- tug(:il2g,:) = t(:il2g,:)
- fice(:,:) = 0._r8
-
- do k = pver, msg+2, -1
- do i = 1, il2g
- tug(i,k) = su(i,k) - grav/cp*zf(i,k)
- end do
- end do
-
- do k = 1, pver-1
- do i = 1, il2g
-
- if (tug(i,k+1) > 273.15_r8) then
- ! If warmer than tmax then water phase
- fice(i,k) = 0._r8
-
- else if (tug(i,k+1) < 233.15_r8) then
- ! If colder than tmin then ice phase
- fice(i,k) = 1._r8
-
- else
- ! Otherwise mixed phase, with ice fraction decreasing linearly
- ! from tmin to tmax
- fice(i,k) =(273.15_r8 - tug(i,k+1)) / 40._r8
- end if
- end do
- end do
-
- do k = 1, pver
- do i = 1,il2g
- loc_conv%cmei(i,k) = cu(i,k)* fice(i,k)
- loc_conv%cmel(i,k) = cu(i,k) * (1._r8-fice(i,k))
- end do
- end do
-
- call zm_mphy(su, qu, mu, du, eu, loc_conv%cmel, loc_conv%cmei, zf, p, t, q, &
- eps0, jb, jt, jlcl, msg, il2g, grav, cp, rd, aero, gamhat, &
- loc_conv%qliq, loc_conv%qice, loc_conv%qnl, loc_conv%qni, qcde, loc_conv%qide, &
- loc_conv%qncde, loc_conv%qnide, rprd, loc_conv%sprd, frz, &
- loc_conv%wu, loc_conv%qrain, loc_conv%qsnow, loc_conv%qnr, loc_conv%qns, &
- loc_conv%autolm, loc_conv%accrlm, loc_conv%bergnm, loc_conv%fhtimm, loc_conv%fhtctm, &
- loc_conv%fhmlm, loc_conv%hmpim, loc_conv%accslm, loc_conv%dlfm, loc_conv%autoln, &
- loc_conv%accrln, loc_conv%bergnn, loc_conv%fhtimn, loc_conv%fhtctn, &
- loc_conv%fhmln, loc_conv%accsln, loc_conv%activn, loc_conv%dlfn, loc_conv%autoim, &
- loc_conv%accsim, loc_conv%difm, loc_conv%nuclin, loc_conv%autoin, &
- loc_conv%accsin, loc_conv%hmpin, loc_conv%difn, loc_conv%trspcm, loc_conv%trspcn, &
- loc_conv%trspim, loc_conv%trspin, loc_conv%lambdadpcu, loc_conv%mudpcu )
-
-
- do k = pver,msg + 2,-1
- do i = 1,il2g
- ql(i,k) = loc_conv%qliq(i,k)+ loc_conv%qice(i,k)
- loc_conv%frz(i,k) = frz(i,k)
- end do
- end do
-
- do i = 1,il2g
- if (iter == 2 .and. jt(i)> jto(i)) then
- do k = jt(i), jto(i), -1
- loc_conv%frz(i,k) = 0.0_r8
- cu(i,k)=0.0_r8
- end do
- end if
- end do
-
-
- do k = pver,msg + 2,-1
- do i = 1,il2g
- if (k >= jt(i) .and. k < jb(i) .and. eps0(i) > 0._r8 .and. mu(i,k) >= 0.0_r8) then
- totpcp(i) = totpcp(i) + dz(i,k)*(cu(i,k)-du(i,k)*(qcde(i,k+1)+loc_conv%qide(i,k+1) ))
- end if
- end do
- end do
-
- do k = msg + 2,pver
- do i = 1,il2g
- if ((k > jt(i) .and. k <= jlcl(i)) .and. eps0(i) > 0._r8) then
- if (iter == 1) tvuo(i,k)= (su(i,k) - grav/cp*zf(i,k))*(1._r8+0.608_r8*qu(i,k))
- if (iter == 2 .and. k > max(jt(i),jto(i)) ) then
- tvu(i,k) = (su(i,k) - grav/cp*zf(i,k))*(1._r8 +0.608_r8*qu(i,k))
- loc_conv%dcape(i) = loc_conv%dcape(i)+ rd*(tvu(i,k)-tvuo(i,k))*log(p(i,k)/p(i,k-1))
- end if
- end if
- end do
- end do
-
- else ! no convective microphysics
-
-! compute condensed liquid, rain production rate
-! accumulate total precipitation (condensation - detrainment of liquid)
-! Note ql1 = ql(k) + rprd(k)*dz(k)/mu(k)
-! The differencing is somewhat strange (e.g. du(i,k)*ql(i,k+1)) but is
-! consistently applied.
-! mu, ql are interface quantities
-! cu, du, eu, rprd are midpoint quantites
-
- do k = pver,msg + 2,-1
- do i = 1,il2g
- rprd(i,k) = 0._r8
- if (k >= jt(i) .and. k < jb(i) .and. eps0(i) > 0._r8 .and. mu(i,k) >= 0.0_r8) then
- if (mu(i,k) > 0._r8) then
- ql1 = 1._r8/mu(i,k)* (mu(i,k+1)*ql(i,k+1)- &
- dz(i,k)*du(i,k)*ql(i,k+1)+dz(i,k)*cu(i,k))
- ql(i,k) = ql1/ (1._r8+dz(i,k)*c0mask(i))
- else
- ql(i,k) = 0._r8
- end if
- totpcp(i) = totpcp(i) + dz(i,k)*(cu(i,k)-du(i,k)*ql(i,k+1))
- rprd(i,k) = c0mask(i)*mu(i,k)*ql(i,k)
- qcde(i,k) = ql(i,k)
-
- if (zmconv_microp) then
- loc_conv%qide(i,k) = 0._r8
- loc_conv%qncde(i,k) = 0._r8
- loc_conv%qnide(i,k) = 0._r8
- loc_conv%sprd(i,k) = 0._r8
- end if
-
- end if
- end do
- end do
-!
- end if ! zmconv_microp
-
- end do !iter
-!
-! specify downdraft properties (no downdrafts if jd.ge.jb).
-! scale down downward mass flux profile so that net flux
-! (up-down) at cloud base in not negative.
-!
- do i = 1,il2g
-!
-! in normal downdraft strength run alfa=0.2. In test4 alfa=0.1
-!
- alfa(i) = 0.1_r8
- jt(i) = min(jt(i),jb(i)-1)
- jd(i) = max(j0(i),jt(i)+1)
- jd(i) = min(jd(i),jb(i))
- hd(i,jd(i)) = hmn(i,jd(i)-1)
- if (jd(i) < jb(i) .and. eps0(i) > 0._r8) then
- epsm(i) = eps0(i)
- md(i,jd(i)) = -alfa(i)*epsm(i)/eps0(i)
- end if
- end do
- do k = msg + 1,pver
- do i = 1,il2g
- if ((k > jd(i) .and. k <= jb(i)) .and. eps0(i) > 0._r8) then
- zdef(i) = zf(i,jd(i)) - zf(i,k)
- md(i,k) = -alfa(i)/ (2._r8*eps0(i))*(exp(2._r8*epsm(i)*zdef(i))-1._r8)/zdef(i)
- end if
- end do
- end do
-
- do k = msg + 1,pver
- do i = 1,il2g
- if ((k >= jt(i) .and. k <= jb(i)) .and. eps0(i) > 0._r8 .and. jd(i) < jb(i)) then
- ratmjb(i) = min(abs(mu(i,jb(i))/md(i,jb(i))),1._r8)
- md(i,k) = md(i,k)*ratmjb(i)
- end if
- end do
- end do
-
- small = 1.e-20_r8
- do k = msg + 1,pver
- do i = 1,il2g
- if ((k >= jt(i) .and. k <= pver) .and. eps0(i) > 0._r8) then
- ed(i,k-1) = (md(i,k-1)-md(i,k))/dz(i,k-1)
- mdt = min(md(i,k),-small)
- hd(i,k) = (md(i,k-1)*hd(i,k-1) - dz(i,k-1)*ed(i,k-1)*hmn(i,k-1))/mdt
- end if
- end do
- end do
-!
-! calculate updraft and downdraft properties.
-!
- do k = msg + 2,pver
- do i = 1,il2g
- if ((k >= jd(i) .and. k <= jb(i)) .and. eps0(i) > 0._r8 .and. jd(i) < jb(i)) then
- qds(i,k) = qsthat(i,k) + gamhat(i,k)*(hd(i,k)-hsthat(i,k))/ &
- (rl*(1._r8 + gamhat(i,k)))
- end if
- end do
- end do
-
- do i = 1,il2g
- qd(i,jd(i)) = qds(i,jd(i))
- sd(i,jd(i)) = (hd(i,jd(i)) - rl*qd(i,jd(i)))/cp
- end do
-!
- do k = msg + 2,pver
- do i = 1,il2g
- if (k >= jd(i) .and. k < jb(i) .and. eps0(i) > 0._r8) then
- qd(i,k+1) = qds(i,k+1)
- evp(i,k) = -ed(i,k)*q(i,k) + (md(i,k)*qd(i,k)-md(i,k+1)*qd(i,k+1))/dz(i,k)
- evp(i,k) = max(evp(i,k),0._r8)
- mdt = min(md(i,k+1),-small)
- if (zmconv_microp) then
- evp(i,k) = min(evp(i,k),rprd(i,k))
- end if
- sd(i,k+1) = ((rl/cp*evp(i,k)-ed(i,k)*s(i,k))*dz(i,k) + md(i,k)*sd(i,k))/mdt
- totevp(i) = totevp(i) - dz(i,k)*ed(i,k)*q(i,k)
- end if
- end do
- end do
- do i = 1,il2g
-!*guang totevp(i) = totevp(i) + md(i,jd(i))*q(i,jd(i)-1) -
- totevp(i) = totevp(i) + md(i,jd(i))*qd(i,jd(i)) - md(i,jb(i))*qd(i,jb(i))
- end do
-!!$ if (.true.) then
- if (.false.) then
- do i = 1,il2g
- k = jb(i)
- if (eps0(i) > 0._r8) then
- evp(i,k) = -ed(i,k)*q(i,k) + (md(i,k)*qd(i,k))/dz(i,k)
- evp(i,k) = max(evp(i,k),0._r8)
- totevp(i) = totevp(i) - dz(i,k)*ed(i,k)*q(i,k)
- end if
- end do
- endif
-
- do i = 1,il2g
- totpcp(i) = max(totpcp(i),0._r8)
- totevp(i) = max(totevp(i),0._r8)
- end do
-!
- do k = msg + 2,pver
- do i = 1,il2g
- if (totevp(i) > 0._r8 .and. totpcp(i) > 0._r8) then
- md(i,k) = md (i,k)*min(1._r8, totpcp(i)/(totevp(i)+totpcp(i)))
- ed(i,k) = ed (i,k)*min(1._r8, totpcp(i)/(totevp(i)+totpcp(i)))
- evp(i,k) = evp(i,k)*min(1._r8, totpcp(i)/(totevp(i)+totpcp(i)))
- else
- md(i,k) = 0._r8
- ed(i,k) = 0._r8
- evp(i,k) = 0._r8
- end if
-! cmeg is the cloud water condensed - rain water evaporated
-! rprd is the cloud water converted to rain - (rain evaporated)
- cmeg(i,k) = cu(i,k) - evp(i,k)
- rprd(i,k) = rprd(i,k)-evp(i,k)
- end do
- end do
-
-! compute the net precipitation flux across interfaces
- pflx(:il2g,1) = 0._r8
- do k = 2,pverp
- do i = 1,il2g
- pflx(i,k) = pflx(i,k-1) + rprd(i,k-1)*dz(i,k-1)
- end do
- end do
-!
- do k = msg + 1,pver
- do i = 1,il2g
- mc(i,k) = mu(i,k) + md(i,k)
- end do
- end do
-!
- return
-end subroutine cldprp
-
-subroutine closure(lchnk , &
- q ,t ,p ,z ,s , &
- tp ,qs ,qu ,su ,mc , &
- du ,mu ,md ,qd ,sd , &
- qhat ,shat ,dp ,qstp ,zf , &
- ql ,dsubcld ,mb ,cape ,tl , &
- lcl ,lel ,jt ,mx ,il1g , &
- il2g ,rd ,grav ,cp ,rl , &
- msg ,capelmt )
-!-----------------------------------------------------------------------
-!
-! Purpose:
-!
-!
-! Method:
-!
-!
-!
-! Author: G. Zhang and collaborators. CCM contact:P. Rasch
-! This is contributed code not fully standardized by the CCM core group.
-!
-! this code is very much rougher than virtually anything else in the CCM
-! We expect to release cleaner code in a future release
-!
-! the documentation has been enhanced to the degree that we are able
-!
-!-----------------------------------------------------------------------
-
-!
-!-----------------------------Arguments---------------------------------
-!
- integer, intent(in) :: lchnk ! chunk identifier
-
- real(r8), intent(inout) :: q(pcols,pver) ! spec humidity
- real(r8), intent(inout) :: t(pcols,pver) ! temperature
- real(r8), intent(inout) :: p(pcols,pver) ! pressure (mb)
- real(r8), intent(inout) :: mb(pcols) ! cloud base mass flux
- real(r8), intent(in) :: z(pcols,pver) ! height (m)
- real(r8), intent(in) :: s(pcols,pver) ! normalized dry static energy
- real(r8), intent(in) :: tp(pcols,pver) ! parcel temp
- real(r8), intent(in) :: qs(pcols,pver) ! sat spec humidity
- real(r8), intent(in) :: qu(pcols,pver) ! updraft spec. humidity
- real(r8), intent(in) :: su(pcols,pver) ! normalized dry stat energy of updraft
- real(r8), intent(in) :: mc(pcols,pver) ! net convective mass flux
- real(r8), intent(in) :: du(pcols,pver) ! detrainment from updraft
- real(r8), intent(in) :: mu(pcols,pver) ! mass flux of updraft
- real(r8), intent(in) :: md(pcols,pver) ! mass flux of downdraft
- real(r8), intent(in) :: qd(pcols,pver) ! spec. humidity of downdraft
- real(r8), intent(in) :: sd(pcols,pver) ! dry static energy of downdraft
- real(r8), intent(in) :: qhat(pcols,pver) ! environment spec humidity at interfaces
- real(r8), intent(in) :: shat(pcols,pver) ! env. normalized dry static energy at intrfcs
- real(r8), intent(in) :: dp(pcols,pver) ! pressure thickness of layers
- real(r8), intent(in) :: qstp(pcols,pver) ! spec humidity of parcel
- real(r8), intent(in) :: zf(pcols,pver+1) ! height of interface levels
- real(r8), intent(in) :: ql(pcols,pver) ! liquid water mixing ratio
-
- real(r8), intent(in) :: cape(pcols) ! available pot. energy of column
- real(r8), intent(in) :: tl(pcols)
- real(r8), intent(in) :: dsubcld(pcols) ! thickness of subcloud layer
-
- integer, intent(in) :: lcl(pcols) ! index of lcl
- integer, intent(in) :: lel(pcols) ! index of launch leve
- integer, intent(in) :: jt(pcols) ! top of updraft
- integer, intent(in) :: mx(pcols) ! base of updraft
-!
-!--------------------------Local variables------------------------------
-!
- real(r8) dtpdt(pcols,pver)
- real(r8) dqsdtp(pcols,pver)
- real(r8) dtmdt(pcols,pver)
- real(r8) dqmdt(pcols,pver)
- real(r8) dboydt(pcols,pver)
- real(r8) thetavp(pcols,pver)
- real(r8) thetavm(pcols,pver)
-
- real(r8) dtbdt(pcols),dqbdt(pcols),dtldt(pcols)
- real(r8) beta
- real(r8) capelmt
- real(r8) cp
- real(r8) dadt(pcols)
- real(r8) debdt
- real(r8) dltaa
- real(r8) eb
- real(r8) grav
-
- integer i
- integer il1g
- integer il2g
- integer k, kmin, kmax
- integer msg
-
- real(r8) rd
- real(r8) rl
-! change of subcloud layer properties due to convection is
-! related to cumulus updrafts and downdrafts.
-! mc(z)=f(z)*mb, mub=betau*mb, mdb=betad*mb are used
-! to define betau, betad and f(z).
-! note that this implies all time derivatives are in effect
-! time derivatives per unit cloud-base mass flux, i.e. they
-! have units of 1/mb instead of 1/sec.
-!
- do i = il1g,il2g
- mb(i) = 0._r8
- eb = p(i,mx(i))*q(i,mx(i))/ (eps1+q(i,mx(i)))
- dtbdt(i) = (1._r8/dsubcld(i))* (mu(i,mx(i))*(shat(i,mx(i))-su(i,mx(i)))+ &
- md(i,mx(i))* (shat(i,mx(i))-sd(i,mx(i))))
- dqbdt(i) = (1._r8/dsubcld(i))* (mu(i,mx(i))*(qhat(i,mx(i))-qu(i,mx(i)))+ &
- md(i,mx(i))* (qhat(i,mx(i))-qd(i,mx(i))))
- debdt = eps1*p(i,mx(i))/ (eps1+q(i,mx(i)))**2*dqbdt(i)
- dtldt(i) = -2840._r8* (3.5_r8/t(i,mx(i))*dtbdt(i)-debdt/eb)/ &
- (3.5_r8*log(t(i,mx(i)))-log(eb)-4.805_r8)**2
- end do
-!
-! dtmdt and dqmdt are cumulus heating and drying.
-!
- do k = msg + 1,pver
- do i = il1g,il2g
- dtmdt(i,k) = 0._r8
- dqmdt(i,k) = 0._r8
- end do
- end do
-!
- do k = msg + 1,pver - 1
- do i = il1g,il2g
- if (k == jt(i)) then
- dtmdt(i,k) = (1._r8/dp(i,k))*(mu(i,k+1)* (su(i,k+1)-shat(i,k+1)- &
- rl/cp*ql(i,k+1))+md(i,k+1)* (sd(i,k+1)-shat(i,k+1)))
- dqmdt(i,k) = (1._r8/dp(i,k))*(mu(i,k+1)* (qu(i,k+1)- &
- qhat(i,k+1)+ql(i,k+1))+md(i,k+1)*(qd(i,k+1)-qhat(i,k+1)))
- end if
- end do
- end do
-!
- beta = 0._r8
- do k = msg + 1,pver - 1
- do i = il1g,il2g
- if (k > jt(i) .and. k < mx(i)) then
- dtmdt(i,k) = (mc(i,k)* (shat(i,k)-s(i,k))+mc(i,k+1)* (s(i,k)-shat(i,k+1)))/ &
- dp(i,k) - rl/cp*du(i,k)*(beta*ql(i,k)+ (1-beta)*ql(i,k+1))
-! dqmdt(i,k)=(mc(i,k)*(qhat(i,k)-q(i,k))
-! 1 +mc(i,k+1)*(q(i,k)-qhat(i,k+1)))/dp(i,k)
-! 2 +du(i,k)*(qs(i,k)-q(i,k))
-! 3 +du(i,k)*(beta*ql(i,k)+(1-beta)*ql(i,k+1))
-
- dqmdt(i,k) = (mu(i,k+1)* (qu(i,k+1)-qhat(i,k+1)+cp/rl* (su(i,k+1)-s(i,k)))- &
- mu(i,k)* (qu(i,k)-qhat(i,k)+cp/rl*(su(i,k)-s(i,k)))+md(i,k+1)* &
- (qd(i,k+1)-qhat(i,k+1)+cp/rl*(sd(i,k+1)-s(i,k)))-md(i,k)* &
- (qd(i,k)-qhat(i,k)+cp/rl*(sd(i,k)-s(i,k))))/dp(i,k) + &
- du(i,k)* (beta*ql(i,k)+(1-beta)*ql(i,k+1))
- end if
- end do
- end do
-!
- do k = msg + 1,pver
- do i = il1g,il2g
- if (k >= lel(i) .and. k <= lcl(i)) then
- thetavp(i,k) = tp(i,k)* (1000._r8/p(i,k))** (rd/cp)*(1._r8+1.608_r8*qstp(i,k)-q(i,mx(i)))
- thetavm(i,k) = t(i,k)* (1000._r8/p(i,k))** (rd/cp)*(1._r8+0.608_r8*q(i,k))
- dqsdtp(i,k) = qstp(i,k)* (1._r8+qstp(i,k)/eps1)*eps1*rl/(rd*tp(i,k)**2)
-!
-! dtpdt is the parcel temperature change due to change of
-! subcloud layer properties during convection.
-!
- dtpdt(i,k) = tp(i,k)/ (1._r8+rl/cp* (dqsdtp(i,k)-qstp(i,k)/tp(i,k)))* &
- (dtbdt(i)/t(i,mx(i))+rl/cp* (dqbdt(i)/tl(i)-q(i,mx(i))/ &
- tl(i)**2*dtldt(i)))
-!
-! dboydt is the integrand of cape change.
-!
- dboydt(i,k) = ((dtpdt(i,k)/tp(i,k)+1._r8/(1._r8+1.608_r8*qstp(i,k)-q(i,mx(i)))* &
- (1.608_r8 * dqsdtp(i,k) * dtpdt(i,k) -dqbdt(i))) - (dtmdt(i,k)/t(i,k)+0.608_r8/ &
- (1._r8+0.608_r8*q(i,k))*dqmdt(i,k)))*grav*thetavp(i,k)/thetavm(i,k)
- end if
- end do
- end do
-!
- do k = msg + 1,pver
- do i = il1g,il2g
- if (k > lcl(i) .and. k < mx(i)) then
- thetavp(i,k) = tp(i,k)* (1000._r8/p(i,k))** (rd/cp)*(1._r8+0.608_r8*q(i,mx(i)))
- thetavm(i,k) = t(i,k)* (1000._r8/p(i,k))** (rd/cp)*(1._r8+0.608_r8*q(i,k))
-!
-! dboydt is the integrand of cape change.
-!
- dboydt(i,k) = (dtbdt(i)/t(i,mx(i))+0.608_r8/ (1._r8+0.608_r8*q(i,mx(i)))*dqbdt(i)- &
- dtmdt(i,k)/t(i,k)-0.608_r8/ (1._r8+0.608_r8*q(i,k))*dqmdt(i,k))* &
- grav*thetavp(i,k)/thetavm(i,k)
- end if
- end do
- end do
-
-!
-! buoyant energy change is set to 2/3*excess cape per 3 hours
-!
- dadt(il1g:il2g) = 0._r8
- kmin = minval(lel(il1g:il2g))
- kmax = maxval(mx(il1g:il2g)) - 1
- do k = kmin, kmax
- do i = il1g,il2g
- if ( k >= lel(i) .and. k <= mx(i) - 1) then
- dadt(i) = dadt(i) + dboydt(i,k)* (zf(i,k)-zf(i,k+1))
- endif
- end do
- end do
- do i = il1g,il2g
- dltaa = -1._r8* (cape(i)-capelmt)
- if (dadt(i) /= 0._r8) mb(i) = max(dltaa/tau/dadt(i),0._r8)
- end do
-!
- return
-end subroutine closure
-
-subroutine q1q2_pjr(lchnk , &
- dqdt ,dsdt ,q ,qs ,qu , &
- su ,du ,qhat ,shat ,dp , &
- mu ,md ,sd ,qd ,ql , &
- dsubcld ,jt ,mx ,il1g ,il2g , &
- cp ,rl ,msg , &
- dl ,evp ,cu , &
- loc_conv)
-
-
- implicit none
-
-!-----------------------------------------------------------------------
-!
-! Purpose:
-!
-!
-! Method:
-!
-!
-!
-! Author: phil rasch dec 19 1995
-!
-!-----------------------------------------------------------------------
-
-
- real(r8), intent(in) :: cp
-
- integer, intent(in) :: lchnk ! chunk identifier
- integer, intent(in) :: il1g
- integer, intent(in) :: il2g
- integer, intent(in) :: msg
-
- real(r8), intent(in) :: q(pcols,pver)
- real(r8), intent(in) :: qs(pcols,pver)
- real(r8), intent(in) :: qu(pcols,pver)
- real(r8), intent(in) :: su(pcols,pver)
- real(r8), intent(in) :: du(pcols,pver)
- real(r8), intent(in) :: qhat(pcols,pver)
- real(r8), intent(in) :: shat(pcols,pver)
- real(r8), intent(in) :: dp(pcols,pver)
- real(r8), intent(in) :: mu(pcols,pver)
- real(r8), intent(in) :: md(pcols,pver)
- real(r8), intent(in) :: sd(pcols,pver)
- real(r8), intent(in) :: qd(pcols,pver)
- real(r8), intent(in) :: ql(pcols,pver)
- real(r8), intent(in) :: evp(pcols,pver)
- real(r8), intent(in) :: cu(pcols,pver)
- real(r8), intent(in) :: dsubcld(pcols)
-
- real(r8),intent(out) :: dqdt(pcols,pver),dsdt(pcols,pver)
- real(r8),intent(out) :: dl(pcols,pver)
-
- type(zm_conv_t) :: loc_conv
-
- integer kbm
- integer ktm
- integer jt(pcols)
- integer mx(pcols)
-!
-! work fields:
-!
- integer i
- integer k
-
- real(r8) emc
- real(r8) rl
-!-------------------------------------------------------------------
- do k = msg + 1,pver
- do i = il1g,il2g
- dsdt(i,k) = 0._r8
- dqdt(i,k) = 0._r8
- dl(i,k) = 0._r8
- end do
- end do
-
- if (zmconv_microp) then
- do k = msg + 1,pver
- do i = il1g,il2g
- loc_conv%di(i,k) = 0._r8
- loc_conv%dnl(i,k) = 0._r8
- loc_conv%dni(i,k) = 0._r8
- end do
- end do
- end if
-!
-! find the highest level top and bottom levels of convection
-!
- ktm = pver
- kbm = pver
- do i = il1g, il2g
- ktm = min(ktm,jt(i))
- kbm = min(kbm,mx(i))
- end do
-
- do k = ktm,pver-1
- do i = il1g,il2g
- emc = -cu (i,k) & ! condensation in updraft
- +evp(i,k) ! evaporating rain in downdraft
-
- dsdt(i,k) = -rl/cp*emc &
- + (+mu(i,k+1)* (su(i,k+1)-shat(i,k+1)) &
- -mu(i,k)* (su(i,k)-shat(i,k)) &
- +md(i,k+1)* (sd(i,k+1)-shat(i,k+1)) &
- -md(i,k)* (sd(i,k)-shat(i,k)) &
- )/dp(i,k)
-
- if (zmconv_microp) dsdt(i,k) = dsdt(i,k) + latice/cp*loc_conv%frz(i,k)
-
- dqdt(i,k) = emc + &
- (+mu(i,k+1)* (qu(i,k+1)-qhat(i,k+1)) &
- -mu(i,k)* (qu(i,k)-qhat(i,k)) &
- +md(i,k+1)* (qd(i,k+1)-qhat(i,k+1)) &
- -md(i,k)* (qd(i,k)-qhat(i,k)) &
- )/dp(i,k)
-
- dl(i,k) = du(i,k)*ql(i,k+1)
-
- if (zmconv_microp) then
- loc_conv%di(i,k) = du(i,k)*loc_conv%qide(i,k+1)
- loc_conv%dnl(i,k) = du(i,k)*loc_conv%qncde(i,k+1)
- loc_conv%dni(i,k) = du(i,k)*loc_conv%qnide(i,k+1)
- end if
-
- end do
- end do
-
-!
- do k = kbm,pver
- do i = il1g,il2g
- if (k == mx(i)) then
- dsdt(i,k) = (1._r8/dsubcld(i))* &
- (-mu(i,k)* (su(i,k)-shat(i,k)) &
- -md(i,k)* (sd(i,k)-shat(i,k)) &
- )
- dqdt(i,k) = (1._r8/dsubcld(i))* &
- (-mu(i,k)*(qu(i,k)-qhat(i,k)) &
- -md(i,k)*(qd(i,k)-qhat(i,k)) &
- )
- else if (k > mx(i)) then
- dsdt(i,k) = dsdt(i,k-1)
- dqdt(i,k) = dqdt(i,k-1)
- end if
- end do
- end do
-!
- return
-end subroutine q1q2_pjr
-
-subroutine buoyan_dilute(lchnk ,ncol , &
- q ,t ,p ,z ,pf , &
- tp ,qstp ,tl ,rl ,cape , &
- pblt ,lcl ,lel ,lon ,mx , &
- rd ,grav ,cp ,msg , &
- zi ,zs ,tpert ,org , landfrac)
-!-----------------------------------------------------------------------
-!
-! Purpose:
-! Calculates CAPE the lifting condensation level and the convective top
-! where buoyancy is first -ve.
-!
-! Method: Calculates the parcel temperature based on a simple constant
-! entraining plume model. CAPE is integrated from buoyancy.
-! 09/09/04 - Simplest approach using an assumed entrainment rate for
-! testing (dmpdp).
-! 08/04/05 - Swap to convert dmpdz to dmpdp
-!
-! SCAM Logical Switches - DILUTE:RBN - Now Disabled
-! ---------------------
-! switch(1) = .T. - Uses the dilute parcel calculation to obtain tendencies.
-! switch(2) = .T. - Includes entropy/q changes due to condensate loss and freezing.
-! switch(3) = .T. - Adds the PBL Tpert for the parcel temperature at all levels.
-!
-! References:
-! Raymond and Blythe (1992) JAS
-!
-! Author:
-! Richard Neale - September 2004
-!
-!-----------------------------------------------------------------------
- implicit none
-!-----------------------------------------------------------------------
-!
-! input arguments
-!
- integer, intent(in) :: lchnk ! chunk identifier
- integer, intent(in) :: ncol ! number of atmospheric columns
-
- real(r8), intent(in) :: q(pcols,pver) ! spec. humidity
- real(r8), intent(in) :: t(pcols,pver) ! temperature
- real(r8), intent(in) :: p(pcols,pver) ! pressure
- real(r8), intent(in) :: z(pcols,pver) ! height
- real(r8), intent(in) :: pf(pcols,pver+1) ! pressure at interfaces
- real(r8), intent(in) :: pblt(pcols) ! index of pbl depth
- real(r8), intent(in) :: tpert(pcols) ! perturbation temperature by pbl processes
-
-! Use z interface/surface relative values for PBL parcel calculations.
- real(r8), intent(in) :: zi(pcols,pver+1)
- real(r8), intent(in) :: zs(pcols)
-
-!
-! output arguments
-!
- real(r8), intent(out) :: tp(pcols,pver) ! parcel temperature
- real(r8), intent(out) :: qstp(pcols,pver) ! saturation mixing ratio of parcel (only above lcl, just q below).
- real(r8), intent(out) :: tl(pcols) ! parcel temperature at lcl
- real(r8), intent(out) :: cape(pcols) ! convective aval. pot. energy.
- integer lcl(pcols) !
- integer lel(pcols) !
- integer lon(pcols) ! level of onset of deep convection
- integer mx(pcols) ! level of max moist static energy
-
- real(r8), pointer :: org(:,:) ! organization parameter
- real(r8), intent(in) :: landfrac(pcols)
-!
-!--------------------------Local Variables------------------------------
-!
- real(r8) capeten(pcols,5) ! provisional value of cape
- real(r8) tv(pcols,pver) !
- real(r8) tpv(pcols,pver) !
- real(r8) buoy(pcols,pver)
-
- real(r8) a1(pcols)
- real(r8) a2(pcols)
- real(r8) estp(pcols)
- real(r8) pl(pcols)
- real(r8) plexp(pcols)
- real(r8) hmax(pcols)
- real(r8) hmn(pcols)
- real(r8) y(pcols)
-
- logical plge600(pcols)
- integer knt(pcols)
- integer lelten(pcols,5)
-
-
-
-
-! Parcel property variables
-
- real(r8) :: hmn_lev(pcols,pver) ! Vertical profile of moist static energy for each column
- real(r8) :: dp_lev(pcols,pver) ! Level dpressure between interfaces
- real(r8) :: hmn_zdp(pcols,pver) ! Integrals of hmn_lev*dp_lev at each level
- real(r8) :: q_zdp(pcols,pver) ! Integrals of q*dp_lev at each level
- real(r8) :: dp_zfrac ! Fraction of vertical grid box below mixing top (usually pblt)
- real(r8) :: parcel_dz(pcols) ! Depth of parcel mixing (usually parcel_hscale*parcel_dz)
- real(r8) :: parcel_ztop(pcols) ! Height of parcel mixing (usually parcel_ztop+zm(nlev))
- real(r8) :: parcel_dp(pcols) ! Pressure integral over parcel mixing depth (usually pblt)
- real(r8) :: parcel_hdp(pcols) ! Pressure*MSE integral over parcel mixing depth (usually pblt)
- real(r8) :: parcel_qdp(pcols) ! Pressure*q integral over parcel mixing depth (usually pblt)
- real(r8) :: pbl_dz(pcols) ! Previously diagnosed PBL height
- real(r8) :: hpar(pcols) ! Initial MSE of the parcel
- real(r8) :: qpar(pcols) ! Initial humidity of the parcel
- real(r8) :: ql(pcols) ! Initial parcel humidity (for ientropy routine)
- integer :: ipar ! Index for top of parcel mixing/launch level.
-
-
-
-
- real(r8) cp
- real(r8) e
- real(r8) grav
-
- integer i
- integer k
- integer msg
- integer n
-
- real(r8) rd
- real(r8) rl
-
-
-! Scaling of PBL height to give parcel mixing length for lparcel_pbl=True
-
- real(r8), parameter :: parcel_hscale = 0.5_r8
-
-
-!
-!-----------------------------------------------------------------------
-!
- do n = 1,5
- do i = 1,ncol
- lelten(i,n) = pver
- capeten(i,n) = 0._r8
- end do
- end do
-!
- do i = 1,ncol
- lon(i) = pver
- knt(i) = 0
- lel(i) = pver
- mx(i) = lon(i)
- cape(i) = 0._r8
- hmax(i) = 0._r8
- pbl_dz(i) = z(i,nint(pblt(i)))-zs(i) ! mid-point z (zm) reference to PBL depth
- parcel_dz(i) = max(zi(i,pver),parcel_hscale*pbl_dz(i)) ! PBL mixing depth [parcel_hscale*Boundary, but no thinner than zi(i,pver)]
- parcel_ztop(i) = parcel_dz(i)+zs(i) ! PBL mixing height ztop this is wrt zs=0
- parcel_hdp(i) = 0._r8
- parcel_dp(i) = 0._r8
- parcel_qdp(i) = 0._r8
- hpar(i) = 0._r8
- qpar(i) = 0._r8
- end do
-
- tp(:ncol,:) = t(:ncol,:)
- qstp(:ncol,:) = q(:ncol,:)
- hmn_lev(:ncol,:) = 0._r8
-
-
-
-!!! Initialize tv and buoy for output.
-!!! tv=tv : tpv=tpv : qstp=q : buoy=0.
- tv(:ncol,:) = t(:ncol,:) *(1._r8+1.608_r8*q(:ncol,:))/ (1._r8+q(:ncol,:))
- tpv(:ncol,:) = tv(:ncol,:)
- buoy(:ncol,:) = 0._r8
-
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-! Mix the parcel over a certain dp or dz and take the launch level as the top level
-! of this mixing region and the parcel properties as this mixed value
-! Should be well mixed by other processes in the very near PBL.
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-
-
-if (lparcel_pbl) then
-
-! Vertical profile of MSE and pressure weighted of the same.
- hmn_lev(:ncol,1:pver) = cp*t(:ncol,1:pver) + grav*z(:ncol,1:pver) + rl*q(:ncol,1:pver)
- dp_lev(:ncol,1:pver) = pf(:ncol,2:pver+1)-pf(:ncol,1:pver)
- hmn_zdp(:ncol,1:pver) = hmn_lev(:ncol,1:pver)*dp_lev(:ncol,1:pver)
- q_zdp(:ncol,1:pver) = q(:ncol,1:pver)*dp_lev(:ncol,1:pver)
-
-
-! Mix profile over vertical length scale of 0.5*PBLH.
-
- do i = 1,ncol ! Loop columns
- do k = pver,msg + 1,-1
-
- if (zi(i,k+1)<= parcel_dz(i)) then ! Has to be relative to near-surface layer center elevation
- ipar = k
-
- if (k == pver) then ! Always at least the full depth of lowest model layer.
- dp_zfrac = 1._r8
- else
- ! Fraction of grid cell depth (mostly 1, except when parcel_ztop is in between levels.
- dp_zfrac = min(1._r8,(parcel_dz(i)-zi(i,k+1))/(zi(i,k)-zi(i,k+1)))
- end if
-
- parcel_hdp(i) = parcel_hdp(i)+hmn_zdp(i,k)*dp_zfrac ! Sum parcel profile up to a certain level.
- parcel_qdp(i) = parcel_qdp(i)+q_zdp(i,k)*dp_zfrac ! Sum parcel profile up to a certain level.
- parcel_dp(i) = parcel_dp(i)+dp_lev(i,k)*dp_zfrac ! SUM dp's for weighting of parcel_hdp
-
- end if
- end do
- hpar(i) = parcel_hdp(i)/parcel_dp(i)
- qpar(i) = parcel_qdp(i)/parcel_dp(i)
- mx(i) = ipar
- end do
-
-else ! Default method finding level of MSE maximum (nlev sensitive though)
- !
- ! set "launching" level(mx) to be at maximum moist static energy.
- ! search for this level stops at planetary boundary layer top.
- !
- do k = pver,msg + 1,-1
- do i = 1,ncol
- hmn(i) = cp*t(i,k) + grav*z(i,k) + rl*q(i,k)
- if (k >= nint(pblt(i)) .and. k <= lon(i) .and. hmn(i) > hmax(i)) then
- hmax(i) = hmn(i)
- mx(i) = k
- end if
- end do
- end do
-
-end if ! Default method of determining parcel launch properties.
-
-
-
-
-
-! LCL dilute calculation - initialize to mx(i)
-! Determine lcl in parcel_dilute and get pl,tl after parcel_dilute
-! Original code actually sets LCL as level above wher condensate forms.
-! Therefore in parcel_dilute lcl(i) will be at first level where qsmix < qtmix.
-
-if (lparcel_pbl) then
-
-! For parcel dilute need to invert hpar and qpar.
-! Now need to supply ql(i) as it is mixed parcel version, just q(i,max(i)) in default
-
- do i = 1,ncol ! Initialise LCL variables.
- lcl(i) = mx(i)
- tl(i) = (hpar(i)-rl*qpar(i)-grav*parcel_ztop(i))/cp
- ql(i) = qpar(i)
- pl(i) = p(i,mx(i))
- end do
-
-else
-
- do i = 1,ncol
- lcl(i) = mx(i)
- tl(i) = t(i,mx(i))
- ql(i) = q(i,mx(i))
- pl(i) = p(i,mx(i))
- end do
-
-end if ! Mixed parcel properties
-
-
-
-!
-! main buoyancy calculation.
-!
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!!! DILUTE PLUME CALCULATION USING ENTRAINING PLUME !!!
-!!! RBN 9/9/04 !!!
-
- call parcel_dilute(lchnk, ncol, msg, mx, p, t, q, &
- tpert, tp, tpv, qstp, pl, tl, ql, lcl, &
- org, landfrac)
-
-
-! If lcl is above the nominal level of non-divergence (600 mbs),
-! no deep convection is permitted (ensuing calculations
-! skipped and cape retains initialized value of zero).
-!
- do i = 1,ncol
- plge600(i) = pl(i).ge.600._r8 ! Just change to always allow buoy calculation.
- end do
-
-!
-! Main buoyancy calculation.
-!
- do k = pver,msg + 1,-1
- do i=1,ncol
- if (k <= mx(i) .and. plge600(i)) then ! Define buoy from launch level to cloud top.
- tv(i,k) = t(i,k)* (1._r8+1.608_r8*q(i,k))/ (1._r8+q(i,k))
- buoy(i,k) = tpv(i,k) - tv(i,k) + tiedke_add ! +0.5K or not?
- else
- qstp(i,k) = q(i,k)
- tp(i,k) = t(i,k)
- tpv(i,k) = tv(i,k)
- endif
- end do
- end do
-
-
-
-!-------------------------------------------------------------------------------
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-
-
-!
- do k = msg + 2,pver
- do i = 1,ncol
- if (k < lcl(i) .and. plge600(i)) then
- if (buoy(i,k+1) > 0._r8 .and. buoy(i,k) <= 0._r8) then
- knt(i) = min(num_cin,knt(i) + 1)
- lelten(i,knt(i)) = k
- end if
- end if
- end do
- end do
-!
-! calculate convective available potential energy (cape).
-!
- do n = 1,num_cin
- do k = msg + 1,pver
- do i = 1,ncol
- if (plge600(i) .and. k <= mx(i) .and. k > lelten(i,n)) then
- capeten(i,n) = capeten(i,n) + rd*buoy(i,k)*log(pf(i,k+1)/pf(i,k))
- end if
- end do
- end do
- end do
-!
-! find maximum cape from all possible tentative capes from
-! one sounding,
-! and use it as the final cape, april 26, 1995
-!
- do n = 1,num_cin
- do i = 1,ncol
- if (capeten(i,n) > cape(i)) then
- cape(i) = capeten(i,n)
- lel(i) = lelten(i,n)
- end if
- end do
- end do
-!
-! put lower bound on cape for diagnostic purposes.
-!
- do i = 1,ncol
- cape(i) = max(cape(i), 0._r8)
- end do
-!
- return
-end subroutine buoyan_dilute
-
-subroutine parcel_dilute (lchnk, ncol, msg, klaunch, p, t, q, &
- tpert, tp, tpv, qstp, pl, tl, ql, lcl, &
- org, landfrac)
-
-! Routine to determine
-! 1. Tp - Parcel temperature
-! 2. qstp - Saturated mixing ratio at the parcel temperature.
-
-!--------------------
-implicit none
-!--------------------
-
-integer, intent(in) :: lchnk
-integer, intent(in) :: ncol
-integer, intent(in) :: msg
-
-integer, intent(in), dimension(pcols) :: klaunch(pcols)
-
-real(r8), intent(in), dimension(pcols,pver) :: p
-real(r8), intent(in), dimension(pcols,pver) :: t
-real(r8), intent(in), dimension(pcols,pver) :: q
-real(r8), intent(in), dimension(pcols) :: tpert ! PBL temperature perturbation.
-
-real(r8), intent(inout), dimension(pcols,pver) :: tp ! Parcel temp.
-real(r8), intent(inout), dimension(pcols,pver) :: qstp ! Parcel water vapour (sat value above lcl).
-real(r8), intent(inout), dimension(pcols) :: tl ! Actual temp of LCL.
-real(r8), intent(inout), dimension(pcols) :: ql ! Actual humidity of LCL
-real(r8), intent(inout), dimension(pcols) :: pl ! Actual pressure of LCL.
-
-integer, intent(inout), dimension(pcols) :: lcl ! Lifting condesation level (first model level with saturation).
-
-real(r8), intent(out), dimension(pcols,pver) :: tpv ! Define tpv within this routine.
-
-real(r8), pointer, dimension(:,:) :: org
-real(r8), intent(in), dimension(pcols) :: landfrac
-!--------------------
-
-! Have to be careful as s is also dry static energy.
-
-
-! If we are to retain the fact that CAM loops over grid-points in the internal
-! loop then we need to dimension sp,atp,mp,xsh2o with ncol.
-
-
-real(r8) tmix(pcols,pver) ! Tempertaure of the entraining parcel.
-real(r8) qtmix(pcols,pver) ! Total water of the entraining parcel.
-real(r8) qsmix(pcols,pver) ! Saturated mixing ratio at the tmix.
-real(r8) smix(pcols,pver) ! Entropy of the entraining parcel.
-real(r8) xsh2o(pcols,pver) ! Precipitate lost from parcel.
-real(r8) ds_xsh2o(pcols,pver) ! Entropy change due to loss of condensate.
-real(r8) ds_freeze(pcols,pver) ! Entropy change sue to freezing of precip.
-real(r8) dmpdz2d(pcols,pver) ! variable detrainment rate
-
-real(r8) mp(pcols) ! Parcel mass flux.
-real(r8) qtp(pcols) ! Parcel total water.
-real(r8) sp(pcols) ! Parcel entropy.
-
-real(r8) sp0(pcols) ! Parcel launch entropy.
-real(r8) qtp0(pcols) ! Parcel launch total water.
-real(r8) mp0(pcols) ! Parcel launch relative mass flux.
-
-real(r8) lwmax ! Maximum condesate that can be held in cloud before rainout.
-real(r8) dmpdp ! Parcel fractional mass entrainment rate (/mb).
-!real(r8) dmpdpc ! In cloud parcel mass entrainment rate (/mb).
-real(r8) dmpdz ! Parcel fractional mass entrainment rate (/m)
-real(r8) dpdz,dzdp ! Hydrstatic relation and inverse of.
-real(r8) senv ! Environmental entropy at each grid point.
-real(r8) qtenv ! Environmental total water " " ".
-real(r8) penv ! Environmental total pressure " " ".
-real(r8) tenv ! Environmental total temperature " " ".
-real(r8) new_s ! Hold value for entropy after condensation/freezing adjustments.
-real(r8) new_q ! Hold value for total water after condensation/freezing adjustments.
-real(r8) dp ! Layer thickness (center to center)
-real(r8) tfguess ! First guess for entropy inversion - crucial for efficiency!
-real(r8) tscool ! Super cooled temperature offset (in degC) (eg -35).
-
-real(r8) qxsk, qxskp1 ! LCL excess water (k, k+1)
-real(r8) dsdp, dqtdp, dqxsdp ! LCL s, qt, p gradients (k, k+1)
-real(r8) slcl,qtlcl,qslcl ! LCL s, qt, qs values.
-real(r8) org2rkm, org2Tpert
-real(r8) dmpdz_lnd, dmpdz_mask
-
-integer rcall ! Number of ientropy call for errors recording
-integer nit_lheat ! Number of iterations for condensation/freezing loop.
-integer i,k,ii ! Loop counters.
-
-!======================================================================
-! SUMMARY
-!
-! 9/9/04 - Assumes parcel is initiated from level of maxh (klaunch)
-! and entrains at each level with a specified entrainment rate.
-!
-! 15/9/04 - Calculates lcl(i) based on k where qsmix is first < qtmix.
-!
-!======================================================================
-!
-! Set some values that may be changed frequently.
-!
-
-if (zm_org) then
- org2rkm = 10._r8
- org2Tpert = 0._r8
-endif
-nit_lheat = 2 ! iterations for ds,dq changes from condensation freezing.
-dmpdz=dmpdz_param ! Entrainment rate. (-ve for /m)
-dmpdz_lnd=-1.e-3_r8
-!dmpdpc = 3.e-2_r8 ! In cloud entrainment rate (/mb).
-lwmax = 1.e-3_r8 ! Need to put formula in for this.
-tscool = 0.0_r8 ! Temp at which water loading freezes in the cloud.
-
-qtmix=0._r8
-smix=0._r8
-
-qtenv = 0._r8
-senv = 0._r8
-tenv = 0._r8
-penv = 0._r8
-
-qtp0 = 0._r8
-sp0 = 0._r8
-mp0 = 0._r8
-
-qtp = 0._r8
-sp = 0._r8
-mp = 0._r8
-
-new_q = 0._r8
-new_s = 0._r8
-
-! **** Begin loops ****
-
-do k = pver, msg+1, -1
- do i=1,ncol
-
-! Initialize parcel values at launch level.
-
- if (k == klaunch(i)) then
-
- if (lparcel_pbl) then ! Modifcations to parcel properties if lparcel_pbl set.
-
- qtp0(i) = ql(i) ! Parcel launch q (PBL mixed value).
- sp0(i) = entropy(tl(i),pl(i),qtp0(i)) ! Parcel launch entropy could be a mixed parcel.
-
- else
-
- qtp0(i) = q(i,k) ! Parcel launch total water (assuming subsaturated)
- sp0(i) = entropy(t(i,k),p(i,k),qtp0(i)) ! Parcel launch entropy.
-
- end if
-
- mp0(i) = 1._r8 ! Parcel launch relative mass (i.e. 1 parcel stays 1 parcel for dmpdp=0, undilute).
- smix(i,k) = sp0(i)
- qtmix(i,k) = qtp0(i)
- tfguess = t(i,k)
- rcall = 1
- call ientropy (rcall,i,lchnk,smix(i,k),p(i,k),qtmix(i,k),tmix(i,k),qsmix(i,k),tfguess)
- end if
-
-! Entraining levels
-
- if (k < klaunch(i)) then
-
-! Set environmental values for this level.
-
- dp = (p(i,k)-p(i,k+1)) ! In -ve mb as p decreasing with height - difference between center of layers.
- qtenv = 0.5_r8*(q(i,k)+q(i,k+1)) ! Total water of environment.
- tenv = 0.5_r8*(t(i,k)+t(i,k+1))
- penv = 0.5_r8*(p(i,k)+p(i,k+1))
-
- senv = entropy(tenv,penv,qtenv) ! Entropy of environment.
-
-! Determine fractional entrainment rate /pa given value /m.
-
- dpdz = -(penv*grav)/(rgas*tenv) ! in mb/m since p in mb.
- dzdp = 1._r8/dpdz ! in m/mb
- if (zm_org) then
- dmpdz_mask = landfrac(i) * dmpdz_lnd + (1._r8 - landfrac(i)) * dmpdz
- dmpdp = (dmpdz_mask/(1._r8+org(i,k)*org2rkm))*dzdp ! /mb Fractional entrainment
- else
- dmpdp = dmpdz*dzdp
- endif
-
-! Sum entrainment to current level
-! entrains q,s out of intervening dp layers, in which linear variation is assumed
-! so really it entrains the mean of the 2 stored values.
-
- sp(i) = sp(i) - dmpdp*dp*senv
- qtp(i) = qtp(i) - dmpdp*dp*qtenv
- mp(i) = mp(i) - dmpdp*dp
-
-! Entrain s and qt to next level.
-
- smix(i,k) = (sp0(i) + sp(i)) / (mp0(i) + mp(i))
- qtmix(i,k) = (qtp0(i) + qtp(i)) / (mp0(i) + mp(i))
-
-! Invert entropy from s and q to determine T and saturation-capped q of mixture.
-! t(i,k) used as a first guess so that it converges faster.
-
- tfguess = tmix(i,k+1)
- rcall = 2
- call ientropy(rcall,i,lchnk,smix(i,k),p(i,k),qtmix(i,k),tmix(i,k),qsmix(i,k),tfguess)
-
-!
-! Determine if this is lcl of this column if qsmix <= qtmix.
-! FIRST LEVEL where this happens on ascending.
-
- if (qsmix(i,k) <= qtmix(i,k) .and. qsmix(i,k+1) > qtmix(i,k+1)) then
- lcl(i) = k
- qxsk = qtmix(i,k) - qsmix(i,k)
- qxskp1 = qtmix(i,k+1) - qsmix(i,k+1)
- dqxsdp = (qxsk - qxskp1)/dp
- pl(i) = p(i,k+1) - qxskp1/dqxsdp ! pressure level of actual lcl.
- dsdp = (smix(i,k) - smix(i,k+1))/dp
- dqtdp = (qtmix(i,k) - qtmix(i,k+1))/dp
- slcl = smix(i,k+1) + dsdp* (pl(i)-p(i,k+1))
- qtlcl = qtmix(i,k+1) + dqtdp*(pl(i)-p(i,k+1))
-
- tfguess = tmix(i,k)
- rcall = 3
- call ientropy (rcall,i,lchnk,slcl,pl(i),qtlcl,tl(i),qslcl,tfguess)
-
-! write(iulog,*)' '
-! write(iulog,*)' p',p(i,k+1),pl(i),p(i,lcl(i))
-! write(iulog,*)' t',tmix(i,k+1),tl(i),tmix(i,lcl(i))
-! write(iulog,*)' s',smix(i,k+1),slcl,smix(i,lcl(i))
-! write(iulog,*)'qt',qtmix(i,k+1),qtlcl,qtmix(i,lcl(i))
-! write(iulog,*)'qs',qsmix(i,k+1),qslcl,qsmix(i,lcl(i))
-
- endif
-!
- end if ! k < klaunch
-
-
- end do ! Levels loop
-end do ! Columns loop
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!END ENTRAINMENT LOOP!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-!! Could stop now and test with this as it will provide some estimate of buoyancy
-!! without the effects of freezing/condensation taken into account for tmix.
-
-!! So we now have a profile of entropy and total water of the entraining parcel
-!! Varying with height from the launch level klaunch parcel=environment. To the
-!! top allowed level for the existence of convection.
-
-!! Now we have to adjust these values such that the water held in vaopor is < or
-!! = to qsmix. Therefore, we assume that the cloud holds a certain amount of
-!! condensate (lwmax) and the rest is rained out (xsh2o). This, obviously
-!! provides latent heating to the mixed parcel and so this has to be added back
-!! to it. But does this also increase qsmix as well? Also freezing processes
-
-
-xsh2o = 0._r8
-ds_xsh2o = 0._r8
-ds_freeze = 0._r8
-
-!!!!!!!!!!!!!!!!!!!!!!!!!PRECIPITATION/FREEZING LOOP!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! Iterate solution twice for accuracy
-
-
-
-do k = pver, msg+1, -1
- do i=1,ncol
-
-! Initialize variables at k=klaunch
-
- if (k == klaunch(i)) then
-
-! Set parcel values at launch level assume no liquid water.
-
- tp(i,k) = tmix(i,k)
- qstp(i,k) = q(i,k)
- if (zm_org) then
- tpv(i,k) = (tp(i,k) + (org2Tpert*org(i,k)+tpert(i))) * (1._r8+1.608_r8*qstp(i,k)) / (1._r8+qstp(i,k))
- else
- tpv(i,k) = (tp(i,k) + tpert(i)) * (1._r8+1.608_r8*qstp(i,k)) / (1._r8+qstp(i,k))
- endif
-
- end if
-
- if (k < klaunch(i)) then
-
-! Initiaite loop if switch(2) = .T. - RBN:DILUTE - TAKEN OUT BUT COULD BE RETURNED LATER.
-
-! Iterate nit_lheat times for s,qt changes.
-
- do ii=0,nit_lheat-1
-
-! Rain (xsh2o) is excess condensate, bar LWMAX (Accumulated loss from qtmix).
-
- xsh2o(i,k) = max (0._r8, qtmix(i,k) - qsmix(i,k) - lwmax)
-
-! Contribution to ds from precip loss of condensate (Accumulated change from smix).(-ve)
-
- ds_xsh2o(i,k) = ds_xsh2o(i,k+1) - cpliq * log (tmix(i,k)/tfreez) * max(0._r8,(xsh2o(i,k)-xsh2o(i,k+1)))
-!
-! Entropy of freezing: latice times amount of water involved divided by T.
-!
-
- if (tmix(i,k) <= tfreez+tscool .and. ds_freeze(i,k+1) == 0._r8) then ! One off freezing of condensate.
- ds_freeze(i,k) = (latice/tmix(i,k)) * max(0._r8,qtmix(i,k)-qsmix(i,k)-xsh2o(i,k)) ! Gain of LH
- end if
-
- if (tmix(i,k) <= tfreez+tscool .and. ds_freeze(i,k+1) /= 0._r8) then ! Continual freezing of additional condensate.
- ds_freeze(i,k) = ds_freeze(i,k+1)+(latice/tmix(i,k)) * max(0._r8,(qsmix(i,k+1)-qsmix(i,k)))
- end if
-
-! Adjust entropy and accordingly to sum of ds (be careful of signs).
-
- new_s = smix(i,k) + ds_xsh2o(i,k) + ds_freeze(i,k)
-
-! Adjust liquid water and accordingly to xsh2o.
-
- new_q = qtmix(i,k) - xsh2o(i,k)
-
-! Invert entropy to get updated Tmix and qsmix of parcel.
-
- tfguess = tmix(i,k)
- rcall =4
- call ientropy (rcall,i,lchnk,new_s, p(i,k), new_q, tmix(i,k), qsmix(i,k), tfguess)
-
- end do ! Iteration loop for freezing processes.
-
-! tp - Parcel temp is temp of mixture.
-! tpv - Parcel v. temp should be density temp with new_q total water.
-
- tp(i,k) = tmix(i,k)
-
-! tpv = tprho in the presence of condensate (i.e. when new_q > qsmix)
-
- if (new_q > qsmix(i,k)) then ! Super-saturated so condensate present - reduces buoyancy.
- qstp(i,k) = qsmix(i,k)
- else ! Just saturated/sub-saturated - no condensate virtual effects.
- qstp(i,k) = new_q
- end if
-
- if (zm_org) then
- tpv(i,k) = (tp(i,k)+(org2Tpert*org(i,k)+tpert(i)))* (1._r8+1.608_r8*qstp(i,k)) / (1._r8+ new_q)
- else
- tpv(i,k) = (tp(i,k)+tpert(i))* (1._r8+1.608_r8*qstp(i,k)) / (1._r8+ new_q)
- endif
-
- end if ! k < klaunch
-
- end do ! Loop for columns
-
-end do ! Loop for vertical levels.
-
-
-return
-end subroutine parcel_dilute
-
-!-----------------------------------------------------------------------------------------
-real(r8) function entropy(TK,p,qtot)
-!-----------------------------------------------------------------------------------------
-!
-! TK(K),p(mb),qtot(kg/kg)
-! from Raymond and Blyth 1992
-!
- real(r8), intent(in) :: p,qtot,TK
- real(r8) :: qv,qst,e,est,L
- real(r8), parameter :: pref = 1000._r8
-
-L = rl - (cpliq - cpwv)*(TK-tfreez) ! T IN CENTIGRADE
-
-call qsat_hPa(TK, p, est, qst)
-
-qv = min(qtot,qst) ! Partition qtot into vapor part only.
-e = qv*p / (eps1 +qv)
-
-entropy = (cpres + qtot*cpliq)*log( TK/tfreez) - rgas*log( (p-e)/pref ) + &
- L*qv/TK - qv*rh2o*log(qv/qst)
-
-end FUNCTION entropy
-
-!
-!-----------------------------------------------------------------------------------------
-SUBROUTINE ientropy (rcall,icol,lchnk,s,p,qt,T,qst,Tfg)
-!-----------------------------------------------------------------------------------------
-!
-! p(mb), Tfg/T(K), qt/qv(kg/kg), s(J/kg).
-! Inverts entropy, pressure and total water qt
-! for T and saturated vapor mixing ratio
-!
-
- use phys_grid, only: get_rlon_p, get_rlat_p
-
- integer, intent(in) :: icol, lchnk, rcall
- real(r8), intent(in) :: s, p, Tfg, qt
- real(r8), intent(out) :: qst, T
- real(r8) :: est, this_lat,this_lon
- real(r8) :: a,b,c,d,ebr,fa,fb,fc,pbr,qbr,rbr,sbr,tol1,xm,tol
- integer :: i
-
- logical :: converged
-
- ! Max number of iteration loops.
- integer, parameter :: LOOPMAX = 100
- real(r8), parameter :: EPS = 3.e-8_r8
-
- converged = .false.
-
- ! Invert the entropy equation -- use Brent's method
- ! Brent, R. P. Ch. 3-4 in Algorithms for Minimization Without Derivatives. Englewood Cliffs, NJ: Prentice-Hall, 1973.
-
- T = Tfg ! Better first guess based on Tprofile from conv.
-
- a = Tfg-10 !low bracket
- b = Tfg+10 !high bracket
-
- fa = entropy(a, p, qt) - s
- fb = entropy(b, p, qt) - s
-
- c=b
- fc=fb
- tol=0.001_r8
-
- converge: do i=0, LOOPMAX
- if ((fb > 0.0_r8 .and. fc > 0.0_r8) .or. &
- (fb < 0.0_r8 .and. fc < 0.0_r8)) then
- c=a
- fc=fa
- d=b-a
- ebr=d
- end if
- if (abs(fc) < abs(fb)) then
- a=b
- b=c
- c=a
- fa=fb
- fb=fc
- fc=fa
- end if
-
- tol1=2.0_r8*EPS*abs(b)+0.5_r8*tol
- xm=0.5_r8*(c-b)
- converged = (abs(xm) <= tol1 .or. fb == 0.0_r8)
- if (converged) exit converge
-
- if (abs(ebr) >= tol1 .and. abs(fa) > abs(fb)) then
- sbr=fb/fa
- if (a == c) then
- pbr=2.0_r8*xm*sbr
- qbr=1.0_r8-sbr
- else
- qbr=fa/fc
- rbr=fb/fc
- pbr=sbr*(2.0_r8*xm*qbr*(qbr-rbr)-(b-a)*(rbr-1.0_r8))
- qbr=(qbr-1.0_r8)*(rbr-1.0_r8)*(sbr-1.0_r8)
- end if
- if (pbr > 0.0_r8) qbr=-qbr
- pbr=abs(pbr)
- if (2.0_r8*pbr < min(3.0_r8*xm*qbr-abs(tol1*qbr),abs(ebr*qbr))) then
- ebr=d
- d=pbr/qbr
- else
- d=xm
- ebr=d
- end if
- else
- d=xm
- ebr=d
- end if
- a=b
- fa=fb
- b=b+merge(d,sign(tol1,xm), abs(d) > tol1 )
-
- fb = entropy(b, p, qt) - s
-
- end do converge
-
- T = b
- call qsat_hPa(T, p, est, qst)
-
- if (.not. converged) then
- this_lat = get_rlat_p(lchnk, icol)*57.296_r8
- this_lon = get_rlon_p(lchnk, icol)*57.296_r8
- write(iulog,*) '*** ZM_CONV: IENTROPY: Failed and about to exit, info follows ****'
- write(iulog,100) 'ZM_CONV: IENTROPY. Details: call#,lchnk,icol= ',rcall,lchnk,icol, &
- ' lat: ',this_lat,' lon: ',this_lon, &
- ' P(mb)= ', p, ' Tfg(K)= ', Tfg, ' qt(g/kg) = ', 1000._r8*qt, &
- ' qst(g/kg) = ', 1000._r8*qst,', s(J/kg) = ',s
- call endrun('**** ZM_CONV IENTROPY: Tmix did not converge ****')
- end if
-
-100 format (A,I1,I4,I4,7(A,F6.2))
-
-end SUBROUTINE ientropy
-
-! Wrapper for qsat_water that does translation between Pa and hPa
-! qsat_water uses Pa internally, so get it right, need to pass in Pa.
-! Afterward, set es back to hPa.
-subroutine qsat_hPa(t, p, es, qm)
- use wv_saturation, only: qsat_water
-
- ! Inputs
- real(r8), intent(in) :: t ! Temperature (K)
- real(r8), intent(in) :: p ! Pressure (hPa)
- ! Outputs
- real(r8), intent(out) :: es ! Saturation vapor pressure (hPa)
- real(r8), intent(out) :: qm ! Saturation mass mixing ratio
- ! (vapor mass over dry mass, kg/kg)
-
- call qsat_water(t, p*100._r8, es, qm)
-
- es = es*0.01_r8
-
-end subroutine qsat_hPa
-
-end module zm_conv
diff --git a/src/physics/cam/zm_conv_intr.F90 b/src/physics/cam/zm_conv_intr.F90
index 48e8d5e932..d559ce4be4 100644
--- a/src/physics/cam/zm_conv_intr.F90
+++ b/src/physics/cam/zm_conv_intr.F90
@@ -8,11 +8,13 @@ module zm_conv_intr
! January 2010 modified by J. Kay to add COSP simulator fields to physics buffer
!---------------------------------------------------------------------------------
use shr_kind_mod, only: r8=>shr_kind_r8
- use physconst, only: cpair
+ use physconst, only: cpair, epsilo, gravit, latvap, tmelt, rair
use ppgrid, only: pver, pcols, pverp, begchunk, endchunk
- use zm_conv, only: zm_conv_evap, zm_convr, convtran, momtran
-
- use zm_microphysics, only: zm_aero_t, zm_conv_t
+ use zm_conv_evap, only: zm_conv_evap_run
+ use zm_convr, only: zm_convr_init, zm_convr_run
+ use zm_conv_convtran, only: zm_conv_convtran_run
+ use zm_conv_momtran, only: zm_conv_momtran_run
+
use rad_constituents, only: rad_cnst_get_info, rad_cnst_get_mode_num, rad_cnst_get_aer_mmr, &
rad_cnst_get_aer_props, rad_cnst_get_mode_props !, &
use ndrop_bam, only: ndrop_bam_init
@@ -36,7 +38,7 @@ module zm_conv_intr
zm_conv_tend, &! return tendencies
zm_conv_tend_2 ! return tendencies
- public :: zmconv_microp
+ public zmconv_ke, zmconv_ke_lnd, zmconv_org ! needed by convect_shallow
integer ::& ! indices for fields in the physics buffer
zm_mu_idx, &
@@ -73,7 +75,6 @@ module zm_conv_intr
! before the convection top and CAPE calculations are completed.
logical :: zmconv_org ! Parameterization for sub-grid scale convective organization for the ZM deep
! convective scheme based on Mapes and Neale (2011)
- logical :: zmconv_microp = .false. ! switch for microphysics
real(r8) :: zmconv_dmpdz = unset_r8 ! Parcel fractional mass entrainment rate
real(r8) :: zmconv_tiedke_add = unset_r8 ! Convective parcel temperature perturbation
real(r8) :: zmconv_capelmt = unset_r8 ! Triggering thereshold for ZM convection
@@ -92,8 +93,6 @@ module zm_conv_intr
integer :: nmodes
integer :: nbulk
- type(zm_aero_t), allocatable :: aero(:) ! object contains information about the aerosols
-
!=========================================================================================
contains
!=========================================================================================
@@ -156,15 +155,7 @@ subroutine zm_conv_register
! convective mass fluxes
call pbuf_add_field('CMFMC_DP', 'physpkg', dtype_r8, (/pcols,pverp/), mconzm_idx)
- if (zmconv_microp) then
- ! Only add the number conc fields if the microphysics is active.
-
- ! detrained convective cloud water num concen.
- call pbuf_add_field('DNLFZM', 'physpkg', dtype_r8, (/pcols,pver/), dnlfzm_idx)
- ! detrained convective cloud ice num concen.
- call pbuf_add_field('DNIFZM', 'physpkg', dtype_r8, (/pcols,pver/), dnifzm_idx)
- end if
-
+!CACNOTE - Is zm_org really a constituent or was it just a handy structure to use for an allocatable which persists in the run?
if (zmconv_org) then
call cnst_add('ZM_ORG',0._r8,0._r8,0._r8,ixorg,longname='organization parameter')
endif
@@ -187,7 +178,7 @@ subroutine zm_conv_readnl(nlfile)
namelist /zmconv_nl/ zmconv_c0_lnd, zmconv_c0_ocn, zmconv_num_cin, &
zmconv_ke, zmconv_ke_lnd, zmconv_org, &
- zmconv_momcu, zmconv_momcd, zmconv_microp, &
+ zmconv_momcu, zmconv_momcd, &
zmconv_dmpdz, zmconv_tiedke_add, zmconv_capelmt, &
zmconv_parcel_pbl, zmconv_tau
!-----------------------------------------------------------------------------
@@ -224,8 +215,6 @@ subroutine zm_conv_readnl(nlfile)
if (ierr /= 0) call endrun("zm_conv_readnl: FATAL: mpi_bcast: zmconv_momcd")
call mpi_bcast(zmconv_org, 1, mpi_logical, masterprocid, mpicom, ierr)
if (ierr /= 0) call endrun("zm_conv_readnl: FATAL: mpi_bcast: zmconv_org")
- call mpi_bcast(zmconv_microp, 1, mpi_logical, masterprocid, mpicom, ierr)
- if (ierr /= 0) call endrun("zm_conv_readnl: FATAL: mpi_bcast: zmconv_microp")
call mpi_bcast(zmconv_dmpdz, 1, mpi_real8, masterprocid, mpicom, ierr)
if (ierr /= 0) call endrun("zm_conv_readnl: FATAL: mpi_bcast: zmconv_dmpdz")
call mpi_bcast(zmconv_tiedke_add, 1, mpi_real8, masterprocid, mpicom, ierr)
@@ -233,7 +222,7 @@ subroutine zm_conv_readnl(nlfile)
call mpi_bcast(zmconv_capelmt, 1, mpi_real8, masterprocid, mpicom, ierr)
if (ierr /= 0) call endrun("zm_conv_readnl: FATAL: mpi_bcast: zmconv_capelmt")
call mpi_bcast(zmconv_parcel_pbl, 1, mpi_logical, masterprocid, mpicom, ierr)
- if (ierr /= 0) call endrun("zm_conv_readnl: FATAL: mpi_bcast: zmconv_parcel_pbl")
+ if (ierr /= 0) call endrun("zm_conv_readnl: FATAL: mpi_bcast: zmconv_parcel_pbl")
call mpi_bcast(zmconv_tau, 1, mpi_real8, masterprocid, mpicom, ierr)
if (ierr /= 0) call endrun("zm_conv_readnl: FATAL: mpi_bcast: zmconv_tau")
@@ -249,7 +238,7 @@ subroutine zm_conv_init(pref_edge)
use cam_history, only: addfld, add_default, horiz_only
use ppgrid, only: pcols, pver
- use zm_conv, only: zm_convi
+ use zm_convr, only: zm_convr_init
use pmgrid, only: plev,plevp
use spmd_utils, only: masterproc
use phys_control, only: phys_deepconv_pbl, phys_getopts, cam_physpkg_is
@@ -259,6 +248,8 @@ subroutine zm_conv_init(pref_edge)
real(r8),intent(in) :: pref_edge(plevp) ! reference pressures at interfaces
+ character(len=512) :: errmsg
+ integer :: errflg
logical :: no_deep_pbl ! if true, no deep convection in PBL
integer limcnv ! top interface level limit for convection
@@ -268,12 +259,6 @@ subroutine zm_conv_init(pref_edge)
! liquid budgets.
integer :: history_budget_histfile_num ! output history file number for budget fields
-! Allocate the basic aero structure outside the zmconv_microp logical
-! This allows the aero structure to be passed
-! Note that all of the arrays inside this structure are conditionally allocated
-
- allocate(aero(begchunk:endchunk))
-
!
! Register fields with the output buffer
!
@@ -344,10 +329,6 @@ subroutine zm_conv_init(pref_edge)
call add_default('ZMMTT ', history_budget_histfile_num, ' ')
end if
- if (zmconv_microp) then
- call add_default ('DIFZM', 1, ' ')
- call add_default ('DLFZM', 1, ' ')
- end if
!
! Limit deep convection to regions below 40 mb
! Note this calculation is repeated in the shallow convection interface
@@ -371,16 +352,16 @@ subroutine zm_conv_init(pref_edge)
end if
no_deep_pbl = phys_deepconv_pbl()
- call zm_convi(limcnv,zmconv_c0_lnd, zmconv_c0_ocn, zmconv_ke, zmconv_ke_lnd, &
+!CACNOTE - Need to check errflg and report errors
+ call zm_convr_init(cpair, epsilo, gravit, latvap, tmelt, rair, &
+ limcnv,zmconv_c0_lnd, zmconv_c0_ocn, zmconv_ke, zmconv_ke_lnd, &
zmconv_momcu, zmconv_momcd, zmconv_num_cin, zmconv_org, &
- zmconv_microp, no_deep_pbl, zmconv_tiedke_add, &
- zmconv_capelmt, zmconv_dmpdz,zmconv_parcel_pbl, zmconv_tau)
+ no_deep_pbl, zmconv_tiedke_add, &
+ zmconv_capelmt, zmconv_dmpdz,zmconv_parcel_pbl, zmconv_tau, errmsg, errflg)
cld_idx = pbuf_get_index('CLD')
fracis_idx = pbuf_get_index('FRACIS')
- if (zmconv_microp) call zm_conv_micro_init()
-
end subroutine zm_conv_init
!=========================================================================================
!subroutine zm_conv_tend(state, ptend, tdt)
@@ -402,7 +383,8 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
use physics_buffer, only : pbuf_get_field, physics_buffer_desc, pbuf_old_tim_idx
use constituents, only: pcnst, cnst_get_ind, cnst_is_convtran1
use check_energy, only: check_energy_chng
- use physconst, only: gravit
+ use physconst, only: gravit, latice, latvap, tmelt, cpwv, cpliq, rh2o
+
use phys_control, only: cam_physpkg_is
! Arguments
@@ -426,8 +408,8 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
! Local variables
-
- type(zm_conv_t) :: conv
+ character(len=512) :: errmsg
+ integer :: errflg
integer :: i,k,l,m
integer :: ilon ! global longitude index of a column
@@ -504,7 +486,10 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
integer :: ii
real(r8),pointer :: zm_org2d(:,:)
- real(r8),pointer :: orgt(:,:), org(:,:)
+ real(r8),allocatable :: orgt_alloc(:,:), org_alloc(:,:)
+
+ real(r8) :: zm_org2d_ncol(state%ncol,pver)
+ real(r8) :: orgt_ncol(state%ncol,pver), org_ncol(state%ncol,pver)
logical :: lq(pcnst)
@@ -515,57 +500,6 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
ncol = state%ncol
nstep = get_nstep()
- if (zmconv_microp) then
- allocate( &
- conv%qi(pcols,pver), &
- conv%qliq(pcols,pver), &
- conv%qice(pcols,pver), &
- conv%wu(pcols,pver), &
- conv%sprd(pcols,pver), &
- conv%qrain(pcols,pver), &
- conv%qsnow(pcols,pver), &
- conv%qnl(pcols,pver), &
- conv%qni(pcols,pver), &
- conv%qnr(pcols,pver), &
- conv%qns(pcols,pver), &
- conv%frz(pcols,pver), &
- conv%autolm(pcols,pver), &
- conv%accrlm(pcols,pver), &
- conv%bergnm(pcols,pver), &
- conv%fhtimm(pcols,pver), &
- conv%fhtctm(pcols,pver), &
- conv%fhmlm (pcols,pver), &
- conv%hmpim (pcols,pver), &
- conv%accslm(pcols,pver), &
- conv%dlfm (pcols,pver), &
- conv%autoln(pcols,pver), &
- conv%accrln(pcols,pver), &
- conv%bergnn(pcols,pver), &
- conv%fhtimn(pcols,pver), &
- conv%fhtctn(pcols,pver), &
- conv%fhmln (pcols,pver), &
- conv%accsln(pcols,pver), &
- conv%activn(pcols,pver), &
- conv%dlfn (pcols,pver), &
- conv%autoim(pcols,pver), &
- conv%accsim(pcols,pver), &
- conv%difm (pcols,pver), &
- conv%nuclin(pcols,pver), &
- conv%autoin(pcols,pver), &
- conv%accsin(pcols,pver), &
- conv%hmpin (pcols,pver), &
- conv%difn (pcols,pver), &
- conv%cmel (pcols,pver), &
- conv%cmei (pcols,pver), &
- conv%trspcm(pcols,pver), &
- conv%trspcn(pcols,pver), &
- conv%trspim(pcols,pver), &
- conv%trspin(pcols,pver), &
- conv%lambdadpcu(pcols,pver), &
- conv%mudpcu(pcols,pver), &
- conv%dcape(pcols) )
- end if
-
ftem = 0._r8
mu_out(:,:) = 0._r8
md_out(:,:) = 0._r8
@@ -578,7 +512,7 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
if (zmconv_org) then
lq(ixorg) = .TRUE.
endif
- call physics_ptend_init(ptend_loc, state%psetcols, 'zm_convr', ls=.true., lq=lq)! initialize local ptend type
+ call physics_ptend_init(ptend_loc, state%psetcols, 'zm_convr_run', ls=.true., lq=lq)! initialize local ptend type
!
! Associate pointers with physics buffer fields
@@ -608,66 +542,70 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
call pbuf_get_field(pbuf, difzm_idx, dif)
call pbuf_get_field(pbuf, mconzm_idx, mconzm)
- if (zmconv_microp) then
- call pbuf_get_field(pbuf, dnlfzm_idx, dnlf)
- call pbuf_get_field(pbuf, dnifzm_idx, dnif)
- else
- allocate(dnlf(pcols,pver), dnif(pcols,pver))
- end if
-
- if (zmconv_microp) then
-
- if (nmodes > 0) then
-
- ! Associate pointers with the modes and species that affect the climate
- ! (list 0)
-
- do m = 1, nmodes
- call rad_cnst_get_mode_num(0, m, 'a', state, pbuf, aero(lchnk)%num_a(m)%val)
- call pbuf_get_field(pbuf, dgnum_idx, aero(lchnk)%dgnum(m)%val, start=(/1,1,m/), kount=(/pcols,pver,1/))
-
- do l = 1, aero(lchnk)%nspec(m)
- call rad_cnst_get_aer_mmr(0, m, l, 'a', state, pbuf, aero(lchnk)%mmr_a(l,m)%val)
- end do
- end do
-
- else if (nbulk > 0) then
-
- ! Associate pointers with the bulk aerosols that affect the climate
- ! (list 0)
-
- do m = 1, nbulk
- call rad_cnst_get_aer_mmr(0, m, state, pbuf, aero(lchnk)%mmr_bulk(m)%val)
- end do
-
- end if
- end if
+ allocate(dnlf(pcols,pver), dnif(pcols,pver))
!
! Begin with Zhang-McFarlane (1996) convection parameterization
!
- call t_startf ('zm_convr')
+ call t_startf ('zm_convr_run')
if (zmconv_org) then
allocate(zm_org2d(pcols,pver))
- org => state%q(:,:,ixorg)
- orgt => ptend_loc%q(:,:,ixorg)
+ allocate(org_alloc(ncol,pver))
+ allocate(orgt_alloc(ncol,pver))
+ org_ncol(:ncol,:) = state%q(1:ncol,:,ixorg)
endif
- call zm_convr( lchnk ,ncol , &
- state%t ,state%q(:,:,1), prec ,jctop ,jcbot , &
- pblh ,state%zm ,state%phis ,state%zi ,ptend_loc%q(:,:,1) , &
- ptend_loc%s , state%pmid ,state%pint ,state%pdel , &
- .5_r8*ztodt ,mcon ,cme , cape, &
- tpert ,dlf ,pflx ,zdu ,rprd , &
- mu, md, du, eu, ed, &
- dp, dsubcld, jt, maxg, ideep, &
- ql, rliq, landfrac, &
- org, orgt, zm_org2d, &
- dif, dnlf, dnif, conv, &
- aero(lchnk), rice)
+!REMOVECAM - no longer need these when CAM is retired and pcols no longer exists
+ ptend_loc%q(:,:,1) = 0._r8
+ ptend_loc%s(:,:) = 0._r8
+ mcon(:,:) = 0._r8
+ dlf(:,:) = 0._r8
+ pflx(:,:) = 0._r8
+ cme(:,:) = 0._r8
+ cape(:) = 0._r8
+ zdu(:,:) = 0._r8
+ rprd(:,:) = 0._r8
+ dif(:,:) = 0._r8
+ dnlf(:,:) = 0._r8
+ dnif(:,:) = 0._r8
+ mu(:,:) = 0._r8
+ eu(:,:) = 0._r8
+ du(:,:) = 0._r8
+ md(:,:) = 0._r8
+ ed(:,:) = 0._r8
+ dp(:,:) = 0._r8
+ dsubcld(:) = 0._r8
+ jctop(:) = 0._r8
+ jcbot(:) = 0._r8
+ prec(:) = 0._r8
+ rliq(:) = 0._r8
+ rice(:) = 0._r8
+ ideep(:) = 0._r8
+!REMOVECAM_END
+
+!CACNOTE - Need to check errflg and report errors
+ call zm_convr_run(ncol, pver, &
+ pverp, gravit, latice, cpwv, cpliq, rh2o, &
+ state%t(:ncol,:), state%q(:ncol,:,1), prec(:ncol), jctop(:ncol), jcbot(:ncol), &
+ pblh(:ncol), state%zm(:ncol,:), state%phis, state%zi(:ncol,:), ptend_loc%q(:ncol,:,1), &
+ ptend_loc%s(:ncol,:), state%pmid(:ncol,:), state%pint(:ncol,:), state%pdel(:ncol,:), &
+ .5_r8*ztodt, mcon(:ncol,:), cme(:ncol,:), cape(:ncol), &
+ tpert(:ncol), dlf(:ncol,:), pflx(:ncol,:), zdu(:ncol,:), rprd(:ncol,:), &
+ mu(:ncol,:), md(:ncol,:), du(:ncol,:), eu(:ncol,:), ed(:ncol,:), &
+ dp(:ncol,:), dsubcld(:ncol), jt(:ncol), maxg(:ncol), ideep(:ncol), &
+ ql(:ncol,:), rliq(:ncol), landfrac(:ncol), &
+ org_ncol(:,:), orgt_ncol(:,:), zm_org2d_ncol(:,:), &
+ dif(:ncol,:), dnlf(:ncol,:), dnif(:ncol,:), &
+ rice(:ncol), errmsg, errflg)
+
+ if (zmconv_org) then
+ ptend_loc%q(:,:,ixorg)=orgt_ncol(:ncol,:)
+ zm_org2d(:ncol,:) = zm_org2d_ncol(:ncol,:)
+ endif
lengath = count(ideep > 0)
+ if (lengath > ncol) lengath = ncol ! should not happen, but force it to not be larger than ncol for safety sake
call outfld('CAPE', cape, pcols, lchnk) ! RBN - CAPE output
!
@@ -702,13 +640,11 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
ftem(:ncol,:pver) = ptend_loc%s(:ncol,:pver)/cpair
call outfld('ZMDT ',ftem ,pcols ,lchnk )
call outfld('ZMDQ ',ptend_loc%q(1,1,1) ,pcols ,lchnk )
- call t_stopf ('zm_convr')
+ call t_stopf ('zm_convr_run')
call outfld('DIFZM' ,dif ,pcols, lchnk)
call outfld('DLFZM' ,dlf ,pcols, lchnk)
- if (zmconv_microp) call zm_conv_micro_outfld(conv, dnif, dnlf, lchnk, ncol)
-
pcont(:ncol) = state%ps(:ncol)
pconb(:ncol) = state%ps(:ncol)
do i = 1,lengath
@@ -735,9 +671,9 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
if (zmconv_org) then
lq(ixorg) = .TRUE.
endif
- call physics_ptend_init(ptend_loc, state1%psetcols, 'zm_conv_evap', ls=.true., lq=lq)
+ call physics_ptend_init(ptend_loc, state1%psetcols, 'zm_conv_evap_run', ls=.true., lq=lq)
- call t_startf ('zm_conv_evap')
+ call t_startf ('zm_conv_evap_run')
!
! Determine the phase of the precipitation produced and add latent heat of fusion
! Evaporate some of the precip directly into the environment (Sundqvist)
@@ -751,13 +687,20 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
call pbuf_get_field(pbuf, dp_cldice_idx, dp_cldice )
dp_cldliq(:ncol,:) = 0._r8
dp_cldice(:ncol,:) = 0._r8
-
- call zm_conv_evap(state1%ncol,state1%lchnk, &
- state1%t,state1%pmid,state1%pdel,state1%q(:pcols,:pver,1), &
- landfrac, &
- ptend_loc%s, tend_s_snwprd, tend_s_snwevmlt, ptend_loc%q(:pcols,:pver,1), &
- rprd, cld, ztodt, &
- prec, snow, ntprprd, ntsnprd , flxprec, flxsnow, conv%sprd)
+!REMOVECAM - no longer need these when CAM is retired and pcols no longer exists
+ flxprec(:,:) = 0._r8
+ flxsnow(:,:) = 0._r8
+ snow(:) = 0._r8
+!REMOVECAM_END
+
+ call zm_conv_evap_run(state1%ncol, pver, pverp, &
+ gravit, latice, latvap, tmelt, &
+ cpair, zmconv_ke, zmconv_ke_lnd, zmconv_org, &
+ state1%t(:ncol,:),state1%pmid(:ncol,:),state1%pdel(:ncol,:),state1%q(:ncol,:pver,1), &
+ landfrac(:ncol), &
+ ptend_loc%s(:ncol,:), tend_s_snwprd(:ncol,:), tend_s_snwevmlt(:ncol,:), ptend_loc%q(:ncol,:pver,1), &
+ rprd(:ncol,:), cld(:ncol,:), ztodt, &
+ prec(:ncol), snow(:ncol), ntprprd(:ncol,:), ntsnprd(:ncol,:), flxprec(:ncol,:), flxsnow(:ncol,:) )
evapcdp(:ncol,:pver) = ptend_loc%q(:ncol,:pver,1)
@@ -768,7 +711,7 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
endif
!
-! Write out variables from zm_conv_evap
+! Write out variables from zm_conv_evap_run
!
ftem(:ncol,:pver) = ptend_loc%s(:ncol,:pver)/cpair
call outfld('EVAPTZM ',ftem ,pcols ,lchnk )
@@ -786,7 +729,7 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
call outfld('PRECCDZM ',prec, pcols ,lchnk )
- call t_stopf ('zm_conv_evap')
+ call t_stopf ('zm_conv_evap_run')
call outfld('PRECZ ', prec , pcols, lchnk)
@@ -801,7 +744,7 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
if ( .not. cam_physpkg_is('cam3')) then
- call physics_ptend_init(ptend_loc, state1%psetcols, 'momtran', ls=.true., lu=.true., lv=.true.)
+ call physics_ptend_init(ptend_loc, state1%psetcols, 'zm_conv_momtran_run', ls=.true., lu=.true., lv=.true.)
winds(:ncol,:pver,1) = state1%u(:ncol,:pver)
winds(:ncol,:pver,2) = state1%v(:ncol,:pver)
@@ -809,13 +752,20 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
l_windt(1) = .true.
l_windt(2) = .true.
- call t_startf ('momtran')
- call momtran (lchnk, ncol, &
- l_windt,winds, 2, mu, md, &
- du, eu, ed, dp, dsubcld, &
- jt, maxg, ideep, 1, lengath, &
- nstep, wind_tends, pguall, pgdall, icwu, icwd, ztodt, seten )
- call t_stopf ('momtran')
+ call t_startf ('zm_conv_momtran_run')
+
+!REMOVECAM - no longer need this when CAM is retired and pcols no longer exists
+ wind_tends(:,:,:) = 0._r8
+!REMOVECAM_END
+
+ call zm_conv_momtran_run (ncol, pver, pverp, &
+ l_windt,winds(:ncol,:,:), 2, mu(:ncol,:), md(:ncol,:), &
+ zmconv_momcu, zmconv_momcd, &
+ du(:ncol,:), eu(:ncol,:), ed(:ncol,:), dp(:ncol,:), dsubcld(:ncol), &
+ jt(:ncol), maxg(:ncol), ideep(:ncol), 1, lengath, &
+ nstep, wind_tends(:ncol,:,:), pguall(:ncol,:,:), pgdall(:ncol,:,:), &
+ icwu(:ncol,:,:), icwd(:ncol,:,:), ztodt, seten(:ncol,:) )
+ call t_stopf ('zm_conv_momtran_run')
ptend_loc%u(:ncol,:pver) = wind_tends(:ncol,:pver,1)
ptend_loc%v(:ncol,:pver) = wind_tends(:ncol,:pver,2)
@@ -863,11 +813,16 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
fake_dpdry(:,:) = 0._r8
call t_startf ('convtran1')
- call convtran (lchnk, &
- ptend_loc%lq,state1%q, pcnst, mu, md, &
- du, eu, ed, dp, dsubcld, &
- jt,maxg, ideep, 1, lengath, &
- nstep, fracis, ptend_loc%q, fake_dpdry, ztodt)
+
+!REMOVECAM - no longer need this when CAM is retired and pcols no longer exists
+ ptend_loc%q(:,:,:) = 0._r8
+!REMOVECAM_END
+
+ call zm_conv_convtran_run (ncol, pver, &
+ ptend_loc%lq,state1%q(:ncol,:,:), pcnst, mu(:ncol,:), md(:ncol,:), &
+ du(:ncol,:), eu(:ncol,:), ed(:ncol,:), dp(:ncol,:), dsubcld(:ncol), &
+ jt(:ncol), maxg(:ncol), ideep(:ncol), 1, lengath, &
+ nstep, fracis(:ncol,:,:), ptend_loc%q(:ncol,:,:), fake_dpdry(:ncol,:), ztodt)
call t_stopf ('convtran1')
call outfld('ZMDICE ',ptend_loc%q(1,1,ixcldice) ,pcols ,lchnk )
@@ -883,61 +838,7 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
deallocate(zm_org2d)
end if
- if (zmconv_microp) then
- deallocate( &
- conv%qi, &
- conv%qliq, &
- conv%qice, &
- conv%wu, &
- conv%sprd, &
- conv%qrain, &
- conv%qsnow, &
- conv%qnl, &
- conv%qni, &
- conv%qnr, &
- conv%qns, &
- conv%frz, &
- conv%autolm, &
- conv%accrlm, &
- conv%bergnm, &
- conv%fhtimm, &
- conv%fhtctm, &
- conv%fhmlm , &
- conv%hmpim , &
- conv%accslm, &
- conv%dlfm , &
- conv%autoln, &
- conv%accrln, &
- conv%bergnn, &
- conv%fhtimn, &
- conv%fhtctn, &
- conv%fhmln , &
- conv%accsln, &
- conv%activn, &
- conv%dlfn , &
- conv%autoim, &
- conv%accsim, &
- conv%difm , &
- conv%nuclin, &
- conv%autoin, &
- conv%accsin, &
- conv%hmpin , &
- conv%difn , &
- conv%cmel , &
- conv%cmei , &
- conv%trspcm, &
- conv%trspcn, &
- conv%trspim, &
- conv%trspin, &
- conv%lambdadpcu, &
- conv%mudpcu, &
- conv%dcape )
-
- else
-
- deallocate(dnlf, dnif)
-
- end if
+ deallocate(dnlf, dnif)
end subroutine zm_conv_tend
!=========================================================================================
@@ -962,6 +863,7 @@ subroutine zm_conv_tend_2( state, ptend, ztodt, pbuf)
integer :: i, lchnk, istat
integer :: lengath ! number of columns with deep convection
integer :: nstep
+ integer :: ncol
real(r8), dimension(pcols,pver) :: dpdry
@@ -994,11 +896,14 @@ subroutine zm_conv_tend_2( state, ptend, ztodt, pbuf)
call pbuf_get_field(pbuf, zm_maxg_idx, maxg)
call pbuf_get_field(pbuf, zm_ideep_idx, ideep)
- lengath = count(ideep > 0)
lchnk = state%lchnk
+ ncol = state%ncol
nstep = get_nstep()
+ lengath = count(ideep > 0)
+ if (lengath > ncol) lengath = ncol ! should not happen, but force it to not be larger than ncol for safety sake
+
if (any(ptend%lq(:))) then
! initialize dpdry for call to convtran
! it is used for tracers of dry mixing ratio type
@@ -1008,11 +913,16 @@ subroutine zm_conv_tend_2( state, ptend, ztodt, pbuf)
end do
call t_startf ('convtran2')
- call convtran (lchnk, &
- ptend%lq,state%q, pcnst, mu, md, &
- du, eu, ed, dp, dsubcld, &
- jt, maxg, ideep, 1, lengath, &
- nstep, fracis, ptend%q, dpdry, ztodt)
+
+!REMOVECAM - no longer need this when CAM is retired and pcols no longer exists
+ ptend%q(:,:,:) = 0._r8
+!REMOVECAM_END
+
+ call zm_conv_convtran_run (ncol, pver, &
+ ptend%lq,state%q(:ncol,:,:), pcnst, mu(:ncol,:), md(:ncol,:), &
+ du(:ncol,:), eu(:ncol,:), ed(:ncol,:), dp(:ncol,:), dsubcld(:ncol), &
+ jt(:ncol), maxg(:ncol), ideep(:ncol), 1, lengath, &
+ nstep, fracis(:ncol,:,:), ptend%q(:ncol,:,:), dpdry(:ncol,:), ztodt)
call t_stopf ('convtran2')
end if
@@ -1020,384 +930,5 @@ end subroutine zm_conv_tend_2
!=========================================================================================
-subroutine zm_conv_micro_init()
-
- use cam_history, only: addfld, add_default, horiz_only
- use ppgrid, only: pcols, pver
- use pmgrid, only: plev,plevp
- use phys_control, only: cam_physpkg_is
- use physics_buffer, only: pbuf_get_index
- use zm_microphysics, only: zm_mphyi
-
- implicit none
-
- integer :: i
-
- !
- ! Register fields with the output buffer
- !
- call addfld ('ICIMRDP', (/ 'lev' /), 'A','kg/kg', 'Deep Convection in-cloud ice mixing ratio ')
- call addfld ('CLDLIQZM',(/ 'lev' /), 'A','g/m3' ,'Cloud liquid water - ZM convection')
- call addfld ('CLDICEZM',(/ 'lev' /), 'A','g/m3' ,'Cloud ice water - ZM convection')
- call addfld ('CLIQSNUM',(/ 'lev' /), 'A','1' ,'Cloud liquid water sample number - ZM convection')
- call addfld ('CICESNUM',(/ 'lev' /), 'A','1' ,'Cloud ice water sample number - ZM convection')
- call addfld ('QRAINZM' ,(/ 'lev' /), 'A','g/m3' ,'rain water - ZM convection')
- call addfld ('QSNOWZM' ,(/ 'lev' /), 'A','g/m3' ,'snow - ZM convection')
- call addfld ('CRAINNUM',(/ 'lev' /), 'A','1' ,'Cloud rain water sample number - ZM convection')
- call addfld ('CSNOWNUM',(/ 'lev' /), 'A','1' ,'Cloud snow sample number - ZM convection')
-
- call addfld ('DNIFZM' ,(/ 'lev' /), 'A','1/kg/s ' ,'Detrained ice water num concen from ZM convection')
- call addfld ('DNLFZM' ,(/ 'lev' /), 'A','1/kg/s ' ,'Detrained liquid water num concen from ZM convection')
- call addfld ('WUZM' ,(/ 'lev' /), 'A','m/s' ,'vertical velocity - ZM convection')
- call addfld ('WUZMSNUM',(/ 'lev' /), 'A','1' ,'vertical velocity sample number - ZM convection')
-
- call addfld ('QNLZM',(/ 'lev' /), 'A','1/m3' ,'Cloud liquid water number concen - ZM convection')
- call addfld ('QNIZM',(/ 'lev' /), 'A','1/m3' ,'Cloud ice number concen - ZM convection')
- call addfld ('QNRZM',(/ 'lev' /), 'A','1/m3' ,'Cloud rain water number concen - ZM convection')
- call addfld ('QNSZM',(/ 'lev' /), 'A','1/m3' ,'Cloud snow number concen - ZM convection')
-
- call addfld ('FRZZM',(/ 'lev' /), 'A','1/s' ,'mass tendency due to freezing - ZM convection')
-
- call addfld ('AUTOL_M' ,(/ 'lev' /), 'A','kg/kg/m' ,'mass tendency due to autoconversion of droplets to rain')
- call addfld ('ACCRL_M' ,(/ 'lev' /), 'A','kg/kg/m' ,'mass tendency due to accretion of droplets by rain')
- call addfld ('BERGN_M' ,(/ 'lev' /), 'A','kg/kg/m' ,'mass tendency due to Bergeron process')
- call addfld ('FHTIM_M' ,(/ 'lev' /), 'A','kg/kg/m' ,'mass tendency due to immersion freezing')
- call addfld ('FHTCT_M' ,(/ 'lev' /), 'A','kg/kg/m' ,'mass tendency due to contact freezing')
- call addfld ('FHML_M' ,(/ 'lev' /), 'A','kg/kg/m' ,'mass tendency due to homogeneous freezing of droplet')
- call addfld ('HMPI_M' ,(/ 'lev' /), 'A','kg/kg/m' ,'mass tendency due to HM process')
- call addfld ('ACCSL_M' ,(/ 'lev' /), 'A','kg/kg/m' ,'mass tendency due to accretion of droplet by snow')
- call addfld ('DLF_M' ,(/ 'lev' /), 'A','kg/kg/m' ,'mass tendency due to detrainment of droplet')
- call addfld ('COND_M' ,(/ 'lev' /), 'A','kg/kg/m' ,'mass tendency due to condensation')
-
- call addfld ('AUTOL_N' ,(/ 'lev' /), 'A','1/kg/m' ,'num tendency due to autoconversion of droplets to rain')
- call addfld ('ACCRL_N' ,(/ 'lev' /), 'A','1/kg/m' ,'num tendency due to accretion of droplets by rain')
- call addfld ('BERGN_N' ,(/ 'lev' /), 'A','1/kg/m' ,'num tendency due to Bergeron process')
- call addfld ('FHTIM_N' ,(/ 'lev' /), 'A','1/kg/m' ,'num tendency due to immersion freezing')
- call addfld ('FHTCT_N' ,(/ 'lev' /), 'A','1/kg/m' ,'num tendency due to contact freezing')
- call addfld ('FHML_N' ,(/ 'lev' /), 'A','1/kg/m' ,'num tendency due to homogeneous freezing of droplet')
- call addfld ('ACCSL_N' ,(/ 'lev' /), 'A','1/kg/m' ,'num tendency due to accretion of droplet by snow')
- call addfld ('ACTIV_N' ,(/ 'lev' /), 'A','1/kg/m' ,'num tendency due to droplets activation')
- call addfld ('DLF_N' ,(/ 'lev' /), 'A','1/kg/m' ,'num tendency due to detrainment of droplet')
-
- call addfld ('AUTOI_M' ,(/ 'lev' /), 'A','kg/kg/m' ,'mass tendency due to autoconversion of ice to snow')
- call addfld ('ACCSI_M' ,(/ 'lev' /), 'A','kg/kg/m' ,'mass tendency due to accretion of ice by snow')
- call addfld ('DIF_M' ,(/ 'lev' /), 'A','kg/kg/m' ,'mass tendency due to detrainment of cloud ice')
- call addfld ('DEPOS_M' ,(/ 'lev' /), 'A','kg/kg/m' ,'mass tendency due to deposition')
-
- call addfld ('NUCLI_N' ,(/ 'lev' /), 'A','1/kg/m' ,'num tendency due to ice nucleation')
- call addfld ('AUTOI_N' ,(/ 'lev' /), 'A','1/kg/m' ,'num tendency due to autoconversion of ice to snow')
- call addfld ('ACCSI_N' ,(/ 'lev' /), 'A','1/kg/m' ,'num tendency due to accretion of ice by snow')
- call addfld ('HMPI_N' ,(/ 'lev' /), 'A','1/kg/m' ,'num tendency due to HM process')
- call addfld ('DIF_N' ,(/ 'lev' /), 'A','1/kg/m' ,'num tendency due to detrainment of cloud ice')
-
- call addfld ('TRSPC_M' ,(/ 'lev' /), 'A','kg/kg/m','mass tendency of droplets due to convective transport')
- call addfld ('TRSPC_N' ,(/ 'lev' /), 'A','1/kg/m' ,'num tendency of droplets due to convective transport')
- call addfld ('TRSPI_M' ,(/ 'lev' /), 'A','kg/kg/m','mass tendency of ice crystal due to convective transport')
- call addfld ('TRSPI_N' ,(/ 'lev' /), 'A','1/kg/m' ,'num tendency of ice crystal due to convective transport')
-
-
- call add_default ('CLDLIQZM', 1, ' ')
- call add_default ('CLDICEZM', 1, ' ')
- call add_default ('CLIQSNUM', 1, ' ')
- call add_default ('CICESNUM', 1, ' ')
- call add_default ('DNIFZM', 1, ' ')
- call add_default ('DNLFZM', 1, ' ')
- call add_default ('WUZM', 1, ' ')
- call add_default ('QRAINZM', 1, ' ')
- call add_default ('QSNOWZM', 1, ' ')
- call add_default ('CRAINNUM', 1, ' ')
- call add_default ('CSNOWNUM', 1, ' ')
- call add_default ('QNLZM', 1, ' ')
- call add_default ('QNIZM', 1, ' ')
- call add_default ('QNRZM', 1, ' ')
- call add_default ('QNSZM', 1, ' ')
- call add_default ('FRZZM', 1, ' ')
-
- ! Initialization for the microphysics
-
- call zm_mphyi()
-
- ! Initialize the aerosol object with data from the modes/species
- ! affecting climate,
- ! i.e., the list index is hardcoded to 0.
-
- call rad_cnst_get_info(0, nmodes=nmodes, naero=nbulk)
-
-
- do i = begchunk, endchunk
- call zm_aero_init(nmodes, nbulk, aero(i))
- end do
-
- if (nmodes > 0) then
-
- dgnum_idx = pbuf_get_index('DGNUM')
-
- else if (nbulk > 0 .and. cam_physpkg_is('cam4')) then
-
- ! This call is needed to allow running the ZM microphysics with the
- ! cam4 physics package.
- call ndrop_bam_init()
-
- end if
-
- end subroutine zm_conv_micro_init
-
-
- subroutine zm_aero_init(nmodes, nbulk, aero)
-
- use pmgrid, only: plev,plevp
-
- ! Initialize the zm_aero_t object for modal aerosols
-
- integer, intent(in) :: nmodes
- integer, intent(in) :: nbulk
- type(zm_aero_t), intent(out) :: aero
-
- integer :: iaer, l, m
- integer :: nspecmx ! max number of species in a mode
-
- character(len=20), allocatable :: aername(:)
- character(len=32) :: str32
- character(len=*), parameter :: routine = 'zm_conv_init'
-
- real(r8) :: sigmag, dgnumlo, dgnumhi
- real(r8) :: alnsg
- !----------------------------------------------------------------------------------
-
- aero%nmodes = nmodes
- aero%nbulk = nbulk
-
- if (nmodes > 0) then
-
- ! Initialize the modal aerosol information
-
- aero%scheme = 'modal'
-
- ! Get number of species in each mode, and find max.
- allocate(aero%nspec(aero%nmodes))
- nspecmx = 0
- do m = 1, aero%nmodes
-
- call rad_cnst_get_info(0, m, nspec=aero%nspec(m), mode_type=str32)
-
- nspecmx = max(nspecmx, aero%nspec(m))
-
- ! save mode index for specified mode types
- select case (trim(str32))
- case ('accum')
- aero%mode_accum_idx = m
- case ('aitken')
- aero%mode_aitken_idx = m
- case ('coarse')
- aero%mode_coarse_idx = m
- end select
-
- end do
-
- ! Check that required mode types were found
- if (aero%mode_accum_idx == -1 .or. aero%mode_aitken_idx == -1 .or. aero%mode_coarse_idx == -1) then
- write(iulog,*) routine//': ERROR required mode type not found - mode idx:', &
- aero%mode_accum_idx, aero%mode_aitken_idx, aero%mode_coarse_idx
- call endrun(routine//': ERROR required mode type not found')
- end if
-
- ! find indices for the dust and seasalt species in the coarse mode
- do l = 1, aero%nspec(aero%mode_coarse_idx)
- call rad_cnst_get_info(0, aero%mode_coarse_idx, l, spec_type=str32)
- select case (trim(str32))
- case ('dust')
- aero%coarse_dust_idx = l
- case ('seasalt')
- aero%coarse_nacl_idx = l
- end select
- end do
- ! Check that required modal specie types were found
- if (aero%coarse_dust_idx == -1 .or. aero%coarse_nacl_idx == -1) then
- write(iulog,*) routine//': ERROR required mode-species type not found - indicies:', &
- aero%coarse_dust_idx, aero%coarse_nacl_idx
- call endrun(routine//': ERROR required mode-species type not found')
- end if
-
- allocate( &
- aero%num_a(nmodes), &
- aero%mmr_a(nspecmx,nmodes), &
- aero%numg_a(pcols,pver,nmodes), &
- aero%mmrg_a(pcols,pver,nspecmx,nmodes), &
- aero%voltonumblo(nmodes), &
- aero%voltonumbhi(nmodes), &
- aero%specdens(nspecmx,nmodes), &
- aero%spechygro(nspecmx,nmodes), &
- aero%dgnum(nmodes), &
- aero%dgnumg(pcols,pver,nmodes) )
-
-
- do m = 1, nmodes
-
- ! Properties of modes
- call rad_cnst_get_mode_props(0, m, &
- sigmag=sigmag, dgnumlo=dgnumlo, dgnumhi=dgnumhi)
-
- alnsg = log(sigmag)
- aero%voltonumblo(m) = 1._r8 / ( (pi/6._r8)*(dgnumlo**3._r8)*exp(4.5_r8*alnsg**2._r8) )
- aero%voltonumbhi(m) = 1._r8 / ( (pi/6._r8)*(dgnumhi**3._r8)*exp(4.5_r8*alnsg**2._r8) )
-
- ! save sigmag of aitken mode
- if (m == aero%mode_aitken_idx) aero%sigmag_aitken = sigmag
-
- ! Properties of modal species
- do l = 1, aero%nspec(m)
- call rad_cnst_get_aer_props(0, m, l, density_aer=aero%specdens(l,m), &
- hygro_aer=aero%spechygro(l,m))
- end do
- end do
-
- else if (nbulk > 0) then
-
- aero%scheme = 'bulk'
-
- ! Props needed for BAM number concentration calcs.
- allocate( &
- aername(nbulk), &
- aero%num_to_mass_aer(nbulk), &
- aero%mmr_bulk(nbulk), &
- aero%mmrg_bulk(pcols,plev,nbulk) )
-
- do iaer = 1, aero%nbulk
- call rad_cnst_get_aer_props(0, iaer, &
- aername = aername(iaer), &
- num_to_mass_aer = aero%num_to_mass_aer(iaer) )
-
- ! Look for sulfate aerosol in this list (Bulk aerosol only)
- if (trim(aername(iaer)) == 'SULFATE') aero%idxsul = iaer
- if (trim(aername(iaer)) == 'DUST1') aero%idxdst1 = iaer
- if (trim(aername(iaer)) == 'DUST2') aero%idxdst2 = iaer
- if (trim(aername(iaer)) == 'DUST3') aero%idxdst3 = iaer
- if (trim(aername(iaer)) == 'DUST4') aero%idxdst4 = iaer
- if (trim(aername(iaer)) == 'BCPHI') aero%idxbcphi = iaer
- end do
-
- end if
-
- end subroutine zm_aero_init
-
- subroutine zm_conv_micro_outfld(conv, dnif, dnlf, lchnk, ncol)
-
- use cam_history, only: outfld
-
- type(zm_conv_t),intent(in) :: conv
- real(r8), intent(in) :: dnlf(:,:) ! detrained convective cloud water num concen.
- real(r8), intent(in) :: dnif(:,:) ! detrained convective cloud ice num concen.
- integer, intent(in) :: lchnk
- integer, intent(in) :: ncol
-
- integer :: i,k
-
- real(r8) :: cice_snum(pcols,pver) ! convective cloud ice sample number.
- real(r8) :: cliq_snum(pcols,pver) ! convective cloud liquid sample number.
- real(r8) :: crain_snum(pcols,pver) ! convective rain water sample number.
- real(r8) :: csnow_snum(pcols,pver) ! convective snow sample number.
- real(r8) :: wu_snum(pcols,pver) ! vertical velocity sample number
-
- real(r8) :: qni_snum(pcols,pver) ! convective cloud ice number sample number.
- real(r8) :: qnl_snum(pcols,pver) ! convective cloud liquid number sample number.
-
- do k = 1,pver
- do i = 1,ncol
- if (conv%qice(i,k) .gt. 0.0_r8) then
- cice_snum(i,k) = 1.0_r8
- else
- cice_snum(i,k) = 0.0_r8
- end if
- if (conv%qliq(i,k) .gt. 0.0_r8) then
- cliq_snum(i,k) = 1.0_r8
- else
- cliq_snum(i,k) = 0.0_r8
- end if
- if (conv%qsnow(i,k) .gt. 0.0_r8) then
- csnow_snum(i,k) = 1.0_r8
- else
- csnow_snum(i,k) = 0.0_r8
- end if
- if (conv%qrain(i,k) .gt. 0.0_r8) then
- crain_snum(i,k) = 1.0_r8
- else
- crain_snum(i,k) = 0.0_r8
- end if
-
- if (conv%qnl(i,k) .gt. 0.0_r8) then
- qnl_snum(i,k) = 1.0_r8
- else
- qnl_snum(i,k) = 0.0_r8
- end if
- if (conv%qni(i,k) .gt. 0.0_r8) then
- qni_snum(i,k) = 1.0_r8
- else
- qni_snum(i,k) = 0.0_r8
- end if
- if (conv%wu(i,k) .gt. 0.0_r8) then
- wu_snum(i,k) = 1.0_r8
- else
- wu_snum(i,k) = 0.0_r8
- end if
-
- end do
- end do
-
- call outfld('ICIMRDP ',conv%qi ,pcols, lchnk )
- call outfld('CLDLIQZM',conv%qliq ,pcols, lchnk)
- call outfld('CLDICEZM',conv%qice ,pcols, lchnk)
- call outfld('CLIQSNUM',cliq_snum ,pcols, lchnk)
- call outfld('CICESNUM',cice_snum ,pcols, lchnk)
- call outfld('QRAINZM' ,conv%qrain ,pcols, lchnk)
- call outfld('QSNOWZM' ,conv%qsnow ,pcols, lchnk)
- call outfld('CRAINNUM',crain_snum ,pcols, lchnk)
- call outfld('CSNOWNUM',csnow_snum ,pcols, lchnk)
-
- call outfld('WUZM' ,conv%wu ,pcols, lchnk)
- call outfld('WUZMSNUM',wu_snum ,pcols, lchnk)
- call outfld('QNLZM' ,conv%qnl ,pcols, lchnk)
- call outfld('QNIZM' ,conv%qni ,pcols, lchnk)
- call outfld('QNRZM' ,conv%qnr ,pcols, lchnk)
- call outfld('QNSZM' ,conv%qns ,pcols, lchnk)
- call outfld('FRZZM' ,conv%frz ,pcols, lchnk)
-
- call outfld('AUTOL_M' ,conv%autolm ,pcols, lchnk)
- call outfld('ACCRL_M' ,conv%accrlm ,pcols, lchnk)
- call outfld('BERGN_M' ,conv%bergnm ,pcols, lchnk)
- call outfld('FHTIM_M' ,conv%fhtimm ,pcols, lchnk)
- call outfld('FHTCT_M' ,conv%fhtctm ,pcols, lchnk)
- call outfld('FHML_M' ,conv%fhmlm ,pcols, lchnk)
- call outfld('HMPI_M' ,conv%hmpim ,pcols, lchnk)
- call outfld('ACCSL_M' ,conv%accslm ,pcols, lchnk)
- call outfld('DLF_M' ,conv%dlfm ,pcols, lchnk)
-
- call outfld('AUTOL_N' ,conv%autoln ,pcols, lchnk)
- call outfld('ACCRL_N' ,conv%accrln ,pcols, lchnk)
- call outfld('BERGN_N' ,conv%bergnn ,pcols, lchnk)
- call outfld('FHTIM_N' ,conv%fhtimn ,pcols, lchnk)
- call outfld('FHTCT_N' ,conv%fhtctn ,pcols, lchnk)
- call outfld('FHML_N' ,conv%fhmln ,pcols, lchnk)
- call outfld('ACCSL_N' ,conv%accsln ,pcols, lchnk)
- call outfld('ACTIV_N' ,conv%activn ,pcols, lchnk)
- call outfld('DLF_N' ,conv%dlfn ,pcols, lchnk)
- call outfld('AUTOI_M' ,conv%autoim ,pcols, lchnk)
- call outfld('ACCSI_M' ,conv%accsim ,pcols, lchnk)
- call outfld('DIF_M' ,conv%difm ,pcols, lchnk)
- call outfld('NUCLI_N' ,conv%nuclin ,pcols, lchnk)
- call outfld('AUTOI_N' ,conv%autoin ,pcols, lchnk)
- call outfld('ACCSI_N' ,conv%accsin ,pcols, lchnk)
- call outfld('HMPI_N' ,conv%hmpin ,pcols, lchnk)
- call outfld('DIF_N' ,conv%difn ,pcols, lchnk)
- call outfld('COND_M' ,conv%cmel ,pcols, lchnk)
- call outfld('DEPOS_M' ,conv%cmei ,pcols, lchnk)
-
- call outfld('TRSPC_M' ,conv%trspcm ,pcols, lchnk)
- call outfld('TRSPC_N' ,conv%trspcn ,pcols, lchnk)
- call outfld('TRSPI_M' ,conv%trspim ,pcols, lchnk)
- call outfld('TRSPI_N' ,conv%trspin ,pcols, lchnk)
- call outfld('DNIFZM' ,dnif ,pcols, lchnk)
- call outfld('DNLFZM' ,dnlf ,pcols, lchnk)
-
- end subroutine zm_conv_micro_outfld
end module zm_conv_intr
diff --git a/src/physics/cam/zm_microphysics.F90 b/src/physics/cam/zm_microphysics.F90
deleted file mode 100644
index b54e1e684e..0000000000
--- a/src/physics/cam/zm_microphysics.F90
+++ /dev/null
@@ -1,2455 +0,0 @@
-module zm_microphysics
-
-!---------------------------------------------------------------------------------
-! Purpose:
-! CAM Interface for cumulus microphysics
-!
-! Author: Xialiang Song and Guang Jun Zhang, June 2010
-!---------------------------------------------------------------------------------
-
-use shr_kind_mod, only: r8=>shr_kind_r8
-use spmd_utils, only: masterproc
-use ppgrid, only: pcols, pver, pverp
-use physconst, only: gravit, rair, tmelt, cpair, rh2o, r_universal, mwh2o, rhoh2o
-use physconst, only: latvap, latice
-!use activate_drop_mam, only: actdrop_mam_calc
-use ndrop, only: activate_aerosol
-use ndrop_bam, only: ndrop_bam_run
-use nucleate_ice, only: nucleati
-use shr_spfn_mod, only: erf => shr_spfn_erf
-use shr_spfn_mod, only: gamma => shr_spfn_gamma
-use wv_saturation, only: svp_water, svp_ice
-use cam_logfile, only: iulog
-use cam_abortutils, only: endrun
-use micro_pumas_utils, only:ice_autoconversion, snow_self_aggregation, accrete_cloud_water_snow, &
- secondary_ice_production, accrete_rain_snow, heterogeneous_rain_freezing, &
- accrete_cloud_water_rain, self_collection_rain, accrete_cloud_ice_snow
-use microp_aero, only: aerosol_properties_object
-use aerosol_properties_mod, only: aerosol_properties
-
-implicit none
-private
-save
-
-public :: &
- zm_mphyi, &
- zm_mphy, &
- zm_conv_t,&
- zm_aero_t
-
-! Private module data
-
-! constants remaped
-real(r8) :: g ! gravity
-real(r8) :: mw ! molecular weight of water
-real(r8) :: r ! Dry air Gas constant
-real(r8) :: rv ! water vapor gas contstant
-real(r8) :: rr ! universal gas constant
-real(r8) :: cpp ! specific heat of dry air
-real(r8) :: rhow ! density of liquid water
-real(r8) :: xlf ! latent heat of freezing
-
-!from 'microconstants'
-real(r8) :: rhosn ! bulk density snow
-real(r8) :: rhoi ! bulk density ice
-
-real(r8) :: ac,bc,as,bs,ai,bi,ar,br !fall speed parameters
-real(r8) :: ci,di !ice mass-diameter relation parameters
-real(r8) :: cs,ds !snow mass-diameter relation parameters
-real(r8) :: cr,dr !drop mass-diameter relation parameters
-real(r8) :: Eii !collection efficiency aggregation of ice
-real(r8) :: Ecc !collection efficiency
-real(r8) :: Ecr !collection efficiency cloud droplets/rain
-real(r8) :: DCS !autoconversion size threshold
-real(r8) :: bimm,aimm !immersion freezing
-real(r8) :: rhosu !typical 850mn air density
-real(r8) :: mi0 ! new crystal mass
-real(r8) :: rin ! radius of contact nuclei
-real(r8) :: pi ! pi
-
-! contact freezing due to dust
-! dust number mean radius (m), Zender et al JGR 2003 assuming number mode radius of 0.6 micron, sigma=2
-real(r8), parameter :: rn_dst1 = 0.258e-6_r8
-real(r8), parameter :: rn_dst2 = 0.717e-6_r8
-real(r8), parameter :: rn_dst3 = 1.576e-6_r8
-real(r8), parameter :: rn_dst4 = 3.026e-6_r8
-
-! smallest mixing ratio considered in microphysics
-real(r8), parameter :: qsmall = 1.e-18_r8
-
-
-type, public :: ptr2d
- real(r8), pointer :: val(:,:)
-end type ptr2d
-
-! Aerosols
-type :: zm_aero_t
-
- ! Aerosol treatment
- character(len=5) :: scheme ! either 'bulk' or 'modal'
-
- ! Bulk aerosols
- integer :: nbulk = 0 ! number of bulk aerosols affecting climate
- integer :: idxsul = -1 ! index in aerosol list for sulfate
- integer :: idxdst1 = -1 ! index in aerosol list for dust1
- integer :: idxdst2 = -1 ! index in aerosol list for dust2
- integer :: idxdst3 = -1 ! index in aerosol list for dust3
- integer :: idxdst4 = -1 ! index in aerosol list for dust4
- integer :: idxbcphi = -1 ! index in aerosol list for Soot (BCPHI)
-
- real(r8), allocatable :: num_to_mass_aer(:) ! conversion of mmr to number conc for bulk aerosols
- type(ptr2d), allocatable :: mmr_bulk(:) ! array of pointers to bulk aerosol mmr
- real(r8), allocatable :: mmrg_bulk(:,:,:) ! gathered bulk aerosol mmr
-
- ! Modal aerosols
- integer :: nmodes = 0 ! number of modes
- integer, allocatable :: nspec(:) ! number of species in each mode
- type(ptr2d), allocatable :: num_a(:) ! number mixing ratio of modes (interstitial phase)
- type(ptr2d), allocatable :: mmr_a(:,:) ! species mmr in each mode (interstitial phase)
- real(r8), allocatable :: numg_a(:,:,:) ! gathered number mixing ratio of modes (interstitial phase)
- real(r8), allocatable :: mmrg_a(:,:,:,:) ! gathered species mmr in each mode (interstitial phase)
- real(r8), allocatable :: voltonumblo(:) ! volume to number conversion (lower bound) for each mode
- real(r8), allocatable :: voltonumbhi(:) ! volume to number conversion (upper bound) for each mode
- real(r8), allocatable :: specdens(:,:) ! density of modal species
- real(r8), allocatable :: spechygro(:,:) ! hygroscopicity of modal species
-
- integer :: mode_accum_idx = -1 ! index of accumulation mode
- integer :: mode_aitken_idx = -1 ! index of aitken mode
- integer :: mode_coarse_idx = -1 ! index of coarse mode
- integer :: coarse_dust_idx = -1 ! index of dust in coarse mode
- integer :: coarse_nacl_idx = -1 ! index of nacl in coarse mode
-
- type(ptr2d), allocatable :: dgnum(:) ! mode dry radius
- real(r8), allocatable :: dgnumg(:,:,:) ! gathered mode dry radius
-
- real(r8) :: sigmag_aitken
-
-end type zm_aero_t
-
-type :: zm_conv_t
-
- real(r8), allocatable :: qi(:,:) ! wg grid slice of cloud ice.
- real(r8), allocatable :: qliq(:,:) ! convective cloud liquid water.
- real(r8), allocatable :: qice(:,:) ! convective cloud ice.
- real(r8), allocatable :: wu(:,:) ! vertical velocity
- real(r8), allocatable :: sprd(:,:) ! rate of production of snow at that layer
- real(r8), allocatable :: qrain(:,:) ! convective rain water.
- real(r8), allocatable :: qsnow(:,:) ! convective snow.
- real(r8), allocatable :: qnl(:,:) ! convective cloud liquid water num concen.
- real(r8), allocatable :: qni(:,:) ! convective cloud ice num concen.
- real(r8), allocatable :: qnr(:,:) ! convective rain water num concen.
- real(r8), allocatable :: qns(:,:) ! convective snow num concen.
- real(r8), allocatable :: frz(:,:) ! heating rate due to freezing
- real(r8), allocatable :: autolm(:,:) !mass tendency due to autoconversion of droplets to rain
- real(r8), allocatable :: accrlm(:,:) !mass tendency due to accretion of droplets by rain
- real(r8), allocatable :: bergnm(:,:) !mass tendency due to Bergeron process
- real(r8), allocatable :: fhtimm(:,:) !mass tendency due to immersion freezing
- real(r8), allocatable :: fhtctm(:,:) !mass tendency due to contact freezing
- real(r8), allocatable :: fhmlm (:,:) !mass tendency due to homogeneous freezing
- real(r8), allocatable :: hmpim (:,:) !mass tendency due to HM process
- real(r8), allocatable :: accslm(:,:) !mass tendency due to accretion of droplets by snow
- real(r8), allocatable :: dlfm (:,:) !mass tendency due to detrainment of droplet
- real(r8), allocatable :: autoln(:,:) !num tendency due to autoconversion of droplets to rain
- real(r8), allocatable :: accrln(:,:) !num tendency due to accretion of droplets by rain
- real(r8), allocatable :: bergnn(:,:) !num tendency due to Bergeron process
- real(r8), allocatable :: fhtimn(:,:) !num tendency due to immersion freezing
- real(r8), allocatable :: fhtctn(:,:) !num tendency due to contact freezing
- real(r8), allocatable :: fhmln (:,:) !num tendency due to homogeneous freezing
- real(r8), allocatable :: accsln(:,:) !num tendency due to accretion of droplets by snow
- real(r8), allocatable :: activn(:,:) !num tendency due to droplets activation
- real(r8), allocatable :: dlfn (:,:) !num tendency due to detrainment of droplet
- real(r8), allocatable :: autoim(:,:) !mass tendency due to autoconversion of cloud ice to snow
- real(r8), allocatable :: accsim(:,:) !mass tendency due to accretion of cloud ice by snow
- real(r8), allocatable :: difm (:,:) !mass tendency due to detrainment of cloud ice
- real(r8), allocatable :: nuclin(:,:) !num tendency due to ice nucleation
- real(r8), allocatable :: autoin(:,:) !num tendency due to autoconversion of cloud ice to snow
- real(r8), allocatable :: accsin(:,:) !num tendency due to accretion of cloud ice by snow
- real(r8), allocatable :: hmpin (:,:) !num tendency due to HM process
- real(r8), allocatable :: difn (:,:) !num tendency due to detrainment of cloud ice
- real(r8), allocatable :: cmel (:,:) !mass tendency due to condensation
- real(r8), allocatable :: cmei (:,:) !mass tendency due to deposition
- real(r8), allocatable :: trspcm(:,:) !LWC tendency due to convective transport
- real(r8), allocatable :: trspcn(:,:) !droplet num tendency due to convective transport
- real(r8), allocatable :: trspim(:,:) !IWC tendency due to convective transport
- real(r8), allocatable :: trspin(:,:) !ice crystal num tendency due to convective transport
- real(r8), allocatable :: dcape(:) ! CAPE change due to freezing heating
- real(r8), allocatable :: lambdadpcu(:,:)! slope of cloud liquid size distr
- real(r8), allocatable :: mudpcu(:,:) ! width parameter of droplet size distr
- real(r8), allocatable :: di(:,:)
- real(r8), allocatable :: dnl(:,:)
- real(r8), allocatable :: dni(:,:)
- real(r8), allocatable :: qide(:,:) ! cloud ice mixing ratio for detrainment (kg/kg)
- real(r8), allocatable :: qncde(:,:) ! cloud water number concentration for detrainment (1/kg)
- real(r8), allocatable :: qnide(:,:) ! cloud ice number concentration for detrainment (1/kg)
-
-
-end type zm_conv_t
-
-real(r8), parameter :: dcon = 25.e-6_r8
-real(r8), parameter :: mucon = 5.3_r8
-real(r8), parameter :: lambdadpcu = (mucon + 1._r8)/dcon
-
-!===============================================================================
-contains
-!===============================================================================
-
-subroutine zm_mphyi
-
-!-----------------------------------------------------------------------
-!
-! Purpose:
-! initialize constants for the cumulus microphysics
-! called from zm_conv_init() in zm_conv_intr.F90
-!
-! Author: Xialiang Song, June 2010
-!
-!-----------------------------------------------------------------------
-
-!NOTE:
-! latent heats should probably be fixed with temperature
-! for energy conservation with the rest of the model
-! (this looks like a +/- 3 or 4% effect, but will mess up energy balance)
-
- xlf = latice ! latent heat freezing
-
-! from microconstants
-
-! parameters below from Reisner et al. (1998)
-! density parameters (kg/m3)
-
- rhosn = 100._r8 ! bulk density snow
- rhoi = 500._r8 ! bulk density ice
- rhow = 1000._r8 ! bulk density liquid
-
-! fall speed parameters, V = aD^b
-! V is in m/s
-
-! droplets
- ac = 3.e7_r8
- bc = 2._r8
-
-! snow
- as = 11.72_r8
- bs = 0.41_r8
-
-! cloud ice
- ai = 700._r8
- bi = 1._r8
-
-! rain
- ar = 841.99667_r8
- br = 0.8_r8
-
-! particle mass-diameter relationship
-! currently we assume spherical particles for cloud ice/snow
-! m = cD^d
-
- pi= 3.14159265358979323846_r8
-
-! cloud ice mass-diameter relationship
-
- ci = rhoi*pi/6._r8
- di = 3._r8
-
-! snow mass-diameter relationship
-
- cs = rhosn*pi/6._r8
- ds = 3._r8
-
-! drop mass-diameter relationship
-
- cr = rhow*pi/6._r8
- dr = 3._r8
-
-! collection efficiency, aggregation of cloud ice and snow
-
- Eii = 0.1_r8
-
-! collection efficiency, accretion of cloud water by rain
-
- Ecr = 1.0_r8
-
-! autoconversion size threshold for cloud ice to snow (m)
-
- Dcs = 150.e-6_r8
-! immersion freezing parameters, bigg 1953
-
- bimm = 100._r8
- aimm = 0.66_r8
-
-! typical air density at 850 mb
-
- rhosu = 85000._r8/(rair * tmelt)
-
-! mass of new crystal due to aerosol freezing and growth (kg)
-
- mi0 = 4._r8/3._r8*pi*rhoi*(10.e-6_r8)*(10.e-6_r8)*(10.e-6_r8)
-
-! radius of contact nuclei aerosol (m)
-
- rin = 0.1e-6_r8
-
-end subroutine zm_mphyi
-
-!===============================================================================
-
-subroutine zm_mphy(su, qu, mu, du, eu, cmel, cmei, zf, pm, te, qe, &
- eps0, jb, jt, jlcl, msg, il2g, grav, cp, rd, aero, gamhat, &
- qc, qi, nc, ni, qcde, qide, ncde, nide, rprd, sprd, frz, &
- wu, qr, qni, nr, ns, autolm, accrlm, bergnm, fhtimm, fhtctm, &
- fhmlm, hmpim, accslm, dlfm, autoln, accrln, bergnn, fhtimn, fhtctn, &
- fhmln, accsln, activn, dlfn, autoim, accsim, difm, nuclin, autoin, &
- accsin, hmpin, difn, trspcm, trspcn, trspim, trspin, lamc, pgam )
-
-
-! Purpose:
-! microphysic parameterization for Zhang-McFarlane convection scheme
-! called from cldprp() in zm_conv.F90
-!
-! Author: Xialiang Song, June 2010
-
- use time_manager, only: get_step_size
-
-! variable declarations
-
- implicit none
-
-! input variables
- real(r8), intent(in) :: su(pcols,pver) ! normalized dry stat energy of updraft
- real(r8), intent(in) :: qu(pcols,pver) ! spec hum of updraft
- real(r8), intent(in) :: mu(pcols,pver) ! updraft mass flux
- real(r8), intent(in) :: du(pcols,pver) ! detrainement rate of updraft
- real(r8), intent(in) :: eu(pcols,pver) ! entrainment rate of updraft
- real(r8), intent(in) :: cmel(pcols,pver) ! condensation rate of updraft
- real(r8), intent(in) :: cmei(pcols,pver) ! condensation rate of updraft
- real(r8), intent(in) :: zf(pcols,pverp) ! height of interfaces
- real(r8), intent(in) :: pm(pcols,pver) ! pressure of env
- real(r8), intent(in) :: te(pcols,pver) ! temp of env
- real(r8), intent(in) :: qe(pcols,pver) ! spec. humidity of env
- real(r8), intent(in) :: eps0(pcols)
- real(r8), intent(in) :: gamhat(pcols,pver) ! gamma=L/cp(dq*/dT) at interface
-
- integer, intent(in) :: jb(pcols) ! updraft base level
- integer, intent(in) :: jt(pcols) ! updraft plume top
- integer, intent(in) :: jlcl(pcols) ! updraft lifting cond level
- integer, intent(in) :: msg ! missing moisture vals
- integer, intent(in) :: il2g ! number of columns in gathered arrays
-
- type(zm_aero_t), intent(in) :: aero ! aerosol object
-
- real(r8) grav ! gravity
- real(r8) cp ! heat capacity of dry air
- real(r8) rd ! gas constant for dry air
-
-! output variables
- real(r8), intent(out) :: qc(pcols,pver) ! cloud water mixing ratio (kg/kg)
- real(r8), intent(out) :: qi(pcols,pver) ! cloud ice mixing ratio (kg/kg)
- real(r8), intent(out) :: nc(pcols,pver) ! cloud water number conc (1/kg)
- real(r8), intent(out) :: ni(pcols,pver) ! cloud ice number conc (1/kg)
- real(r8), intent(out) :: qcde(pcols,pver) ! cloud water mixing ratio for detrainment(kg/kg)
- real(r8), intent(out) :: qide(pcols,pver) ! cloud ice mixing ratio for detrainment (kg/kg)
- real(r8), intent(out) :: ncde(pcols,pver) ! cloud water number conc for detrainment (1/kg)
- real(r8), intent(out) :: nide(pcols,pver) ! cloud ice number conc for detrainment (1/kg)
- real(r8), intent(out) :: wu(pcols,pver)
- real(r8), intent(out) :: qni(pcols,pver) ! snow mixing ratio
- real(r8), intent(out) :: qr(pcols,pver) ! rain mixing ratio
- real(r8), intent(out) :: ns(pcols,pver) ! snow number conc
- real(r8), intent(out) :: nr(pcols,pver) ! rain number conc
- real(r8), intent(out) :: rprd(pcols,pver) ! rate of production of precip at that layer
- real(r8), intent(out) :: sprd(pcols,pver) ! rate of production of snow at that layer
- real(r8), intent(out) :: frz(pcols,pver) ! rate of freezing
-
-
- real(r8), intent(inout) :: lamc(pcols,pver) ! slope of cloud liquid size distr
- real(r8), intent(inout) :: pgam(pcols,pver) ! spectral width parameter of droplet size distr
-
-! tendency for output
- real(r8),intent(out) :: autolm(pcols,pver) !mass tendency due to autoconversion of droplets to rain
- real(r8),intent(out) :: accrlm(pcols,pver) !mass tendency due to accretion of droplets by rain
- real(r8),intent(out) :: bergnm(pcols,pver) !mass tendency due to Bergeron process
- real(r8),intent(out) :: fhtimm(pcols,pver) !mass tendency due to immersion freezing
- real(r8),intent(out) :: fhtctm(pcols,pver) !mass tendency due to contact freezing
- real(r8),intent(out) :: fhmlm (pcols,pver) !mass tendency due to homogeneous freezing
- real(r8),intent(out) :: hmpim (pcols,pver) !mass tendency due to HM process
- real(r8),intent(out) :: accslm(pcols,pver) !mass tendency due to accretion of droplets by snow
- real(r8),intent(out) :: dlfm (pcols,pver) !mass tendency due to detrainment of droplet
- real(r8),intent(out) :: trspcm(pcols,pver) !mass tendency of droplets due to convective transport
-
- real(r8),intent(out) :: autoln(pcols,pver) !num tendency due to autoconversion of droplets to rain
- real(r8),intent(out) :: accrln(pcols,pver) !num tendency due to accretion of droplets by rain
- real(r8),intent(out) :: bergnn(pcols,pver) !num tendency due to Bergeron process
- real(r8),intent(out) :: fhtimn(pcols,pver) !num tendency due to immersion freezing
- real(r8),intent(out) :: fhtctn(pcols,pver) !num tendency due to contact freezing
- real(r8),intent(out) :: fhmln (pcols,pver) !num tendency due to homogeneous freezing
- real(r8),intent(out) :: accsln(pcols,pver) !num tendency due to accretion of droplets by snow
- real(r8),intent(out) :: activn(pcols,pver) !num tendency due to droplets activation
- real(r8),intent(out) :: dlfn (pcols,pver) !num tendency due to detrainment of droplet
- real(r8),intent(out) :: trspcn(pcols,pver) !num tendency of droplets due to convective transport
-
- real(r8),intent(out) :: autoim(pcols,pver) !mass tendency due to autoconversion of cloud ice to snow
- real(r8),intent(out) :: accsim(pcols,pver) !mass tendency due to accretion of cloud ice by snow
- real(r8),intent(out) :: difm (pcols,pver) !mass tendency due to detrainment of cloud ice
- real(r8),intent(out) :: trspim(pcols,pver) !mass tendency of ice crystal due to convective transport
-
- real(r8),intent(out) :: nuclin(pcols,pver) !num tendency due to ice nucleation
- real(r8),intent(out) :: autoin(pcols,pver) !num tendency due to autoconversion of cloud ice to snow
- real(r8),intent(out) :: accsin(pcols,pver) !num tendency due to accretion of cloud ice by snow
- real(r8),intent(out) :: hmpin (pcols,pver) !num tendency due to HM process
- real(r8),intent(out) :: difn (pcols,pver) !num tendency due to detrainment of cloud ice
- real(r8),intent(out) :: trspin(pcols,pver) !num tendency of ice crystal due to convective transport
-
-!................................................................................
-! local workspace
-! all units mks unless otherwise stated
- real(r8) :: deltat ! time step (s)
- real(r8) :: omsm ! number near unity for round-off issues
- real(r8) :: dum ! temporary dummy variable
- real(r8) :: dum1 ! temporary dummy variable
- real(r8) :: dum2 ! temporary dummy variable
-
- real(r8) :: q(pcols,pver) ! water vapor mixing ratio (kg/kg)
- real(r8) :: t(pcols,pver) ! temperature (K)
- real(r8) :: rho(pcols,pver) ! air density (kg m-3)
- real(r8) :: dz(pcols,pver) ! height difference across model vertical level
-
- real(r8) :: qcic(pcols,pver) ! in-cloud cloud liquid mixing ratio
- real(r8) :: qiic(pcols,pver) ! in-cloud cloud ice mixing ratio
- real(r8) :: qniic(pcols,pver) ! in-precip snow mixing ratio
- real(r8) :: qric(pcols,pver) ! in-precip rain mixing ratio
- real(r8) :: ncic(pcols,pver) ! in-cloud droplet number conc
- real(r8) :: niic(pcols,pver) ! in-cloud cloud ice number conc
- real(r8) :: nsic(pcols,pver) ! in-precip snow number conc
- real(r8) :: nric(pcols,pver) ! in-precip rain number conc
-
- real(r8) :: lami(pver) ! slope of cloud ice size distr
- real(r8) :: n0i(pver) ! intercept of cloud ice size distr
- real(r8) :: n0c(pver) ! intercept of cloud liquid size distr
- real(r8) :: lams(pver) ! slope of snow size distr
- real(r8) :: n0s(pver) ! intercept of snow size distr
- real(r8) :: lamr(pver) ! slope of rain size distr
- real(r8) :: n0r(pver) ! intercept of rain size distr
- real(r8) :: cdist1(pver) ! size distr parameter to calculate droplet freezing
- real(r8) :: lammax ! maximum allowed slope of size distr
- real(r8) :: lammin ! minimum allowed slope of size distr
-
- real(r8) :: mnuccc(pver) ! mixing ratio tendency due to freezing of cloud water
- real(r8) :: nnuccc(pver) ! number conc tendency due to freezing of cloud water
- real(r8) :: mnucct(pver) ! mixing ratio tendency due to contact freezing of cloud water
- real(r8) :: nnucct(pver) ! number conc tendency due to contact freezing of cloud water
- real(r8) :: msacwi(pver) ! mixing ratio tendency due to HM ice multiplication
- real(r8) :: nsacwi(pver) ! number conc tendency due to HM ice multiplication
- real(r8) :: prf(pver) ! mixing ratio tendency due to fallout of rain
- real(r8) :: psf(pver) ! mixing ratio tendency due to fallout of snow
- real(r8) :: pnrf(pver) ! number conc tendency due to fallout of rain
- real(r8) :: pnsf(pver) ! number conc tendency due to fallout of snow
- real(r8) :: prc(pver) ! mixing ratio tendency due to autoconversion of cloud droplets
- real(r8) :: nprc(pver) ! number conc tendency due to autoconversion of cloud droplets
- real(r8) :: nprc1(pver) ! qr tendency due to autoconversion of cloud droplets
- real(r8) :: nsagg(pver) ! ns tendency due to self-aggregation of snow
- real(r8) :: dc0 ! mean size droplet size distr
- real(r8) :: ds0 ! mean size snow size distr (area weighted)
- real(r8) :: eci ! collection efficiency for riming of snow by droplets
- real(r8) :: dv(pcols,pver) ! diffusivity of water vapor in air
- real(r8) :: mua(pcols,pver) ! viscocity of air
- real(r8) :: psacws(pver) ! mixing rat tendency due to collection of droplets by snow
- real(r8) :: npsacws(pver) ! number conc tendency due to collection of droplets by snow
- real(r8) :: pracs(pver) ! mixing rat tendency due to collection of rain by snow
- real(r8) :: npracs(pver) ! number conc tendency due to collection of rain by snow
- real(r8) :: mnuccr(pver) ! mixing rat tendency due to freezing of rain
- real(r8) :: nnuccr(pver) ! number conc tendency due to freezing of rain
- real(r8) :: pra(pver) ! mixing rat tendnency due to accretion of droplets by rain
- real(r8) :: npra(pver) ! nc tendnency due to accretion of droplets by rain
- real(r8) :: nragg(pver) ! nr tendency due to self-collection of rain
- real(r8) :: prci(pver) ! mixing rat tendency due to autoconversion of cloud ice to snow
- real(r8) :: nprci(pver) ! number conc tendency due to autoconversion of cloud ice to snow
- real(r8) :: prai(pver) ! mixing rat tendency due to accretion of cloud ice by snow
- real(r8) :: nprai(pver) ! number conc tendency due to accretion of cloud ice by snow
- real(r8) :: prb(pver) ! rain mixing rat tendency due to Bergeron process
- real(r8) :: nprb(pver) ! number conc tendency due to Bergeron process
- real(r8) :: fhmrm (pcols,pver) !mass tendency due to homogeneous freezing of rain
-
-! fall speed
- real(r8) :: arn(pcols,pver) ! air density corrected rain fallspeed parameter
- real(r8) :: asn(pcols,pver) ! air density corrected snow fallspeed parameter
- real(r8) :: acn(pcols,pver) ! air density corrected cloud droplet fallspeed parameter
- real(r8) :: ain(pcols,pver) ! air density corrected cloud ice fallspeed parameter
- real(r8) :: uns(pver) ! number-weighted snow fallspeed
- real(r8) :: ums(pver) ! mass-weighted snow fallspeed
- real(r8) :: unr(pver) ! number-weighted rain fallspeed
- real(r8) :: umr(pver) ! mass-weighted rain fallspeed
-
-! conservation check
- real(r8) :: qce ! dummy qc for conservation check
- real(r8) :: qie ! dummy qi for conservation check
- real(r8) :: nce ! dummy nc for conservation check
- real(r8) :: nie ! dummy ni for conservation check
- real(r8) :: qre ! dummy qr for conservation check
- real(r8) :: nre ! dummy nr for conservation check
- real(r8) :: qnie ! dummy qni for conservation check
- real(r8) :: nse ! dummy ns for conservation check
- real(r8) :: ratio ! parameter for conservation check
-
-! sum of source/sink terms for cloud hydrometeor
- real(r8) :: qctend(pcols,pver) ! microphysical tendency qc (1/s)
- real(r8) :: qitend(pcols,pver) ! microphysical tendency qi (1/s)
- real(r8) :: nctend(pcols,pver) ! microphysical tendency nc (1/(kg*s))
- real(r8) :: nitend(pcols,pver) ! microphysical tendency ni (1/(kg*s))
- real(r8) :: qnitend(pcols,pver) ! snow mixing ratio source/sink term
- real(r8) :: nstend(pcols,pver) ! snow number concentration source/sink term
- real(r8) :: qrtend(pcols,pver) ! rain mixing ratio source/sink term
- real(r8) :: nrtend(pcols,pver) ! rain number concentration source/sink term
-
-! terms for Bergeron process
- real(r8) :: bergtsf !bergeron timescale to remove all liquid
- real(r8) :: plevap ! cloud liquid water evaporation rate
-
-! variables for droplet activation by modal aerosols
- real(r8) :: wmix, wmin, wmax, wdiab
- real(r8) :: vol, nlsrc
- real(r8), allocatable :: vaerosol(:), hygro(:), naermod(:)
- real(r8), allocatable :: fn(:) ! number fraction of aerosols activated
- real(r8), allocatable :: fm(:) ! mass fraction of aerosols activated
- real(r8), allocatable :: fluxn(:) ! flux of activated aerosol number fraction into cloud (cm/s)
- real(r8), allocatable :: fluxm(:) ! flux of activated aerosol mass fraction into cloud (cm/s)
- real(r8) :: flux_fullact ! flux of activated aerosol fraction assuming 100% activation (cm/s)
- real(r8) :: dmc
- real(r8) :: ssmc
- real(r8) :: dgnum_aitken
-
-! bulk aerosol variables
- real(r8), allocatable :: naer2(:,:,:) ! new aerosol number concentration (/m3)
- real(r8), allocatable :: naer2h(:,:,:) ! new aerosol number concentration (/m3)
- real(r8), allocatable :: maerosol(:) ! aerosol mass conc (kg/m3)
- real(r8) :: so4_num
- real(r8) :: soot_num
- real(r8) :: dst1_num
- real(r8) :: dst2_num
- real(r8) :: dst3_num
- real(r8) :: dst4_num
- real(r8) :: dst_num
-
-! droplet activation
- logical :: in_cloud ! true when above cloud base layer (k > jb)
- real(r8) :: smax_f ! droplet and rain size distr factor used in the
- ! in-cloud smax calculation
- real(r8) :: dum2l(pcols,pver) ! number conc of CCN (1/kg)
- real(r8) :: npccn(pver) ! droplet activation rate
- real(r8) :: ncmax
- real(r8) :: mtimec ! factor to account for droplet activation timescale
-
-! ice nucleation
- real(r8) :: dum2i(pcols,pver) ! number conc of ice nuclei available (1/kg)
- real(r8) :: qs(pcols,pver) ! liquid-ice weighted sat mixing rat (kg/kg)
- real(r8) :: es(pcols,pver) ! sat vapor press (pa) over water
- real(r8) :: relhum(pcols,pver) ! relative humidity
- real(r8) :: esi(pcols,pver) ! sat vapor press (pa) over ice
- real(r8) :: nnuccd(pver) ! ice nucleation rate from deposition/cond.-freezing
- real(r8) :: mnuccd(pver) ! mass tendency from ice nucleation
- real(r8) :: mtime ! factor to account for ice nucleation timescale
-
-! output for ice nucleation
- real(r8) :: nimey(pcols,pver) !number conc of ice nuclei due to meyers deposition (1/m3)
- real(r8) :: nihf(pcols,pver) !number conc of ice nuclei due to heterogenous freezing (1/m3)
- real(r8) :: nidep(pcols,pver) !number conc of ice nuclei due to deoposion nucleation (hetero nuc) (1/m3)
- real(r8) :: niimm(pcols,pver) !number conc of ice nuclei due to immersion freezing (hetero nuc) (1/m3)
-
- real(r8) :: wpice, weff, fhom ! unused dummies
-
-! loop array variables
- integer i,k, n, l
- integer ii,kk, m
-
-! loop variables for iteration solution
- integer iter,it,ltrue(pcols)
-
-! used in contact freezing via dust particles
- real(r8) tcnt, viscosity, mfp
- real(r8) slip1, slip2, slip3, slip4
- real(r8) dfaer1, dfaer2, dfaer3, dfaer4
- real(r8) nacon1,nacon2,nacon3,nacon4
-
-! used in immersion freezing via soot
- real(r8) ttend(pver)
- real(r8) naimm
- real(r8) :: ntaer(pcols,pver)
- real(r8) :: ntaerh(pcols,pver)
-
-! used in homogeneous freezing
- real(r8) :: fholm (pcols,pver) !mass tendency due to homogeneous freezing
- real(r8) :: fholn (pcols,pver) !number conc tendency due to homogeneous freezing
-
-! used in secondary ice production
- real(r8) ni_secp
-
-! used in vertical velocity calculation
- real(r8) th(pcols,pver)
- real(r8) qh(pcols,pver)
- real(r8) zkine(pcols,pver)
- real(r8) zbuo(pcols,pver)
- real(r8) zfacbuo, cwdrag, cwifrac, retv, zbuoc
- real(r8) zbc, zbe, zdkbuo, zdken
- real(r8) arcf(pcols,pver)
- real(r8) p(pcols,pver)
- real(r8) ph(pcols,pver)
-
-! used in vertical integreation
- logical qcimp(pver) ! true to solve qc with implicit formula
- logical ncimp(pver) ! true to solve nc with implicit formula
- logical qiimp(pver) ! true to solve qi with implicit formula
- logical niimp(pver) ! true to solve ni with implicit formula
-
-! tendency due to adjustment
- real(r8) :: ncadj(pcols,pver) !droplet num tendency due to adjustment
- real(r8) :: niadj(pcols,pver) !ice crystal num tendency due to adjustment
- real(r8) :: ncorg, niorg, total
-
- real(r8) :: rhoh(pcols,pver) ! air density (kg m-3) at interface
- real(r8) :: rhom(pcols,pver) ! air density (kg m-3) at mid-level
- real(r8) :: tu(pcols,pver) ! temperature in updraft (K)
-
- integer kqi(pcols),kqc(pcols)
- logical lcbase(pcols), libase(pcols)
-
- real(r8) :: nai_bcphi, nai_dst1, nai_dst2, nai_dst3, nai_dst4
-
- real(r8) flxrm, mvtrm, flxrn, mvtrn, flxsm, mvtsm, flxsn, mvtsn
- integer nlr, nls
-
- real(r8) rmean, beta6, beta66, r6, r6c
- real(r8) temp1, temp2, temp3, temp4 ! variable to store output which is not required by this routine
-
- class(aerosol_properties), pointer :: aero_props_obj => null()
-
-! Aerosol properties
- aero_props_obj => aerosol_properties_object()
-
-!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-! initialization
-!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-
- if (aero%scheme == 'modal') then
-
- allocate(vaerosol(aero%nmodes), hygro(aero%nmodes), naermod(aero%nmodes), &
- fn(aero%nmodes), fm(aero%nmodes), fluxn(aero%nmodes), fluxm(aero%nmodes))
-
- else if (aero%scheme == 'bulk') then
-
- allocate( &
- naer2(pcols,pver,aero%nbulk), &
- naer2h(pcols,pver,aero%nbulk), &
- maerosol(aero%nbulk))
-
- end if
-
- deltat= get_step_size() !for FV dynamical core
-
- ! parameters for scheme
- omsm=0.99999_r8
- zfacbuo = 0.5_r8/(1._r8+0.5_r8)
- cwdrag = 1.875_r8*0.506_r8
- cwifrac = 0.5_r8
- retv = 0.608_r8
- bergtsf = 1800._r8
-
- ! initialize multi-level fields
- do i=1,il2g
- do k=1,pver
- q(i,k) = qu(i,k)
- tu(i,k)= su(i,k) - grav/cp*zf(i,k)
- t(i,k) = su(i,k) - grav/cp*zf(i,k)
- p(i,k) = 100._r8*pm(i,k)
- wu(i,k) = 0._r8
- zkine(i,k)= 0._r8
- arcf(i,k) = 0._r8
- zbuo(i,k) = 0._r8
- nc(i,k) = 0._r8
- ni(i,k) = 0._r8
- qc(i,k) = 0._r8
- qi(i,k) = 0._r8
- ncde(i,k) = 0._r8
- nide(i,k) = 0._r8
- qcde(i,k) = 0._r8
- qide(i,k) = 0._r8
- rprd(i,k) = 0._r8
- sprd(i,k) = 0._r8
- frz(i,k) = 0._r8
- qcic(i,k) = 0._r8
- qiic(i,k) = 0._r8
- ncic(i,k) = 0._r8
- niic(i,k) = 0._r8
- qr(i,k) = 0._r8
- qni(i,k) = 0._r8
- nr(i,k) = 0._r8
- ns(i,k) = 0._r8
- qric(i,k) = 0._r8
- qniic(i,k) = 0._r8
- nric(i,k) = 0._r8
- nsic(i,k) = 0._r8
- nimey(i,k) = 0._r8
- nihf(i,k) = 0._r8
- nidep(i,k) = 0._r8
- niimm(i,k) = 0._r8
- fhmrm(i,k) = 0._r8
-
- autolm(i,k) = 0._r8
- accrlm(i,k) = 0._r8
- bergnm(i,k) = 0._r8
- fhtimm(i,k) = 0._r8
- fhtctm(i,k) = 0._r8
- fhmlm (i,k) = 0._r8
- fholm (i,k) = 0._r8
- hmpim (i,k) = 0._r8
- accslm(i,k) = 0._r8
- dlfm (i,k) = 0._r8
-
- autoln(i,k) = 0._r8
- accrln(i,k) = 0._r8
- bergnn(i,k) = 0._r8
- fhtimn(i,k) = 0._r8
- fhtctn(i,k) = 0._r8
- fhmln (i,k) = 0._r8
- fholn (i,k) = 0._r8
- accsln(i,k) = 0._r8
- activn(i,k) = 0._r8
- dlfn (i,k) = 0._r8
-
- autoim(i,k) = 0._r8
- accsim(i,k) = 0._r8
- difm (i,k) = 0._r8
-
- nuclin(i,k) = 0._r8
- autoin(i,k) = 0._r8
- accsin(i,k) = 0._r8
- hmpin (i,k) = 0._r8
- difn (i,k) = 0._r8
-
- trspcm(i,k) = 0._r8
- trspcn(i,k) = 0._r8
- trspim(i,k) = 0._r8
- trspin(i,k) = 0._r8
-
- ncadj (i,k) = 0._r8
- niadj (i,k) = 0._r8
- end do
- end do
-
- ! initialize time-varying parameters
- do k=1,pver
- do i=1,il2g
- if (k .eq.1) then
- rhoh(i,k) = p(i,k)/(t(i,k)*rd)
- rhom(i,k) = p(i,k)/(t(i,k)*rd)
- th (i,k) = te(i,k)
- qh (i,k) = qe(i,k)
- dz (i,k) = zf(i,k) - zf(i,k+1)
- ph(i,k) = p(i,k)
- else
- rhoh(i,k) = 0.5_r8*(p(i,k)+p(i,k-1))/(t(i,k)*rd)
- if (k .eq. pver) then
- rhom(i,k) = p(i,k)/(rd*t(i,k))
- else
- rhom(i,k) = 2.0_r8*p(i,k)/(rd*(t(i,k)+t(i,k+1)))
- end if
- th (i,k) = 0.5_r8*(te(i,k)+te(i,k-1))
- qh (i,k) = 0.5_r8*(qe(i,k)+qe(i,k-1))
- dz(i,k) = zf(i,k-1) - zf(i,k)
- ph(i,k) = 0.5_r8*(p(i,k) + p(i,k-1))
- end if
- dv(i,k) = 8.794E-5_r8*t(i,k)**1.81_r8/ph(i,k)
- mua(i,k) = 1.496E-6_r8*t(i,k)**1.5_r8/ &
- (t(i,k)+120._r8)
-
- rho(i,k) = rhoh(i,k)
-
- ! air density adjustment for fallspeed parameters
- ! add air density correction factor to the power of
- ! 0.54 following Heymsfield and Bansemer 2006
-
- arn(i,k)=ar*(rhosu/rho(i,k))**0.54_r8
- asn(i,k)=as*(rhosu/rho(i,k))**0.54_r8
- acn(i,k)=ac*(rhosu/rho(i,k))**0.54_r8
- ain(i,k)=ai*(rhosu/rho(i,k))**0.54_r8
-
- end do
- end do
-
- if (aero%scheme == 'modal') then
-
- wmix = 0._r8
- wmin = 0._r8
- wmax = 10._r8
- wdiab = 0._r8
-
- do k=1,pver
- do i=1,il2g
- dum2l(i,k)=0._r8
- dum2i(i,k)=0._r8
- ntaer(i,k) = 0.0_r8
- ntaerh(i,k) = 0.0_r8
- do m = 1, aero%nmodes
- ntaer(i,k) = ntaer(i,k) + aero%numg_a(i,k,m)*rhom(i,k)
- enddo
- end do
- end do
-
- else if (aero%scheme == 'bulk') then
-
- ! initialize aerosol number
- do k=1,pver
- do i=1,il2g
- naer2(i,k,:)=0._r8
- naer2h(i,k,:)=0._r8
- dum2l(i,k)=0._r8
- dum2i(i,k)=0._r8
- end do
- end do
-
- do k=1,pver
- do i=1,il2g
- ntaer(i,k) = 0.0_r8
- ntaerh(i,k) = 0.0_r8
- do m = 1, aero%nbulk
- maerosol(m) = aero%mmrg_bulk(i,k,m)*rhom(i,k)
-
- ! set number nucleated for sulfate based on Lohmann et al. 2000 (JGR) Eq.2
- ! Na=340.*(massSO4)^0.58 where Na=cm-3 and massSO4=ug/m3
- ! convert units to Na [m-3] and SO4 [kgm-3]
- ! Na(m-3)= 1.e6 cm3 m-3 Na(cm-3)=340. *(massSO4[kg/m3]*1.e9ug/kg)^0.58
- ! or Na(m-3)= 1.e6* 340.*(1.e9ug/kg)^0.58 * (massSO4[kg/m3])^0.58
-
- if (m .eq. aero%idxsul) then
- naer2(i,k,m)= 5.64259e13_r8 * maerosol(m)**0.58_r8
- else
- naer2(i,k,m)=maerosol(m)*aero%num_to_mass_aer(m)
- end if
- ntaer(i,k) = ntaer(i,k) + naer2(i,k,m)
- end do
- end do
- end do
-
- end if
-
- do i=1,il2g
- ltrue(i)=0
- do k=1,pver
- if (qc(i,k).ge.qsmall.or.qi(i,k).ge.qsmall.or.cmel(i,k).ge.qsmall.or.cmei(i,k).ge.qsmall) ltrue(i)=1
- end do
- end do
-
- ! skip microphysical calculations if no cloud water
- do i=1,il2g
- if (ltrue(i).eq.0) then
- do k=1,pver
- qctend(i,k)=0._r8
- qitend(i,k)=0._r8
- qnitend(i,k)=0._r8
- qrtend(i,k)=0._r8
- nctend(i,k)=0._r8
- nitend(i,k)=0._r8
- nrtend(i,k)=0._r8
- nstend(i,k)=0._r8
- qniic(i,k)=0._r8
- qric(i,k)=0._r8
- nsic(i,k)=0._r8
- nric(i,k)=0._r8
- qni(i,k)=0._r8
- qr(i,k)=0._r8
- ns(i,k)=0._r8
- nr(i,k)=0._r8
- qc(i,k) = 0._r8
- qi(i,k) = 0._r8
- nc(i,k) = 0._r8
- ni(i,k) = 0._r8
- qcde(i,k) = 0._r8
- qide(i,k) = 0._r8
- ncde(i,k) = 0._r8
- nide(i,k) = 0._r8
- rprd(i,k) = 0._r8
- sprd(i,k) = 0._r8
- frz(i,k) = 0._r8
- end do
- goto 300
- end if
-
- kqc(i) = 1
- kqi(i) = 1
- lcbase(i) = .true.
- libase(i) = .true.
-
- ! assign number of steps for iteration
- ! use 2 steps following Song and Zhang, 2011, J. Clim.
- iter = 2
-
- !cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
- ! iteration
- !cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-
- do it=1,iter
-
- ! initialize sub-step microphysical tendencies
- do k=1,pver
- qctend(i,k)=0._r8
- qitend(i,k)=0._r8
- qnitend(i,k)=0._r8
- qrtend(i,k)=0._r8
- nctend(i,k)=0._r8
- nitend(i,k)=0._r8
- nrtend(i,k)=0._r8
- nstend(i,k)=0._r8
- rprd(i,k) = 0._r8
- sprd(i,k) = 0._r8
- frz(i,k) = 0._r8
- qniic(i,k)=0._r8
- qric(i,k)=0._r8
- nsic(i,k)=0._r8
- nric(i,k)=0._r8
- qiic(i,k)=0._r8
- qcic(i,k)=0._r8
- niic(i,k)=0._r8
- ncic(i,k)=0._r8
- qcimp(k) = .false.
- ncimp(k) = .false.
- qiimp(k) = .false.
- niimp(k) = .false.
- dum2l(i,k)=0._r8
- dum2i(i,k)=0._r8
- autolm(i,k) = 0._r8
- accrlm(i,k) = 0._r8
- bergnm(i,k) = 0._r8
- fhtimm(i,k) = 0._r8
- fhtctm(i,k) = 0._r8
- fhmlm (i,k) = 0._r8
- fholm (i,k) = 0._r8
- hmpim (i,k) = 0._r8
- accslm(i,k) = 0._r8
- dlfm (i,k) = 0._r8
-
- autoln(i,k) = 0._r8
- accrln(i,k) = 0._r8
- bergnn(i,k) = 0._r8
- fhtimn(i,k) = 0._r8
- fhtctn(i,k) = 0._r8
- fhmln (i,k) = 0._r8
- fholn (i,k) = 0._r8
- accsln(i,k) = 0._r8
- activn(i,k) = 0._r8
- dlfn (i,k) = 0._r8
- ncadj (i,k) = 0._r8
-
- autoim(i,k) = 0._r8
- accsim(i,k) = 0._r8
- difm (i,k) = 0._r8
-
- nuclin(i,k) = 0._r8
- autoin(i,k) = 0._r8
- accsin(i,k) = 0._r8
- hmpin (i,k) = 0._r8
- difn (i,k) = 0._r8
- niadj (i,k) = 0._r8
-
- trspcm(i,k) = 0._r8
- trspcn(i,k) = 0._r8
- trspim(i,k) = 0._r8
- trspin(i,k) = 0._r8
-
- fhmrm (i,k) = 0._r8
- end do
-
- do k = pver,msg+2,-1
-
- es(i,k) = svp_water(t(i,k)) ! over water in mixed clouds
- esi(i,k) = svp_ice(t(i,k)) ! over ice
-
- if (k > jt(i) .and. k <= jb(i) .and. eps0(i) > 0._r8 &
- .and.mu(i,k).gt.0._r8 .and. mu(i,k-1).gt.0._r8) then
-
- ! initialize precip fallspeeds to zero
- if (it.eq.1) then
- ums(k)=0._r8
- uns(k)=0._r8
- umr(k)=0._r8
- unr(k)=0._r8
- prf(k)=0._r8
- pnrf(k)=0._r8
- psf(k) =0._r8
- pnsf(k) = 0._r8
- end if
- ttend(k)=0._r8
- nnuccd(k)=0._r8
- npccn(k)=0._r8
-
- !************************************************************************************
- ! obtain values of cloud water/ice mixing ratios and number concentrations in updraft
- ! for microphysical process calculations
- ! units are kg/kg for mixing ratio, 1/kg for number conc
- !************************************************************************************
-
-
- if (it.eq.1) then
- qcic(i,k) = qc(i,k)
- qiic(i,k) = qi(i,k)
- ncic(i,k) = nc(i,k)
- niic(i,k) = ni(i,k)
- qniic(i,k)= qni(i,k)
- qric(i,k) = qr(i,k)
- nsic(i,k) = ns(i,k)
- nric(i,k) = nr(i,k)
- else
- if (k.le.kqc(i)) then
- qcic(i,k) = qc(i,k)
- ncic(i,k) = nc(i,k)
-
- ! consider rain falling from above
- flxrm = 0._r8
- mvtrm = 0._r8
- flxrn = 0._r8
- mvtrn = 0._r8
- nlr = 0
-
- do kk= k,jt(i)+3,-1
- if (qr(i,kk-1) .gt. 0._r8) then
- nlr = nlr + 1
- flxrm = flxrm + umr(kk-1)*qr(i,kk-1)*arcf(i,kk-1)
- flxrn = flxrn + unr(kk-1)*nr(i,kk-1)*arcf(i,kk-1)
- mvtrm = mvtrm + umr(kk-1)*arcf(i,kk-1)
- mvtrn = mvtrn + unr(kk-1)*arcf(i,kk-1)
- end if
- end do
- if (mvtrm.gt.0) then
- qric(i,k) = (qr(i,k)*mu(i,k)+flxrm)/(mu(i,k)+mvtrm)
- else
- qric(i,k) = qr(i,k)
- end if
- if (mvtrn.gt.0) then
- nric(i,k) = (nr(i,k)*mu(i,k)+flxrn)/(mu(i,k)+mvtrn)
- else
- nric(i,k) = nr(i,k)
- end if
-
- end if
- if (k.eq.kqc(i)) then
- qcic(i,k) = qc(i,k-1)
- ncic(i,k) = nc(i,k-1)
- end if
- if(k.le.kqi(i)) then
- qiic(i,k) = qi(i,k)
- niic(i,k) = ni(i,k)
-! consider snow falling from above
- flxsm = 0._r8
- mvtsm = 0._r8
- flxsn = 0._r8
- mvtsn = 0._r8
- nls = 0
-
- do kk= k,jt(i)+3,-1
- if (qni(i,kk-1) .gt. 0._r8) then
- nls = nls + 1
- flxsm = flxsm + ums(kk-1)*qni(i,kk-1)*arcf(i,kk-1)
- mvtsm = mvtsm + ums(kk-1)*arcf(i,kk-1)
- flxsn = flxsn + uns(kk-1)*ns(i,kk-1)*arcf(i,kk-1)
- mvtsn = mvtsn + uns(kk-1)*arcf(i,kk-1)
- end if
- end do
-
- if (mvtsm.gt.0) then
- qniic(i,k) = (qni(i,k)*mu(i,k)+flxsm)/(mu(i,k)+mvtsm)
- else
- qniic(i,k) = qni(i,k)
- end if
- if (mvtsn.gt.0) then
- nsic(i,k) = (ns(i,k)*mu(i,k)+flxsn)/(mu(i,k)+mvtsn)
- else
- nsic(i,k) = ns(i,k)
- end if
- end if
- if(k.eq.kqi(i)) then
- qiic(i,k) = qi(i,k-1)
- niic(i,k) = ni(i,k-1)
- end if
- end if
-
- !**********************************************************************
- ! boundary condition for cloud liquid water and cloud ice
- !***********************************************************************
-
- ! boundary condition for provisional cloud water
- if (cmel(i,k-1).gt.qsmall .and. lcbase(i) .and. it.eq.1 ) then
- kqc(i) = k
- lcbase(i) = .false.
- qcic(i,k) = dz(i,k)*cmel(i,k-1)/(mu(i,k-1)+dz(i,k)*du(i,k-1))
- ncic(i,k) = qcic(i,k)/(4._r8/3._r8*pi*10.e-6_r8**3*rhow)
- end if
-
- ! boundary condition for provisional cloud ice
- if (qiic(i,k).gt.qsmall .and. libase(i) .and. it.eq.1 ) then
- kqi(i) = k
- libase(i) = .false.
- else if ( cmei(i,k-1).gt.qsmall .and. &
- cmei(i,k).lt.qsmall .and. k.le.jb(i) .and. libase(i) .and. it.eq.1 ) then
- kqi(i)=k
- libase(i) = .false.
- qiic(i,k) = dz(i,k)*cmei(i,k-1)/(mu(i,k-1)+dz(i,k)*du(i,k-1))
- niic(i,k) = qiic(i,k)/(4._r8/3._r8*pi*25.e-6_r8**3*rhoi)
- end if
-
- !***************************************************************************
- ! get size distribution parameters based on in-cloud cloud water/ice
- ! these calculations also ensure consistency between number and mixing ratio
- !***************************************************************************
- ! cloud ice
- if (qiic(i,k).ge.qsmall) then
-
- ! add upper limit to in-cloud number concentration to prevent numerical error
- niic(i,k)=min(niic(i,k),qiic(i,k)*1.e20_r8)
- lami(k) = (gamma(1._r8+di)*ci* &
- niic(i,k)/qiic(i,k))**(1._r8/di)
- n0i(k) = niic(i,k)*lami(k)
-
- ! check for slope
- lammax = 1._r8/10.e-6_r8
- lammin = 1._r8/(2._r8*dcs)
-
- ! adjust vars
- if (lami(k).lt.lammin) then
- lami(k) = lammin
- n0i(k) = lami(k)**(di+1._r8)*qiic(i,k)/(ci*gamma(1._r8+di))
- niic(i,k) = n0i(k)/lami(k)
- else if (lami(k).gt.lammax) then
- lami(k) = lammax
- n0i(k) = lami(k)**(di+1._r8)*qiic(i,k)/(ci*gamma(1._r8+di))
- niic(i,k) = n0i(k)/lami(k)
- end if
- else
- lami(k) = 0._r8
- n0i(k) = 0._r8
- end if
-
- ! cloud water
- if (qcic(i,k).ge.qsmall) then
-
- ! add upper limit to in-cloud number concentration to prevent numerical error
- ncic(i,k)=min(ncic(i,k),qcic(i,k)*1.e20_r8)
-
- ! get pgam from fit to observations of martin et al. 1994
-
- pgam(i,k)=0.0005714_r8*(ncic(i,k)/1.e6_r8/rho(i,k))+0.2714_r8
- pgam(i,k)=1._r8/(pgam(i,k)**2)-1._r8
- pgam(i,k)=max(pgam(i,k),2._r8)
- pgam(i,k)=min(pgam(i,k),15._r8)
-
- ! calculate lamc
- lamc(i,k) = (pi/6._r8*rhow*ncic(i,k)*gamma(pgam(i,k)+4._r8)/ &
- (qcic(i,k)*gamma(pgam(i,k)+1._r8)))**(1._r8/3._r8)
-
- ! lammin, 50 micron diameter max mean size
- lammin = (pgam(i,k)+1._r8)/40.e-6_r8
- lammax = (pgam(i,k)+1._r8)/1.e-6_r8
-
- if (lamc(i,k).lt.lammin) then
- lamc(i,k) = lammin
- ncic(i,k) = 6._r8*lamc(i,k)**3*qcic(i,k)* &
- gamma(pgam(i,k)+1._r8)/ &
- (pi*rhow*gamma(pgam(i,k)+4._r8))
- else if (lamc(i,k).gt.lammax) then
- lamc(i,k) = lammax
- ncic(i,k) = 6._r8*lamc(i,k)**3*qcic(i,k)* &
- gamma(pgam(i,k)+1._r8)/ &
- (pi*rhow*gamma(pgam(i,k)+4._r8))
- end if
-
- ! parameter to calculate droplet freezing
-
- cdist1(k) = ncic(i,k)/gamma(pgam(i,k)+1._r8)
- else
- lamc(i,k) = 0._r8
- cdist1(k) = 0._r8
- end if
-
- ! boundary condition for cloud liquid water
- if ( kqc(i) .eq. k ) then
- qc(i,k) = 0._r8
- nc(i,k) = 0._r8
- end if
-
- ! boundary condition for cloud ice
- if (kqi(i).eq.k ) then
- qi(i,k) = 0._r8
- ni(i,k) = 0._r8
- end if
-
- !**************************************************************************
- ! begin micropysical process calculations
- !**************************************************************************
-
- !.................................................................
- ! autoconversion of cloud liquid water to rain
- ! formula from Khrouditnov and Kogan (2000)
- ! minimum qc of 1 x 10^-8 prevents floating point error
-
- if (qcic(i,k).ge.1.e-8_r8) then
-
- ! nprc is increase in rain number conc due to autoconversion
- ! nprc1 is decrease in cloud droplet conc due to autoconversion
- ! Khrouditnov and Kogan (2000)
-! prc(k) = 1350._r8*qcic(i,k)**2.47_r8* &
-! (ncic(i,k)/1.e6_r8*rho(i,k))**(-1.79_r8)
-
- ! Liu and Daum(2004)(modified), Wood(2005)
- rmean = 1.e6_r8*((qcic(i,k)/ncic(i,k))/(4._r8/3._r8*pi*rhow))**(1._r8/3._r8)
-
- if (rmean .ge. 15._r8) then
-
- beta6 = (1._r8+3._r8/rmean)**(1._r8/3._r8)
- beta66 = (1._r8+3._r8/rmean)**2._r8
- r6 = beta6*rmean
- r6c = 7.5_r8/(r6**0.5_r8*(qcic(i,k)*rho(i,k))**(1._r8/6._r8))
- prc(k) = 1.3e9_r8*beta66*(qcic(i,k)*rho(i,k))**3._r8/ &
- (ncic(i,k)*rho(i,k))*max(0._r8,r6-r6c)/rho(i,k)
-
- nprc1(k) = prc(k)/(qcic(i,k)/ncic(i,k))
- nprc(k) = nprc1(k)*0.5_r8
- else
- prc(k)=0._r8
- nprc(k)=0._r8
- nprc1(k)=0._r8
- end if
- else
- prc(k)=0._r8
- nprc(k)=0._r8
- nprc1(k)=0._r8
- end if
-
- ! provisional rain mixing ratio and number concentration (qric and nric)
- ! at boundary are estimated via autoconversion
-
- if (k.eq.kqc(i) .and. it.eq.1) then
- qric(i,k) = prc(k)*dz(i,k)/0.55_r8
- nric(i,k) = nprc(k)*dz(i,k)/0.55_r8
- qr(i,k) = 0.0_r8
- nr(i,k) = 0.0_r8
- end if
-
- !.......................................................................
- ! Autoconversion of cloud ice to snow
- ! similar to Ferrier (1994)
-
- call ice_autoconversion(t(i,k), qiic(i,k), lami(k), n0i(k), dcs, prci(k), nprci(k), 1)
-
- ! provisional snow mixing ratio and number concentration (qniic and nsic)
- ! at boundary are estimated via autoconversion
-
- if (k.eq.kqi(i) .and. it.eq.1) then
- qniic(i,k)= prci(k)*dz(i,k)*0.25_r8
- nsic(i,k)= nprci(k)*dz(i,k)*0.25_r8
- qni(i,k)= 0.0_r8
- ns(i,k)= 0.0_r8
- end if
-
- ! if precip mix ratio is zero so should number concentration
- if (qniic(i,k).lt.qsmall) then
- qniic(i,k)=0._r8
- nsic(i,k)=0._r8
- end if
- if (qric(i,k).lt.qsmall) then
- qric(i,k)=0._r8
- nric(i,k)=0._r8
- end if
-
- ! make sure number concentration is a positive number to avoid
- ! taking root of negative later
- nric(i,k)=max(nric(i,k),0._r8)
- nsic(i,k)=max(nsic(i,k),0._r8)
-
- !**********************************************************************
- ! get size distribution parameters for precip
- !**********************************************************************
- ! rain
-
- if (qric(i,k).ge.qsmall) then
- lamr(k) = (pi*rhow*nric(i,k)/qric(i,k))**(1._r8/3._r8)
- n0r(k) = nric(i,k)*lamr(k)
-
- ! check for slope
- lammax = 1._r8/150.e-6_r8
- lammin = 1._r8/3000.e-6_r8
-
- ! adjust vars
- if (lamr(k).lt.lammin) then
- lamr(k) = lammin
- n0r(k) = lamr(k)**4*qric(i,k)/(pi*rhow)
- nric(i,k) = n0r(k)/lamr(k)
- else if (lamr(k).gt.lammax) then
- lamr(k) = lammax
- n0r(k) = lamr(k)**4*qric(i,k)/(pi*rhow)
- nric(i,k) = n0r(k)/lamr(k)
- end if
-
- ! provisional rain number and mass weighted mean fallspeed (m/s)
- ! Eq.18 of Morrison and Gettelman, 2008, J. Climate
- unr(k) = min(arn(i,k)*gamma(1._r8+br)/lamr(k)**br,10._r8)
- umr(k) = min(arn(i,k)*gamma(4._r8+br)/(6._r8*lamr(k)**br),10._r8)
- else
- lamr(k) = 0._r8
- n0r(k) = 0._r8
- umr(k) = 0._r8
- unr(k) = 0._r8
- end if
-
- !......................................................................
- ! snow
- if (qniic(i,k).ge.qsmall) then
- lams(k) = (gamma(1._r8+ds)*cs*nsic(i,k)/ &
- qniic(i,k))**(1._r8/ds)
- n0s(k) = nsic(i,k)*lams(k)
-
- ! check for slope
- lammax = 1._r8/10.e-6_r8
- lammin = 1._r8/2000.e-6_r8
-
- ! adjust vars
- if (lams(k).lt.lammin) then
- lams(k) = lammin
- n0s(k) = lams(k)**(ds+1._r8)*qniic(i,k)/(cs*gamma(1._r8+ds))
- nsic(i,k) = n0s(k)/lams(k)
- else if (lams(k).gt.lammax) then
- lams(k) = lammax
- n0s(k) = lams(k)**(ds+1._r8)*qniic(i,k)/(cs*gamma(1._r8+ds))
- nsic(i,k) = n0s(k)/lams(k)
- end if
-
- ! provisional snow number and mass weighted mean fallspeed (m/s)
- ums(k) = min(asn(i,k)*gamma(4._r8+bs)/(6._r8*lams(k)**bs),3.6_r8)
- uns(k) = min(asn(i,k)*gamma(1._r8+bs)/lams(k)**bs,3.6_r8)
- else
- lams(k) = 0._r8
- n0s(k) = 0._r8
- ums(k) = 0._r8
- uns(k) = 0._r8
- end if
-
- !.......................................................................
- ! snow self-aggregation from passarelli, 1978, used by Reisner(1998,Eq.A.35)
- ! this is hard-wired for bs = 0.4 for now
- ! ignore self-collection of cloud ice
-
- call snow_self_aggregation(t(i,k), rho(i,k), asn(i,k), rhosn, qniic(i,k), nsic(i,k), nsagg(k), 1)
-
- !.......................................................................
- ! accretion of cloud droplets onto snow/graupel
- ! here use continuous collection equation with
- ! simple gravitational collection kernel
- ! ignore collisions between droplets/cloud ice
-
- ! ignore collision of snow with droplets above freezing
-
- call accrete_cloud_water_snow(t(i,k), rho(i,k), asn(i,k), uns(k), mua(i,k), &
- qcic(i,k), ncic(i,k), qniic(i,k), pgam(i,k), lamc(i,k), lams(k), n0s(k), &
- psacws(k), npsacws(k), 1)
-
- ! secondary ice production due to accretion of droplets by snow
- ! (Hallet-Mossop process) (from Cotton et al., 1986)
-
- call secondary_ice_production(t(i,k), psacws(k), msacwi(k), nsacwi(k), 1)
-
- !.......................................................................
- ! accretion of rain water by snow
- ! formula from ikawa and saito, 1991, used by reisner et al., 1998
-
- call accrete_rain_snow(t(i,k), rho(i,k), umr(k), ums(k), unr(k), uns(k), qric(i,k), &
- qniic(i,k), lamr(k), n0r(k), lams(k), n0s(k), pracs(k), npracs(k), 1 )
-
- !.......................................................................
- ! heterogeneous freezing of rain drops
- ! follows from Bigg (1953)
-
- call heterogeneous_rain_freezing(t(i,k), qric(i,k), nric(i,k), lamr(k), mnuccr(k), nnuccr(k), 1)
-
- !.......................................................................
- ! accretion of cloud liquid water by rain
- ! formula from Khrouditnov and Kogan (2000)
- ! gravitational collection kernel, droplet fall speed neglected
-
- call accrete_cloud_water_rain(.true., qric(i,k), qcic(i,k), ncic(i,k), [1._r8], [0._r8], pra(k), npra(k), 1)
-
- !.......................................................................
- ! Self-collection of rain drops
- ! from Beheng(1994)
-
- call self_collection_rain(rho(i,k), qric(i,k), nric(i,k), nragg(k), 1)
-
- !.......................................................................
- ! Accretion of cloud ice by snow
- ! For this calculation, it is assumed that the Vs >> Vi
- ! and Ds >> Di for continuous collection
-
- call accrete_cloud_ice_snow(t(i,k), rho(i,k), asn(i,k), qiic(i,k), niic(i,k), &
- qniic(i,k), lams(k), n0s(k), prai(k), nprai(k), 1)
-
- !.......................................................................
- ! fallout term
- prf(k) = -umr(k)*qric(i,k)/dz(i,k)
- pnrf(k) = -unr(k)*nric(i,k)/dz(i,k)
- psf(k) = -ums(k)*qniic(i,k)/dz(i,k)
- pnsf(k) = -uns(k)*nsic(i,k)/dz(i,k)
-
- !........................................................................
- ! calculate vertical velocity in cumulus updraft
-
- if (k.eq.jb(i)) then
- zkine(i,jb(i)) = 0.5_r8
- wu (i,jb(i)) = 1._r8
- zbuo (i,jb(i)) = (tu(i,jb(i))*(1._r8+retv*qu(i,jb(i)))- &
- th(i,jb(i))*(1._r8+retv*qh(i,jb(i))))/ &
- (th(i,jb(i))*(1._r8+retv*qh(i,jb(i))))
- else
- if (.true.) then
- ! ECMWF formula
- zbc = tu(i,k)*(1._r8+retv*qu(i,k)-qr(i,k)-qni(i,k)-qi(i,k)-qc(i,k))
- zbe = th(i,k)*(1._r8+retv*qh(i,k))
- zbuo(i,k) = (zbc-zbe)/zbe
- zbuoc= (zbuo(i,k)+zbuo(i,k+1))*0.5_r8
- zdkbuo = dz(i,k+1)*grav*zfacbuo*zbuoc
- zdken = min(.99_r8,(1._r8+cwdrag)*max(du(i,k),eu(i,k))*dz(i,k+1)/ &
- max(1.e-10_r8,mu(i,k+1)))
- zkine(i,k) = (zkine(i,k+1)*(1._r8-zdken)+zdkbuo)/ &
- (1._r8+zdken)
- else
- ! Gregory formula
- zbc = tu(i,k)*(1._r8+retv*qu(i,k))
- zbe = th(i,k)*(1._r8+retv*qh(i,k))
- zbuo(i,k) = (zbc-zbe)/zbe-qr(i,k)-qni(i,k)-qi(i,k)-qc(i,k)
- zbuoc= (zbuo(i,k)+zbuo(i,k+1))*0.5_r8
- zdkbuo = dz(i,k+1)*grav*zbuoc*(1.0_r8-0.25_r8)/6._r8
- zdken = du(i,k)*dz(i,k+1)/max(1.e-10_r8,mu(i,k+1))
- zkine(i,k) = (zkine(i,k+1)*(1._r8-zdken)+zdkbuo)/ &
- (1._r8+zdken)
- end if
- wu(i,k) = min(15._r8,sqrt(2._r8*max(0.1_r8,zkine(i,k) )))
- end if
-
- arcf(i,k)= mu(i,k)/wu(i,k)
-
- !............................................................................
- ! droplet activation
- ! calculate potential for droplet activation if cloud water is present
- ! formulation from Abdul-Razzak and Ghan (2000) and Abdul-Razzak et al. (1998), AR98
-
- if (aero%scheme == 'bulk') then
- naer2h(i,k,:) = 0.5_r8*(naer2(i,k,:) + naer2(i,k-1,:))
- end if
-
- ntaerh(i,k) = 0.5_r8*(ntaer(i,k) + ntaer(i,k-1))
-
- if (qcic(i,k).ge.qsmall ) then
-
- if (aero%scheme == 'modal') then
-
- nlsrc = 0._r8
-
- do m = 1, aero%nmodes
- vaerosol(m) = 0._r8
- hygro(m) = 0._r8
- do l = 1, aero%nspec(m)
- vol = max(0.5_r8*(aero%mmrg_a(i,k,l,m)+aero%mmrg_a(i,k-1,l,m)) , 0._r8)/aero%specdens(l,m)
- vaerosol(m) = vaerosol(m) + vol
- hygro(m) = hygro(m) + vol*aero%spechygro(l,m)
- end do
- if (vaerosol(m) > 1.0e-30_r8) then
- hygro(m) = hygro(m)/(vaerosol(m))
- vaerosol(m) = vaerosol(m)*rho(i,k)
- else
- hygro(m) = 0.0_r8
- vaerosol(m) = 0.0_r8
- endif
- naermod(m) = 0.5_r8*(aero%numg_a(i,k,m)+aero%numg_a(i,k-1,m))*rho(i,k)
- naermod(m) = max(naermod(m), vaerosol(m)*aero%voltonumbhi(m))
- naermod(m) = min(naermod(m), vaerosol(m)*aero%voltonumblo(m))
- end do
-
- in_cloud = (k < jb(i))
- smax_f = 0.0_r8
- if (in_cloud) then
- if ( qcic(i,k).ge.qsmall ) &
- smax_f = ncic(i,k)/lamc(i,k) * gamma(2.0_r8 + pgam(i,k))/gamma(1.0_r8 + pgam(i,k))
- if ( qric(i,k).ge.qsmall) smax_f = smax_f + nric(i,k)/lamr(k)
-
- end if
-
- call activate_aerosol( &
- wu(i,k), wmix, wdiab, wmin, wmax, &
- t(i,k), rho(i,k), naermod, aero%nmodes, vaerosol, &
- hygro, aero_props_obj, fn, fm, &
- fluxn, fluxm, flux_fullact, in_cloud_in=in_cloud, smax_f=smax_f)
-
- do m = 1, aero%nmodes
- nlsrc = nlsrc + fn(m)*naermod(m) ! number nucleated
- end do
-
- if (nlsrc .ne. nlsrc) then
- write(iulog,*) "nlsrc=",nlsrc,"wu(i,k)=",wu(i,k)
- write(iulog,*) "fn(m)=",fn,"naermod(m)=",naermod,"aero%specdens(l,m)=",aero%specdens
- write(iulog,*) "vaerosol(m)=",vaerosol,"aero%voltonumbhi(m)=",aero%voltonumbhi
- write(iulog,*) "aero%voltonumblo(m)=",aero%voltonumblo,"k=",k,"i=",i
- write(iulog,*) "aero%numg_a(i,k,m)=",aero%numg_a(i,k,:),"rho(i,k)=",rho(i,k)
- write(iulog,*) "aero%mmrg_a(i,k,l,m)=",aero%mmrg_a(i,k,:,:)
- end if
-
- dum2l(i,k) = nlsrc
-
- else if (aero%scheme == 'bulk') then
-
- call ndrop_bam_run( &
- wu(i,k), t(i,k), rho(i,k), naer2h(i,k,:), aero%nbulk, &
- aero%nbulk, maerosol, dum2)
-
- dum2l(i,k) = dum2
-
- end if
-
- else
- dum2l(i,k) = 0._r8
- end if
-
- ! get droplet activation rate
- if (qcic(i,k).ge.qsmall .and. t(i,k).gt.238.15_r8 .and. k.gt.jt(i)+2 ) then
-
- ! assume aerosols already activated are equal number of existing droplets for simplicity
- if (k.eq.kqc(i)) then
- npccn(k) = dum2l(i,k)/deltat
- else
- npccn(k) = (dum2l(i,k)-ncic(i,k))/deltat
- end if
-
- ! make sure number activated > 0
- npccn(k) = max(0._r8,npccn(k))
- ncmax = dum2l(i,k)
- else
- npccn(k)=0._r8
- ncmax = 0._r8
- end if
-
- !..............................................................................
- !ice nucleation
- es(i,k) = svp_water(t(i,k)) ! over water in mixed clouds
- esi(i,k) = svp_ice(t(i,k)) ! over ice
- qs(i,k) = 0.622_r8*es(i,k)/(ph(i,k) - (1.0_r8-0.622_r8)*es(i,k))
- qs(i,k) = min(1.0_r8,qs(i,k))
- if (qs(i,k) < 0.0_r8) qs(i,k) = 1.0_r8
-
- relhum(i,k)= 1.0_r8
-
- if (t(i,k).lt.tmelt ) then
-
- ! compute aerosol number for so4, soot, and dust with units #/cm^3
- so4_num = 0._r8
- soot_num = 0._r8
- dst1_num = 0._r8
- dst2_num = 0._r8
- dst3_num = 0._r8
- dst4_num = 0._r8
-
- if (aero%scheme == 'modal') then
-
- !For modal aerosols, assume for the upper troposphere:
- ! soot = accumulation mode
- ! sulfate = aiken mode
- ! dust = coarse mode
- ! since modal has internal mixtures.
- soot_num = 0.5_r8*(aero%numg_a(i,k-1,aero%mode_accum_idx) &
- +aero%numg_a(i,k,aero%mode_accum_idx))*rho(i,k)*1.0e-6_r8
- dmc = 0.5_r8*(aero%mmrg_a(i,k-1,aero%coarse_dust_idx,aero%mode_coarse_idx) &
- +aero%mmrg_a(i,k,aero%coarse_dust_idx,aero%mode_coarse_idx))
- ssmc = 0.5_r8*(aero%mmrg_a(i,k-1,aero%coarse_nacl_idx,aero%mode_coarse_idx) &
- +aero%mmrg_a(i,k,aero%coarse_nacl_idx,aero%mode_coarse_idx))
- if (dmc > 0._r8) then
- dst_num = dmc/(ssmc + dmc) *(aero%numg_a(i,k-1,aero%mode_coarse_idx) &
- + aero%numg_a(i,k,aero%mode_coarse_idx))*0.5_r8*rho(i,k)*1.0e-6_r8
- else
- dst_num = 0.0_r8
- end if
- dgnum_aitken = 0.5_r8*(aero%dgnumg(i,k,aero%mode_aitken_idx)+ &
- aero%dgnumg(i,k-1,aero%mode_aitken_idx))
- if (dgnum_aitken > 0._r8) then
- ! only allow so4 with D>0.1 um in ice nucleation
- so4_num = 0.5_r8*(aero%numg_a(i,k-1,aero%mode_aitken_idx)+ &
- aero%numg_a(i,k,aero%mode_aitken_idx))*rho(i,k)*1.0e-6_r8 &
- * (0.5_r8 - 0.5_r8*erf(log(0.1e-6_r8/dgnum_aitken)/ &
- (2._r8**0.5_r8*log(aero%sigmag_aitken))))
- else
- so4_num = 0.0_r8
- end if
- so4_num = max(0.0_r8, so4_num)
-
- else if (aero%scheme == 'bulk') then
-
- if (aero%idxsul > 0) then
- so4_num = naer2h(i,k,aero%idxsul)/25._r8 *1.0e-6_r8
- end if
- if (aero%idxbcphi > 0) then
- soot_num = naer2h(i,k,aero%idxbcphi)/25._r8 *1.0e-6_r8
- end if
- if (aero%idxdst1 > 0) then
- dst1_num = naer2h(i,k,aero%idxdst1)/25._r8 *1.0e-6_r8
- end if
- if (aero%idxdst2 > 0) then
- dst2_num = naer2h(i,k,aero%idxdst2)/25._r8 *1.0e-6_r8
- end if
- if (aero%idxdst3 > 0) then
- dst3_num = naer2h(i,k,aero%idxdst3)/25._r8 *1.0e-6_r8
- end if
- if (aero%idxdst4 > 0) then
- dst4_num = naer2h(i,k,aero%idxdst4)/25._r8 *1.0e-6_r8
- end if
- dst_num = dst1_num + dst2_num + dst3_num + dst4_num
-
- end if
-
- ! *** Turn off soot nucleation ***
- soot_num = 0.0_r8
-
- ! Liu et al.,J. climate, 2007
- if ( wu(i,k) .lt. 4.0_r8) then
- call nucleati( &
- wu(i,k), t(i,k), ph(i,k), relhum(i,k), 1.0_r8, qcic(i,k), &
- 1.0e-20_r8, 0.0_r8, rho(i,k), so4_num, dst_num, soot_num, 1.0_r8, &
- dum2i(i,k), nihf(i,k), niimm(i,k), nidep(i,k), nimey(i,k), &
- wpice, weff, fhom, temp1, temp2, temp3, temp4, .true. )
- end if
- nihf(i,k)=nihf(i,k)*rho(i,k) ! convert from #/kg -> #/m3)
- niimm(i,k)=niimm(i,k)*rho(i,k)
- nidep(i,k)=nidep(i,k)*rho(i,k)
- nimey(i,k)=nimey(i,k)*rho(i,k)
-
- if (.false.) then
- ! cooper curve (factor of 1000 is to convert from L-1 to m-3)
- !dum2i(i,k)=0.005_r8*exp(0.304_r8*(273.15_r8-t(i,k)))*1000._r8
-
- ! put limit on number of nucleated crystals, set to number at T=-30 C
- ! cooper (limit to value at -35 C)
- !dum2i(i,k)=min(dum2i(i,k),208.9e3_r8)/rho(i,k) ! convert from m-3 to kg-1
- end if
-
- else
- dum2i(i,k)=0._r8
- end if
-
- ! ice nucleation if activated nuclei exist at t<0C
-
- if (dum2i(i,k).gt.0._r8.and.t(i,k).lt.tmelt.and. &
- relhum(i,k)*es(i,k)/esi(i,k).gt. 1.05_r8 .and. k.gt.jt(i)+1) then
-
- if (k.eq.kqi(i)) then
- nnuccd(k)=dum2i(i,k)/deltat
- else
- nnuccd(k)=(dum2i(i,k)-niic(i,k))/deltat
- end if
- nnuccd(k)=max(nnuccd(k),0._r8)
-
- !Calc mass of new particles using new crystal mass...
- !also this will be multiplied by mtime as nnuccd is...
-
- mnuccd(k) = nnuccd(k) * mi0
- else
- nnuccd(k)=0._r8
- mnuccd(k) = 0._r8
- end if
-
- !................................................................................
- ! Bergeron process
- ! If 0C< T <-40C and both ice and liquid exist
-
- if (t(i,k).le.273.15_r8 .and. t(i,k).gt.233.15_r8 .and. &
- qiic(i,k).gt.0.5e-6_r8 .and. qcic(i,k).gt. qsmall) then
- plevap = qcic(i,k)/bergtsf
- prb(k) = max(0._r8,plevap)
- nprb(k) = prb(k)/(qcic(i,k)/ncic(i,k))
- else
- prb(k)=0._r8
- nprb(k)=0._r8
- end if
-
- !................................................................................
- ! heterogeneous freezing of cloud water (-5C < T < -35C)
-
- if (qcic(i,k).ge.qsmall .and.ncic(i,k).gt.0._r8 .and. ntaerh(i,k).gt.0._r8 .and. &
- t(i,k).le.268.15_r8 .and. t(i,k).gt.238.15_r8 ) then
-
- if (aero%scheme == 'bulk') then
- ! immersion freezing (Diehl and Wurzler, 2004)
- ttend(k) = -grav*wu(i,k)/cp/(1.0_r8+gamhat(i,k))
-
- nai_bcphi = 0.0_r8
- nai_dst1 = 0.0_r8
- nai_dst2 = 0.0_r8
- nai_dst3 = 0.0_r8
- nai_dst4 = 0.0_r8
-
- if (aero%idxbcphi > 0) nai_bcphi = naer2h(i,k,aero%idxbcphi)
- if (aero%idxdst1 > 0) nai_dst1 = naer2h(i,k,aero%idxdst1)
- if (aero%idxdst2 > 0) nai_dst2 = naer2h(i,k,aero%idxdst2)
- if (aero%idxdst3 > 0) nai_dst3 = naer2h(i,k,aero%idxdst3)
- if (aero%idxdst4 > 0) nai_dst4 = naer2h(i,k,aero%idxdst4)
-
- naimm = (0.00291_r8*nai_bcphi + 32.3_r8*(nai_dst1 + nai_dst2 + &
- nai_dst3 + nai_dst4))/ntaerh(i,k) !m-3
- if (ttend(k) .lt. 0._r8) then
- nnuccc(k) = -naimm*exp(273.15_r8-t(i,k))*ttend(k)*qcic(i,k)/rhow ! kg-1s-1
- mnuccc(k) = nnuccc(k)*qcic(i,k)/ncic(i,k)
- end if
- else
- if (.false.) then
- ! immersion freezing (Diehl and Wurzler, 2004)
- ttend(k) = -grav*wu(i,k)/cp/(1.0_r8+gamhat(i,k))
- naimm = (0.00291_r8*soot_num + 32.3_r8*dst_num )*1.0e6_r8/ntaerh(i,k) !m-3
- if (ttend(k) .lt. 0._r8) then
- nnuccc(k) = -naimm*exp(273.15_r8-t(i,k))*ttend(k)*qcic(i,k)/rhow ! kg-1s-1
- mnuccc(k) = nnuccc(k)*qcic(i,k)/ncic(i,k)
- end if
- else
- ! immersion freezing (Bigg, 1953)
- mnuccc(k) = pi*pi/36._r8*rhow* &
- cdist1(k)*gamma(7._r8+pgam(i,k))* &
- bimm*(exp(aimm*(273.15_r8-t(i,k)))-1._r8)/ &
- lamc(i,k)**3/lamc(i,k)**3
-
- nnuccc(k) = pi/6._r8*cdist1(k)*gamma(pgam(i,k)+4._r8) &
- *bimm*(exp(aimm*(273.15_r8-t(i,k)))-1._r8)/lamc(i,k)**3
- end if
- end if
-
- ! contact freezing (Young, 1974) with hooks into simulated dust
-
- tcnt=(270.16_r8-t(i,k))**1.3_r8
- viscosity=1.8e-5_r8*(t(i,k)/298.0_r8)**0.85_r8 ! Viscosity (kg/m/s)
- mfp=2.0_r8*viscosity/(ph(i,k) & ! Mean free path (m)
- *sqrt(8.0_r8*28.96e-3_r8/(pi*8.314409_r8*t(i,k))))
-
- slip1=1.0_r8+(mfp/rn_dst1)*(1.257_r8+(0.4_r8*Exp(-(1.1_r8*rn_dst1/mfp))))! Slip correction factor
- slip2=1.0_r8+(mfp/rn_dst2)*(1.257_r8+(0.4_r8*Exp(-(1.1_r8*rn_dst2/mfp))))
- slip3=1.0_r8+(mfp/rn_dst3)*(1.257_r8+(0.4_r8*Exp(-(1.1_r8*rn_dst3/mfp))))
- slip4=1.0_r8+(mfp/rn_dst4)*(1.257_r8+(0.4_r8*Exp(-(1.1_r8*rn_dst4/mfp))))
-
- dfaer1=1.381e-23_r8*t(i,k)*slip1/(6._r8*pi*viscosity*rn_dst1) ! aerosol diffusivity (m2/s)
- dfaer2=1.381e-23_r8*t(i,k)*slip2/(6._r8*pi*viscosity*rn_dst2)
- dfaer3=1.381e-23_r8*t(i,k)*slip3/(6._r8*pi*viscosity*rn_dst3)
- dfaer4=1.381e-23_r8*t(i,k)*slip4/(6._r8*pi*viscosity*rn_dst4)
-
- nacon1=0.0_r8
- nacon2=0.0_r8
- nacon3=0.0_r8
- nacon4=0.0_r8
-
- if (aero%scheme == 'modal') then
-
- ! For modal aerosols:
- ! use size '3' for dust coarse mode...
- ! scale by dust fraction in coarse mode
-
- dmc = 0.5_r8*(aero%mmrg_a(i,k,aero%coarse_dust_idx,aero%mode_coarse_idx) &
- +aero%mmrg_a(i,k-1,aero%coarse_dust_idx,aero%mode_coarse_idx))
- ssmc = 0.5_r8*(aero%mmrg_a(i,k,aero%coarse_nacl_idx,aero%mode_coarse_idx) &
- +aero%mmrg_a(i,k-1,aero%coarse_nacl_idx,aero%mode_coarse_idx))
- if (dmc > 0.0_r8) then
- nacon3 = dmc/(ssmc + dmc) * (aero%numg_a(i,k,aero%mode_coarse_idx) &
- + aero%numg_a(i,k-1,aero%mode_coarse_idx))*0.5_r8*rho(i,k)
- end if
-
- else if (aero%scheme == 'bulk') then
-
- if (aero%idxdst1.gt.0) then
- nacon1=naer2h(i,k,aero%idxdst1)*tcnt *0.0_r8
- endif
- if (aero%idxdst2.gt.0) then
- nacon2=naer2h(i,k,aero%idxdst2)*tcnt ! 1/m3
- endif
- if (aero%idxdst3.gt.0) then
- nacon3=naer2h(i,k,aero%idxdst3)*tcnt
- endif
- if (aero%idxdst4.gt.0) then
- nacon4=naer2h(i,k,aero%idxdst4)*tcnt
- endif
- end if
-
- mnucct(k) = (dfaer1*nacon1+dfaer2*nacon2+dfaer3*nacon3+dfaer4*nacon4)*pi*pi/3._r8*rhow* &
- cdist1(k)*gamma(pgam(i,k)+5._r8)/lamc(i,k)**4
-
- nnucct(k) = (dfaer1*nacon1+dfaer2*nacon2+dfaer3*nacon3+dfaer4*nacon4)*2._r8*pi* &
- cdist1(k)*gamma(pgam(i,k)+2._r8)/lamc(i,k)
-
- ! if (nnuccc(k).gt.nnuccd(k)) then
- ! dum=nnuccd(k)/nnuccc(k)
- ! scale mixing ratio of droplet freezing with limit
- ! mnuccc(k)=mnuccc(k)*dum
- ! nnuccc(k)=nnuccd(k)
- ! end if
-
- else
- mnuccc(k) = 0._r8
- nnuccc(k) = 0._r8
- mnucct(k) = 0._r8
- nnucct(k) = 0._r8
- end if
-
- ! freeze cloud liquid water homogeneously at -40 C
- if (t(i,k) < 233.15_r8 .and. qc(i,k) > 0._r8) then
-
- ! make sure freezing rain doesn't increase temperature above
- ! threshold
- dum = xlf/cp*qc(i,k)
- if (t(i,k)+dum.gt.233.15_r8) then
- dum = -(t(i,k)-233.15_r8)*cp/xlf
- dum = dum/qc(i,k)
- dum = max(0._r8,dum)
- dum = min(1._r8,dum)
- else
- dum = 1._r8
- end if
- fholm(i,k) = mu(i,k)*dum*qc(i,k)
- fholn(i,k) = mu(i,k)*dum*nc(i,k)
- end if
-
-
- !****************************************************************************************
- ! conservation to ensure no negative values of cloud water/precipitation
- ! in case microphysical process rates are large
- ! note: for check on conservation, processes are multiplied by omsm
- ! to prevent problems due to round off error
-
- ! since activation/nucleation processes are fast, need to take into account
- ! factor mtime = mixing timescale in cloud / model time step
- ! for now mixing timescale is assumed to be 15 min
- !*****************************************************************************************
-
- mtime=deltat/900._r8
- mtimec=deltat/900._r8
-
- ! conservation of qc
- ! ice mass production from ice nucleation(deposition/cond.-freezing), mnuccd,
- ! is considered as a part of cmei.
-
- qce = mu(i,k)*qc(i,k)-fholm(i,k) +dz(i,k)*cmel(i,k-1)
- dum = arcf(i,k)*(pra(k)+prc(k)+prb(k)+mnuccc(k)+mnucct(k)+msacwi(k)+ &
- psacws(k))*dz(i,k)
- if( qce.lt.0._r8) then
- qcimp(k) = .true.
- prc(k) = 0._r8
- pra(k) = 0._r8
- prb(k) = 0._r8
- mnuccc(k) = 0._r8
- mnucct(k) = 0._r8
- msacwi(k) = 0._r8
- psacws(k) = 0._r8
- else if (dum.gt.qce) then
- ratio = qce/dum*omsm
- prc(k) = prc(k)*ratio
- pra(k) = pra(k)*ratio
- prb(k) = prb(k)*ratio
- mnuccc(k) = mnuccc(k)*ratio
- mnucct(k) = mnucct(k)*ratio
- msacwi(k) = msacwi(k)*ratio
- psacws(k) = psacws(k)*ratio
- end if
-
- ! conservation of nc
- nce = mu(i,k)*nc(i,k)-fholn(i,k) + (arcf(i,k)*npccn(k)*mtimec)*dz(i,k)
- dum = arcf(i,k)*dz(i,k)*(nprc1(k)+npra(k)+nnuccc(k)+nnucct(k)+ &
- npsacws(k)+ nprb(k) )
- if (nce.lt.0._r8) then
- ncimp(k) = .true.
- nprc1(k) = 0._r8
- npra(k) = 0._r8
- nnuccc(k) = 0._r8
- nnucct(k) = 0._r8
- npsacws(k) = 0._r8
- nprb(k) = 0._r8
- else if (dum.gt.nce) then
- ratio = nce/dum*omsm
- nprc1(k) = nprc1(k)*ratio
- npra(k) = npra(k)*ratio
- nnuccc(k) = nnuccc(k)*ratio
- nnucct(k) = nnucct(k)*ratio
- npsacws(k) = npsacws(k)*ratio
- nprb(k) = nprb(k)*ratio
- end if
-
- ! conservation of qi
- qie = mu(i,k)*qi(i,k)+fholm(i,k) +dz(i,k)*(cmei(i,k-1) + &
- ( mnuccc(k)+mnucct(k)+msacwi(k)+prb(k))*arcf(i,k) )
- dum = arcf(i,k)*(prci(k)+ prai(k))*dz(i,k)
- if (qie.lt.0._r8) then
- qiimp(k) = .true.
- prci(k) = 0._r8
- prai(k) = 0._r8
- else if (dum.gt.qie) then
- ratio = qie/dum*omsm
- prci(k) = prci(k)*ratio
- prai(k) = prai(k)*ratio
- end if
-
- ! conservation of ni
- nie = mu(i,k)*ni(i,k)+fholn(i,k) +dz(i,k)*(nnuccd(k)*mtime*arcf(i,k) &
- +(nnuccc(k)+ nnucct(k))*arcf(i,k) )
- dum = arcf(i,k)*dz(i,k)*(-nsacwi(k)+nprci(k)+ nprai(k))
- if( nie.lt.0._r8) then
- niimp(k) = .true.
- nsacwi(k)= 0._r8
- nprci(k) = 0._r8
- nprai(k) = 0._r8
- else if (dum.gt.nie) then
- ratio = nie/dum*omsm
- nsacwi(k)= nsacwi(k)*ratio
- nprci(k) = nprci(k)*ratio
- nprai(k) = nprai(k)*ratio
- end if
-
- ! conservation of qr
-
- qre = mu(i,k)*qr(i,k)+dz(i,k)*(pra(k)+prc(k))*arcf(i,k)
- dum = arcf(i,k)*dz(i,k)*(pracs(k)+ mnuccr(k)-prf(k))
- if (qre.lt.0._r8) then
- prf(k) = 0._r8
- pracs(k) = 0._r8
- mnuccr(k) = 0._r8
- else if (dum.gt.qre) then
- ratio = qre/dum*omsm
- prf(k) = prf(k)*ratio
- pracs(k) = pracs(k)*ratio
- mnuccr(k) = mnuccr(k)*ratio
- end if
-
- ! conservation of nr
- nre = mu(i,k)*nr(i,k) + nprc(k)*arcf(i,k)*dz(i,k)
- dum = arcf(i,k)*dz(i,k)*(npracs(k)+nnuccr(k) &
- -nragg(k)-pnrf(k))
- if(nre.lt.0._r8) then
- npracs(k)= 0._r8
- nnuccr(k)= 0._r8
- nragg(k) = 0._r8
- pnrf(k) = 0._r8
- else if (dum.gt.nre) then
- ratio = nre/dum*omsm
- npracs(k)= npracs(k)*ratio
- nnuccr(k)= nnuccr(k)*ratio
- nragg(k) = nragg(k)*ratio
- pnrf(k) = pnrf(k)*ratio
- end if
-
- ! conservation of qni
-
- qnie = mu(i,k)*qni(i,k)+dz(i,k)*( (prai(k)+psacws(k)+prci(k)+ &
- pracs(k)+mnuccr(k))*arcf(i,k) )
- dum = arcf(i,k)*dz(i,k)*(-psf(k))
-
- if(qnie.lt.0._r8) then
- psf(k) = 0._r8
- else if (dum.gt.qnie) then
- ratio = qnie/dum*omsm
- psf(k) = psf(k)*ratio
- end if
-
- ! conservation of ns
- nse = mu(i,k)*ns(i,k)+dz(i,k)*(nprci(k)+nnuccr(k))*arcf(i,k)
- dum = arcf(i,k)*dz(i,k)*(-nsagg(k)-pnsf(k))
- if (nse.lt.0._r8) then
- nsagg(k) = 0._r8
- pnsf(k) = 0._r8
- else if (dum.gt.nse) then
- ratio = nse/dum*omsm
- nsagg(k) = nsagg(k)*ratio
- pnsf(k) = pnsf(k)*ratio
- end if
-
- !*****************************************************************************
- ! get tendencies due to microphysical conversion processes
- !*****************************************************************************
-
- if (k.le.kqc(i)) then
- qctend(i,k) = (-pra(k)-prc(k)-prb(k)-mnuccc(k)-mnucct(k)-msacwi(k)- &
- psacws(k))
-
- qitend(i,k) = (prb(k)+mnuccc(k)+mnucct(k)+msacwi(k)-prci(k)- prai(k))
-
- qrtend(i,k) = (pra(k)+prc(k))+(-pracs(k)- mnuccr(k))
-
- qnitend(i,k) = (prai(k)+psacws(k)+prci(k))+(pracs(k)+mnuccr(k))
-
- ! multiply activation/nucleation by mtime to account for fast timescale
-
- nctend(i,k) = npccn(k)*mtimec+(-nnuccc(k)-nnucct(k)-npsacws(k) &
- -npra(k)-nprc1(k)-nprb(k))
-
- nitend(i,k) = nnuccd(k)*mtime+(nnuccc(k)+ nnucct(k)+nsacwi(k)-nprci(k)- &
- nprai(k))
-
- nstend(i,k) = nsagg(k)+nnuccr(k) + nprci(k)
-
- nrtend(i,k) = nprc(k)+(-npracs(k)-nnuccr(k) +nragg(k))
-
- ! for output
- ! cloud liquid water-------------
-
- autolm(i,k-1) = -prc(k)*arcf(i,k)
- accrlm(i,k-1) = -pra(k)*arcf(i,k)
- bergnm(i,k-1) = -prb(k)*arcf(i,k)
- fhtimm(i,k-1) = -mnuccc(k)*arcf(i,k)
- fhtctm(i,k-1) = -mnucct(k)*arcf(i,k)
- hmpim (i,k-1) = -msacwi(k)*arcf(i,k)
- accslm(i,k-1) = -psacws(k)*arcf(i,k)
- fhmlm(i,k-1) = -fholm(i,k)/dz(i,k)
-
- autoln(i,k-1) = -nprc1(k)*arcf(i,k)
- accrln(i,k-1) = -npra(k)*arcf(i,k)
- bergnn(i,k-1) = -nprb(k)*arcf(i,k)
- fhtimn(i,k-1) = -nnuccc(k)*arcf(i,k)
- fhtctn(i,k-1) = -nnucct(k)*arcf(i,k)
- accsln(i,k-1) = -npsacws(k)*arcf(i,k)
- activn(i,k-1) = npccn(k)*mtimec*arcf(i,k)
- fhmln(i,k-1) = -fholn(i,k)/dz(i,k)
-
- !cloud ice------------------------
-
- autoim(i,k-1) = -prci(k)*arcf(i,k)
- accsim(i,k-1) = -prai(k)*arcf(i,k)
-
- nuclin(i,k-1) = nnuccd(k)*mtime*arcf(i,k)
- autoin(i,k-1) = -nprci(k)*arcf(i,k)
- accsin(i,k-1) = -nprai(k)*arcf(i,k)
- hmpin (i,k-1) = nsacwi(k)*arcf(i,k)
-
- else
- qctend(i,k) = 0._r8
- qitend(i,k) = 0._r8
- qrtend(i,k) = 0._r8
- qnitend(i,k) = 0._r8
- nctend(i,k) = 0._r8
- nitend(i,k) = 0._r8
- nstend(i,k) = 0._r8
- nrtend(i,k) = 0._r8
- end if
-
- !********************************************************************************
- ! vertical integration
- !********************************************************************************
- ! snow
- if ( k.le.kqi(i) ) then
- qni(i,k-1) = 1._r8/mu(i,k-1)* &
- (mu(i,k)*qni(i,k)+dz(i,k)*(qnitend(i,k)+psf(k))*arcf(i,k) )
-
- ns(i,k-1) = 1._r8/mu(i,k-1)* &
- (mu(i,k)*ns(i,k)+dz(i,k)*(nstend(i,k)+pnsf(k))*arcf(i,k) )
-
- else
- qni(i,k-1)=0._r8
- ns(i,k-1)=0._r8
- end if
-
- if (qni(i,k-1).le.0._r8) then
- qni(i,k-1)=0._r8
- ns(i,k-1)=0._r8
- end if
-
- ! rain
- if (k.le.kqc(i) ) then
- qr(i,k-1) = 1._r8/mu(i,k-1)* &
- (mu(i,k)*qr(i,k)+dz(i,k)*(qrtend(i,k)+prf(k))*arcf(i,k) )
-
- nr(i,k-1) = 1._r8/mu(i,k-1)* &
- (mu(i,k)*nr(i,k)+dz(i,k)*(nrtend(i,k)+pnrf(k))*arcf(i,k) )
-
- else
- qr(i,k-1)=0._r8
- nr(i,k-1)=0._r8
- end if
-
- if( qr(i,k-1) .le. 0._r8) then
- qr(i,k-1)=0._r8
- nr(i,k-1)=0._r8
- end if
-
- ! freeze rain homogeneously at -40 C
-
- if (t(i,k-1) < 233.15_r8 .and. qr(i,k-1) > 0._r8) then
-
- ! make sure freezing rain doesn't increase temperature above threshold
- dum = xlf/cp*qr(i,k-1)
- if (t(i,k-1)+dum.gt.233.15_r8) then
- dum = -(t(i,k-1)-233.15_r8)*cp/xlf
- dum = dum/qr(i,k-1)
- dum = max(0._r8,dum)
- dum = min(1._r8,dum)
- else
- dum = 1._r8
- end if
- qni(i,k-1)=qni(i,k-1)+dum*qr(i,k-1)
- ns(i,k-1)=ns(i,k-1)+dum*nr(i,k-1)
- qr(i,k-1)=(1._r8-dum)*qr(i,k-1)
- nr(i,k-1)=(1._r8-dum)*nr(i,k-1)
- fhmrm(i,k-1) = -mu(i,k-1)*dum*qr(i,k-1)/dz(i,k)
- end if
-
-
- ! cloud water
- if ( k.le.kqc(i) ) then
- qc(i,k-1) = (mu(i,k)*qc(i,k)-fholm(i,k)+dz(i,k)*qctend(i,k)*arcf(i,k) &
- +dz(i,k)*cmel(i,k-1) )/(mu(i,k-1)+dz(i,k)*du(i,k-1))
-
- qcde(i,k) = qc(i,k-1)
-
- nc(i,k-1) = (mu(i,k)*nc(i,k) -fholn(i,k) +dz(i,k)*nctend(i,k)*arcf(i,k) ) &
- /(mu(i,k-1)+dz(i,k)*du(i,k-1))
-
- ncde(i,k) = nc(i,k-1)
- else
- qc(i,k-1)=0._r8
- nc(i,k-1)=0._r8
- end if
-
- if (qc(i,k-1).lt.0._r8) write(iulog,*) "negative qc(i,k-1)=",qc(i,k-1)
- dlfm(i,k-1) = -du(i,k-1)*qcde(i,k)
- dlfn(i,k-1) = -du(i,k-1)*ncde(i,k)
-
- if (qc(i,k-1).le. 0._r8) then
- qc(i,k-1)=0._r8
- nc(i,k-1)=0._r8
- end if
-
- if (nc(i,k-1).lt. 0._r8) then
- write(iulog,*) "nc(i,k-1)=",nc(i,k-1),"k-1=",k-1,"arcf(i,k)=",arcf(i,k)
- write(iulog,*) "mu(i,k-1)=",mu(i,k-1),"mu(i,k)=",mu(i,k),"nc(i,k)=",ni(i,k)
- write(iulog,*) "dz(i,k)=",dz(i,k),"du(i,k-1)=",du(i,k-1),"nctend(i,k)=",nctend(i,k)
- write(iulog,*) "eu(i,k-1)=",eu(i,k-1)
- end if
-
- ! cloud ice
- if( k.le.kqi(i)) then
- qi(i,k-1) = (mu(i,k)*qi(i,k)+fholm(i,k) +dz(i,k)*qitend(i,k)*arcf(i,k) &
- +dz(i,k)*cmei(i,k-1) )/(mu(i,k-1)+dz(i,k)*du(i,k-1))
-
- qide(i,k) = qi(i,k-1)
-
- ni(i,k-1) = (mu(i,k)*ni(i,k)+fholn(i,k)+dz(i,k)*nitend(i,k)*arcf(i,k) ) &
- /(mu(i,k-1)+dz(i,k)*du(i,k-1))
-
- nide(i,k) = ni(i,k-1)
- else
- qi(i,k-1)=0._r8
- ni(i,k-1)=0._r8
- end if
-
- if (qi(i,k-1).lt.0._r8) write(iulog,*) "negative qi(i,k-1)=",qi(i,k-1)
- difm(i,k-1) = -du(i,k-1)*qide(i,k)
- difn(i,k-1) = -du(i,k-1)*nide(i,k)
-
- if (qi(i,k-1).le. 0._r8) then
- qi(i,k-1)=0._r8
- ni(i,k-1)=0._r8
- end if
-
-
- if (ni(i,k-1).lt. 0._r8) then
- write(iulog,*) "ni(i,k-1)=",ni(i,k-1),"k-1=",k-1,"arcf(i,k)=",arcf(i,k)
- write(iulog,*) "mu(i,k-1)=",mu(i,k-1),"mu(i,k)=",mu(i,k),"ni(i,k)=",ni(i,k)
- write(iulog,*) "dz(i,k)=",dz(i,k),"du(i,k-1)=",du(i,k-1),"nitend(i,k)=",nitend(i,k)
- write(iulog,*) "eu(i,k-1)=",eu(i,k-1)
- end if
-
-
- frz(i,k-1) = cmei(i,k-1) + arcf(i,k)*(prb(k)+mnuccc(k)+mnucct(k)+msacwi(k)+ &
- pracs(k)+mnuccr(k)+psacws(k) )-fhmlm(i,k-1)-fhmrm(i,k-1)
-
-
- !******************************************************************************
- ! get size distribution parameters based on in-cloud cloud water/ice
- ! these calculations also ensure consistency between number and mixing ratio
-
- ! following equation(2,3,4) of Morrison and Gettelman, 2008, J. Climate.
- ! Gamma(n)= (n-1)!
- ! lamc <-> lambda for cloud liquid water
- ! pgam <-> meu for cloud liquid water
- ! meu=0 for ice,rain and snow
- !*******************************************************************************
-
- ! cloud ice
- niorg = ni(i,k-1)
- if (qi(i,k-1).ge.qsmall) then
-
- ! add upper limit to in-cloud number concentration to prevent numerical error
- ni(i,k-1)=min(ni(i,k-1),qi(i,k-1)*1.e20_r8)
- ! ni should be non-negative
- ! ni(i,k-1) = max(ni(i,k-1), 0._r8)
- if (ni(i,k-1).lt. 0._r8) write(iulog,*) "ni(i,k-1)=",ni(i,k-1)
-
- lami(k-1) = (gamma(1._r8+di)*ci* &
- ni(i,k-1)/qi(i,k-1))**(1._r8/di)
- n0i(k-1) = ni(i,k-1)*lami(k-1)
-
- ! check for slope
- lammax = 1._r8/10.e-6_r8
- lammin = 1._r8/(2._r8*dcs)
-
- ! adjust vars
- if (lami(k-1).lt.lammin) then
- lami(k-1) = lammin
- n0i(k-1) = lami(k-1)**(di+1._r8)*qi(i,k-1)/(ci*gamma(1._r8+di))
- ni(i,k-1) = n0i(k-1)/lami(k-1)
- else if (lami(k-1).gt.lammax) then
- lami(k-1) = lammax
- n0i(k-1) = lami(k-1)**(di+1._r8)*qi(i,k-1)/(ci*gamma(1._r8+di))
- ni(i,k-1) = n0i(k-1)/lami(k-1)
- end if
- else
- lami(k-1) = 0._r8
- n0i(k-1) = 0._r8
- end if
-
- nide(i,k) = ni(i,k-1)
- difn(i,k-1) = -du(i,k-1)*nide(i,k)
-
- niadj(i,k-1)= (ni(i,k-1)- niorg)*mu(i,k-1)/dz(i,k)
-
- if (niadj(i,k-1) .lt. 0._r8) then
- total = nuclin(i,k-1)-fhtimn(i,k-1)-fhtctn(i,k-1)-fhmln(i,k-1)+ hmpin (i,k-1)
- if (total .ne. 0._r8) then
- nuclin(i,k-1) = nuclin(i,k-1) + nuclin(i,k-1)*niadj(i,k-1)/total
- fhtimn(i,k-1) = fhtimn(i,k-1) + fhtimn(i,k-1)*niadj(i,k-1)/total
- fhtctn(i,k-1) = fhtctn(i,k-1) + fhtctn(i,k-1)*niadj(i,k-1)/total
- fhmln (i,k-1) = fhmln (i,k-1) + fhmln (i,k-1)*niadj(i,k-1)/total
- hmpin (i,k-1) = hmpin (i,k-1) + hmpin (i,k-1)*niadj(i,k-1)/total
- else
- total = 5._r8
- nuclin(i,k-1) = nuclin(i,k-1) + niadj(i,k-1)/total
- fhtimn(i,k-1) = fhtimn(i,k-1) + niadj(i,k-1)/total
- fhtctn(i,k-1) = fhtctn(i,k-1) + niadj(i,k-1)/total
- fhmln (i,k-1) = fhmln (i,k-1) + niadj(i,k-1)/total
- hmpin (i,k-1) = hmpin (i,k-1) + niadj(i,k-1)/total
- end if
- else if (niadj(i,k-1) .gt. 0._r8) then
- total = autoin(i,k-1)+accsin(i,k-1)
- if (total .ne. 0._r8) then
- autoin(i,k-1) = autoin(i,k-1) + autoin(i,k-1)*niadj(i,k-1)/total
- accsin(i,k-1) = accsin(i,k-1) + accsin(i,k-1)*niadj(i,k-1)/total
- else
- total = 2._r8
- autoin(i,k-1) = autoin(i,k-1) + niadj(i,k-1)/total
- accsin(i,k-1) = accsin(i,k-1) + niadj(i,k-1)/total
- end if
- end if
-
- !................................................................................
- !cloud water
- ncorg = nc(i,k-1)
- if (qc(i,k-1).ge.qsmall) then
-
- ! add upper limit to in-cloud number concentration to prevent numerical error
- nc(i,k-1)=min(nc(i,k-1),qc(i,k-1)*1.e20_r8)
- ! and make sure it's non-negative
- ! nc(i,k-1) = max(nc(i,k-1), 0._r8)
- if (nc(i,k-1).lt. 0._r8) write(iulog,*) "nc(i,k-1)=",nc(i,k-1)
-
- ! get pgam from fit to observations of martin et al. 1994
-
- pgam(i,k-1)=0.0005714_r8*(nc(i,k-1)/1.e6_r8/rho(i,k-1))+0.2714_r8
- pgam(i,k-1)=1._r8/(pgam(i,k-1)**2)-1._r8
- pgam(i,k-1)=max(pgam(i,k-1),2._r8)
- pgam(i,k-1)=min(pgam(i,k-1),15._r8)
- ! calculate lamc
-
- lamc(i,k-1) = (pi/6._r8*rhow*nc(i,k-1)*gamma(pgam(i,k-1)+4._r8)/ &
- (qc(i,k-1)*gamma(pgam(i,k-1)+1._r8)))**(1._r8/3._r8)
-
- ! lammin, 50 micron diameter max mean size
- lammin = (pgam(i,k-1)+1._r8)/40.e-6_r8
- lammax = (pgam(i,k-1)+1._r8)/1.e-6_r8
-
- if (lamc(i,k-1).lt.lammin) then
- lamc(i,k-1) = lammin
- nc(i,k-1) = 6._r8*lamc(i,k-1)**3*qc(i,k-1)* &
- gamma(pgam(i,k-1)+1._r8)/ &
- (pi*rhow*gamma(pgam(i,k-1)+4._r8))
- else if (lamc(i,k-1).gt.lammax) then
- lamc(i,k-1) = lammax
- nc(i,k-1) = 6._r8*lamc(i,k-1)**3*qc(i,k-1)* &
- gamma(pgam(i,k-1)+1._r8)/ &
- (pi*rhow*gamma(pgam(i,k-1)+4._r8))
- end if
-
- ! parameter to calculate droplet freezing
-
- cdist1(k-1) = nc(i,k-1)/gamma(pgam(i,k-1)+1._r8)
- else
- lamc(i,k-1) = 0._r8
- cdist1(k-1) = 0._r8
- end if
-
- ncde(i,k) = nc(i,k-1)
- dlfn(i,k-1) = -du(i,k-1)*ncde(i,k)
-
- ncadj(i,k-1) = (nc(i,k-1)- ncorg)*mu(i,k-1)/dz(i,k)
- if (ncadj(i,k-1) .lt. 0._r8) then
- activn(i,k-1) = activn(i,k-1) + ncadj(i,k-1)
- else if (ncadj(i,k-1) .gt. 0._r8) then
- total = autoln(i,k-1)+accrln(i,k-1)+bergnn(i,k-1)+accsln(i,k-1)
- if (total .ne. 0._r8) then
- autoln(i,k-1) = autoln(i,k-1) + autoln(i,k-1)*ncadj(i,k-1)/total
- accrln(i,k-1) = accrln(i,k-1) + accrln(i,k-1)*ncadj(i,k-1)/total
- bergnn(i,k-1) = bergnn(i,k-1) + bergnn(i,k-1)*ncadj(i,k-1)/total
- accsln(i,k-1) = accsln(i,k-1) + accsln(i,k-1)*ncadj(i,k-1)/total
- else
- total = 4._r8
- autoln(i,k-1) = autoln(i,k-1) + ncadj(i,k-1)/total
- accrln(i,k-1) = accrln(i,k-1) + ncadj(i,k-1)/total
- bergnn(i,k-1) = bergnn(i,k-1) + ncadj(i,k-1)/total
- accsln(i,k-1) = accsln(i,k-1) + ncadj(i,k-1)/total
- end if
- end if
-
- trspcm(i,k-1) = (mu(i,k)*qc(i,k) - mu(i,k-1)*qc(i,k-1))/dz(i,k)
- trspcn(i,k-1) = (mu(i,k)*nc(i,k) - mu(i,k-1)*nc(i,k-1))/dz(i,k)
- trspim(i,k-1) = (mu(i,k)*qi(i,k) - mu(i,k-1)*qi(i,k-1))/dz(i,k)
- trspin(i,k-1) = (mu(i,k)*ni(i,k) - mu(i,k-1)*ni(i,k-1))/dz(i,k)
-
- if (k-1 .eq. jt(i)+1) then
- trspcm(i,k-2) = mu(i,k-1)*qc(i,k-1)/dz(i,k-1)
- trspcn(i,k-2) = mu(i,k-1)*nc(i,k-1)/dz(i,k-1)
- trspim(i,k-2) = mu(i,k-1)*qi(i,k-1)/dz(i,k-1)
- trspin(i,k-2) = mu(i,k-1)*ni(i,k-1)/dz(i,k-1)
- qcde(i,k-1) = qc(i,k-1)
- ncde(i,k-1) = nc(i,k-1)
- qide(i,k-1) = qi(i,k-1)
- nide(i,k-1) = ni(i,k-1)
- dlfm (i,k-2) = -du(i,k-2)*qcde(i,k-1)
- dlfn (i,k-2) = -du(i,k-2)*ncde(i,k-1)
- difm (i,k-2) = -du(i,k-2)*qide(i,k-1)
- difn (i,k-2) = -du(i,k-2)*nide(i,k-1)
- end if
-
-
- !.......................................................................
- ! get size distribution parameters for precip
- !......................................................................
- ! rain
- if (qr(i,k-1).ge.qsmall) then
-
- lamr(k-1) = (pi*rhow*nr(i,k-1)/qr(i,k-1))**(1._r8/3._r8)
- n0r(k-1) = nr(i,k-1)*lamr(k-1)
-
- ! check for slope
- lammax = 1._r8/150.e-6_r8
- lammin = 1._r8/3000.e-6_r8
- ! adjust vars
- if (lamr(k-1).lt.lammin) then
- lamr(k-1) = lammin
- n0r(k-1) = lamr(k-1)**4*qr(i,k-1)/(pi*rhow)
- nr(i,k-1) = n0r(k-1)/lamr(k-1)
- else if (lamr(k-1).gt.lammax) then
- lamr(k-1) = lammax
- n0r(k-1) = lamr(k-1)**4*qr(i,k-1)/(pi*rhow)
- nr(i,k-1) = n0r(k-1)/lamr(k-1)
- end if
-
- unr(k-1) = min(arn(i,k-1)*gamma(1._r8+br)/lamr(k-1)**br,10._r8)
- umr(k-1) = min(arn(i,k-1)*gamma(4._r8+br)/(6._r8*lamr(k-1)**br),10._r8)
- else
- lamr(k-1) = 0._r8
- n0r(k-1) = 0._r8
- umr(k-1) = 0._r8
- unr(k-1) = 0._r8
- end if
-
- !......................................................................
- ! snow
- if (qni(i,k-1).ge.qsmall) then
- lams(k-1) = (gamma(1._r8+ds)*cs*ns(i,k-1)/ &
- qni(i,k-1))**(1._r8/ds)
- n0s(k-1) = ns(i,k-1)*lams(k-1)
-
- ! check for slope
- lammax = 1._r8/10.e-6_r8
- lammin = 1._r8/2000.e-6_r8
-
- ! adjust vars
- if (lams(k-1).lt.lammin) then
- lams(k-1) = lammin
- n0s(k-1) = lams(k-1)**(ds+1._r8)*qni(i,k-1)/(cs*gamma(1._r8+ds))
- ns(i,k-1) = n0s(k-1)/lams(k-1)
- else if (lams(k-1).gt.lammax) then
- lams(k-1) = lammax
- n0s(k-1) = lams(k-1)**(ds+1._r8)*qni(i,k-1)/(cs*gamma(1._r8+ds))
- ns(i,k-1) = n0s(k-1)/lams(k-1)
- end if
- ums(k-1) = min(asn(i,k-1)*gamma(4._r8+bs)/(6._r8*lams(k-1)**bs),3.6_r8)
- uns(k-1) = min(asn(i,k-1)*gamma(1._r8+bs)/lams(k-1)**bs,3.6_r8)
- else
- lams(k-1) = 0._r8
- n0s(k-1) = 0._r8
- ums(k-1) = 0._r8
- uns(k-1) = 0._r8
- end if
-
- rprd(i,k-1)= (qnitend(i,k) + qrtend(i,k))*arcf(i,k)
- sprd(i,k-1)= qnitend(i,k) *arcf(i,k) -fhmrm(i,k-1)
-
- end if ! kshr_kind_r8
+use shr_kind_mod, only: cl=>shr_kind_cl
use spmd_utils, only: masterproc
use ppgrid, only: pcols, pver, pverp, psubcols
use physconst, only: gravit, rair, tmelt, cpair, rh2o, rhoh2o, &
@@ -76,6 +77,7 @@ module micro_pumas_cam
real(r8) :: micro_mg_autocon_lwp_exp = unset_r8 ! autoconversion lwp exponent
real(r8) :: micro_mg_homog_size = unset_r8 ! size of freezing homogeneous ice
real(r8) :: micro_mg_vtrmi_factor = unset_r8 ! ice fall speed factor
+real(r8) :: micro_mg_vtrms_factor = unset_r8 ! snow fall speed factor
real(r8) :: micro_mg_effi_factor = unset_r8 ! ice effective radius factor
real(r8) :: micro_mg_iaccr_factor = unset_r8 ! ice accretion of cloud droplet
real(r8) :: micro_mg_max_nicons = unset_r8 ! max allowed ice number concentration
@@ -235,8 +237,8 @@ module micro_pumas_cam
frzcnt_idx = -1, &
frzdep_idx = -1
-logical :: allow_sed_supersat ! allow supersaturated conditions after sedimentation loop
-logical :: micro_do_sb_physics = .false. ! do SB 2001 autoconversion and accretion
+logical :: allow_sed_supersat ! allow supersaturated conditions after sedimentation loop
+character(len=16) :: micro_mg_warm_rain= 'kk2000' ! 'tau', 'emulated', 'sb2001' and ' kk2000'
integer :: bergso_idx = -1
@@ -251,6 +253,9 @@ subroutine micro_pumas_cam_readnl(nlfile)
use spmd_utils, only: mpicom, mstrid=>masterprocid, mpi_integer, mpi_real8, &
mpi_logical, mpi_character
+ use stochastic_emulated_cam, only: stochastic_emulated_readnl
+ use stochastic_tau_cam, only: stochastic_tau_readnl
+
character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input
! Namelist variables
@@ -266,10 +271,10 @@ subroutine micro_pumas_cam_readnl(nlfile)
namelist /micro_mg_nl/ micro_mg_version, micro_mg_sub_version, &
micro_mg_do_cldice, micro_mg_do_cldliq, micro_mg_num_steps, &
microp_uniform, micro_mg_dcs, micro_mg_precip_frac_method, &
- micro_mg_berg_eff_factor, micro_do_sb_physics, micro_mg_adjust_cpt, &
+ micro_mg_berg_eff_factor, micro_mg_warm_rain, micro_mg_adjust_cpt, &
micro_mg_do_hail, micro_mg_do_graupel, micro_mg_ngcons, micro_mg_ngnst, &
- micro_mg_vtrmi_factor, micro_mg_effi_factor, micro_mg_iaccr_factor, &
- micro_mg_max_nicons, micro_mg_accre_enhan_fact, &
+ micro_mg_vtrmi_factor, micro_mg_vtrms_factor, micro_mg_effi_factor, &
+ micro_mg_iaccr_factor, micro_mg_max_nicons, micro_mg_accre_enhan_fact, &
micro_mg_autocon_fact, micro_mg_autocon_nd_exp, micro_mg_autocon_lwp_exp, micro_mg_homog_size, &
micro_mg_nccons, micro_mg_nicons, micro_mg_ncnst, micro_mg_ninst, &
micro_mg_nrcons, micro_mg_nscons, micro_mg_nrnst, micro_mg_nsnst, &
@@ -383,6 +388,9 @@ subroutine micro_pumas_cam_readnl(nlfile)
call mpi_bcast(micro_mg_vtrmi_factor, 1, mpi_real8, mstrid, mpicom, ierr)
if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: micro_mg_vtrmi_factor")
+ call mpi_bcast(micro_mg_vtrms_factor, 1, mpi_real8, mstrid, mpicom, ierr)
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: micro_mg_vtrms_factor")
+
call mpi_bcast(micro_mg_effi_factor, 1, mpi_real8, mstrid, mpicom, ierr)
if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: micro_mg_effi_factor")
@@ -395,8 +403,8 @@ subroutine micro_pumas_cam_readnl(nlfile)
call mpi_bcast(micro_mg_precip_frac_method, 16, mpi_character, mstrid, mpicom, ierr)
if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: micro_mg_precip_frac_method")
- call mpi_bcast(micro_do_sb_physics, 1, mpi_logical, mstrid, mpicom, ierr)
- if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: micro_do_sb_physics")
+ call mpi_bcast(micro_mg_warm_rain, 16, mpi_character, mstrid, mpicom, ierr)
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: micro_mg_warm_rain")
call mpi_bcast(micro_mg_adjust_cpt, 1, mpi_logical, mstrid, mpicom, ierr)
if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: micro_mg_adjust_cpt")
@@ -477,6 +485,7 @@ subroutine micro_pumas_cam_readnl(nlfile)
if(micro_mg_autocon_lwp_exp == unset_r8) call endrun(sub//": FATAL: micro_mg_autocon_lwp_exp is not set")
if(micro_mg_homog_size == unset_r8) call endrun(sub//": FATAL: micro_mg_homog_size is not set")
if(micro_mg_vtrmi_factor == unset_r8) call endrun(sub//": FATAL: micro_mg_vtrmi_factor is not set")
+ if(micro_mg_vtrms_factor == unset_r8) call endrun(sub//": FATAL: micro_mg_vtrms_factor is not set")
if(micro_mg_effi_factor == unset_r8) call endrun(sub//": FATAL: micro_mg_effi_factor is not set")
if(micro_mg_iaccr_factor == unset_r8) call endrun(sub//": FATAL: micro_mg_iaccr_factor is not set")
if(micro_mg_max_nicons == unset_r8) call endrun(sub//": FATAL: micro_mg_max_nicons is not set")
@@ -498,11 +507,12 @@ subroutine micro_pumas_cam_readnl(nlfile)
write(iulog,*) ' micro_mg_autocon_lwp_exp = ' , micro_mg_autocon_lwp_exp
write(iulog,*) ' micro_mg_homog_size = ', micro_mg_homog_size
write(iulog,*) ' micro_mg_vtrmi_factor = ', micro_mg_vtrmi_factor
+ write(iulog,*) ' micro_mg_vtrms_factor = ', micro_mg_vtrms_factor
write(iulog,*) ' micro_mg_effi_factor = ', micro_mg_effi_factor
write(iulog,*) ' micro_mg_iaccr_factor = ', micro_mg_iaccr_factor
write(iulog,*) ' micro_mg_max_nicons = ', micro_mg_max_nicons
write(iulog,*) ' micro_mg_precip_frac_method = ', micro_mg_precip_frac_method
- write(iulog,*) ' micro_do_sb_physics = ', micro_do_sb_physics
+ write(iulog,*) ' micro_mg_warm_rain = ', micro_mg_warm_rain
write(iulog,*) ' micro_mg_adjust_cpt = ', micro_mg_adjust_cpt
write(iulog,*) ' micro_mg_nccons = ', micro_mg_nccons
write(iulog,*) ' micro_mg_nicons = ', micro_mg_nicons
@@ -529,6 +539,13 @@ subroutine micro_pumas_cam_readnl(nlfile)
write(iulog,*) ' micro_mg_accre_sees_auto = ', micro_mg_accre_sees_auto
end if
+ ! Read in the emulated or tau namelist if needed
+ if( trim(micro_mg_warm_rain) == 'emulated') then
+ call stochastic_emulated_readnl(nlfile)
+ else if (trim(micro_mg_warm_rain) == 'tau') then
+ call stochastic_tau_readnl(nlfile)
+ end if
+
contains
subroutine bad_version_endrun
@@ -544,7 +561,6 @@ end subroutine micro_pumas_cam_readnl
!================================================================================================
subroutine micro_pumas_cam_register
-
use cam_history_support, only: add_vert_coord, hist_dimension_values
use cam_abortutils, only: handle_allocate_error
@@ -843,6 +859,8 @@ subroutine micro_pumas_cam_init(pbuf2d)
use time_manager, only: is_first_step
use micro_pumas_utils, only: micro_pumas_utils_init
use micro_pumas_v1, only: micro_mg_init3_0 => micro_pumas_init
+ use stochastic_tau_cam, only: stochastic_tau_init_cam
+ use stochastic_emulated_cam, only: stochastic_emulated_init_cam
!-----------------------------------------------------------------------
!
@@ -863,6 +881,9 @@ subroutine micro_pumas_cam_init(pbuf2d)
integer :: ierr
character(128) :: errstring ! return status (non-blank for error return)
+ character(len=cl) :: stochastic_emulated_filename_quantile, stochastic_emulated_filename_input_scale, &
+ stochastic_emulated_filename_output_scale
+
!-----------------------------------------------------------------------
call phys_getopts(use_subcol_microp_out=use_subcol_microp, &
@@ -890,6 +911,15 @@ subroutine micro_pumas_cam_init(pbuf2d)
ncnst = 10
end if
+ ! If Machine learning is turned on, perform its initializations
+ if (trim(micro_mg_warm_rain) == 'tau') then
+ call stochastic_tau_init_cam()
+ else if( trim(micro_mg_warm_rain) == 'emulated') then
+ call stochastic_emulated_init_cam(stochastic_emulated_filename_quantile, &
+ stochastic_emulated_filename_input_scale, &
+ stochastic_emulated_filename_output_scale)
+ end if
+
call micro_mg_init3_0( &
r8, gravit, rair, rh2o, cpair, &
tmelt, latvap, latice, rhmini, &
@@ -899,16 +929,18 @@ subroutine micro_pumas_cam_init(pbuf2d)
micro_mg_precip_frac_method, micro_mg_berg_eff_factor, &
micro_mg_accre_enhan_fact , &
micro_mg_autocon_fact , micro_mg_autocon_nd_exp, micro_mg_autocon_lwp_exp, micro_mg_homog_size, &
- micro_mg_vtrmi_factor, micro_mg_effi_factor, micro_mg_iaccr_factor, &
- micro_mg_max_nicons, &
- allow_sed_supersat, micro_do_sb_physics, &
+ micro_mg_vtrmi_factor, micro_mg_vtrms_factor, micro_mg_effi_factor, &
+ micro_mg_iaccr_factor, micro_mg_max_nicons, &
+ allow_sed_supersat, micro_mg_warm_rain, &
micro_mg_evap_sed_off, micro_mg_icenuc_rh_off, micro_mg_icenuc_use_meyers, &
micro_mg_evap_scl_ifs, micro_mg_evap_rhthrsh_ifs, &
micro_mg_rainfreeze_ifs, micro_mg_ifs_sed, micro_mg_precip_fall_corr,&
micro_mg_accre_sees_auto, micro_mg_implicit_fall, &
micro_mg_nccons, micro_mg_nicons, micro_mg_ncnst, &
micro_mg_ninst, micro_mg_ngcons, micro_mg_ngnst, &
- micro_mg_nrcons, micro_mg_nrnst, micro_mg_nscons, micro_mg_nsnst, errstring)
+ micro_mg_nrcons, micro_mg_nrnst, micro_mg_nscons, micro_mg_nsnst, &
+ stochastic_emulated_filename_quantile, stochastic_emulated_filename_input_scale, &
+ stochastic_emulated_filename_output_scale, iulog, errstring)
call handle_errmsg(errstring, subname="micro_pumas_cam_init")
@@ -1013,6 +1045,23 @@ subroutine micro_pumas_cam_init(pbuf2d)
call addfld ('NMELTO', (/ 'trop_cld_lev' /), 'A', '#/kg/s', 'Number Tendency due to Melting of cloud ice ')
call addfld ('NMELTS', (/ 'trop_cld_lev' /), 'A', '#/kg/s', 'Number Tendency due to Melting of snow')
+ if (trim(micro_mg_warm_rain) == 'kk2000') then
+ call addfld ('qctend_KK2000', (/ 'trop_cld_lev' /), 'A', 'kg/kg/s', 'cloud liquid mass tendency due to autoconversion & accretion from KK2000')
+ call addfld ('nctend_KK2000', (/ 'trop_cld_lev' /), 'A', '#/kg/s', 'cloud number mass tendency due to autoconversion & accretion from KK2000')
+ call addfld ('qrtend_KK2000', (/ 'trop_cld_lev' /), 'A', 'kg/kg/s', 'rain mass tendency due to autoconversion & accretion from KK2000')
+ call addfld ('nrtend_KK2000', (/ 'trop_cld_lev' /), 'A', '#/kg/s', 'rain number tendency due to autoconversion & accretion from KK2000')
+ end if
+ if (trim(micro_mg_warm_rain) == 'sb2001') then
+ call addfld ('qctend_SB2001', (/ 'trop_cld_lev' /), 'A', 'kg/kg/s', 'cloud liquid mass tendency due to autoconversion & accretion from SB2001')
+ call addfld ('nctend_SB2001', (/ 'trop_cld_lev' /), 'A', '#/kg/s', 'cloud liquid number tendency due to autoconversion & accretion from SB2001')
+ call addfld ('qrtend_SB2001', (/ 'trop_cld_lev' /), 'A', 'kg/kg/s', 'rain mass tendency due to autoconversion & accretion from SB2001')
+ call addfld ('nrtend_SB2001', (/ 'trop_cld_lev' /), 'A', '#/kg/s', 'rain number tendency due to autoconversion & accretion from SB2001')
+ end if
+ call addfld ('LAMC', (/ 'trop_cld_lev' /), 'A', 'unitless', 'Size distribution parameter lambda for liquid' )
+ call addfld ('LAMR', (/ 'trop_cld_lev' /), 'A', 'unitless', 'Size distribution parameter lambda for rain' )
+ call addfld ('PGAM', (/ 'trop_cld_lev' /), 'A', 'unitless', 'Size distribution parameter mu (pgam) for liquid' )
+ call addfld ('N0R', (/ 'trop_cld_lev' /), 'A', 'unitless', 'Size distribution parameter n0 for rain' )
+
if (micro_mg_version > 2) then
call addfld ('NMELTG', (/ 'trop_cld_lev' /), 'A', '#/kg/s', 'Number Tendency due to Melting of graupel')
call addfld ('NGSEDTEN', (/ 'trop_cld_lev' /), 'A', '#/kg/s', 'Number Tendency due to graupel sedimentation')
@@ -1424,6 +1473,8 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf)
use infnan, only: nan, assignment(=)
use cam_abortutils, only: handle_allocate_error
+ use stochastic_tau_cam, only: ncd
+
type(physics_state), intent(in) :: state
type(physics_ptend), intent(out) :: ptend
real(r8), intent(in) :: dtime
@@ -1849,7 +1900,7 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf)
! all the other arrays in this routine are dimensioned pver. This is required because
! PUMAS only gets the top_lev:pver array subsection, and the proc_rates arrays
! need to be the same levels.
- call proc_rates%allocate(ncol,nlev, errstring)
+ call proc_rates%allocate(ncol, nlev, ncd, micro_mg_warm_rain, errstring)
call handle_errmsg(errstring, subname="micro_pumas_cam_tend")
@@ -2322,6 +2373,16 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf)
! Update local state
call physics_update(state_loc, ptend_loc, dtime/num_steps)
+ if (trim(micro_mg_warm_rain) == 'tau') then
+ proc_rates%amk_c(:ncol,:,:) = proc_rates%amk_c(:ncol,:,:)/num_steps
+ proc_rates%ank_c(:ncol,:,:) = proc_rates%ank_c(:ncol,:,:)/num_steps
+ proc_rates%amk_r(:ncol,:,:) = proc_rates%amk_r(:ncol,:,:)/num_steps
+ proc_rates%ank_r(:ncol,:,:) = proc_rates%ank_r(:ncol,:,:)/num_steps
+ proc_rates%amk(:ncol,:,:) = proc_rates%amk(:ncol,:,:)/num_steps
+ proc_rates%ank(:ncol,:,:) = proc_rates%ank(:ncol,:,:)/num_steps
+ proc_rates%amk_out(:ncol,:,:) = proc_rates%amk_out(:ncol,:,:)/num_steps
+ end if
+
end do
! Divide ptend by substeps.
@@ -2498,6 +2559,7 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf)
!Copy pbuf field from proc_rates back to pbuf pointer
bergstot(:ncol,top_lev:) = proc_rates%bergstot(:ncol,1:nlev)
+ bergstot(:ncol,1:top_lev-1) = 0._r8
! ------------------------------------------------------ !
! ------------------------------------------------------ !
@@ -2628,6 +2690,7 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf)
nmultgo_grid(:ncol,:top_lev-1) = 0._r8
nmultrgo_grid(:ncol,:top_lev-1) = 0._r8
npsacwgo_grid(:ncol,:top_lev-1) = 0._r8
+ bergso_grid(:ncol,:top_lev-1) = 0._r8
! These pbuf fields need to be assigned. There is no corresponding subcol_field_avg
! as they are reset before being used, so it would be a needless calculation
@@ -3190,6 +3253,56 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf)
call outfld( 'MPDI2P', ftem_grid, pcols, lchnk)
! Output fields which have not been averaged already, averaging if use_subcol_microp is true
+ if (trim(micro_mg_warm_rain) == 'tau' .or. trim(micro_mg_warm_rain) == 'emulated') then
+ call outfld('scale_qc', proc_rates%scale_qc, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('scale_nc', proc_rates%scale_nc, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('scale_qr', proc_rates%scale_qr, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('scale_nr', proc_rates%scale_nr, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('amk_c', proc_rates%amk_c, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('ank_c', proc_rates%ank_c, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('amk_r', proc_rates%amk_r, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('ank_r', proc_rates%ank_r, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('amk', proc_rates%amk, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('ank', proc_rates%ank, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('amk_out', proc_rates%amk_out, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('ank_out', proc_rates%ank_out, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('QC_TAU_out', proc_rates%qc_out_TAU, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('NC_TAU_out', proc_rates%nc_out_TAU, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('QR_TAU_out', proc_rates%qr_out_TAU, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('NR_TAU_out', proc_rates%nr_out_TAU, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('qctend_TAU', proc_rates%qctend_TAU, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('nctend_TAU', proc_rates%nctend_TAU, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('qrtend_TAU', proc_rates%qrtend_TAU, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('nrtend_TAU', proc_rates%nrtend_TAU, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('gmnnn_lmnnn_TAU', proc_rates%gmnnn_lmnnn_TAU, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('ML_fixer', proc_rates%ML_fixer, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('qc_fixer', proc_rates%qc_fixer, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('nc_fixer', proc_rates%nc_fixer, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('qr_fixer', proc_rates%qr_fixer, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('nr_fixer', proc_rates%nr_fixer, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('QC_TAU_in', proc_rates%qc_in_TAU, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('NC_TAU_in', proc_rates%nc_in_TAU, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('QR_TAU_in', proc_rates%qr_in_TAU, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('NR_TAU_in', proc_rates%nr_in_TAU, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ end if
+
+ if (trim(micro_mg_warm_rain) == 'sb2001') then
+ call outfld('qctend_SB2001', proc_rates%qctend_SB2001, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('nctend_SB2001', proc_rates%nctend_SB2001, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('qrtend_SB2001', proc_rates%qrtend_SB2001, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('nrtend_SB2001', proc_rates%nrtend_SB2001, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ end if
+ if (trim(micro_mg_warm_rain) == 'kk2000') then
+ call outfld('qctend_KK2000', proc_rates%qctend_KK2000, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('nctend_KK2000', proc_rates%nctend_KK2000, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('qrtend_KK2000', proc_rates%qrtend_KK2000, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('nrtend_KK2000', proc_rates%nrtend_KK2000, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ end if
+ call outfld('LAMC', proc_rates%lamc_out, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('LAMR', proc_rates%lamr_out, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('PGAM', proc_rates%pgam_out, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+ call outfld('N0R', proc_rates%n0r_out, ncol, lchnk, avg_subcol_field=use_subcol_microp)
+
call outfld('MPICLWPI', iclwpi, psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld('MPICIWPI', iciwpi, psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld('REFL', refl, psetcols, lchnk, avg_subcol_field=use_subcol_microp)
@@ -3390,7 +3503,7 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf)
end if
! deallocate the proc_rates DDT
- call proc_rates%deallocate()
+ call proc_rates%deallocate(micro_mg_warm_rain)
! ptend_loc is deallocated in physics_update above
call physics_state_dealloc(state_loc)
diff --git a/src/physics/cam_dev/physpkg.F90 b/src/physics/cam_dev/physpkg.F90
index d2fe6f7ca0..1c461c9a1c 100644
--- a/src/physics/cam_dev/physpkg.F90
+++ b/src/physics/cam_dev/physpkg.F90
@@ -21,6 +21,8 @@ module physpkg
use constituents, only: pcnst, cnst_name, cnst_get_ind
use camsrfexch, only: cam_out_t, cam_in_t
+ use phys_control, only: use_hemco ! Use Harmonized Emissions Component (HEMCO)
+
use cam_control_mod, only: ideal_phys, adiabatic
use phys_control, only: phys_do_flux_avg, phys_getopts, waccmx_is
use scamMod, only: single_column, scm_crm_mode
@@ -71,6 +73,8 @@ module physpkg
integer :: qini_idx = 0
integer :: cldliqini_idx = 0
integer :: cldiceini_idx = 0
+ integer :: totliqini_idx = 0
+ integer :: toticeini_idx = 0
integer :: prec_str_idx = 0
integer :: snow_str_idx = 0
@@ -110,6 +114,7 @@ subroutine phys_register
use cam_control_mod, only: moist_physics
use chemistry, only: chem_register
+ use mo_lightning, only: lightning_register
use cloud_fraction, only: cldfrc_register
use microp_driver, only: microp_driver_register
use microp_aero, only: microp_aero_register
@@ -145,6 +150,7 @@ subroutine phys_register
use subcol_utils, only: is_subcol_on, subcol_get_scheme
use dyn_comp, only: dyn_register
use offline_driver, only: offline_driver_reg
+ use hemco_interface, only: HCOI_Chunk_Init
!---------------------------Local variables-----------------------------
!
@@ -194,6 +200,8 @@ subroutine phys_register
call pbuf_add_field('QINI', 'physpkg', dtype_r8, (/pcols,pver/), qini_idx)
call pbuf_add_field('CLDLIQINI', 'physpkg', dtype_r8, (/pcols,pver/), cldliqini_idx)
call pbuf_add_field('CLDICEINI', 'physpkg', dtype_r8, (/pcols,pver/), cldiceini_idx)
+ call pbuf_add_field('TOTLIQINI', 'physpkg', dtype_r8, (/pcols,pver/), totliqini_idx)
+ call pbuf_add_field('TOTICEINI', 'physpkg', dtype_r8, (/pcols,pver/), toticeini_idx)
! check energy package
call check_energy_register
@@ -253,6 +261,9 @@ subroutine phys_register
! register chemical constituents including aerosols ...
call chem_register()
+ ! add prognostic lightning flash freq pbuf fld
+ call lightning_register()
+
! co2 constituents
call co2_register()
@@ -319,6 +330,11 @@ subroutine phys_register
call offline_driver_reg()
+ if (use_hemco) then
+ ! initialize harmonized emissions component (HEMCO)
+ call HCOI_Chunk_Init()
+ endif
+
! This needs to be last as it requires all pbuf fields to be added
if (cam_snapshot_before_num > 0 .or. cam_snapshot_after_num > 0) then
call pbuf_cam_snapshot_register()
@@ -699,6 +715,7 @@ subroutine phys_init( phys_state, phys_tend, pbuf2d, cam_in, cam_out )
use cam_control_mod, only: initial_run
use check_energy, only: check_energy_init
use chemistry, only: chem_init
+ use mo_lightning, only: lightning_init
use prescribed_ozone, only: prescribed_ozone_init
use prescribed_ghg, only: prescribed_ghg_init
use prescribed_aero, only: prescribed_aero_init
@@ -749,6 +766,10 @@ subroutine phys_init( phys_state, phys_tend, pbuf2d, cam_in, cam_out )
use nudging, only: Nudge_Model, nudging_init
use cam_snapshot, only: cam_snapshot_init
use cam_history, only: addfld, register_vector_field, add_default
+ use cam_budget, only: cam_budget_init
+ use phys_grid_ctem, only: phys_grid_ctem_init
+
+ use ccpp_constituent_prop_mod, only: ccpp_const_props_init
! Input/output arguments
type(physics_state), pointer :: phys_state(:)
@@ -831,6 +852,9 @@ subroutine phys_init( phys_state, phys_tend, pbuf2d, cam_in, cam_out )
! Prognostic chemistry.
call chem_init(phys_state,pbuf2d)
+ ! Lightning flash frq and NOx prod
+ call lightning_init( pbuf2d )
+
! Prescribed tracers
call prescribed_ozone_init()
call prescribed_ghg_init()
@@ -925,12 +949,22 @@ subroutine phys_init( phys_state, phys_tend, pbuf2d, cam_in, cam_out )
end if
+ ! Initialize CAM CCPP constituent properties array
+ ! for use in CCPP-ized physics schemes:
+ call ccpp_const_props_init()
+
! Initialize qneg3 and qneg4
call qneg_init()
+ ! Initialize phys TEM diagnostics
+ call phys_grid_ctem_init()
+
! Initialize the snapshot capability
call cam_snapshot_init(cam_in, cam_out, pbuf2d, begchunk)
+ ! Initialize the budget capability
+ call cam_budget_init()
+
! addfld calls for U, V tendency budget variables that are output in
! tphysac, tphysbc
call addfld ( 'UTEND_DCONV', (/ 'lev' /), 'A', 'm/s2', 'Zonal wind tendency by deep convection')
@@ -1148,6 +1182,7 @@ subroutine phys_run2(phys_state, ztodt, phys_tend, pbuf2d, cam_out, &
#if ( defined OFFLINE_DYN )
use metdata, only: get_met_srf2
#endif
+ use hemco_interface, only: HCOI_Chunk_Run
!
! Input arguments
!
@@ -1181,6 +1216,14 @@ subroutine phys_run2(phys_state, ztodt, phys_tend, pbuf2d, cam_out, &
!-----------------------------------------------------------------------
if (single_column) call scam_use_iop_srf(cam_in)
+ if(use_hemco) then
+ !----------------------------------------------------------
+ ! run hemco (phase 2 before chemistry)
+ ! only phase 2 is used currently for HEMCO-CESM
+ !----------------------------------------------------------
+ call HCOI_Chunk_Run(cam_in, phys_state, pbuf2d, phase=2)
+ endif
+
!-----------------------------------------------------------------------
! Tendency physics after coupler
! Not necessary at terminal timestep.
@@ -1192,9 +1235,9 @@ subroutine phys_run2(phys_state, ztodt, phys_tend, pbuf2d, cam_out, &
!
call get_met_srf2( cam_in )
#endif
- ! Set lightning production of NO
+ ! lightning flash freq and prod rate of NOx
call t_startf ('lightning_no_prod')
- call lightning_no_prod( phys_state, pbuf2d, cam_in )
+ call lightning_no_prod( phys_state, pbuf2d, cam_in )
call t_stopf ('lightning_no_prod')
call t_barrierf('sync_ac_physics', mpicom)
@@ -1248,6 +1291,9 @@ subroutine phys_final( phys_state, phys_tend, pbuf2d )
use carma_intr, only: carma_final
use wv_saturation, only: wv_sat_final
use microp_aero, only: microp_aero_final
+ use phys_grid_ctem, only: phys_grid_ctem_final
+ use nudging, only: Nudge_Model, nudging_final
+ use hemco_interface, only: HCOI_Chunk_Final
!-----------------------------------------------------------------------
!
@@ -1270,6 +1316,13 @@ subroutine phys_final( phys_state, phys_tend, pbuf2d )
call carma_final
call wv_sat_final
call microp_aero_final()
+ call phys_grid_ctem_final()
+ if(Nudge_Model) call nudging_final()
+
+ if(use_hemco) then
+ ! cleanup hemco
+ call HCOI_Chunk_Final
+ endif
end subroutine phys_final
@@ -1309,7 +1362,7 @@ subroutine tphysac (ztodt, cam_in, &
use aoa_tracers, only: aoa_tracers_timestep_tend
use physconst, only: rhoh2o
use aero_model, only: aero_model_drydep
- use check_energy, only: check_energy_chng, calc_te_and_aam_budgets
+ use check_energy, only: check_energy_chng, tot_energy_phys
use check_energy, only: check_tracers_data, check_tracers_init, check_tracers_chng
use time_manager, only: get_nstep
use cam_abortutils, only: endrun
@@ -1352,6 +1405,10 @@ subroutine tphysac (ztodt, cam_in, &
use carma_flags_mod, only: carma_do_aerosol, carma_do_emission, carma_do_detrain
use carma_flags_mod, only: carma_do_cldice, carma_do_cldliq, carma_do_wetdep
use dyn_tests_utils, only: vc_dycore
+ use cam_thermo, only: cam_thermo_water_update
+ use cam_budget, only: thermo_budget_history
+ use dyn_tests_utils, only: vc_dycore, vc_height, vc_dry_pressure
+ use air_composition, only: cpairv, cp_or_cv_dycore
!
! Arguments
!
@@ -1437,12 +1494,10 @@ subroutine tphysac (ztodt, cam_in, &
real(r8) obklen(pcols) ! Obukhov length
real(r8) :: fh2o(pcols) ! h2o flux to balance source from methane chemistry
real(r8) :: flx_heat(pcols) ! Heat flux for check_energy_chng.
- real(r8) :: tmp_q (pcols,pver) ! tmp space
- real(r8) :: tmp_cldliq(pcols,pver) ! tmp space
- real(r8) :: tmp_cldice(pcols,pver) ! tmp space
real(r8) :: tmp_trac (pcols,pver,pcnst) ! tmp space
real(r8) :: tmp_pdel (pcols,pver) ! tmp space
real(r8) :: tmp_ps (pcols) ! tmp space
+ real(r8) :: scaling(pcols,pver)
logical :: moist_mixing_ratio_dycore
! physics buffer fields for total energy and mass adjustment
@@ -1452,6 +1507,8 @@ subroutine tphysac (ztodt, cam_in, &
real(r8), pointer, dimension(:,:) :: qini
real(r8), pointer, dimension(:,:) :: cldliqini
real(r8), pointer, dimension(:,:) :: cldiceini
+ real(r8), pointer, dimension(:,:) :: totliqini
+ real(r8), pointer, dimension(:,:) :: toticeini
real(r8), pointer, dimension(:,:) :: dtcore
real(r8), pointer, dimension(:,:) :: dqcore
real(r8), pointer, dimension(:,:) :: ducore
@@ -1487,6 +1544,8 @@ subroutine tphysac (ztodt, cam_in, &
call pbuf_get_field(pbuf, qini_idx, qini)
call pbuf_get_field(pbuf, cldliqini_idx, cldliqini)
call pbuf_get_field(pbuf, cldiceini_idx, cldiceini)
+ call pbuf_get_field(pbuf, totliqini_idx, totliqini)
+ call pbuf_get_field(pbuf, toticeini_idx, toticeini)
ifld = pbuf_get_index('CLD')
call pbuf_get_field(pbuf, ifld, cld, start=(/1,1,itim_old/),kount=(/pcols,pver,1/))
@@ -1543,7 +1602,7 @@ subroutine tphysac (ztodt, cam_in, &
call cam_snapshot_all_outfld_tphysac(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf,&
fh2o, surfric, obklen, flx_heat, cmfmc, dlf, det_s, det_ice, net_flx)
end if
- call chem_emissions( state, cam_in )
+ call chem_emissions( state, cam_in, pbuf )
if (trim(cam_take_snapshot_after) == "chem_emissions") then
call cam_snapshot_all_outfld_tphysac(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf,&
fh2o, surfric, obklen, flx_heat, cmfmc, dlf, det_s, det_ice, net_flx)
@@ -2264,8 +2323,8 @@ subroutine tphysac (ztodt, cam_in, &
call cam_snapshot_all_outfld_tphysac(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf,&
fh2o, surfric, obklen, flx_heat, cmfmc, dlf, det_s, det_ice, net_flx)
end if
- call calc_te_and_aam_budgets(state, 'phAP')
- call calc_te_and_aam_budgets(state, 'dyAP',vc=vc_dycore)
+ call tot_energy_phys(state, 'phAP')
+ call tot_energy_phys(state, 'dyAP',vc=vc_dycore)
!---------------------------------------------------------------------------------
! Enforce charge neutrality after O+ change from ionos_tend
@@ -2295,61 +2354,77 @@ subroutine tphysac (ztodt, cam_in, &
!-------------- Energy budget checks vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
! Save total energy for global fixer in next timestep
+ !
+ ! This call must be after the last parameterization and call to physics_update
+ !
call pbuf_set_field(pbuf, teout_idx, state%te_cur(:,dyn_te_idx), (/1,itim_old/),(/pcols,1/))
!
! FV: convert dry-type mixing ratios to moist here because physics_dme_adjust
! assumes moist. This is done in p_d_coupling for other dynamics. Bundy, Feb 2004.
moist_mixing_ratio_dycore = dycore_is('LR').or. dycore_is('FV3')
- if (moist_mixing_ratio_dycore) call set_dry_to_wet(state) ! Physics had dry, dynamics wants moist
-
- ! Scale dry mass and energy (does nothing if dycore is EUL or SLD)
- tmp_q (:ncol,:pver) = state%q(:ncol,:pver,ixq)
- tmp_cldliq(:ncol,:pver) = state%q(:ncol,:pver,ixcldliq)
- tmp_cldice(:ncol,:pver) = state%q(:ncol,:pver,ixcldice)
+ !
+ ! update cp/cv for energy computation based in updated water variables
+ !
+ call cam_thermo_water_update(state%q(:ncol,:,:), lchnk, ncol, vc_dycore,&
+ to_dry_factor=state%pdel(:ncol,:)/state%pdeldry(:ncol,:))
! for dry mixing ratio dycore, physics_dme_adjust is called for energy diagnostic purposes only.
! So, save off tracers
- if (.not.moist_mixing_ratio_dycore.and.&
- (hist_fld_active('SE_phAM').or.hist_fld_active('KE_phAM').or.hist_fld_active('WV_phAM').or.&
- hist_fld_active('WL_phAM').or.hist_fld_active('WI_phAM').or.hist_fld_active('MR_phAM').or.&
- hist_fld_active('MO_phAM'))) then
- tmp_trac(:ncol,:pver,:pcnst) = state%q(:ncol,:pver,:pcnst)
- tmp_pdel(:ncol,:pver) = state%pdel(:ncol,:pver)
- tmp_ps(:ncol) = state%ps(:ncol)
-
+ if (.not.moist_mixing_ratio_dycore) then
+ !
+ ! for dry-mixing ratio based dycores dme_adjust takes place in the dynamical core
+ !
+ ! only compute dme_adjust for diagnostics purposes
+ !
+ if (thermo_budget_history) then
+ tmp_trac(:ncol,:pver,:pcnst) = state%q(:ncol,:pver,:pcnst)
+ tmp_pdel(:ncol,:pver) = state%pdel(:ncol,:pver)
+ tmp_ps(:ncol) = state%ps(:ncol)
+ call physics_dme_adjust(state, tend, qini, totliqini, toticeini, ztodt)
+ call tot_energy_phys(state, 'phAM')
+ call tot_energy_phys(state, 'dyAM', vc=vc_dycore)
+ ! Restore pre-"physics_dme_adjust" tracers
+ state%q(:ncol,:pver,:pcnst) = tmp_trac(:ncol,:pver,:pcnst)
+ state%pdel(:ncol,:pver) = tmp_pdel(:ncol,:pver)
+ state%ps(:ncol) = tmp_ps(:ncol)
+ end if
+ else
+ !
+ ! for moist-mixing ratio based dycores
+ !
+ ! Note: this operation will NOT be reverted with set_wet_to_dry after set_dry_to_wet call
+ !
call set_dry_to_wet(state)
-
- call physics_dme_adjust(state, tend, qini, ztodt)
-
- call calc_te_and_aam_budgets(state, 'phAM')
- call calc_te_and_aam_budgets(state, 'dyAM',vc=vc_dycore)
- ! Restore pre-"physics_dme_adjust" tracers
- state%q(:ncol,:pver,:pcnst) = tmp_trac(:ncol,:pver,:pcnst)
- state%pdel(:ncol,:pver) = tmp_pdel(:ncol,:pver)
- state%ps(:ncol) = tmp_ps(:ncol)
- end if
-
- if (moist_mixing_ratio_dycore) then
-
if (trim(cam_take_snapshot_before) == "physics_dme_adjust") then
call cam_snapshot_all_outfld_tphysac(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf,&
fh2o, surfric, obklen, flx_heat, cmfmc, dlf, det_s, det_ice, net_flx)
end if
-
- call physics_dme_adjust(state, tend, qini, ztodt)
-
+ call physics_dme_adjust(state, tend, qini, totliqini, toticeini, ztodt)
if (trim(cam_take_snapshot_after) == "physics_dme_adjust") then
- call cam_snapshot_all_outfld_tphysac(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf,&
- fh2o, surfric, obklen, flx_heat, cmfmc, dlf, det_s, det_ice, net_flx)
+ call cam_snapshot_all_outfld_tphysac(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf,&
+ fh2o, surfric, obklen, flx_heat, cmfmc, dlf, det_s, det_ice, net_flx)
end if
- call calc_te_and_aam_budgets(state, 'phAM')
- call calc_te_and_aam_budgets(state, 'dyAM',vc=vc_dycore)
+ call tot_energy_phys(state, 'phAM')
+ call tot_energy_phys(state, 'dyAM', vc=vc_dycore)
endif
-!!! REMOVE THIS CALL, SINCE ONLY Q IS BEING ADJUSTED. WON'T BALANCE ENERGY. TE IS SAVED BEFORE THIS
-!!! call check_energy_chng(state, tend, "drymass", nstep, ztodt, zero, zero, zero, zero)
+ if (vc_dycore == vc_height.or.vc_dycore == vc_dry_pressure) then
+ !
+ ! MPAS and SE specific scaling of temperature for enforcing energy consistency
+ ! (and to make sure that temperature dependent diagnostic tendencies
+ ! are computed correctly; e.g. dtcore)
+ !
+ scaling(1:ncol,:) = cpairv(:ncol,:,lchnk)/cp_or_cv_dycore(:ncol,:,lchnk)
+ state%T(1:ncol,:) = state%temp_ini(1:ncol,:)+&
+ scaling(1:ncol,:)*(state%T(1:ncol,:)-state%temp_ini(1:ncol,:))
+ tend%dtdt(:ncol,:) = scaling(:ncol,:)*tend%dtdt(:ncol,:)
+ !
+ ! else: do nothing for dycores with energy consistent with CAM physics
+ !
+ end if
+
! store T, U, and V in buffer for use in computing dynamics T-tendency in next timestep
do k = 1,pver
@@ -2374,8 +2449,7 @@ subroutine tphysac (ztodt, cam_in, &
endif
endif
- call diag_phys_tend_writeout (state, pbuf, tend, ztodt, tmp_q, tmp_cldliq, tmp_cldice, &
- qini, cldliqini, cldiceini)
+ call diag_phys_tend_writeout (state, pbuf, tend, ztodt, qini, cldliqini, cldiceini)
call clybry_fam_set( ncol, lchnk, map2chm, state%q, pbuf )
@@ -2419,12 +2493,14 @@ subroutine tphysbc (ztodt, state, &
use cam_diagnostics, only: diag_conv_tend_ini, diag_conv, diag_export, diag_state_b4_phys_write
use cam_history, only: outfld
use constituents, only: qmin
+ use air_composition, only: thermodynamic_active_species_liq_num,thermodynamic_active_species_liq_idx
+ use air_composition, only: thermodynamic_active_species_ice_num,thermodynamic_active_species_ice_idx
use convect_deep, only: convect_deep_tend
use time_manager, only: is_first_step, get_nstep
use convect_diagnostics,only: convect_diagnostics_calc
use check_energy, only: check_energy_chng, check_energy_fix
use check_energy, only: check_tracers_data, check_tracers_init
- use check_energy, only: calc_te_and_aam_budgets
+ use check_energy, only: tot_energy_phys
use dycore, only: dycore_is
use radiation, only: radiation_tend
use perf_mod
@@ -2474,6 +2550,7 @@ subroutine tphysbc (ztodt, state, &
integer :: i ! column indicex
integer :: ixcldice, ixcldliq, ixq ! constituent indices for cloud liquid and ice water.
+ integer :: m, m_cnst
! physics buffer fields to compute tendencies for stratiform package
integer itim_old, ifld
@@ -2484,6 +2561,8 @@ subroutine tphysbc (ztodt, state, &
real(r8), pointer, dimension(:,:) :: qini
real(r8), pointer, dimension(:,:) :: cldliqini
real(r8), pointer, dimension(:,:) :: cldiceini
+ real(r8), pointer, dimension(:,:) :: totliqini
+ real(r8), pointer, dimension(:,:) :: toticeini
real(r8), pointer, dimension(:,:) :: dtcore
real(r8), pointer, dimension(:,:) :: dqcore
real(r8), pointer, dimension(:,:) :: ducore
@@ -2548,6 +2627,8 @@ subroutine tphysbc (ztodt, state, &
call pbuf_get_field(pbuf, qini_idx, qini)
call pbuf_get_field(pbuf, cldliqini_idx, cldliqini)
call pbuf_get_field(pbuf, cldiceini_idx, cldiceini)
+ call pbuf_get_field(pbuf, totliqini_idx, totliqini)
+ call pbuf_get_field(pbuf, toticeini_idx, toticeini)
call pbuf_get_field(pbuf, dtcore_idx, dtcore, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) )
call pbuf_get_field(pbuf, dqcore_idx, dqcore, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) )
@@ -2594,8 +2675,8 @@ subroutine tphysbc (ztodt, state, &
!===================================================
call t_startf('energy_fixer')
- call calc_te_and_aam_budgets(state, 'phBF')
- call calc_te_and_aam_budgets(state, 'dyBF',vc=vc_dycore)
+ call tot_energy_phys(state, 'phBF')
+ call tot_energy_phys(state, 'dyBF',vc=vc_dycore)
if (.not.dycore_is('EUL')) then
call check_energy_fix(state, ptend, nstep, flx_heat)
@@ -2604,8 +2685,8 @@ subroutine tphysbc (ztodt, state, &
call outfld( 'EFIX', flx_heat , pcols, lchnk )
end if
- call calc_te_and_aam_budgets(state, 'phBP')
- call calc_te_and_aam_budgets(state, 'dyBP',vc=vc_dycore)
+ call tot_energy_phys(state, 'phBP')
+ call tot_energy_phys(state, 'dyBP',vc=vc_dycore)
! Save state for convective tendency calculations.
call diag_conv_tend_ini(state, pbuf)
@@ -2616,6 +2697,18 @@ subroutine tphysbc (ztodt, state, &
cldliqini(:ncol,:pver) = state%q(:ncol,:pver,ixcldliq)
cldiceini(:ncol,:pver) = state%q(:ncol,:pver,ixcldice)
+ totliqini(:ncol,:pver) = 0.0_r8
+ do m_cnst=1,thermodynamic_active_species_liq_num
+ m = thermodynamic_active_species_liq_idx(m_cnst)
+ totliqini(:ncol,:pver) = totliqini(:ncol,:pver)+state%q(:ncol,:pver,m)
+ end do
+ toticeini(:ncol,:pver) = 0.0_r8
+ do m_cnst=1,thermodynamic_active_species_ice_num
+ m = thermodynamic_active_species_ice_idx(m_cnst)
+ toticeini(:ncol,:pver) = toticeini(:ncol,:pver)+state%q(:ncol,:pver,m)
+ end do
+
+
call outfld('TEOUT', teout , pcols, lchnk )
call outfld('TEINP', state%te_ini(:,dyn_te_idx), pcols, lchnk )
call outfld('TEFIX', state%te_cur(:,dyn_te_idx), pcols, lchnk )
@@ -2828,6 +2921,7 @@ subroutine phys_timestep_init(phys_state, cam_in, cam_out, pbuf2d)
use iop_forcing, only: scam_use_iop_srf
use nudging, only: Nudge_Model, nudging_timestep_init
use waccmx_phys_intr, only: waccmx_phys_ion_elec_temp_timestep_init
+ use phys_grid_ctem, only: phys_grid_ctem_diags
implicit none
@@ -2895,6 +2989,9 @@ subroutine phys_timestep_init(phys_state, cam_in, cam_out, pbuf2d)
!----------------------------------
if(Nudge_Model) call nudging_timestep_init(phys_state)
+ ! Update TEM diagnostics
+ call phys_grid_ctem_diags(phys_state)
+
end subroutine phys_timestep_init
end module physpkg
diff --git a/src/physics/cam_dev/stochastic_emulated_cam.F90 b/src/physics/cam_dev/stochastic_emulated_cam.F90
new file mode 100644
index 0000000000..8fbc9e44a1
--- /dev/null
+++ b/src/physics/cam_dev/stochastic_emulated_cam.F90
@@ -0,0 +1,134 @@
+module stochastic_emulated_cam
+! From Morrison (Lebo, originally TAU bin code)
+! Gettelman and Chen 2018
+!the subroutines take in air density, air temperature, and the bin mass boundaries, and
+!output the mass and number mixing ratio tendencies in each bin directly.
+!this is then wrapped for CAM.
+
+use shr_kind_mod, only: cl=>shr_kind_cl
+use cam_history, only: addfld
+use cam_logfile, only: iulog
+use cam_abortutils, only: endrun
+
+implicit none
+private
+save
+
+! Subroutines
+public :: stochastic_emulated_readnl
+public :: stochastic_emulated_init_cam
+
+!Module variables
+integer, parameter, public :: ncd = 35
+integer, parameter, public :: ncdp = ncd + 1
+
+character(len=cl) :: stochastic_emulated_filename_quantile = " "
+character(len=cl) :: stochastic_emulated_filename_input_scale = " "
+character(len=cl) :: stochastic_emulated_filename_output_scale = " "
+
+!===============================================================================
+contains
+!===============================================================================
+
+subroutine stochastic_emulated_readnl(nlfile)
+
+ use namelist_utils, only: find_group_name
+ use units, only: getunit, freeunit
+ use spmd_utils, only: mpicom, mstrid=>masterprocid, mpi_character, masterproc
+ use string_utils, only: int2str
+
+ character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input
+ integer :: unitn, ierr
+ character(len=*), parameter :: sub = 'stochastic_emulated_readnl'
+
+ namelist /stochastic_emulated_nl/ stochastic_emulated_filename_quantile, stochastic_emulated_filename_input_scale, &
+ stochastic_emulated_filename_output_scale
+
+ if (masterproc) then
+ unitn = getunit()
+ open( unitn, file=trim(nlfile), status='old' )
+ call find_group_name(unitn, 'stochastic_emulated_nl', status=ierr)
+ if (ierr == 0) then
+ read(unitn, stochastic_emulated_nl, iostat=ierr)
+ if (ierr /= 0) then
+ call endrun(sub // ':: ERROR reading namelist, iostat = ' // int2str(ierr))
+ end if
+ end if
+ close(unitn)
+ call freeunit(unitn)
+ end if
+
+ ! Broadcast namelist variables
+ call mpi_bcast(stochastic_emulated_filename_quantile, cl, mpi_character, mstrid, mpicom, ierr)
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: stochastic_emulated_filename_quantile")
+
+ call mpi_bcast(stochastic_emulated_filename_input_scale, cl, mpi_character, mstrid, mpicom, ierr)
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: stochastic_emulated_filename_input_scale")
+
+ call mpi_bcast(stochastic_emulated_filename_output_scale, cl, mpi_character, mstrid, mpicom, ierr)
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: stochastic_emulated_filename_output_scale")
+
+ write(iulog,*) 'PUMAS stochastic_emulated_readnl, stochastic_emulated_filename_quantile=',&
+ stochastic_emulated_filename_quantile
+
+end subroutine stochastic_emulated_readnl
+
+subroutine stochastic_emulated_init_cam(stochastic_emulated_filename_quantile_out, &
+ stochastic_emulated_filename_input_scale_out, &
+ stochastic_emulated_filename_output_scale_out)
+
+ use cam_history_support, only: add_hist_coord
+
+ character(len=cl),intent(out) :: stochastic_emulated_filename_quantile_out
+ character(len=cl),intent(out) :: stochastic_emulated_filename_input_scale_out
+ character(len=cl),intent(out) :: stochastic_emulated_filename_output_scale_out
+
+ call add_hist_coord('bins_ncd', ncd, 'bins for TAU microphysics')
+
+ call addfld('amk_c',(/'trop_cld_lev','bins_ncd '/),'A','kg','cloud liquid mass from bins')
+ call addfld('ank_c',(/'trop_cld_lev','bins_ncd '/),'A','1/kg','cloud liquid number concentration from bins')
+ call addfld('amk_r',(/'trop_cld_lev','bins_ncd '/),'A','kg','rain mass from bins')
+ call addfld('ank_r',(/'trop_cld_lev','bins_ncd '/),'A','1/kg','rain number concentration from bins')
+ call addfld('amk',(/'trop_cld_lev','bins_ncd '/),'A','kg','all liquid mass from bins')
+ call addfld('ank',(/'trop_cld_lev','bins_ncd '/),'A','1/kg','all liquid number concentration from bins')
+ call addfld('amk_out',(/'trop_cld_lev','bins_ncd '/),'A','kg','all liquid mass from bins')
+ call addfld('ank_out',(/'trop_cld_lev','bins_ncd '/),'A','1/kg','all liquid number concentration from bins')
+
+ call addfld('scale_nc',(/'trop_cld_lev'/),'A','1','scaling factor for nc')
+ call addfld('scale_nr',(/'trop_cld_lev'/),'A','1','scaling factor for nr')
+ call addfld('scale_qc',(/'trop_cld_lev'/),'A','1','scaling factor for qc')
+ call addfld('scale_qr',(/'trop_cld_lev'/),'A','1','scaling factor for qr')
+
+ call addfld('QC_TAU_in',(/'trop_cld_lev'/),'A','kg/kg','qc in TAU')
+ call addfld('NC_TAU_in',(/'trop_cld_lev'/),'A','1/kg','nc in TAU')
+ call addfld('QR_TAU_in',(/'trop_cld_lev'/),'A','kg/kg','qr in TAU')
+ call addfld('NR_TAU_in',(/'trop_cld_lev'/),'A','1/kg','nr in TAU')
+ call addfld('QC_TAU_out',(/'trop_cld_lev'/),'A','kg/kg','qc out TAU')
+ call addfld('NC_TAU_out',(/'trop_cld_lev'/),'A','1/kg','nc out TAU')
+ call addfld('QR_TAU_out',(/'trop_cld_lev'/),'A','kg/kg','qr out TAU')
+ call addfld('NR_TAU_out',(/'trop_cld_lev'/),'A','1/kg','nr out TAU')
+
+ call addfld('qctend_TAU',(/'trop_cld_lev'/),'A','kg/kg/s','qc tendency due to TAU bin code')
+ call addfld('nctend_TAU',(/'trop_cld_lev'/),'A','1/kg/s','nc tendency due to TAU bin code')
+ call addfld('qrtend_TAU',(/'trop_cld_lev'/),'A','kg/kg/s','qr tendency due to TAU bin code')
+ call addfld('nrtend_TAU',(/'trop_cld_lev'/),'A','1/kg/s','nr tendency due to TAU bin code')
+ call addfld('qctend_TAU_diag',(/'trop_cld_lev'/),'A','kg/kg/s','qc tendency due to TAU bin code')
+ call addfld('nctend_TAU_diag',(/'trop_cld_lev'/),'A','1/kg/s','nc tendency due to TAU bin code')
+ call addfld('qrtend_TAU_diag',(/'trop_cld_lev'/),'A','kg/kg/s','qr tendency due to TAU bin code')
+ call addfld('nrtend_TAU_diag',(/'trop_cld_lev'/),'A','1/kg/s','nr tendency due to TAU bin code')
+
+ call addfld('gmnnn_lmnnn_TAU',(/'trop_cld_lev'/),'A','1','sum of mass gain and loss from bin code')
+ call addfld('ML_fixer',(/'trop_cld_lev'/),'A','1','frequency that ML fixer is activated')
+ call addfld('qc_fixer',(/'trop_cld_lev'/),'A','kg/kg','delta qc due to ML fixer')
+ call addfld('nc_fixer',(/'trop_cld_lev'/),'A','kg/kg','delta nc due to ML fixer')
+ call addfld('qr_fixer',(/'trop_cld_lev'/),'A','kg/kg','delta qr due to ML fixer')
+ call addfld('nr_fixer',(/'trop_cld_lev'/),'A','kg/kg','delta nr due to ML fixer')
+
+ stochastic_emulated_filename_quantile_out = stochastic_emulated_filename_quantile
+ stochastic_emulated_filename_input_scale_out = stochastic_emulated_filename_input_scale
+ stochastic_emulated_filename_output_scale_out = stochastic_emulated_filename_output_scale
+
+end subroutine stochastic_emulated_init_cam
+end module stochastic_emulated_cam
+
+
diff --git a/src/physics/cam_dev/stochastic_tau_cam.F90 b/src/physics/cam_dev/stochastic_tau_cam.F90
new file mode 100644
index 0000000000..b305201e7c
--- /dev/null
+++ b/src/physics/cam_dev/stochastic_tau_cam.F90
@@ -0,0 +1,117 @@
+module stochastic_tau_cam
+! From Morrison (Lebo, originally TAU bin code)
+! Gettelman and Chen 2018
+!the subroutines take in air density, air temperature, and the bin mass boundaries, and
+!output the mass and number mixing ratio tendencies in each bin directly.
+!this is then wrapped for CAM.
+
+use shr_kind_mod, only: cl=>shr_kind_cl
+use cam_history, only: addfld
+use cam_logfile, only: iulog
+
+implicit none
+private
+save
+
+! Subroutines
+public :: stochastic_tau_init_cam, stochastic_tau_readnl
+
+!Module variables
+
+integer, parameter, public :: ncd = 35
+character(len=cl) :: pumas_stochastic_tau_kernel_filename ! Full filepath/filename for tau kernel file
+
+!===============================================================================
+contains
+!===============================================================================
+subroutine stochastic_tau_readnl(nlfile)
+
+ use namelist_utils, only: find_group_name
+ use units, only: getunit, freeunit
+ use spmd_utils, only: mpicom, mstrid=>masterprocid, mpi_character, masterproc
+ use cam_abortutils, only: endrun
+ use string_utils, only: int2str
+
+ character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input
+
+ integer :: unitn, ierr
+ character(len=*), parameter :: sub = 'stochastic_tau_readnl'
+
+ namelist /pumas_stochastic_tau_nl/ pumas_stochastic_tau_kernel_filename
+
+ if (masterproc) then
+ unitn = getunit()
+ open( unitn, file=trim(nlfile), status='old' )
+ call find_group_name(unitn, 'pumas_stochastic_tau_nl', status=ierr)
+ if (ierr == 0) then
+ read(unitn, pumas_stochastic_tau_nl, iostat=ierr)
+ if (ierr /= 0) then
+ call endrun(sub // ':: ERROR reading namelist, iostat = ' // int2str(ierr))
+ end if
+ end if
+ close(unitn)
+ call freeunit(unitn)
+ end if
+
+ ! Broadcast namelist variables
+ call mpi_bcast(pumas_stochastic_tau_kernel_filename, cl, mpi_character, mstrid, mpicom, ierr)
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: pumas_stochastic_tau_kernel_filename")
+
+ write(iulog,*) 'PUMAS stochastic_tau_readnl, pumas_stochastic_tau_kernel_filename=',pumas_stochastic_tau_kernel_filename
+
+end subroutine stochastic_tau_readnl
+
+subroutine stochastic_tau_init_cam
+
+ use cam_history_support, only: add_hist_coord
+ use pumas_stochastic_collect_tau, only: pumas_stochastic_kernel_init
+
+
+ call pumas_stochastic_kernel_init(pumas_stochastic_tau_kernel_filename)
+
+ call add_hist_coord('bins_ncd', ncd, 'bins for TAU microphysics')
+
+ !Note: lev needs to be trop_cld_lev for proc_rates....
+ call addfld('amk_c',(/'trop_cld_lev','bins_ncd '/),'A','kg','cloud liquid mass from bins')
+ call addfld('ank_c',(/'trop_cld_lev','bins_ncd '/),'A','1/kg','cloud liquid number concentration from bins')
+ call addfld('amk_r',(/'trop_cld_lev','bins_ncd '/),'A','kg','rain mass from bins')
+ call addfld('ank_r',(/'trop_cld_lev','bins_ncd '/),'A','1/kg','rain number concentration from bins')
+ call addfld('amk',(/'trop_cld_lev','bins_ncd '/),'A','kg','all liquid mass from bins')
+ call addfld('ank',(/'trop_cld_lev','bins_ncd '/),'A','1/kg','all liquid number concentration from bins')
+ call addfld('amk_out',(/'trop_cld_lev','bins_ncd '/),'A','kg','all liquid mass from bins')
+ call addfld('ank_out',(/'trop_cld_lev','bins_ncd '/),'A','1/kg','all liquid number concentration from bins')
+
+ call addfld('scale_nc',(/'trop_cld_lev'/),'A','1','scaling factor for nc')
+ call addfld('scale_nr',(/'trop_cld_lev'/),'A','1','scaling factor for nr')
+ call addfld('scale_qc',(/'trop_cld_lev'/),'A','1','scaling factor for qc')
+ call addfld('scale_qr',(/'trop_cld_lev'/),'A','1','scaling factor for qr')
+
+ call addfld('QC_TAU_in',(/'trop_cld_lev'/),'A','kg/kg','qc in TAU')
+ call addfld('NC_TAU_in',(/'trop_cld_lev'/),'A','1/kg','nc in TAU')
+ call addfld('QR_TAU_in',(/'trop_cld_lev'/),'A','kg/kg','qr in TAU')
+ call addfld('NR_TAU_in',(/'trop_cld_lev'/),'A','1/kg','nr in TAU')
+ call addfld('QC_TAU_out',(/'trop_cld_lev'/),'A','kg/kg','qc out TAU')
+ call addfld('NC_TAU_out',(/'trop_cld_lev'/),'A','1/kg','nc out TAU')
+ call addfld('QR_TAU_out',(/'trop_cld_lev'/),'A','kg/kg','qr out TAU')
+ call addfld('NR_TAU_out',(/'trop_cld_lev'/),'A','1/kg','nr out TAU')
+
+ call addfld('qctend_TAU',(/'trop_cld_lev'/),'A','kg/kg/s','qc tendency due to TAU bin code')
+ call addfld('nctend_TAU',(/'trop_cld_lev'/),'A','1/kg/s','nc tendency due to TAU bin code')
+ call addfld('qrtend_TAU',(/'trop_cld_lev'/),'A','kg/kg/s','qr tendency due to TAU bin code')
+ call addfld('nrtend_TAU',(/'trop_cld_lev'/),'A','1/kg/s','nr tendency due to TAU bin code')
+ call addfld('qctend_TAU_diag',(/'trop_cld_lev'/),'A','kg/kg/s','qc tendency due to TAU bin code')
+ call addfld('nctend_TAU_diag',(/'trop_cld_lev'/),'A','1/kg/s','nc tendency due to TAU bin code')
+ call addfld('qrtend_TAU_diag',(/'trop_cld_lev'/),'A','kg/kg/s','qr tendency due to TAU bin code')
+ call addfld('nrtend_TAU_diag',(/'trop_cld_lev'/),'A','1/kg/s','nr tendency due to TAU bin code')
+
+ call addfld('gmnnn_lmnnn_TAU',(/'trop_cld_lev'/),'A','1','sum of mass gain and loss from bin code')
+ call addfld('ML_fixer',(/'trop_cld_lev'/),'A','1','frequency that ML fixer is activated')
+ call addfld('qc_fixer',(/'trop_cld_lev'/),'A','kg/kg','delta qc due to ML fixer')
+ call addfld('nc_fixer',(/'trop_cld_lev'/),'A','kg/kg','delta nc due to ML fixer')
+ call addfld('qr_fixer',(/'trop_cld_lev'/),'A','kg/kg','delta qr due to ML fixer')
+ call addfld('nr_fixer',(/'trop_cld_lev'/),'A','kg/kg','delta nr due to ML fixer')
+
+end subroutine stochastic_tau_init_cam
+end module stochastic_tau_cam
+
+
diff --git a/src/physics/carma/cam/carma_constants_mod.F90 b/src/physics/carma/cam/carma_constants_mod.F90
index 27c8055095..e7392cc6a5 100644
--- a/src/physics/carma/cam/carma_constants_mod.F90
+++ b/src/physics/carma/cam/carma_constants_mod.F90
@@ -18,82 +18,82 @@ module carma_constants_mod
!--
! Physical constants
-
+
! Meter-Kilogram-Second (MKS) convention for units
- ! This convention is different from CARMA's original
+ ! This convention is different from CARMA's original
! Centimeter-Gram-Second (CGS) convention. Be wary of
! this conversion to the new convention.
-
+
! Use the _f for all literal constants, e.g. 1.2e_f.
! If you omit the _f in the initialization, a compiler may cast this
! number into single precision and then store it as _f precision.
-
+
!! Define triple-point temperature (K)
real(kind=f), parameter :: T0 = SHR_CONST_TKTRIP
-
- ! Define constants for circles and trig
- real(kind=f), parameter :: PI = p_pi
+
+ ! Define constants for circles and trig
+ real(kind=f), parameter :: PI = p_pi
real(kind=f), parameter :: DEG2RAD = PI / 180._f
real(kind=f), parameter :: RAD2DEG = 180._f / PI
-
+
!! Define avogadro's number [ # particles / mole ]
real(kind=f), parameter :: AVG = avogad / 1000._f
-
+
!! Define Boltzmann's constant [ erg / deg_K ]
real(kind=f), parameter :: BK = boltz * 1e7_f
-
+
!! Define Loschmidt's number [ mole / cm^3, @ STP ]
real(kind=f), parameter :: ALOS = 2.68719e+19_f
-
+
!! Define reference pressure, e.g. for potential temp calcs [ dyne / cm^2 ]
real(kind=f), parameter :: PREF = 1000.e+3_f
-
+
!! Define conversion factor for mb to cgs [ dyne / cm^2 ] units
real(kind=f), parameter :: RMB2CGS = 1000.e+0_f
-
+
!! Define conversion factor for Pa to cgs [ dyne / cm^2 ] units
real(kind=f), parameter :: RPA2CGS = 10.e+0_f
!! Define conversion factor for m to cgs [ cm ] units
real(kind=f), parameter :: RM2CGS = 100.0_f
-
+
!! Define universal gas constant [ erg / deg_K / mole ]
real(kind=f), parameter :: RGAS = r_universal * 1e7_f / 1000._f
-
+
!! Define number of seconds per the planet's day [ s / d ]
real(kind=f), parameter :: SCDAY = SHR_CONST_CDAY
-
+
!! Define mass density of liquid water [ g / cm^3 ]
real(kind=f), parameter :: RHO_W = rhoh2o / 1000._f
-
+
!! Define mass density of water ice [ g / cm^3 ]
real(kind=f), parameter :: RHO_I = SHR_CONST_RHOICE / 1000._f
!! Latent heat of evaporation for gas [cm^2/s^2]
real(kind=f), parameter :: RLHE_CNST = latvap * 1e4_f
-
+
!! Latent heat of ice melting for gas [cm^2/s^2]
real(kind=f), parameter :: RLHM_CNST = latice * 1e4_f
-
-
+
+
!! The dimension of THETD, ELTRMX, CSTHT, PI, TAU, SI2THT.
!! IT must correspond exactly to the second dimension of ELTRMX.
integer, parameter :: IT = 1
-
- !! String length of names
+
+ !! String length of names
integer, parameter :: CARMA_NAME_LEN = 255
- !! String length of short names
+ !! String length of short names
integer, parameter :: CARMA_SHORT_NAME_LEN = 6
-
+
!! Fill value indicating no value is being returned
real(kind=f), parameter :: CAM_FILL = fillvalue
-
+
!! Define particle number concentration [ # / cm3 ]
!! used to decide whether to bypass microphysical processes.
real(kind=f), parameter :: FEW_PC = 1e-6_f
-
+
!! Define small particle number concentration
!! [ # / x_units / y_units / z_units ]
!!
@@ -104,49 +104,48 @@ module carma_constants_mod
!!
!! For degree/degree/hybrid coordinates, the metric is on the
!! order of 1e20.
-! real(kind=f), parameter :: SMALL_PC = 1e-50_f
- real(kind=f), parameter :: SMALL_PC = FEW_PC * 1e20 * 1e-30
-
+ real(kind=f), parameter :: SMALL_PC = FEW_PC * 1.e-30_f
+
!! Define core fraction (for core mass and second moment) used
!! when particle number concentrations are limited to SMALL_PC
real(kind=f), parameter :: FIX_COREF = 0.1_f
-
- !! Minimum Cloud Fraction
+
+ !! Minimum Cloud Fraction
real(kind=f), parameter :: CLDFRC_MIN = 0.009_f
-
+
!! Incloud Cloud Fraction Threshold for statistics
real(kind=f), parameter :: CLDFRC_INCLOUD = 0.01_f
-
+
!! NWAVE should be the total number of bands CAM supports.
integer, public, parameter :: NWAVE = nlwbands+nswbands ! Number of wavelength bands
-
-
-
+
+
+
!! These are constants per CARMA's definition, but are set dynamically in CAM and thus
!! can not be set as constants. They must be initialized as variables in carma_init.
-
+
!! Acceleration of gravity near Earth surface [ cm/s^2 ]
real(kind=f) :: GRAV
-
+
!! Define planet equatorial radius [ cm ]
real(kind=f) :: REARTH
-
+
!! Define molecular weight of dry air [ g / mole ]
real(kind=f) :: WTMOL_AIR
-
+
!! Define molecular weight of water [ g / mole ]
real(kind=f) :: WTMOL_H2O
-
+
!! Define gas constant for dry air [ erg / deg_K / mole ]
real(kind=f) :: R_AIR
-
+
!! Define specific heat at constant pres of dry air [ cm^2 / s^2 / deg_K ]
real(kind=f) :: CP
!! Define ratio of gas constant for dry air and specific heat
real(kind=f) :: RKAPPA
-
-end module
+
+end module
diff --git a/src/physics/carma/cam/carma_intr.F90 b/src/physics/carma/cam/carma_intr.F90
index 50bad3dffa..ec935e29b4 100644
--- a/src/physics/carma/cam/carma_intr.F90
+++ b/src/physics/carma/cam/carma_intr.F90
@@ -21,7 +21,7 @@ module carma_intr
use carmasolute_mod
use carmastate_mod
use carma_mod
-
+
use shr_kind_mod, only: r8 => shr_kind_r8
use spmd_utils, only: masterproc
use pmgrid, only: plat, plev, plevp, plon
@@ -41,15 +41,15 @@ module carma_intr
#if ( defined SPMD )
use mpishorthand
-#endif
-
+#endif
+
implicit none
-
+
private
save
! Public interfaces
-
+
! CAM Physics Interface
public carma_register ! register consituents
public carma_is_active ! retrns true if this package is active (microphysics = .true.)
@@ -60,16 +60,16 @@ module carma_intr
public carma_timestep_init ! initialize timestep dependent variables
public carma_timestep_tend ! interface to tendency computation
public carma_accumulate_stats ! collect stats from all MPI tasks
-
+
! Other Microphysics
public carma_emission_tend ! calculate tendency from emission source function
public carma_wetdep_tend ! calculate tendency from wet deposition
-
+
! Private data
-
+
! Particle Group Statistics
-
+
! Gridbox average
integer, parameter :: NGPDIAGS = 12 ! Number of particle diagnostics ...
integer, parameter :: GPDIAGS_ND = 1 ! Number density
@@ -88,13 +88,13 @@ module carma_intr
! Particle Bin (Element) Statistics
integer, parameter :: NBNDIAGS = 1 ! Number of bin surface diagnostics ...
integer, parameter :: BNDIAGS_TP = 1 ! Delta Particle Temperature [K]
-
+
! Surface
integer, parameter :: NSBDIAGS = 2 ! Number of bin surface diagnostics ...
integer, parameter :: SBDIAGS_DD = 1 ! Dry deposition flux [kg/m2/s]
integer, parameter :: SBDIAGS_VD = 2 ! Dry deposition velocity [cm/s]
-
-
+
+
! Gas Statistics
integer, parameter :: NGSDIAGS = 5 ! Number of gas diagnostics ...
integer, parameter :: GSDIAGS_SI = 1 ! saturation wrt ice
@@ -102,27 +102,27 @@ module carma_intr
integer, parameter :: GSDIAGS_EI = 3 ! equilibrium vp wrt ice
integer, parameter :: GSDIAGS_EL = 4 ! equilibrium vp wrt water
integer, parameter :: GSDIAGS_WT = 5 ! weight percent composition for aerosols
-
+
! Step Statistics
integer, parameter :: NSPDIAGS = 2 ! Number of step diagnostics ...
integer, parameter :: SPDIAGS_NSTEP = 1 ! number of substeps
integer, parameter :: SPDIAGS_LNSTEP = 2 ! ln(number of substeps)
-
+
! Defaults not in the namelist
character(len=10), parameter :: carma_mixtype = 'wet' ! mixing ratio type for CARMA constituents
integer :: LUNOPRT = -1 ! lun for output
-
- ! Constituent Mappings
+
+ ! Constituent Mappings
integer :: icnst4elem(NELEM, NBIN) ! constituent index for a carma element
integer :: icnst4gas(NGAS) ! constituent index for a carma gas
character(len=16) :: btndname(NGROUP, NBIN) ! names of group per bin tendencies
character(len=16) :: etndname(NELEM, NBIN) ! names of element tendencies
character(len=16) :: gtndname(NGAS) ! names of gas tendencies
-
+
! Flags to indicate whether each constituent could have a CARMA tendency.
logical :: lq_carma(pcnst)
-
+
! The CARMA object stores the configuration inforamtion about CARMA, only one is
! is needed per MPI task. In the future, this could potentially be turned into one
! per model to allow multiple models with different numbers of bins, ... to be
@@ -133,12 +133,12 @@ module carma_intr
type(carma_type), target :: carma ! the carma object
- ! Physics Buffer Indicies
+ ! Physics Buffer Indicies
integer :: ipbuf4gas(NGAS) ! physics buffer index for a carma gas
integer :: ipbuf4t ! physics buffer index for a carma temperature
integer :: ipbuf4sati(NGAS) ! physics buffer index for a carma saturation over ice
integer :: ipbuf4satl(NGAS) ! physics buffer index for a carma saturation over liquid
-
+
! Globals used for a reference atmosphere.
real(kind=f) :: carma_t_ref(pver) ! midpoint temperature (Pa)
real(kind=f) :: carma_h2o_ref(pver) ! h2o mmmr (kg/kg)
@@ -209,13 +209,13 @@ subroutine carma_register
! Initialize the return code.
rc = 0
-
+
! Some constants are set on the fly in CAM, so initialize them and any derived "constants" here.
! Some of them are needed in CARMA_DefineModel and CARMA_Initialize.
GRAV = gravit * RM2CGS
- REARTH = p_rearth * RM2CGS
- WTMOL_AIR = mwdry
- WTMOL_H2O = mwh2o
+ REARTH = p_rearth * RM2CGS
+ WTMOL_AIR = mwdry
+ WTMOL_H2O = mwh2o
R_AIR = RGAS / WTMOL_AIR
CP = cpair * 1.e7_r8 / 1000._r8
RKAPPA = R_AIR / CP
@@ -225,7 +225,7 @@ subroutine carma_register
! Find out which radiation scheme is active.
call phys_getopts(radiation_scheme_out = radiation_scheme)
-
+
! Get the wavelength centers for the CAM longwave and shortwave bands
! from the radiation code.
@@ -251,15 +251,15 @@ subroutine carma_register
! Create the CARMA object that will contain all the information about the
! how CARMA is configured.
-
+
call CARMA_Create(carma, NBIN, NELEM, NGROUP, NSOLUTE, NGAS, NWAVE, rc, &
LUNOPRT=LUNOPRT, wave=wave, dwave=dwave, do_wave_emit=do_wave_emit)
if (rc < 0) call endrun('carma_register::CARMA_Create failed.')
-
+
! Define the microphysical model.
call CARMA_DefineModel(carma, rc)
if (rc < 0) call endrun('carma_register::CARMA_DefineModel failed.')
-
+
if (masterproc) then
write(LUNOPRT,*) ''
write(LUNOPRT,*) 'CARMA general settings for ', trim(carma_model), ' model : '
@@ -301,7 +301,7 @@ subroutine carma_register
write(LUNOPRT,*) ' carma_rad_feedback = ', carma_rad_feedback
write(LUNOPRT,*) ''
endif
-
+
! Intialize the model based upon the namelist configuration.
!
! NOTE: When used with CAM, the latents heats (of melting and evaporation)
@@ -337,8 +337,8 @@ subroutine carma_register
gstickl = carma_gstickl, &
tstick = carma_tstick)
if (rc < 0) call endrun('carma_register::CARMA_Initialize failed.')
-
-
+
+
! The elements and gases from CARMA need to be added as constituents in
! CAM (if they don't already exist). For the elements, each radius bin
! needs to be its own constiuent in CAM.
@@ -349,34 +349,34 @@ subroutine carma_register
! 2) The molecular weight is in kg/kmol.
! 3) The specific heat at constant pressure is in J/kg/K.
! 4) The consituents are added sequentially.
-
+
! Add a CAM constituents for each bin of each element.
do ielem = 1, NELEM
-
+
call CARMAELEMENT_Get(carma, ielem, rc, igroup=igroup, shortname=shortname, name=name)
if (rc < 0) call endrun('carma_register::CARMAELEMENT_Get failed.')
-
+
call CARMAGROUP_Get(carma, igroup, rc, cnsttype=cnsttype, r=r, rmass=rmass, maxbin=maxbin, shortname=grp_short)
if (rc < 0) call endrun('carma_register::CARMAGROUP_Get failed.')
-
+
! For prognostic groups, all of the bins need to be represented as actual CAM
! constituents. Diagnostic groups are determined from state information that
! is already present in CAM, and thus their bins only exist in CARMA.
if (cnsttype == I_CNSTTYPE_PROGNOSTIC) then
-
+
do ibin = 1, NBIN
-
+
! Bins past maxbin are treated as diagnostic even if the group
! is prognostic and thus are not advected in the paerent model.
if (ibin <= maxbin) then
-
+
write(btndname(igroup, ibin), '(A, I2.2)') trim(grp_short), ibin
write(c_name, '(A, I2.2)') trim(shortname), ibin
write(c_longname, '(A, e11.4, A)') trim(name) // ', ', r(ibin)*1.e4_r8, ' um'
-
+
! The molecular weight seems to be used for molecular diffusion, which
- ! doesn't make sense for particles. The CAM solvers are unstable if the
+ ! doesn't make sense for particles. The CAM solvers are unstable if the
! mass provided is large.
call cnst_add(c_name, WTMOL_AIR, cpair, 0._r8, icnst4elem(ielem, ibin), &
longname=c_longname, mixtype=carma_mixtype, is_convtran1=is_convtran1(igroup))
@@ -384,28 +384,28 @@ subroutine carma_register
end do
end if
end do
-
+
! Find the constituent for the gas or add it if not found.
do igas = 1, NGAS
-
+
call CARMAGAS_Get(carma, igas, rc, shortname=shortname, name=name, wtmol=wtmol)
if (rc < 0) call endrun('carma_register::CARMAGAS_Get failed.')
-
+
! Is the gas already defined?
call cnst_get_ind(shortname, icnst4gas(igas))
-
+
! For substepping, we need to store the last mmr values for the gas.
call pbuf_add_field('CG' // shortname, 'global',dtype_r8, (/pcols, pver/), ipbuf4gas(igas))
-
+
! For substepping, we need to store the last supersaturations.
call pbuf_add_field('CI' // shortname, 'global',dtype_r8, (/pcols, pver/), ipbuf4sati(igas))
call pbuf_add_field('CL' // shortname, 'global',dtype_r8, (/pcols, pver/), ipbuf4satl(igas))
end do
-
-
+
+
! For substepping, we need to store the temperature.
call pbuf_add_field('CT', 'global',dtype_r8, (/pcols, pver/), ipbuf4t)
-
+
! Create the optical properties files needed for RRTMG radiative transfer
! calculations.
@@ -418,7 +418,7 @@ subroutine carma_register
call CARMA_CreateOpticsFile(carma, rc)
if (rc < 0) call endrun('carma_register::carma_CreateOpticsFiles failed.')
end if
-
+
return
end subroutine carma_register
@@ -431,11 +431,11 @@ end subroutine carma_register
!! @version May 2009
function carma_is_active()
implicit none
-
+
logical :: carma_is_active
-
+
carma_is_active = carma_flag
-
+
return
end function carma_is_active
@@ -448,38 +448,38 @@ end function carma_is_active
!! @version May 2009
function carma_implements_cnst(name)
implicit none
-
+
character(len=*), intent(in) :: name !! constituent name
logical :: carma_implements_cnst ! return value
-
+
integer :: igroup
integer :: ielem
integer :: ibin
integer :: igas
integer :: rc
-
+
integer :: cnsttype ! constituent type
integer :: maxbin ! last prognostic bin
rc = 0
-
+
carma_implements_cnst = .false.
-
+
! Check each bin to see if it this constituent.
do ielem = 1, NELEM
do ibin = 1, NBIN
call CARMAELEMENT_Get(carma, ielem, rc, igroup=igroup)
- if (rc < 0) call endrun('carma_init::CARMAELEMENT_Get failed.')
-
+ if (rc < 0) call endrun('carma_implements_cnst::CARMAELEMENT_Get failed.')
+
call CARMAGROUP_Get(carma, igroup, rc, cnsttype=cnsttype, maxbin=maxbin)
- if (rc < 0) call endrun('carma_init::CARMAGROUP_Get failed.')
-
+ if (rc < 0) call endrun('carma_implements_cnst::CARMAGROUP_Get failed.')
+
if (cnsttype == I_CNSTTYPE_PROGNOSTIC) then
-
+
! Bins past maxbin are treated as diagnostic even if the group
! is prognostic and thus are not advected in the parent model.
if (ibin <= maxbin) then
-
+
if (name == cnst_name(icnst4elem(ielem, ibin))) then
carma_implements_cnst = .true.
return
@@ -487,8 +487,8 @@ function carma_implements_cnst(name)
end if
end if
end do
- end do
-
+ end do
+
! Check each gas to see if it this constituent.
do igas = 1, NGAS
if (name == cnst_name(icnst4gas(igas))) then
@@ -496,10 +496,10 @@ function carma_implements_cnst(name)
return
end if
end do
-
+
return
end function carma_implements_cnst
-
+
!! Initialize items in CARMA that only need to be initialized once. This
!! routine is called after carma_register has been called.
@@ -516,7 +516,7 @@ subroutine carma_init
use phys_control, only: phys_getopts
implicit none
-
+
integer :: iz ! vertical index
integer :: ielem ! element index
integer :: ibin ! bin index
@@ -529,17 +529,15 @@ subroutine carma_init
integer :: maxbin ! last prognostic bin
logical :: is_cloud ! is the group a cloud?
logical :: do_drydep ! is dry deposition enabled?
-
- integer :: i
+
integer :: ier
- integer :: ncid, dimid_lev, lev, vid_T
+ integer :: ncid, dimid_lev, vid_T
logical :: lexist
character(len=256) :: locfn
integer :: nlev
integer :: LUNOPRT ! logical unit number for output
logical :: do_print ! do print output?
logical :: history_carma
-
1 format(a6,4x,a11,4x,a11,4x,a11)
2 format(i6,4x,3(1pe11.3,4x))
@@ -552,34 +550,34 @@ subroutine carma_init
! Set names of constituent sources and declare them as history variables; howver,
! only prognostic variables have.
lq_carma(:) = .false.
-
+
do ielem = 1, NELEM
do ibin = 1, NBIN
call CARMAELEMENT_Get(carma, ielem, rc, igroup=igroup)
if (rc < 0) call endrun('carma_init::CARMAELEMENT_Get failed.')
-
+
call CARMAGROUP_Get(carma, igroup, rc, cnsttype=cnsttype, maxbin=maxbin, do_drydep=do_drydep)
if (rc < 0) call endrun('carma_init::CARMAGROUP_Get failed.')
-
+
if (cnsttype == I_CNSTTYPE_PROGNOSTIC) then
! Bins past maxbin are treated as diagnostic even if the group
! is prognostic and thus are not advected in the parent model.
if (ibin <= maxbin) then
-
+
icnst = icnst4elem(ielem, ibin)
-
+
! Indicate that this is a constituent whose tendency could be changed by
! CARMA.
lq_carma(icnst) = .true.
-
+
etndname(ielem, ibin) = trim(cnst_name(icnst))
-
+
call addfld(cnst_name(icnst), (/ 'lev' /), 'A', 'kg/kg', cnst_longname(icnst))
if (history_carma) then
call add_default(cnst_name(icnst), 1, ' ')
end if
-
+
call addfld(trim(etndname(ielem, ibin))//'TC', (/ 'lev' /), 'A', 'kg/kg/s', &
trim(cnst_name(icnst)) // ' tendency')
call addfld(trim(etndname(ielem, ibin))//'SF', horiz_only, 'A', 'kg/m2/s', &
@@ -608,7 +606,7 @@ subroutine carma_init
do igroup = 1, NGROUP
call CARMAGROUP_Get(carma, igroup, rc, shortname=sname, is_cloud=is_cloud, do_drydep=do_drydep)
if (rc < 0) call endrun('carma_init::CARMAGROUP_GetGroup failed.')
-
+
! Gridbox average
!
! NOTE: Would like use flag_xf_fill for the reffective radius fields, but cam_history
@@ -648,7 +646,7 @@ subroutine carma_init
if (do_drydep) then
do ibin = 1, NBIN
call addfld(trim(btndname(igroup, ibin))//'VD', horiz_only, 'A', 'm/s', &
- trim(cnst_name(icnst)) // ' dry deposition velocity')
+ trim(btndname(igroup, ibin))//' dry deposition velocity')
end do
end if
@@ -674,17 +672,17 @@ subroutine carma_init
trim(cnst_name(icnst)) // ' equilibrium vmr wrt liquid')
call addfld(trim(cnst_name(icnst))//'WT', (/ 'lev' /), 'A', '%', &
trim(cnst_name(icnst)) // ' weight percent aerosol composition')
-
+
if (history_carma) then
call add_default(trim(cnst_name(icnst))//'SI', 1, ' ')
call add_default(trim(cnst_name(icnst))//'SL', 1, ' ')
end if
end do
-
+
if (carma_do_thermo) then
call addfld('CRTT', (/ 'lev' /), 'A', 'K/s', ' CARMA temperature tendency')
end if
-
+
! Add fields for diagnostic fields, and make them defaults on the first tape.
if (carma_do_substep) then
call addfld('CRNSTEP', (/ 'lev' /), 'A', ' ', 'number of carma substeps')
@@ -695,8 +693,8 @@ subroutine carma_init
call add_default('CRLNSTEP', 1, ' ')
end if
end if
-
-
+
+
! Set up the reference atmosphere that can be used for fixed initialization. This is
! an approximate atmospheric used to define average fall velocities, coagulation
! kernels, and growth parameters.
@@ -705,7 +703,7 @@ subroutine carma_init
! NOTE: Reading the initial condtion file using the supplied routines must
! be done outside of masterproc, so does this in all threads before deciding
! if it will be used. The initial condition file is only opened on an initial run.
- if (is_first_step()) then
+ if (is_first_step()) then
call carma_getT(carma_t_ref)
if (carma%f_igash2o /= 0) call carma_getH2O(carma_h2o_ref)
if (carma%f_igash2So4 /= 0) call carma_getH2SO4(carma_h2so4_ref)
@@ -714,49 +712,49 @@ subroutine carma_init
if (masterproc) then
call CARMA_Get(carma, rc, do_print=do_print, LUNOPRT=LUNOPRT)
if (rc < 0) call endrun('carma_init::CARMA_Get failed.')
-
+
if (do_print) write(LUNOPRT,*) ""
if (do_print) write(LUNOPRT,*) "CARMA initializing to fixed reference state."
if (do_print) write(LUNOPRT,*) ""
-
+
! For temperature, get the average temperature from reference temperature file
! if it exists or from the initial condition file if the reference temperature file
! doesn't exist.
!
! NOTE: The reference temperature file will only be created for an inital run. It
! must already exist for a restart run.
-
+
! Does reference temperature file already exist?
call getfil(carma_reftfile, locfn, iflag=1)
-
+
inquire(file=locfn, exist=lexist)
-
+
! Read the reference temperature from the file.
if (lexist) then
-
+
! Open the netcdf file.
call wrap_open(trim(locfn), NF90_NOWRITE, ncid)
-
+
! Inquire about dimensions
call wrap_inq_dimid(ncid, 'lev', dimid_lev)
call wrap_inq_dimlen(ncid, dimid_lev, nlev)
-
+
! Does the number of levels match?
if (nlev /= pver) then
call endrun("carma_init::ERROR - Incompatible number of levels &
&in the CARMA reference temperature file ... " // trim(locfn))
end if
-
+
! Get variable ID for reference temperature
call wrap_inq_varid(ncid, 'T', vid_T)
-
+
! Read in the temperature data.
call wrap_get_var_realx(ncid, vid_T, carma_T_ref)
if (carma%f_igash2o /= 0) then
! Get variable ID for reference temperature
call wrap_inq_varid(ncid, 'Q', vid_T)
-
+
! Read in the temperature data.
call wrap_get_var_realx(ncid, vid_T, carma_h2o_ref)
end if
@@ -764,25 +762,25 @@ subroutine carma_init
if (carma%f_igash2so4 /= 0) then
! Get variable ID for reference temperature
call wrap_inq_varid(ncid, 'H2SO4', vid_T)
-
+
! Read in the temperature data.
call wrap_get_var_realx(ncid, vid_T, carma_h2so4_ref)
end if
-
+
! Close the file
call wrap_close(ncid)
-
+
! Is this an initial or restart run?
else if (is_first_step()) then
if (do_print) write(LUNOPRT,*) ""
if (do_print) write(LUNOPRT,*) 'Creating CARMA reference temperature file ... ', trim(locfn)
-
+
! Save the average into a file to be used for restarts.
call CARMA_CreateRefTFile(carma, locfn, pref_mid(:) / 100._r8, &
carma_t_ref(:), rc, refh2o=carma_h2o_ref(:), refh2so4=carma_h2so4_ref(:))
else
-
+
! The file must already exist for a restart run.
call endrun("carma_init::ERROR - Can't find the CARMA reference temperature file ... " // trim(carma_reftfile))
@@ -791,14 +789,14 @@ subroutine carma_init
! Write out the values that are being used.
if (do_print) write(LUNOPRT,*) ""
if (do_print) write(LUNOPRT,1) "Level","Int P (Pa)","Mid P (Pa)","Mid T (K)"
-
+
do iz = 1, pver
if (do_print) write(LUNOPRT,2) iz, pref_edge(iz), pref_mid(iz), carma_t_ref(iz)
end do
if (do_print) write(LUNOPRT,2) iz, pref_edge(iz), 0.0_r8, 0.0_r8
if (do_print) write(LUNOPRT,*) ""
end if
-
+
#ifdef SPMD
! Communicate the settings to the other MPI tasks.
@@ -810,7 +808,7 @@ subroutine carma_init
! Do a model specific initialization.
call CARMA_InitializeModel(carma, lq_carma, rc)
if (rc < 0) call endrun('carma_init::CARMA_InitializeModel failed.')
-
+
return
end subroutine carma_init
@@ -823,18 +821,18 @@ end subroutine carma_init
!! @version October 2009
subroutine carma_final
implicit none
-
+
integer :: rc ! CARMA return code
integer :: LUNOPRT ! logical unit number for output
logical :: do_print ! do print output?
-
+
2 format(' carma_final: overall substepping statistics',/,&
' max nsubstep=',1F9.0,/,' avg nsubstep=',1F9.2,/,&
' max nretry=',1F9.0,/,' avg nretry=',1F10.4)
! Initialize the return code.
rc = 0
-
+
! Output the end of run statistics for CARMA
if (carma_do_substep) then
if (masterproc) then
@@ -854,12 +852,12 @@ subroutine carma_final
end if
end if
end if
-
-
+
+
! Do a model specific initialization.
call CARMA_Destroy(carma, rc)
if (rc < 0) call endrun('carma_final::CARMA_Destroy failed.')
-
+
return
end subroutine carma_final
@@ -881,7 +879,7 @@ subroutine carma_timestep_init
step_nstep = 0._f
step_nsubstep = 0._f
step_nretry = 0._f
-
+
return
end subroutine carma_timestep_init
@@ -906,9 +904,8 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
prec_sed, snow_sed, ustar, obklen)
use time_manager, only: get_nstep, get_step_size, is_first_step
use camsrfexch, only: cam_in_t, cam_out_t
- use scamMod, only: single_column
use planck, only: planckIntensity
-
+
implicit none
type(physics_state), intent(in) :: state !! physics state variables
@@ -919,7 +916,7 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
type(physics_buffer_desc), pointer :: pbuf(:) !! physics buffer
real(r8), intent(in), optional :: dlf(pcols,pver) !! Detraining cld H20 from convection (kg/kg/s)
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(out), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(out), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(out), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(out), optional :: prec_sed(pcols) !! total precip from cloud sedimentation (m/s)
real(r8), intent(out), optional :: snow_sed(pcols) !! snow from cloud ice sedimentation (m/s)
@@ -932,26 +929,20 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
type(carmastate_type) :: cstate ! the carma state object
integer :: igroup ! group index
integer :: ielem ! element index
- integer :: ielem_nd ! index of numder density element in group
integer :: ibin ! bin index
integer :: igas ! gas index
integer :: icol ! column index
integer :: icnst ! constituent index
integer :: icnst_q ! H2O constituent index
- integer :: ncol ! number of columns
integer :: rc ! CARMA return code
integer :: cnsttype ! constituent type
integer :: maxbin ! last prognostic bin
- real(r8) :: spdiags(pcols, pver, NSPDIAGS) ! CARMA step diagnostic output
- real(r8) :: gsdiags(pcols, pver, NGAS, NGSDIAGS) ! CARMA gas diagnostic output
- real(r8) :: gpdiags(pcols, pver, NGROUP, NGPDIAGS) ! CARMA group diagnostic output
- real(r8) :: sbdiags(pcols, NBIN, NELEM, NSBDIAGS) ! CARMA surface bin diagnostic output
- real(r8) :: bndiags(pcols, pver, NBIN, NELEM, NBNDIAGS) ! CARMA bin diagnostic output
+ real(r8) :: spdiags(pcols, pver, NSPDIAGS) ! CARMA step diagnostic output
+ real(r8) :: gsdiags(pcols, pver, NGAS, NGSDIAGS) ! CARMA gas diagnostic output
+ real(r8) :: gpdiags(pcols, pver, NGROUP, NGPDIAGS) ! CARMA group diagnostic output
+ real(r8) :: sbdiags(pcols, NBIN, NELEM, NSBDIAGS) ! CARMA surface bin diagnostic output
+ real(r8) :: bndiags(pcols, pver, NBIN, NELEM, NBNDIAGS) ! CARMA bin diagnostic output
real(r8) :: newstate(pver) ! next state for a physics state field
- real(r8) :: xc(pver) ! x center
- real(r8) :: dx(pver) ! x width
- real(r8) :: yc(pver) ! y center
- real(r8) :: dy(pver) ! y width
real(r8) :: dz(pver) ! z width
real(r8) :: satice(pver) ! saturation wrt ice
real(r8) :: satliq(pver) ! saturation wrt liquid
@@ -959,12 +950,10 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
real(r8) :: eqliq(pver) ! equil vp wrt liquid
real(r8) :: wtpct(pver) ! weight percent aerosol composition
real(r8) :: time ! the total elapsed time (s)
- real(r8) :: dlat ! latitude spacing
real(r8) :: r(NBIN) ! particle radius (cm)
real(r8) :: rmass(NBIN) ! particle mass (g)
real(r8) :: rrat(NBIN) ! particle maximum radius ratio ()
real(r8) :: arat(NBIN) ! particle area ration ()
- real(r8) :: rhoelem ! element density (g)
real(r8) :: nd(pver) ! number density (cm-3)
real(r8) :: ad(pver) ! area density (um2/cm3)
real(r8) :: md(pver) ! mass density (g cm-3)
@@ -976,7 +965,7 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
real(r8) :: re2(pver) ! N(r)*r^2 (cm2)
real(r8) :: re3(pver) ! N(r)*r^3 (cm3)
real(r8) :: pa(pver) ! Projected Area (cm2)
- real(r8) :: ar(pver) ! Area Ratio
+ real(r8) :: ar(pver) ! Area Ratio
real(r8) :: vm(pver) ! Massweighted fall velocity (cm2)
real(r8) :: jn(pver) ! nucleation (cm-3)
real(r8) :: numberDensity(pver) ! number density (cm-3)
@@ -998,8 +987,6 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
real(r8), pointer, dimension(:,:) :: tnd_nsnow ! external tendency on snow number(#/kg/s)
real(r8), pointer, dimension(:,:) :: re_ice ! ice effective radius (m)
integer :: lchnk ! chunk identifier
- real(r8) :: coremmr(pver)
- real(r8) :: ttlmmr(pver)
integer :: iz
real(r8) :: cldfrc(pver) ! cloud fraction [fraction]
real(r8) :: rhcrit(pver) ! relative humidity for onset of liquid clouds [fraction]
@@ -1021,7 +1008,6 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
real(kind=f) :: zsubsteps(pver)
logical :: is_cloud ! is the group a cloud?
logical :: is_ice ! is the group ice?
- integer :: ienconc
logical :: grp_do_drydep ! is dry depostion enabled for group?
logical :: do_drydep ! is dry depostion enabled?
logical :: do_fixedinit ! do initialization from reference atm?
@@ -1030,42 +1016,42 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
real(r8), parameter :: zzocen = 0.0001_r8 ! Ocean aerodynamic roughness length [m]
real(r8), parameter :: zzsice = 0.0400_r8 ! Sea ice aerodynamic roughness length [m]
-
+
! Initialize the return code.
rc = 0
! Initialize the output tendency structure.
call physics_ptend_init(ptend,state%psetcols,'CARMA', ls=carma_do_thermo, lq=lq_carma)
-
+
if (present(prec_sed)) prec_sed(:) = 0._f
if (present(snow_sed)) snow_sed(:) = 0._f
if (present(prec_str)) prec_str(:) = 0._f
if (present(snow_str)) snow_str(:) = 0._f
-
+
if (.not. carma_flag) return
! Determine the current time in seconds.
time = dt * get_nstep() - 1
-
+
! The CARMA interface assumes that mass mixing ratios are relative to a
! wet atmosphere, so convert any dry mass mixing ratios to wet.
call physics_state_copy(state, state_loc)
call set_dry_to_wet(state_loc)
-
+
spdiags(:, :, :) = 0.0_r8
gpdiags(:, :, :, :) = 0.0_r8
gsdiags(:, :, :, :) = 0.0_r8
sbdiags(:, :, :, :) = 0.0_r8
bndiags(:, :, :, :, :) = 0.0_r8
-
+
! Find the constituent index for water vapor.
call cnst_get_ind('Q', icnst_q)
-
+
! Get pointers into pbuf ...
lchnk = state_loc%lchnk
-
+
call pbuf_get_field(pbuf, ipbuf4t, t_ptr)
-
+
! If doing particle heating, then get pointers to the spectral flux data provided
! by the radiation code in the physics buffer.
!
@@ -1077,7 +1063,7 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
call pbuf_get_field(pbuf, pbuf_get_index("LU"), lu_ptr)
call pbuf_get_field(pbuf, pbuf_get_index("LD"), ld_ptr)
end if
-
+
! Cloud ice pbuf fields
if (carma_do_cldice) then
call pbuf_get_field(pbuf, pbuf_get_index("TND_QSNOW"), tnd_qsnow)
@@ -1096,23 +1082,8 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
!
call CARMA_Get(carma, rc, do_fixedinit=do_fixedinit, do_drydep=do_drydep)
if (rc < 0) call endrun('carma_timestep_tend::CARMA_Get failed.')
-
+
if (do_fixedinit) then
-
- ! The latitude and longitude are arbitrary, but the dimensions need to be correct.
- xc = 255._r8
- yc = 40._r8
-
- ! Assume resolution is 64x128.
- if (single_column) then
- dx = 360._r8 / 128._r8
- dy = 180._r8 / 64._r8
- else
-
- ! Calculate the x and y coordinates, in degrees latitude and longitude.
- dx = 360._r8 / plon
- dy = 180._r8 / (plat-1)
- end if
call CARMASTATE_CreateFromReference(cstate, &
carma_ptr, &
@@ -1120,13 +1091,8 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
dt, &
pver, &
I_HYBRID, &
- I_LL, &
40._r8, &
255._r8, &
- xc, &
- dx, &
- yc, &
- dy, &
pref_mid_norm, &
pref_edge/psurf_ref, &
pref_mid(:), &
@@ -1141,42 +1107,11 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
! Process each column.
do icol = 1, state_loc%ncol
-
- ! Haven't figured out how to get dimensions for single column. Perhaps should change
- ! CARMA to work with area rather than dx and dy. For now, just hack something.
- xc(:) = state_loc%lon(icol) / DEG2RAD
- yc(:) = state_loc%lat(icol) / DEG2RAD
-
- ! Assume resolution is 64x128.
- if (single_column) then
- dx = 360._r8 / 128._r8
- dy = 180._r8 / 64._r8
- else
-
- ! Caclulate the x and y coordinates, in degrees latitude and longitude.
- dx(:) = 360._r8 / plon
-
- dlat = 180._r8 / (plat-1)
-
- ! The pole points need special treatment, since the point is not the
- ! center of the grid box.
- !
- ! In single column mode there is just one latitude, so make it global.
- if (abs(state_loc%lat(icol) / DEG2RAD) >= (90._r8 - (90._r8 / (plat-1)))) then
-
- ! Nudge yc toward the equator.
- yc(:) = yc(:) - sign(0.25_r8,state_loc%lat(icol)) * dlat
-
- dy(:) = dlat / 2._r8
- else
- dy(:) = dlat
- endif
- end if
if (is_first_step()) then
t_ptr(icol,:) = state_loc%t(icol,:)
end if
-
+
! For particle heating, need to get the incoming radiative intensity from
! the radiation code.
!
@@ -1184,11 +1119,11 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
! when the compute_spectral_flux namelist variable is provided to the radiation. This
! data needs to be scaled to a radiative intensity by assuming it is isotrotropic.
radint(:,:) = 0._f
-
+
if (carma_do_pheat) then
call CARMA_Get(carma, rc, dwave=dwave, wave=wave)
if (rc < 0) call endrun('carma_timestep_tend::CARMA_Get failed.')
-
+
! CARMA may run before the radiation code for the very first time step.
! In that case, the lu, ld, su and sd values are NaN. NaN will crash
! the model, so instead substitute an approximation that is roughly a
@@ -1206,17 +1141,17 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
lu_ptr(icol, iz, iwvl) = planckIntensity(wave(iwvl), state_loc%t(icol, iz)) / 1e7_f * 1e4_f * dwave(iwvl) * PI
end do
lu_ptr(icol, pverp, iwvl) = lu_ptr(icol, pver, iwvl)
-
+
ld_ptr(icol, 2:pverp, iwvl) = lu_ptr(icol, 1:pver, iwvl)
ld_ptr(icol, 1, iwvl) = lu_ptr(icol, 2, iwvl)
end do
end if
-
+
do iwvl = 1, nlwbands
radint(:, iwvl) = (lu_ptr(icol, 2:, iwvl) + ld_ptr(icol, :pver, iwvl)) / 2._r8 / PI / dwave(iwvl)
end do
-
+
do iwvl = 1, nswbands
radint(:, nlwbands+iwvl) = (su_ptr(icol, 2:, iwvl) + sd_ptr(icol, :pver, iwvl)) / 2._r8 / PI / dwave(nlwbands+iwvl)
end do
@@ -1228,13 +1163,8 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
dt, &
pver, &
I_HYBRID, &
- I_LL, &
- state_loc%lat(icol) / DEG2RAD, &
- state_loc%lon(icol) / DEG2RAD, &
- xc, &
- dx, &
- yc, &
- dy, &
+ state_loc%lat(icol) * RAD2DEG, &
+ state_loc%lon(icol) * RAD2DEG, &
pref_mid_norm, &
pref_edge/psurf_ref, &
state_loc%pmid(icol, :), &
@@ -1254,10 +1184,10 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
do ielem = 1, NELEM
call CARMAELEMENT_Get(carma, ielem, rc, igroup=igroup)
if (rc < 0) call endrun('carma_timestep_tend::CARMAELEMENT_Get failed.')
-
+
call CARMAGROUP_Get(carma, igroup, rc, cnsttype=cnsttype, maxbin=maxbin)
if (rc < 0) call endrun('carma_timestep_tend::CARMAGROUP_Get failed.')
-
+
if (cnsttype == I_CNSTTYPE_PROGNOSTIC) then
! For prognostic groups, set the bin from the corresponding constituent.
@@ -1270,7 +1200,7 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
if (rc < 0) call endrun('carma_timestep_tend::CARMASTATE_SetBin failed.')
else
newstate(:) = 0._f
-
+
call CARMASTATE_SetBin(cstate, ielem, ibin, newstate, rc)
if (rc < 0) call endrun('carma_timestep_tend::CARMASTATE_SetBin failed.')
end if
@@ -1298,9 +1228,9 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
call CARMA_DiagnoseBins(carma, cstate, state_loc, pbuf, icol, dt, rc, rliq=rliq, prec_str=prec_str, snow_str=snow_str)
- if (rc < 0) call endrun('carma_timestep_tend::CARMA_DiagnoseBins failed.')
-
-
+ if (rc < 0) call endrun('carma_timestep_tend::CARMA_DiagnoseBins failed.')
+
+
! If the model supports detraining of condensed water from convection, then pass
! along the condensed H2O.
call CARMA_Get(carma, rc, do_detrain=do_detrain)
@@ -1311,7 +1241,7 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
snow_str=snow_str, tnd_qsnow=tnd_qsnow, tnd_nsnow=tnd_nsnow)
if (rc < 0) call endrun('carma_timestep_tend::CARMA_Detrain failed.')
end if
-
+
! Now that detrainment has happened, determine the cloud fractions.
! These will be used to scale the cloud amount to go from gridbox average to in-cloud
@@ -1326,17 +1256,17 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
if (carma_rhcrit /= 0._f) then
rhcrit(:) = carma_rhcrit
end if
-
-
+
+
! For dry deposition, provide a surface friction velocity and an aerodynamic
! resistance for each of the land surface types. The values for the land come
! from the land model, but those for ocean and sea ice need to be calculated.
if (do_drydep) then
-
+
! Land
lndfv = cam_in%fv(icol)
lndram = cam_in%ram1(icol)
-
+
! Ocean
ocnfv = ustar(icol)
ocnram = 0._r8
@@ -1363,15 +1293,15 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
iceram)
end if
end if
-
-
+
+
! Advance the microphysics one timestep.
call CARMASTATE_Step(cstate, rc, cldfrc=cldfrc, rhcrit=rhcrit, &
lndfv=lndfv, ocnfv=ocnfv, icefv=icefv, lndram=lndram, &
ocnram=ocnram, iceram=iceram, lndfrac=cam_in%landfrac(icol), &
ocnfrac=cam_in%ocnfrac(icol), icefrac=cam_in%icefrac(icol))
- if (rc < 0) call endrun('carma_timestep_tend::CARMA_Step failed.')
-
+ if (rc < 0) call endrun('carma_timestep_tend::CARMA_Step failed.')
+
! Get the results for the CARMA particles.
@@ -1393,16 +1323,16 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
! Calculate the group statistics for all elements.
dz(:) = state_loc%zi(icol, 1:pver) - state_loc%zi(icol, 2:pverp)
-
+
do ielem = 1, NELEM
-
+
call CARMAELEMENT_Get(carma, ielem, rc, igroup=igroup)
if (rc < 0) call endrun('carma_timestep_tend::CARMAELEMENT_Get failed.')
-
+
call CARMAGROUP_Get(carma, igroup, rc, cnsttype=cnsttype, r=r, rmass=rmass, maxbin=maxbin, &
is_cloud=is_cloud, is_ice=is_ice, do_drydep=grp_do_drydep, rrat=rrat, arat=arat)
if (rc < 0) call endrun('carma_timestep_tend::CARMAGROUP_Get failed.')
-
+
! Intialize the group totals
nd(:) = 0.0_r8
ad(:) = 0.0_r8
@@ -1423,26 +1353,26 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
call CARMASTATE_GetBin(cstate, ielem, ibin, newstate(:), rc, &
numberDensity=numberDensity, nucleationRate=nucleationRate, surface=dd, vd=vd, vf=vf, dtpart=dtpart)
if (rc < 0) call endrun('carma_timestep_tend::CARMASTATE_GetBin failed.')
-
+
! For prognostic groups, set the tendency from the corresponding constituents.
if (cnsttype == I_CNSTTYPE_PROGNOSTIC) then
-
+
! Bins past maxbin are treated as diagnostic even if the group
! is prognostic and thus are not advected in the paerent model.
if (ibin <= maxbin) then
-
+
icnst = icnst4elem(ielem, ibin)
-
+
! Update the consituent tendency.
ptend%q(icol, :, icnst) = (newstate(:) - state_loc%q(icol, :, icnst)) / dt
-
+
if (grp_do_drydep) then
sbdiags(icol, ibin, ielem, SBDIAGS_DD) = dd / dt
sbdiags(icol, ibin, ielem, SBDIAGS_VD) = - vd / 100._r8
end if
end if
end if
-
+
! Calculate the total densities.
!
! NOTE: Convert AD to um2/cm3.
@@ -1455,7 +1385,7 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
mr(:) = mr(:) + newstate(:)
pa(:) = pa(:) + numberDensity(:) * PI * ((r(ibin) * rrat(ibin))**2) * arat(ibin)
vm(:) = vm(:) + numberDensity(:) * rmass(ibin) * vf(2:) / 100._f
-
+
! Calculate the optical depth and extinction.
!
! NOTE: Assume Qext = 2 for optical depth. This can be pulled out of CARMA
@@ -1476,11 +1406,11 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
jn(:) = jn(:) + nucleationRate(:)
end if
end do
-
+
! If this is the number element for the group, then write out the
! statistics.
if (numberDensity(1) /= CAM_FILL) then
-
+
! Calculate the effective radius (total volume / total area). Places
! with no surface area will cause NaN values.
!
@@ -1496,9 +1426,9 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
end where
! Store the statistics.
-
+
! Gridbox average
- gpdiags(icol, :, igroup, GPDIAGS_ND) = nd
+ gpdiags(icol, :, igroup, GPDIAGS_ND) = nd
gpdiags(icol, :, igroup, GPDIAGS_AD) = ad
gpdiags(icol, :, igroup, GPDIAGS_MD) = md
gpdiags(icol, :, igroup, GPDIAGS_RE) = re
@@ -1509,14 +1439,14 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
gpdiags(icol, :, igroup, GPDIAGS_VM) = vm
gpdiags(icol, :, igroup, GPDIAGS_PA) = pa
gpdiags(icol, :, igroup, GPDIAGS_AR) = ar
-
+
if (nucleationRate(1) /= CAM_FILL) then
gpdiags(icol, :, igroup, GPDIAGS_JN) = jn
end if
end if
end do
-
+
! Get the results for the CARMA gases.
do igas = 1, NGAS
call pbuf_get_field(pbuf, ipbuf4gas(igas), gc_ptr)
@@ -1526,47 +1456,47 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
call CARMASTATE_GetGas(cstate, igas, newstate(:), rc, satice=satice, satliq=satliq, &
eqice=eqice, eqliq=eqliq, wtpct=wtpct)
if (rc < 0) call endrun('carma_timestep_tend::CARMASTATE_GetGas failed.')
-
+
icnst = icnst4gas(igas)
ptend%q(icol, :, icnst) = (newstate(:) - state_loc%q(icol, :, icnst)) / dt
-
- gsdiags(icol, :, igas, GSDIAGS_SI) = satice(:)
+
+ gsdiags(icol, :, igas, GSDIAGS_SI) = satice(:)
gsdiags(icol, :, igas, GSDIAGS_SL) = satliq(:)
- gsdiags(icol, :, igas, GSDIAGS_EI) = eqice(:)
+ gsdiags(icol, :, igas, GSDIAGS_EI) = eqice(:)
gsdiags(icol, :, igas, GSDIAGS_EL) = eqliq(:)
gsdiags(icol, :, igas, GSDIAGS_WT) = wtpct(:)
-
+
! Store the values needed for substepping in the physics buffer.
gc_ptr(icol,:) = newstate(:)
sati_ptr(icol, :) = satice(:)
satl_ptr(icol, :) = satliq(:)
end do
-
+
! Get the results for temperature.
call CARMASTATE_GetState(cstate, rc, t=newstate(:))
if (rc < 0) call endrun('carma_timestep_tend::CARMASTATE_GetState failed.')
-
+
! Store the values needed for substepping in the physics buffer.
t_ptr(icol,:) = newstate(:)
- if (carma_do_thermo) then
+ if (carma_do_thermo) then
ptend%s(icol, :) = (newstate(:) - state_loc%t(icol, :)) * cpair / dt
endif
-
-
+
+
! Get the substepping statistics
if (carma_do_substep) then
call CARMASTATE_Get(cstate, rc, zsubsteps=zsubsteps)
if (rc < 0) call endrun('carma_timestep_tend::CARMASTATE_Get failed.')
-
+
spdiags(icol, :, SPDIAGS_NSTEP) = zsubsteps(:)
spdiags(icol, :, SPDIAGS_LNSTEP) = log(zsubsteps(:))
end if
end do
-
-
+
+
! Report substep diagnostics
if (carma_do_substep) then
call CARMASTATE_Get(cstate, rc, max_nsubstep=max_nsubstep, max_nretry=max_nretry, &
@@ -1576,27 +1506,27 @@ subroutine carma_timestep_tend(state, cam_in, cam_out, ptend, dt, pbuf, dlf, rli
!$OMP CRITICAL
step_max_nsubstep = max(step_max_nsubstep, real(max_nsubstep, f))
step_max_nretry = max(step_max_nretry, max_nretry)
-
+
step_nstep = step_nstep + nstep
step_nsubstep = step_nsubstep + real(nsubstep, f)
step_nretry = step_nretry + nretry
!$OMP END CRITICAL
end if
-
+
! The CARMASTATE object is no longer needed.
call CARMASTATE_Destroy(cstate, rc)
if (rc < 0) call endrun('carma_timestep_tend::CARMASTATE_Destroy failed.')
-
-
+
+
! Output diagnostic fields.
call carma_output_diagnostics(state_loc, ptend, gpdiags, sbdiags, gsdiags, spdiags, bndiags)
end subroutine carma_timestep_tend
-
-
+
+
subroutine carma_accumulate_stats()
implicit none
-
+
integer :: istat
integer :: rc
real(kind=f) :: wrk
@@ -1604,7 +1534,7 @@ subroutine carma_accumulate_stats()
logical :: do_print ! do print output?
! Define formats
- 1 format(' carma: max nsubstep=',1F9.0,3x,'avg nsubstep=',1F9.2,3x,'max nretry=',1F9.0,3x,'avg nretry=',1F10.4)
+ 1 format(' carma: max nsubstep=',1F9.0,3x,'avg nsubstep=',1F9.2,3x,'max nretry=',1F9.0,3x,'avg nretry=',1F10.4)
if (carma_do_substep) then
@@ -1619,7 +1549,7 @@ subroutine carma_accumulate_stats()
end if
step_max_nsubstep = wrk
glob_max_nsubstep = max(glob_max_nsubstep, wrk)
-
+
call mpi_allreduce(step_max_nretry, wrk, 1, mpir8, mpi_max, mpicom, istat)
if( istat /= MPI_SUCCESS ) then
if (do_print) write(LUNOPRT,*) 'carma_timestep_tend: MPI_ALLREDUCE for max_nsubstep failed; error = ',istat
@@ -1627,7 +1557,7 @@ subroutine carma_accumulate_stats()
end if
step_max_nretry = wrk
glob_max_nretry = max(glob_max_nretry, wrk)
-
+
call mpi_allreduce(step_nstep, wrk, 1, mpir8, mpi_sum, mpicom, istat)
if( istat /= MPI_SUCCESS ) then
if (do_print) write(LUNOPRT,*) 'carma_timestep_tend: MPI_ALLREDUCE for nstep failed; error = ',istat
@@ -1635,7 +1565,7 @@ subroutine carma_accumulate_stats()
end if
step_nstep = wrk
glob_nstep = glob_nstep + wrk
-
+
call mpi_allreduce(step_nsubstep, wrk, 1, mpir8, mpi_sum, mpicom, istat)
if( istat /= MPI_SUCCESS ) then
if (do_print) write(LUNOPRT,*) 'carma_timestep_tend: MPI_ALLREDUCE for nsubstep failed; error = ',istat
@@ -1643,7 +1573,7 @@ subroutine carma_accumulate_stats()
end if
step_nsubstep = wrk
glob_nsubstep = glob_nsubstep + wrk
-
+
call mpi_allreduce(step_nretry, wrk, 1, mpir8, mpi_sum, mpicom, istat)
if( istat /= MPI_SUCCESS ) then
if (do_print) write(LUNOPRT,*) 'carma_timestep_tend: MPI_ALLREDUCE for nretry failed; error = ',istat
@@ -1659,7 +1589,7 @@ subroutine carma_accumulate_stats()
glob_nstep = glob_nstep + step_nstep
glob_nsubstep = glob_nsubstep + step_nsubstep
glob_nretry = glob_nretry + step_nretry
-
+
#endif
if (masterproc) then
@@ -1695,7 +1625,7 @@ subroutine carma_init_cnst(name, latvals, lonvals, mask, q)
real(r8), intent(in) :: lonvals(:) !! lon in degrees (ncol)
logical, intent(in) :: mask(:) !! Only initialize where .true.
real(r8), intent(out) :: q(:,:) !! mass mixing ratio (gcol, lev)
-
+
integer :: igroup ! group index
integer :: ielem ! element index
integer :: ilev ! level index
@@ -1707,27 +1637,27 @@ subroutine carma_init_cnst(name, latvals, lonvals, mask, q)
! Initialize the return code.
rc = 0
-
+
! Determine the element an bin for the particle
do ielem = 1, NELEM
do ibin = 1, NBIN
-
+
call CARMAELEMENT_Get(carma, ielem, rc, igroup=igroup)
if (rc < 0) call endrun('carma_timestep_tend::CARMAELEMENT_Get failed.')
-
+
call CARMAGROUP_Get(carma, igroup, rc, cnsttype=cnsttype, maxbin=maxbin)
if (rc < 0) call endrun('carma_timestep_tend::CARMAGROUP_Get failed.')
-
+
if (cnsttype == I_CNSTTYPE_PROGNOSTIC) then
! Bins past maxbin are treated as diagnostic even if the group
! is prognostic and thus are not advected in the paerent model.
if (ibin <= maxbin) then
-
+
icnst = icnst4elem(ielem, ibin)
-
+
if (cnst_name(icnst) == name) then
-
+
! By default, initialize all constituents to 0.
do ilev = 1, size(q, 2)
where(mask)
@@ -1742,10 +1672,10 @@ subroutine carma_init_cnst(name, latvals, lonvals, mask, q)
end if
end do
end do
-
+
! NOTE: There is currently no initialization for gases, but it could be
! added here.
-
+
return
end subroutine carma_init_cnst
@@ -1762,11 +1692,11 @@ subroutine carma_output_diagnostics(state, ptend, gpdiags, sbdiags, gsdiags, spd
type(physics_state), intent(in) :: state !! Physics state variables - before CARMA
type(physics_ptend), intent(in) :: ptend !! indivdual parameterization tendencies
- real(r8), intent(in), dimension(pcols, pver, NGROUP, NGPDIAGS) :: gpdiags !! CARMA group diagnostic output
- real(r8), intent(in), dimension(pcols, NBIN, NELEM, NSBDIAGS) :: sbdiags !! CARMA surface bin diagnostic output
- real(r8), intent(in), dimension(pcols, pver, NGAS, NGSDIAGS) :: gsdiags !! CARMA gas diagnostic output
- real(r8), intent(in), dimension(pcols, pver, NSPDIAGS) :: spdiags !! CARMA step diagnostic output
- real(r8), intent(in), dimension(pcols, pver, NBIN, NELEM, NBNDIAGS) :: bndiags !! CARMA bin diagnostic output
+ real(r8), intent(in), dimension(pcols, pver, NGROUP, NGPDIAGS) :: gpdiags !! CARMA group diagnostic output
+ real(r8), intent(in), dimension(pcols, NBIN, NELEM, NSBDIAGS) :: sbdiags !! CARMA surface bin diagnostic output
+ real(r8), intent(in), dimension(pcols, pver, NGAS, NGSDIAGS) :: gsdiags !! CARMA gas diagnostic output
+ real(r8), intent(in), dimension(pcols, pver, NSPDIAGS) :: spdiags !! CARMA step diagnostic output
+ real(r8), intent(in), dimension(pcols, pver, NBIN, NELEM, NBNDIAGS) :: bndiags !! CARMA bin diagnostic output
! Local variables
integer :: igroup ! group index
@@ -1783,46 +1713,46 @@ subroutine carma_output_diagnostics(state, ptend, gpdiags, sbdiags, gsdiags, spd
integer :: maxbin ! last prognostic bin
logical :: is_cloud ! is the group a cloud?
logical :: do_drydep ! is dry deposition enabled?
-
+
! Initialize the return code.
rc = 0
-
+
! Check each column int the chunk.
lchnk = state%lchnk
ncol = state%ncol
! Output step diagnostics.
if (carma_do_substep) then
- call outfld('CRNSTEP', spdiags(:, :, SPDIAGS_NSTEP), pcols, lchnk)
- call outfld('CRLNSTEP', spdiags(:, :, SPDIAGS_LNSTEP), pcols, lchnk)
+ call outfld('CRNSTEP', spdiags(:, :, SPDIAGS_NSTEP), pcols, lchnk)
+ call outfld('CRLNSTEP', spdiags(:, :, SPDIAGS_LNSTEP), pcols, lchnk)
end if
! Output the particle tendencies.
do ielem = 1, NELEM
do ibin = 1, NBIN
-
+
call CARMAELEMENT_Get(carma, ielem, rc, igroup=igroup)
if (rc < 0) call endrun('carma_timestep_tend::CARMAELEMENT_Get failed.')
-
+
call CARMAGROUP_Get(carma, igroup, rc, cnsttype=cnsttype, maxbin=maxbin, do_drydep=do_drydep)
if (rc < 0) call endrun('carma_timestep_tend::CARMAGROUP_Get failed.')
-
+
if (cnsttype == I_CNSTTYPE_PROGNOSTIC) then
! Bins past maxbin are treated as diagnostic even if the group
! is prognostic and thus are not advected in the paerent model.
if (ibin <= maxbin) then
-
+
icnst = icnst4elem(ielem, ibin)
-
- call outfld(trim(etndname(ielem, ibin))//'TC', ptend%q(:, :, icnst), pcols, lchnk)
+
+ call outfld(trim(etndname(ielem, ibin))//'TC', ptend%q(:, :, icnst), pcols, lchnk)
if (do_drydep) then
call outfld(trim(etndname(ielem, ibin))//'DD', sbdiags(:, ibin, ielem, SBDIAGS_DD), pcols, lchnk)
end if
if (carma_do_pheat) then
-
+
! Only specified for the number density element of the group.
if (bndiags(1, 1, ibin, ielem, BNDIAGS_TP) /= CAM_FILL) then
call outfld(trim(etndname(ielem, ibin))//'TP', bndiags(:, :, ibin, ielem, BNDIAGS_TP), pcols, lchnk)
@@ -1832,56 +1762,56 @@ subroutine carma_output_diagnostics(state, ptend, gpdiags, sbdiags, gsdiags, spd
end if
end do
end do
-
+
! Output the particle diagnostics.
- do igroup = 1, NGROUP
+ do igroup = 1, NGROUP
call CARMAGROUP_Get(carma, igroup, rc, shortname=sname, is_cloud=is_cloud, do_drydep=do_drydep, ienconc=ienconc)
if (rc < 0) call endrun('carma_output_diagnostics::CARMAGROUP_Get failed.')
-
+
! Gridbox average
- call outfld(trim(sname)//'ND', gpdiags(:, :, igroup, GPDIAGS_ND), pcols, lchnk)
- call outfld(trim(sname)//'AD', gpdiags(:, :, igroup, GPDIAGS_AD), pcols, lchnk)
- call outfld(trim(sname)//'MD', gpdiags(:, :, igroup, GPDIAGS_MD), pcols, lchnk)
- call outfld(trim(sname)//'RE', gpdiags(:, :, igroup, GPDIAGS_RE), pcols, lchnk)
- call outfld(trim(sname)//'RM', gpdiags(:, :, igroup, GPDIAGS_RM), pcols, lchnk)
- call outfld(trim(sname)//'JN', gpdiags(:, :, igroup, GPDIAGS_JN), pcols, lchnk)
- call outfld(trim(sname)//'MR', gpdiags(:, :, igroup, GPDIAGS_MR), pcols, lchnk)
- call outfld(trim(sname)//'EX', gpdiags(:, :, igroup, GPDIAGS_EX), pcols, lchnk)
- call outfld(trim(sname)//'OD', gpdiags(:, :, igroup, GPDIAGS_OD), pcols, lchnk)
- call outfld(trim(sname)//'PA', gpdiags(:, :, igroup, GPDIAGS_PA), pcols, lchnk)
- call outfld(trim(sname)//'AR', gpdiags(:, :, igroup, GPDIAGS_AR), pcols, lchnk)
- call outfld(trim(sname)//'VM', gpdiags(:, :, igroup, GPDIAGS_VM), pcols, lchnk)
-
+ call outfld(trim(sname)//'ND', gpdiags(:, :, igroup, GPDIAGS_ND), pcols, lchnk)
+ call outfld(trim(sname)//'AD', gpdiags(:, :, igroup, GPDIAGS_AD), pcols, lchnk)
+ call outfld(trim(sname)//'MD', gpdiags(:, :, igroup, GPDIAGS_MD), pcols, lchnk)
+ call outfld(trim(sname)//'RE', gpdiags(:, :, igroup, GPDIAGS_RE), pcols, lchnk)
+ call outfld(trim(sname)//'RM', gpdiags(:, :, igroup, GPDIAGS_RM), pcols, lchnk)
+ call outfld(trim(sname)//'JN', gpdiags(:, :, igroup, GPDIAGS_JN), pcols, lchnk)
+ call outfld(trim(sname)//'MR', gpdiags(:, :, igroup, GPDIAGS_MR), pcols, lchnk)
+ call outfld(trim(sname)//'EX', gpdiags(:, :, igroup, GPDIAGS_EX), pcols, lchnk)
+ call outfld(trim(sname)//'OD', gpdiags(:, :, igroup, GPDIAGS_OD), pcols, lchnk)
+ call outfld(trim(sname)//'PA', gpdiags(:, :, igroup, GPDIAGS_PA), pcols, lchnk)
+ call outfld(trim(sname)//'AR', gpdiags(:, :, igroup, GPDIAGS_AR), pcols, lchnk)
+ call outfld(trim(sname)//'VM', gpdiags(:, :, igroup, GPDIAGS_VM), pcols, lchnk)
+
if (do_drydep) then
do ibin = 1, NBIN
call outfld(trim(btndname(igroup, ibin))//'VD', sbdiags(:, ibin, ienconc, SBDIAGS_VD), pcols, lchnk)
end do
end if
end do
-
+
! Output the gas tendencies.
do igas = 1, NGAS
icnst = icnst4gas(igas)
-
- call outfld(gtndname(igas), ptend%q(:, :, icnst), pcols, lchnk)
-
+
+ call outfld(gtndname(igas), ptend%q(:, :, icnst), pcols, lchnk)
+
! Output the supersaturations.
- call outfld(trim(cnst_name(icnst))//'SI', gsdiags(:, :, igas, GSDIAGS_SI), pcols, lchnk)
- call outfld(trim(cnst_name(icnst))//'SL', gsdiags(:, :, igas, GSDIAGS_SL), pcols, lchnk)
- call outfld(trim(cnst_name(icnst))//'EI', gsdiags(:, :, igas, GSDIAGS_EI), pcols, lchnk)
- call outfld(trim(cnst_name(icnst))//'EL', gsdiags(:, :, igas, GSDIAGS_EL), pcols, lchnk)
- call outfld(trim(cnst_name(icnst))//'WT', gsdiags(:, :, igas, GSDIAGS_WT), pcols, lchnk)
+ call outfld(trim(cnst_name(icnst))//'SI', gsdiags(:, :, igas, GSDIAGS_SI), pcols, lchnk)
+ call outfld(trim(cnst_name(icnst))//'SL', gsdiags(:, :, igas, GSDIAGS_SL), pcols, lchnk)
+ call outfld(trim(cnst_name(icnst))//'EI', gsdiags(:, :, igas, GSDIAGS_EI), pcols, lchnk)
+ call outfld(trim(cnst_name(icnst))//'EL', gsdiags(:, :, igas, GSDIAGS_EL), pcols, lchnk)
+ call outfld(trim(cnst_name(icnst))//'WT', gsdiags(:, :, igas, GSDIAGS_WT), pcols, lchnk)
end do
-
+
! Output the temperature tendency.
if (carma_do_thermo) then
- call outfld('CRTT', ptend%s(:, :) / cpair, pcols, lchnk)
+ call outfld('CRTT', ptend%s(:, :) / cpair, pcols, lchnk)
end if
-
+
return
end subroutine carma_output_diagnostics
-
-
+
+
!! Calculate the emissions for CARMA aerosols. This is taken from
!! the routine aerosol_emis_intr in aerosol_intr.F90 and dust_emis_intr in
!! dust_intr.F90 by Phil Rasch.
@@ -1893,7 +1823,7 @@ subroutine carma_emission_tend (state, ptend, cam_in, dt)
use camsrfexch, only: cam_in_t
implicit none
-
+
type(physics_state), intent(in ) :: state !! physics state
type(physics_ptend), intent(inout) :: ptend !! physics state tendencies
type(cam_in_t), intent(inout) :: cam_in !! surface inputs
@@ -1901,7 +1831,6 @@ subroutine carma_emission_tend (state, ptend, cam_in, dt)
integer :: lchnk ! chunk identifier
integer :: ncol ! number of columns in chunk
- integer :: icol ! column index
integer :: igroup ! group index
integer :: ielem ! element index
integer :: ibin ! bin index
@@ -1923,34 +1852,34 @@ subroutine carma_emission_tend (state, ptend, cam_in, dt)
ncol = state%ncol
lchnk = state%lchnk
-
+
! Provide emissions rates for particles.
!
! NOTE: This can only be done for prognostic groups.
do ielem = 1, NELEM
call CARMAELEMENT_Get(carma, ielem, rc, igroup=igroup)
if (rc < 0) call endrun('carma_drydep_tend::CARMAELEMENT_Get failed.')
-
+
call CARMAGROUP_Get(carma, igroup, rc, cnsttype=cnsttype, maxbin=maxbin)
if (rc < 0) call endrun('carma_drydep_tend::CARMAGROUP_Get failed.')
-
+
if (cnsttype == I_CNSTTYPE_PROGNOSTIC) then
-
+
do ibin = 1, NBIN
! Bins past maxbin are treated as diagnostic even if the group
! is prognostic and thus are not advected in the paerent model.
if (ibin <= maxbin) then
-
+
icnst = icnst4elem(ielem, ibin)
-
+
call CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tendency, surfaceFlux, rc)
if (rc < 0) call endrun('carma_emission_tend::CARMA_EmitParticle failed.')
-
+
! Add any surface flux here.
cam_in%cflx(:ncol, icnst) = surfaceFlux(:ncol)
call outfld(trim(cnst_name(icnst))//'SF', cam_in%cflx(:ncol, icnst), ncol, lchnk)
-
+
! For emissions into the atmosphere, put the emission here.
ptend%q(:ncol, :pver, icnst) = tendency(:ncol, :pver)
call outfld(trim(cnst_name(icnst))//'EM', ptend%q(:ncol, :, icnst), ncol, lchnk)
@@ -1958,18 +1887,18 @@ subroutine carma_emission_tend (state, ptend, cam_in, dt)
enddo
end if
enddo
-
+
! No emissions rate is set up for gases, but it could be added here.
return
- end subroutine carma_emission_tend
+ end subroutine carma_emission_tend
!! Calculate the wet deposition for the CARMA aerosols. This is taken from
!! the routine aerosol_wet_int in aerosol_intr.F90 and dust_wet_intr in
!! dust_intr.F90 by Phil Rasch.
- !!
- !! Method:
+ !!
+ !! Method:
!! Use a modified version of the scavenging parameterization described in
!! Barth et al, 2000, JGR (sulfur cycle paper)
!! Rasch et al, 2001, JGR (INDOEX paper)
@@ -1983,7 +1912,7 @@ subroutine carma_wetdep_tend(state, ptend, dt, pbuf, dlf, cam_out)
use wetdep, only: clddiag, wetdepa_v1, wetdepa_v2
use camsrfexch, only: cam_out_t
use physconst, only: gravit
-
+
implicit none
real(r8), intent(in) :: dt !! time step (s)
@@ -1997,14 +1926,11 @@ subroutine carma_wetdep_tend(state, ptend, dt, pbuf, dlf, cam_out)
real(r8) :: rainmr(pcols,pver) ! mixing ratio of rain within cloud volume
real(r8) :: cldv(pcols,pver) ! cloudy volume undergoing wet chem and scavenging
real(r8) :: cldvcu(pcols,pver) ! Convective precipitation area, top interface of current layer
- real(r8) :: cldvst(pcols,pver) ! Stratiform precipitation area, top interface of current layer
+ real(r8) :: cldvst(pcols,pver) ! Stratiform precipitation area, top interface of current layer
integer :: ielem ! element index
integer :: igroup ! group index
integer :: ibin ! bin index
integer :: icnst ! constituent index
- integer :: lat(pcols) ! latitude indices
- real(r8) :: clat(pcols) ! latitudes
- integer :: lon(pcols) ! longtitude indices
real(r8) :: conicw(pcols,pver) ! convective in-cloud water
real(r8) :: cmfdqr(pcols,pver) ! convective production of rain
real(r8) :: cldc(pcols,pver) ! convective cloud fraction, currently empty
@@ -2027,8 +1953,8 @@ subroutine carma_wetdep_tend(state, ptend, dt, pbuf, dlf, cam_out)
real(r8) :: sflx(pcols) ! Surface Flux (kg/m2/s)
integer :: maxbin
- ! physics buffer
- integer itim_old, ifld
+ ! physics buffer
+ integer itim_old
real(r8), pointer, dimension(:,:) :: cldn ! cloud fraction
real(r8), pointer, dimension(:,:) :: cme
real(r8), pointer, dimension(:,:) :: prain
@@ -2045,23 +1971,19 @@ subroutine carma_wetdep_tend(state, ptend, dt, pbuf, dlf, cam_out)
! Initialize the return code.
rc = 0
-
+
! Initialize the output tendency structure.
call physics_ptend_init(ptend,state%psetcols, 'CARMA (wetdep)', lq=lq_carma)
if (.not. carma_flag) return
- if (.not. carma_do_wetdep) return
+ if (.not. carma_do_wetdep) return
ncol = state%ncol
lchnk = state%lchnk
- call get_lat_all_p(lchnk, ncol, lat)
- call get_lon_all_p(lchnk, ncol, lon)
- call get_rlat_all_p(lchnk, ncol, clat)
-
! Associate pointers with physics buffer fields
itim_old = pbuf_old_tim_idx()
-
+
call pbuf_get_field(pbuf, pbuf_get_index('CLD'), cldn, (/1,1,itim_old/),(/pcols,pver,1/))
call pbuf_get_field(pbuf, pbuf_get_index('QME'), cme )
call pbuf_get_field(pbuf, pbuf_get_index('PRAIN'), prain )
@@ -2080,14 +2002,14 @@ subroutine carma_wetdep_tend(state, ptend, dt, pbuf, dlf, cam_out)
call pbuf_get_field(pbuf, pbuf_get_index('DP_FRAC'), dp_frac )
call pbuf_get_field(pbuf, pbuf_get_index('NEVAPR_SHCU'), evapcsh )
call pbuf_get_field(pbuf, pbuf_get_index('NEVAPR_DPCU'), evapcdp )
-
+
cldc(:ncol,:) = dp_frac(:ncol,:) + sh_frac(:ncol,:) ! Sungsu included this.
evapc(:ncol,:) = evapcsh(:ncol,:) + evapcdp(:ncol,:) ! Sungsu included this.
clds(:ncol,:) = cldn(:ncol,:) - cldc(:ncol,:) ! Stratiform cloud fraction
cmfdqr(:ncol,:) = rprddp(:ncol,:) + rprdsh(:ncol,:)
-
+
! fields needed for wet scavenging
call clddiag( state%t, state%pmid, state%pdel, cmfdqr, evapc, cldn, cldc, clds, cme, evapr, prain, &
cldv, cldvcu, cldvst, rainmr, ncol )
@@ -2100,33 +2022,33 @@ subroutine carma_wetdep_tend(state, ptend, dt, pbuf, dlf, cam_out)
! Iterate over each particle and calculate a tendency from wet
! scavenging for it.
do ielem = 1, NELEM
-
+
! NOTE: This can only be done for prognistic groups.
-
+
call CARMAELEMENT_Get(carma, ielem, rc, igroup=igroup)
if (rc < 0) call endrun('carma_wetdep_tend::CARMAELEMENT_Get failed.')
-
+
call CARMAGROUP_Get(carma, igroup, rc, cnsttype=cnsttype, do_wetdep=do_wetdep, &
solfac=solfac, scavcoef=scavcoef, maxbin=maxbin)
if (rc < 0) call endrun('carma_wetdep_tend::CARMAGROUP_Get failed.')
-
+
if ((do_wetdep) .and. (cnsttype == I_CNSTTYPE_PROGNOSTIC)) then
-
+
do ibin = 1, NBIN
-
+
! Bins past maxbin are treated as diagnostic even if the group
! is prognostic and thus are not advected in the parent model.
if (ibin <= maxbin) then
-
+
icnst = icnst4elem(ielem, ibin)
-
+
scavt = 0._r8
-
+
! The scavenging coefficient might be calculated as a function of
! the aerosol bin at each grid point. However, for now, we will just
! use a constant value for each group.
z_scavcoef(:, :) = scavcoef
-
+
if (cam_physpkg_is('cam5') .or. cam_physpkg_is('cam6')) then
call wetdepa_v2( &
@@ -2142,20 +2064,20 @@ subroutine carma_wetdep_tend(state, ptend, dt, pbuf, dlf, cam_out)
cme, &
evapr, &
totcond, &
- state%q(:, :, icnst), &
+ state%q(:, :, icnst), &
dt, &
scavt, &
iscavt, &
cldvcu, &
cldvst, &
- dlf, &
- fracis(:, :, icnst), &
+ dlf, &
+ fracis(:, :, icnst), &
solfac, &
ncol, &
z_scavcoef)
-
+
else if (cam_physpkg_is('cam4')) then
-
+
call wetdepa_v1(state%t, &
state%pmid, &
state%q, &
@@ -2168,20 +2090,20 @@ subroutine carma_wetdep_tend(state, ptend, dt, pbuf, dlf, cam_out)
cme, &
evapr, &
totcond, &
- state%q(:, :, icnst), &
+ state%q(:, :, icnst), &
dt, &
scavt, &
iscavt, &
cldv, &
- fracis(:, :, icnst), &
+ fracis(:, :, icnst), &
solfac, &
ncol, &
z_scavcoef)
else
-
+
call endrun('carma_wetdep_tend:: No wet deposition routine is available for this configuration.')
end if
-
+
ptend%q(:, :, icnst) = scavt
call outfld(trim(cnst_name(icnst))//'WD', ptend%q(:, :, icnst), pcols, lchnk)
@@ -2189,7 +2111,7 @@ subroutine carma_wetdep_tend(state, ptend, dt, pbuf, dlf, cam_out)
! ptend%q(kg/kg air/s) * pdel(Pa) / gravit (m/s2) => (kg/m2/s)
! note: 1Pa = 1 kg air * (m/s2) / m2
sflx(:) = 0._r8
-
+
do k = 1,pver
sflx(:ncol) = sflx(:ncol) - ptend%q(:ncol, k, icnst) * state%pdel(:ncol,k) / gravit
enddo
@@ -2198,7 +2120,7 @@ subroutine carma_wetdep_tend(state, ptend, dt, pbuf, dlf, cam_out)
! Add this to the surface amount of the constituent
call CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
-
+
end if
end do
end if
@@ -2206,8 +2128,8 @@ subroutine carma_wetdep_tend(state, ptend, dt, pbuf, dlf, cam_out)
return
end subroutine carma_wetdep_tend
-
-
+
+
!! This routine creates files containing optical properties for each radiatively
!! active particle type. These optical properties are used by the RRTMG radiation
!! code to include the impact of CARMA particles in the radiative transfer
@@ -2220,7 +2142,7 @@ subroutine CARMA_CreateOpticsFile(carma, rc)
use radconstants, only : nswbands, nlwbands
use wrap_nf
use wetr, only : getwetr
-
+
implicit none
type(carma_type), intent(inout) :: carma !! the carma object
@@ -2242,16 +2164,16 @@ subroutine CARMA_CreateOpticsFile(carma, rc)
integer :: rhvar, lwvar, swvar
integer :: abs_lw_var
integer :: ext_sw_var, ssa_sw_var, asm_sw_var
- integer :: omdim, andim, namedim
- integer :: omvar, anvar, namevar
+ integer :: omdim, andim, namedim
+ integer :: omvar, anvar, namevar
integer :: dimids(2)
integer :: denvar, slogvar, dryrvar, rminvar, rmaxvar, hygrovar, ntmvar
real(kind=f) :: abs_lw(NMIE_RH, nlwbands)
real(kind=f) :: ext_sw(NMIE_RH, nswbands)
real(kind=f) :: ssa_sw(NMIE_RH, nswbands)
real(kind=f) :: asm_sw(NMIE_RH, nswbands)
- character(len=8) :: c_name ! constituent name
- character(len=32) :: aer_name ! long enough for both aername and name
+ character(len=8) :: c_name ! constituent name
+ character(len=32) :: aer_name ! long enough for both aername and name
character(len=255) :: filepath
real(kind=f) :: rwet
real(kind=f) :: Qext
@@ -2265,55 +2187,55 @@ subroutine CARMA_CreateOpticsFile(carma, rc)
integer :: LUNOPRT ! logical unit number for output
logical :: do_print ! do print output?
integer :: ret
-
-
+
+
! Assume success.
rc = 0
-
+
! Get the wavelength structure.
call CARMA_GET(carma, rc, wave=wave, do_print=do_print, LUNOPRT=LUNOPRT)
if (rc < 0) call endrun('carma_CreateOpticsFile::CARMA_Get failed.')
-
+
! Process each group that is defined in the model.
do igroup = 1, NGROUP
-
+
! Get the necessary group properties.
call CARMAGROUP_Get(carma, igroup, rc, do_mie=do_mie, name=name, shortname=shortname, r=r, &
rlow=rlow, rup=rup, rmass=rmass, refidx=refidx, irhswell=irhswell, &
ienconc=ienconc, cnsttype=cnsttype, maxbin=maxbin)
if (rc < 0) call endrun('carma_CreateOpticsFile::CARMAGROUP_Get failed.')
-
+
! Are we supposed to do the mie calculation for this group?
if ((do_mie) .and. (cnsttype == I_CNSTTYPE_PROGNOSTIC)) then
-
+
call CARMAELEMENT_Get(carma, ienconc, rc, rho=rho)
if (rc < 0) call endrun('carma_CreateOpticsFile::CARMAELEMENT_Get failed.')
-
+
! A file needs to be created for each bin.
do ibin = 1, NBIN
-
+
! Bins past maxbin are treated as diagnostic even if the group
! is prognostic and thus are not advected in the paerent model.
if (ibin <= maxbin) then
-
+
write(c_name, '(A, I2.2)') trim(shortname), ibin
-
+
! Construct the path to the file. Each model will have its own subdirectory
! where the optical property files are stored.
filepath = trim(carma_model) // '_' // trim(c_name) // '_rrtmg.nc'
-
+
if (do_print) write(LUNOPRT,*) 'Creating CARMA optics file ... ', trim(filepath)
-
+
! Create the file.
call wrap_create(filepath, NF90_CLOBBER, fid)
-
+
! For non-hygroscopic, only use 1 RH value.
if (irhswell /= 0) then
nrh = NMIE_RH
else
nrh = min(NMIE_RH, 1)
end if
-
+
! Define the dimensions: rh, lwbands, swbands
call wrap_def_dim(fid, 'rh_idx', nrh, rhdim)
call wrap_def_dim(fid, 'lw_band', nlwbands, lwdim)
@@ -2323,23 +2245,23 @@ subroutine CARMA_CreateOpticsFile(carma, rc)
dimids(1) = rhdim
call wrap_def_var(fid, 'rh', NF90_DOUBLE, 1, dimids(1:1), rhvar)
-
+
dimids(1) = lwdim
call wrap_def_var(fid, 'lw_band', NF90_DOUBLE, 1, dimids(1:1), lwvar)
-
+
dimids(1) = swdim
call wrap_def_var(fid, 'sw_band', NF90_DOUBLE, 1, dimids(1:1), swvar)
write(LUNOPRT,*) "Defined rh_idx, lw_band, and sw_band vars."
-
- call wrap_put_att_text(fid, rhvar, 'units', 'fraction')
- call wrap_put_att_text(fid, lwvar, 'units', 'm')
- call wrap_put_att_text(fid, swvar, 'units', 'm')
-
+
+ call wrap_put_att_text(fid, rhvar, 'units', 'fraction')
+ call wrap_put_att_text(fid, lwvar, 'units', 'm')
+ call wrap_put_att_text(fid, swvar, 'units', 'm')
+
call wrap_put_att_text(fid, rhvar, 'long_name', 'relative humidity')
call wrap_put_att_text(fid, lwvar, 'long_name', 'longwave bands')
call wrap_put_att_text(fid, swvar, 'long_name', 'shortwave bands')
-
+
! Define the variables: abs_lw, ext_sw, ssa_sw, asm_sw
dimids(1) = rhdim
dimids(2) = lwdim
@@ -2347,61 +2269,61 @@ subroutine CARMA_CreateOpticsFile(carma, rc)
write(LUNOPRT,*) "Defined abs_lw."
- call wrap_put_att_text(fid, abs_lw_var, 'units', 'meter^2 kilogram^-1')
-
+ call wrap_put_att_text(fid, abs_lw_var, 'units', 'meter^2 kilogram^-1')
+
dimids(1) = rhdim
dimids(2) = swdim
call wrap_def_var(fid, 'ext_sw', NF90_DOUBLE, 2, dimids, ext_sw_var)
call wrap_def_var(fid, 'ssa_sw', NF90_DOUBLE, 2, dimids, ssa_sw_var)
call wrap_def_var(fid, 'asm_sw', NF90_DOUBLE, 2, dimids, asm_sw_var)
-
+
write(LUNOPRT,*) "Defined ext_sw, ssa_sw, and asm_sw."
- call wrap_put_att_text(fid, ssa_sw_var, 'units', 'fraction')
- call wrap_put_att_text(fid, ext_sw_var, 'units', 'meter^2 kilogram^-1')
- call wrap_put_att_text(fid, asm_sw_var, 'units', '-')
-
+ call wrap_put_att_text(fid, ssa_sw_var, 'units', 'fraction')
+ call wrap_put_att_text(fid, ext_sw_var, 'units', 'meter^2 kilogram^-1')
+ call wrap_put_att_text(fid, asm_sw_var, 'units', '-')
+
! Define the variables for the refractive indicies.
dimids(1) = swdim
call wrap_def_var(fid, 'refindex_real_aer_sw', NF90_DOUBLE, 1, dimids(1:1), sw_r_refidx_var)
call wrap_def_var(fid, 'refindex_im_aer_sw', NF90_DOUBLE, 1, dimids(1:1), sw_i_refidx_var)
-
+
write(LUNOPRT,*) "Defined lw refindex."
dimids(1) = lwdim
call wrap_def_var(fid, 'refindex_real_aer_lw', NF90_DOUBLE, 1, dimids(1:1), lw_r_refidx_var)
call wrap_def_var(fid, 'refindex_im_aer_lw', NF90_DOUBLE, 1, dimids(1:1), lw_i_refidx_var)
-
+
write(LUNOPRT,*) "Defined sw refindex."
- call wrap_put_att_text(fid, sw_r_refidx_var, 'units', '-')
- call wrap_put_att_text(fid, sw_i_refidx_var, 'units', '-')
- call wrap_put_att_text(fid, lw_r_refidx_var, 'units', '-')
- call wrap_put_att_text(fid, lw_i_refidx_var, 'units', '-')
-
- call wrap_put_att_text(fid, sw_r_refidx_var, 'long_name', 'real refractive index of aerosol - shortwave')
- call wrap_put_att_text(fid, sw_i_refidx_var, 'long_name', 'imaginary refractive index of aerosol - shortwave')
- call wrap_put_att_text(fid, lw_r_refidx_var, 'long_name', 'real refractive index of aerosol - longwave')
- call wrap_put_att_text(fid, lw_i_refidx_var, 'long_name', 'imaginary refractive index of aerosol - longwave')
-
-
+ call wrap_put_att_text(fid, sw_r_refidx_var, 'units', '-')
+ call wrap_put_att_text(fid, sw_i_refidx_var, 'units', '-')
+ call wrap_put_att_text(fid, lw_r_refidx_var, 'units', '-')
+ call wrap_put_att_text(fid, lw_i_refidx_var, 'units', '-')
+
+ call wrap_put_att_text(fid, sw_r_refidx_var, 'long_name', 'real refractive index of aerosol - shortwave')
+ call wrap_put_att_text(fid, sw_i_refidx_var, 'long_name', 'imaginary refractive index of aerosol - shortwave')
+ call wrap_put_att_text(fid, lw_r_refidx_var, 'long_name', 'real refractive index of aerosol - longwave')
+ call wrap_put_att_text(fid, lw_i_refidx_var, 'long_name', 'imaginary refractive index of aerosol - longwave')
+
+
! Define fields that define the aerosol properties.
call wrap_def_dim(fid, 'opticsmethod_len', 32, omdim)
dimids(1) = omdim
call wrap_def_var(fid, 'opticsmethod', NF90_CHAR, 1, dimids(1:1), omvar)
-
+
write(LUNOPRT,*) "Defined omdim."
call wrap_def_dim(fid, 'namelength', 20, andim)
dimids(1) = andim
call wrap_def_var(fid, 'aername', NF90_CHAR, 1, dimids(1:1), anvar)
-
+
write(LUNOPRT,*) "Defined aername."
call wrap_def_dim(fid, 'name_len', 32, namedim)
dimids(1) = namedim
call wrap_def_var(fid, 'name', NF90_CHAR, 1, dimids(1:1), namevar)
-
+
write(LUNOPRT,*) "Defined name."
call wrap_def_var(fid, 'density', NF90_DOUBLE, 0, dimids(1:0), denvar)
@@ -2411,42 +2333,42 @@ subroutine CARMA_CreateOpticsFile(carma, rc)
call wrap_def_var(fid, 'radmax_aer', NF90_DOUBLE, 0, dimids(1:0), rmaxvar)
call wrap_def_var(fid, 'hygroscopicity', NF90_DOUBLE, 0, dimids(1:0), hygrovar)
call wrap_def_var(fid, 'num_to_mass_ratio', NF90_DOUBLE, 0, dimids(1:0), ntmvar)
-
- call wrap_put_att_text(fid, denvar, 'units', 'kg m^-3')
- call wrap_put_att_text(fid, slogvar, 'units', '-')
- call wrap_put_att_text(fid, dryrvar, 'units', 'm')
- call wrap_put_att_text(fid, rminvar, 'units', 'm')
- call wrap_put_att_text(fid, rmaxvar, 'units', 'm')
- call wrap_put_att_text(fid, hygrovar, 'units', '-')
- call wrap_put_att_text(fid, ntmvar, 'units', 'kg^-1')
-
- call wrap_put_att_text(fid, denvar, 'long_name', 'aerosol material density')
- call wrap_put_att_text(fid, slogvar, 'long_name', 'geometric standard deviation of aerosol')
- call wrap_put_att_text(fid, dryrvar, 'long_name', 'dry number mode radius of aerosol')
- call wrap_put_att_text(fid, rminvar, 'long_name', 'minimum dry radius of aerosol for bin')
- call wrap_put_att_text(fid, rmaxvar, 'long_name', 'maximum dry radius of aerosol for bin')
- call wrap_put_att_text(fid, hygrovar, 'long_name', 'hygroscopicity of aerosol')
- call wrap_put_att_text(fid, ntmvar, 'long_name', 'ratio of number to mass of aerosol')
-
-
+
+ call wrap_put_att_text(fid, denvar, 'units', 'kg m^-3')
+ call wrap_put_att_text(fid, slogvar, 'units', '-')
+ call wrap_put_att_text(fid, dryrvar, 'units', 'm')
+ call wrap_put_att_text(fid, rminvar, 'units', 'm')
+ call wrap_put_att_text(fid, rmaxvar, 'units', 'm')
+ call wrap_put_att_text(fid, hygrovar, 'units', '-')
+ call wrap_put_att_text(fid, ntmvar, 'units', 'kg^-1')
+
+ call wrap_put_att_text(fid, denvar, 'long_name', 'aerosol material density')
+ call wrap_put_att_text(fid, slogvar, 'long_name', 'geometric standard deviation of aerosol')
+ call wrap_put_att_text(fid, dryrvar, 'long_name', 'dry number mode radius of aerosol')
+ call wrap_put_att_text(fid, rminvar, 'long_name', 'minimum dry radius of aerosol for bin')
+ call wrap_put_att_text(fid, rmaxvar, 'long_name', 'maximum dry radius of aerosol for bin')
+ call wrap_put_att_text(fid, hygrovar, 'long_name', 'hygroscopicity of aerosol')
+ call wrap_put_att_text(fid, ntmvar, 'long_name', 'ratio of number to mass of aerosol')
+
+
write(LUNOPRT,*) "Defined all variables."
- ! End the defintion phase of the netcdf file.
+ ! End the defintion phase of the netcdf file.
call wrap_enddef(fid)
-
-
+
+
! Write out the dimensions.
call wrap_put_var_realx(fid, rhvar, mie_rh(:nrh))
call wrap_put_var_realx(fid, lwvar, wave(:nlwbands) * 1e-2_f)
call wrap_put_var_realx(fid, swvar, wave(nlwbands+1:) * 1e-2_f)
-
+
! Write out the refractive indicies.
call wrap_put_var_realx(fid, sw_r_refidx_var, real(refidx(nlwbands+1:)))
call wrap_put_var_realx(fid, sw_i_refidx_var, aimag(refidx(nlwbands+1:)))
call wrap_put_var_realx(fid, lw_r_refidx_var, real(refidx(:nlwbands)))
call wrap_put_var_realx(fid, lw_i_refidx_var, aimag(refidx(:nlwbands)))
-
-
+
+
! Pad the names out with spaces.
aer_name = ' '
aer_name(1:len(trim(c_name))) = c_name
@@ -2456,7 +2378,7 @@ subroutine CARMA_CreateOpticsFile(carma, rc)
call wrap_put_vara_text(fid, namevar, start_text, count_text, (/ aer_name /))
count_text(1) = 20
call wrap_put_vara_text(fid, anvar, start_text, count_text, (/ aer_name /))
-
+
! These fields control whether the particle is treated as a CCN. For now,
! set these so that CARMA particles are not considered as CCN by the
! CAM microphysics.
@@ -2467,7 +2389,7 @@ subroutine CARMA_CreateOpticsFile(carma, rc)
count_text(1) = len('insoluble ')
call wrap_put_vara_text(fid, omvar, start_text, count_text, (/ 'insoluble ' /))
end if
-
+
call wrap_put_var_realx(fid, denvar, (/ rho(ibin) * 1e-3_f / 1e-6_f /))
call wrap_put_var_realx(fid, slogvar, (/ 0._f /))
call wrap_put_var_realx(fid, dryrvar, (/ r(ibin) * 1e-2_f /))
@@ -2475,20 +2397,20 @@ subroutine CARMA_CreateOpticsFile(carma, rc)
call wrap_put_var_realx(fid, rmaxvar, (/ rup(ibin) * 1e-2_f /))
call wrap_put_var_realx(fid, hygrovar, (/ 0._f /))
call wrap_put_var_realx(fid, ntmvar, (/ 1._f / rmass(ibin) / 1e-3_f /))
-
+
! Iterate over a range of relative humidities, since the particle may swell
! with relative humidity which will change its optical properties.
do irh = 1, nrh
-
+
! Determine the wet radius.
call getwetr(carma, igroup, mie_rh(irh), r(ibin), rwet, rho(ibin), rhopwet, rc)
if (rc < 0) call endrun('carma_CreateOpticsFile::wetr failed.')
-
+
! Calculate at each wavelength.
do iwave = 1, NWAVE
write(carma%f_LUNOPRT,*) "CARMA mie calc: start ", igroup, ibin, iwave, carma%f_wave(iwave), carma%f_group(igroup)%f_nmon(ibin)
-
+
! Using Mie code, calculate the optical properties: extinction coefficient,
! single scattering albedo and asymmetry factor.
! Assume the particle is homogeneous (no core).
@@ -2509,18 +2431,18 @@ subroutine CARMA_CreateOpticsFile(carma, rc)
rc)
if (rc < 0) call endrun('carma_CreateOpticsFile::mie failed.')
write(carma%f_LUNOPRT,*) "CARMA mie calc: done ", Qext, Qsca, asym
-
-
+
+
! Calculate the shortwave and longwave properties?
!
! NOTE: miess is in cgs units, but the optics file needs to be in mks
! units, so perform the necessary conversions.
if (iwave <= nlwbands) then
-
+
! Longwave just needs absorption: abs_lw.
abs_lw(irh, iwave) = (Qext - Qsca) * PI * (rwet * 1e-2_f)**2 / (rmass(ibin) * 1e-3_f)
else
-
+
! Shortwave needs extinction, single scattering albedo and asymmetry factor:
! ext_sw, ssa_sw and asm_sw.
ext_sw(irh, iwave - nlwbands) = Qext * PI * (rwet * 1e-2_f)**2 / (rmass(ibin) * 1e-3_f)
@@ -2529,14 +2451,14 @@ subroutine CARMA_CreateOpticsFile(carma, rc)
end if
end do
end do
-
+
! Write out the longwave fields.
ret = nf90_put_var (fid, abs_lw_var, abs_lw(:nrh, :))
if (ret/=NF90_NOERR) then
write(iulog,*)'CARMA_CreateOpticsFile: error writing varid =', abs_lw_var
call handle_error (ret)
end if
-
+
! Write out the shortwave fields.
ret = nf90_put_var (fid, ext_sw_var, ext_sw(:nrh, :))
if (ret/=NF90_NOERR) then
@@ -2553,23 +2475,23 @@ subroutine CARMA_CreateOpticsFile(carma, rc)
write(iulog,*)'CARMA_CreateOpticsFile: error writing varid =', asm_sw_var
call handle_error (ret)
end if
-
+
! Close the file.
call wrap_close(fid)
- end if
+ end if
end do
end if
end do
-
+
return
- end subroutine CARMA_CreateOpticsFile
-
-
+ end subroutine CARMA_CreateOpticsFile
+
+
!! This routine creates a file containing a reference temperature profile
!! for use with fixed initialization.
subroutine CARMA_CreateRefTFile(carma, filepath, lev, reft, rc, refh2o, refh2so4)
use wrap_nf
-
+
implicit none
type(carma_type), intent(inout) :: carma !! the carma object
@@ -2585,54 +2507,54 @@ subroutine CARMA_CreateRefTFile(carma, filepath, lev, reft, rc, refh2o, refh2so4
integer :: levdim
integer :: levvar, tvar, h2ovar, h2so4var
integer :: dimids(2)
-
-
+
+
! Assume success.
rc = 0
-
+
! Create the file.
call wrap_create(filepath, NF90_CLOBBER, fid)
-
-
+
+
! Define the dimensions: lev
call wrap_def_dim(fid, 'lev', pver, levdim)
-
+
dimids(1) = levdim
call wrap_def_var(fid, 'lev', NF90_DOUBLE, 1, dimids(1:1), levvar)
- call wrap_put_att_text(fid, levvar, 'units', 'level')
- call wrap_put_att_text(fid, levvar, 'long_name', 'hybrid level at midpoints (1000*(A+B))')
- call wrap_put_att_text(fid, levvar, 'positive', 'down')
- call wrap_put_att_text(fid, levvar, 'standard_name', 'atmosphere_hybrid_sigma_pressure_coordinate')
- call wrap_put_att_text(fid, levvar, 'formula_terms', 'a: hyam b: hybm p0: P0 ps: PS')
-
+ call wrap_put_att_text(fid, levvar, 'units', 'level')
+ call wrap_put_att_text(fid, levvar, 'long_name', 'hybrid level at midpoints (1000*(A+B))')
+ call wrap_put_att_text(fid, levvar, 'positive', 'down')
+ call wrap_put_att_text(fid, levvar, 'standard_name', 'atmosphere_hybrid_sigma_pressure_coordinate')
+ call wrap_put_att_text(fid, levvar, 'formula_terms', 'a: hyam b: hybm p0: P0 ps: PS')
+
! Define the variables: T
call wrap_def_var(fid, 'T', NF90_DOUBLE, 1, dimids(1:1), tvar)
-
- call wrap_put_att_text(fid, tvar, 'units', 'K')
+
+ call wrap_put_att_text(fid, tvar, 'units', 'K')
call wrap_put_att_text(fid, tvar, 'long_name', 'Temperature')
-
+
if ((carma%f_igash2o /= 0) .and. present(refh2o)) then
call wrap_def_var(fid, 'Q', NF90_DOUBLE, 1, dimids(1:1), h2ovar)
-
- call wrap_put_att_text(fid, h2ovar, 'units', 'kg/kg')
+
+ call wrap_put_att_text(fid, h2ovar, 'units', 'kg/kg')
call wrap_put_att_text(fid, h2ovar, 'long_name', 'Specific Humidity')
end if
if ((carma%f_igash2so4 /= 0) .and. present(refh2so4)) then
call wrap_def_var(fid, 'H2SO4', NF90_DOUBLE, 1, dimids(1:1), h2so4var)
-
- call wrap_put_att_text(fid, h2so4var, 'units', 'kg/kg')
+
+ call wrap_put_att_text(fid, h2so4var, 'units', 'kg/kg')
call wrap_put_att_text(fid, h2so4var, 'long_name', 'H2SO4')
end if
-
- ! End the defintion phase of the netcdf file.
+
+ ! End the defintion phase of the netcdf file.
call wrap_enddef(fid)
-
-
+
+
! Write out the dimensions.
call wrap_put_var_realx(fid, levvar, lev)
-
+
! Write out the variables.
call wrap_put_var_realx(fid, tvar, reft)
@@ -2643,14 +2565,14 @@ subroutine CARMA_CreateRefTFile(carma, filepath, lev, reft, rc, refh2o, refh2so4
if ((carma%f_igash2so4 /= 0) .and. present(refh2so4)) then
call wrap_put_var_realx(fid, h2so4var, refh2so4(:))
end if
-
+
! Close the file.
call wrap_close(fid)
-
+
return
end subroutine CARMA_CreateRefTFile
-
-
+
+
!! Calculate the aerodynamic resistance for dry deposition.
!!
!! This is based upon Seinfeld and Pandis (1998) page 963, and
@@ -2661,10 +2583,10 @@ end subroutine CARMA_CreateRefTFile
!! @author Tianyi Fan
!! @version Aug 2011
subroutine CARMA_calcram(ustar, z0, pdel, pmid, tmid, obklen, ram)
- use shr_const_mod, only: shr_const_karman
+ use shr_const_mod, only: shr_const_karman
use physconst, only: rair, gravit
- implicit none
+ implicit none
! input and output argument
real(r8), intent(in) :: ustar ! friction velocity
@@ -2674,31 +2596,31 @@ subroutine CARMA_calcram(ustar, z0, pdel, pmid, tmid, obklen, ram)
real(r8), intent(in) :: tmid ! layer mid-point temperature [K]
real(r8), intent(in) :: obklen ! Monin-Obukhov length
real(r8), intent(out) :: ram ! aerodynamic resistance
-
+
! local varibles
real(r8) :: z ! half the layer height
real(r8) :: psi ! stability parameter for z
real(r8) :: psi0 ! stability parameter for z0
- real(r8) :: nu ! temparory variable
+ real(r8) :: nu ! temparory variable
real(r8) :: nu0 ! temparory variable
real(r8), parameter :: xkar = shr_const_karman
-
-
+
+
! Use half the layer height like Ganzefeld and Lelieveld, 1995
z = pdel * rair * tmid / pmid / gravit / 2._r8
-
+
if (obklen .eq. 0._r8) then
psi = 0._r8
psi0 = 0._r8
else
psi = min(max(z / obklen, -1._r8), 1._r8)
- psi0 = min(max(z0 / obklen, -1._r8), 1._r8)
+ psi0 = min(max(z0 / obklen, -1._r8), 1._r8)
endif
-
+
! Stable
if (psi > 0._r8) then
ram = 1._r8 / xkar / ustar * (log(z / z0) + 4.7_r8 * (psi - psi0))
-
+
! Unstable
else if (psi < 0._r8) then
nu = (1._r8 - 15._r8 *psi)**(.25_r8)
@@ -2712,12 +2634,12 @@ subroutine CARMA_calcram(ustar, z0, pdel, pmid, tmid, obklen, ram)
else
ram = 0._r8
end if
-
+
! Neutral
else
ram = 1._r8 / xkar / ustar * log(z / z0)
end if
-
- return
- end subroutine CARMA_calcram
+
+ return
+ end subroutine CARMA_calcram
end module carma_intr
diff --git a/src/physics/carma/models/dust/carma_model_mod.F90 b/src/physics/carma/models/dust/carma_model_mod.F90
index cfd1d3f284..22ba9b69d2 100644
--- a/src/physics/carma/models/dust/carma_model_mod.F90
+++ b/src/physics/carma/models/dust/carma_model_mod.F90
@@ -17,7 +17,7 @@
!! - WeibullWind()
!!
!! @version July-2012
-!! @author Lin Su, Pengfei Yu, Chuck Bardeen
+!! @author Lin Su, Pengfei Yu, Chuck Bardeen
module carma_model_mod
use carma_precision_mod
@@ -79,8 +79,8 @@ module carma_model_mod
integer :: nClay !! Number of clay bins (r < 1 um)
integer :: nSilt !! Number of silt bins
- real(kind=f) :: clay_mf(NBIN) !! clay mass fraction (fraction)
- real(kind=f), allocatable, dimension(:,:) :: soil_factor !! Soil Erosion Factor (fraction)
+ real(kind=f) :: clay_mf(NBIN) !! clay mass fraction (fraction)
+ real(kind=f), allocatable, dimension(:,:) :: soil_factor !! Soil Erosion Factor (fraction)
contains
@@ -88,27 +88,27 @@ module carma_model_mod
!! Defines all the CARMA components (groups, elements, solutes and gases) and process
!! (coagulation, growth, nucleation) that will be part of the microphysical model.
!!
- !! @version May-2009
- !! @author Chuck Bardeen
+ !! @version May-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DefineModel(carma, rc)
type(carma_type), intent(inout) :: carma !! the carma object
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
! Local variables
integer :: LUNOPRT ! logical unit number for output
logical :: do_print ! do print output?
- real(kind=f), parameter :: RHO_DUST = 2.65_f ! dry density of dust particles (g/cm^3) -Lin Su
+ real(kind=f), parameter :: RHO_DUST = 2.65_f ! dry density of dust particles (g/cm^3) -Lin Su
real(kind=f), parameter :: rmin = 1.19e-5_f ! minimum radius (cm)
real(kind=f), parameter :: vmrat = 2.371_f ! volume ratio
-
+
! Default return code.
- rc = RC_OK
-
+ rc = RC_OK
+
! Report model specific namelist configuration parameters.
if (masterproc) then
call CARMA_Get(carma, rc, do_print=do_print, LUNOPRT=LUNOPRT)
if (rc < 0) call endrun("CARMA_DefineModel: CARMA_Get failed.")
-
+
if (do_print) write(LUNOPRT,*) ''
if (do_print) write(LUNOPRT,*) 'CARMA ', trim(carma_model), ' specific settings :'
if (do_print) write(LUNOPRT,*) ' carma_soilerosion_file = ', carma_soilerosion_file
@@ -124,24 +124,24 @@ subroutine CARMA_DefineModel(carma, rc)
scavcoef=0.1_f, shortname="CRDUST")
if (rc < 0) call endrun('CARMA_DefineModel::CARMA_AddGroup failed.')
-
+
! Define the Elements
!
! NOTE: For CAM, the optional shortname needs to be provided for the group. These names
! should be 6 characters or less and without spaces.
call CARMAELEMENT_Create(carma, 1, 1, "dust", RHO_DUST, I_INVOLATILE, I_DUST, rc, shortname="CRDUST")
if (rc < 0) call endrun('CARMA_DefineModel::CARMA_AddElement failed.')
-
-
+
+
! Define the Solutes
-
-
+
+
! Define the Gases
-
-
+
+
! Define the Processes
-
+
return
end subroutine CARMA_DefineModel
@@ -149,8 +149,8 @@ end subroutine CARMA_DefineModel
!! Defines all the CARMA components (groups, elements, solutes and gases) and process
!! (coagulation, growth, nucleation) that will be part of the microphysical model.
!!
- !! @version May-2009
- !! @author Chuck Bardeen
+ !! @version May-2009
+ !! @author Chuck Bardeen
!!
!! @see CARMASTATE_SetDetrain
subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq, prec_str, snow_str, &
@@ -169,22 +169,22 @@ subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq,
real(r8), intent(in) :: dt !! time step (s)
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(out), optional :: tnd_qsnow(pcols,pver) !! snow mass tendency (kg/kg/s)
real(r8), intent(out), optional :: tnd_nsnow(pcols,pver) !! snow number tendency (#/kg/s)
! Default return code.
rc = RC_OK
-
+
return
end subroutine CARMA_Detrain
!! For diagnostic groups, sets up up the CARMA bins based upon the CAM state.
!!
- !! @version July-2009
- !! @author Chuck Bardeen
+ !! @version July-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, prec_str, snow_str)
use time_manager, only: is_first_step
@@ -198,32 +198,32 @@ subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, pr
real(r8), intent(in) :: dt !! time step
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(in), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
-
+
real(r8) :: mmr(pver) !! elements mass mixing ratio
integer :: ibin !! bin index
-
+
! Default return code.
rc = RC_OK
-
+
! By default, do nothing. If diagnosed groups exist, this needs to be replaced by
! code to determine the mass in each bin from the CAM state.
-
+
return
end subroutine CARMA_DiagnoseBins
!! For diagnostic groups, determines the tendencies on the CAM state from the CARMA bins.
!!
- !! @version July-2009
- !! @author Chuck Bardeen
+ !! @version July-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol, dt, rc, rliq, prec_str, snow_str, &
prec_sed, snow_sed, tnd_qsnow, tnd_nsnow, re_ice)
use camsrfexch, only: cam_out_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(cam_out_t), intent(inout) :: cam_out !! cam output to surface models
@@ -234,20 +234,20 @@ subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol,
real(r8), intent(in) :: dt !! time step
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(inout), optional :: prec_sed(pcols) !! total precip from cloud sedimentation (m/s)
real(r8), intent(inout), optional :: snow_sed(pcols) !! snow from cloud ice sedimentation (m/s)
real(r8), intent(inout), optional :: tnd_qsnow(pcols,pver) !! snow mass tendency (kg/kg/s)
real(r8), intent(inout), optional :: tnd_nsnow(pcols,pver) !! snow number tendency (#/kg/s)
real(r8), intent(out), optional :: re_ice(pcols,pver) !! ice effective radius (m)
-
+
! Default return code.
rc = RC_OK
-
+
! By default, do nothing. If diagnosed groups exist, this needs to be replaced by
! code to determine the bulk mass from the CARMA state.
-
+
return
end subroutine CARMA_DiagnoseBulk
@@ -262,12 +262,11 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
use shr_kind_mod, only: r8 => shr_kind_r8
use ppgrid, only: pcols, pver
use physics_types, only: physics_state
- use phys_grid, only: get_lon_all_p, get_lat_all_p
use camsrfexch, only: cam_in_t
use cam_history, only: outfld
-
+
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -278,15 +277,15 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
real(r8), intent(out) :: tendency(pcols, pver) !! constituent tendency (kg/kg/s)
real(r8), intent(out) :: surfaceFlux(pcols) !! constituent surface flux (kg/m^2/s)
integer, intent(out) :: rc !! return code, negative indicates failure
-
- integer :: ilat(pcols) ! latitude index
+
+ integer :: ilat(pcols) ! latitude index
integer :: ilon(pcols) ! longitude index
integer :: lchnk ! chunk identifier
integer :: ncol ! number of columns in chunk
integer :: icol ! column index
integer :: igroup ! the index of the carma aerosol group
character(len=32) :: shortname ! the shortname of the group
-
+
! -------- local variables added for dust model ------------
real(r8), parameter :: ch = 0.5e-9_r8 ! dimensional factor & tuning number,
! as it's model resolution dependent (kgs^2/m^5)!!!
@@ -295,10 +294,9 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
real(r8) :: uv10 ! 10 m wind speed (m/s)
real(r8) :: cd10 ! 10-m drag coefficient ()
- real(r8) :: wwd ! raw wind speed (m/s)
+ real(r8) :: wwd ! raw wind speed (m/s)
real(r8) :: sp ! mass fraction for soil factor
integer :: idustbin ! ibin to use for dust production, smallest silt bin for clay
- real(r8) :: soilfact(pcols) ! soil erosion factor (for debug)
! Default return code.
rc = RC_OK
@@ -307,26 +305,23 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
lchnk = state%lchnk
ncol = state%ncol
- call get_lat_all_p(lchnk, ncol, ilat)
- call get_lon_all_p(lchnk, ncol, ilon)
-
! Add any surface flux here.
surfaceFlux(:ncol) = 0.0_r8
-
+
! For emissions into the atmosphere, put the emission here.
!
! NOTE: Do not set tendency to be the surface flux. Surface source is put in to
- ! the bottom layer by vertical diffusion. See vertical_solver module, line 355.
+ ! the bottom layer by vertical diffusion. See vertical_solver module, line 355.
tendency(:ncol, :pver) = 0.0_r8
-
+
call CARMAELEMENT_GET(carma, ielem, rc, igroup=igroup)
if (RC < RC_ERROR) return
-
+
call CARMAGROUP_GET(carma, igroup, rc, shortname=shortname, r=r)
if (RC < RC_ERROR) return
-
+
if (shortname .eq. "CRDUST") then
-
+
! Is this clay or silt?
!
! NOTE: It is assumed that 90% of the mass will be silt and 10% will
@@ -340,31 +335,30 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
idustbin = ibin
else
sp = 0.1_r8 / nClay
- idustbin = nClay + 1
+ idustbin = nClay + 1
end if
! Process each column.
do icol = 1,ncol
-
- call CARMA_SurfaceWind(carma, state, icol, ilat(icol), ilon(icol), ielem, igroup, idustbin, cam_in, uv10, wwd, uth, rc)
+
+ call CARMA_SurfaceWind(carma, state, icol, ielem, igroup, idustbin, cam_in, uv10, wwd, uth, rc)
! Is the wind above the threshold for dust production?
if (uv10 > uth) then
- surfaceFlux(icol) = ch * soil_factor(ilat(icol), ilon(icol)) * sp * &
- wwd * (uv10 - uth)
+ surfaceFlux(icol) = ch * soil_factor(icol, lchnk) * sp * &
+ wwd * (uv10 - uth)
endif
-
- ! Scale the clay bins based upon the smallest silt bin.
+
+ ! Scale the clay bins based upon the smallest silt bin.
surfaceFlux(icol) = clay_mf(ibin) * surfaceFlux(icol)
-
- ! Save off the soil erosion factor so it can be output.
- soilfact(icol) = soil_factor(ilat(icol), ilon(icol))
+
end do
! For debug purposes, output the soil erosion factor.
- call outfld('CRSLERFC', soilfact, pcols, lchnk)
- end if
-
+ call outfld('CRSLERFC', soil_factor(:ncol, lchnk), ncol, lchnk)
+
+ end if
+
return
end subroutine CARMA_EmitParticle
@@ -380,10 +374,10 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
implicit none
- type(carma_type), intent(in) :: carma !! the carma object
- logical, intent(inout) :: lq_carma(pcnst) !! flags to indicate whether the constituent
+ type(carma_type), intent(in) :: carma !! the carma object
+ logical, intent(inout) :: lq_carma(pcnst) !! flags to indicate whether the constituent
!! could have a CARMA tendency
- integer, intent(out) :: rc !! return code, negative indicates failure
+ integer, intent(out) :: rc !! return code, negative indicates failure
! -------- local variables ----------
integer :: ibin ! CARMA bin index
@@ -394,8 +388,8 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
character(len=32) :: shortname ! the shortname of the element
integer :: LUNOPRT ! logical unit number for output
logical :: do_print ! do print output?
-
-
+
+
! Default return code.
rc = RC_OK
@@ -404,15 +398,15 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
!
! TBD: This should use the radii rather than being hard coded.
! nClay = 8
- ! nSilt = NBIN - nClay
- do ielem = 1, NELEM
+ ! nSilt = NBIN - nClay
+ do ielem = 1, NELEM
! To get particle radius
call CARMAELEMENT_GET(carma, ielem, rc, igroup=igroup, shortname=shortname)
if (RC < RC_ERROR) return
-
+
call CARMAGROUP_GET(carma, igroup, rc, r=r)
if (RC < RC_ERROR) return
-
+
if (shortname .eq. "CRDUST") then
count_Silt = 0
do ibin = 1, NBIN
@@ -420,27 +414,27 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
count_Silt = count_Silt + 1
else
end if
- end do
+ end do
nSilt = count_Silt
- nClay = NBIN - nSilt
- end if
+ nClay = NBIN - nSilt
+ end if
end do
-
+
! Read in the soil factors.
call CARMA_ReadSoilErosionFactor(carma, rc)
if (RC < RC_ERROR) return
-
+
! To determine Clay Mass Fraction
- do ielem = 1, NELEM
+ do ielem = 1, NELEM
! To get particle radius
call CARMAELEMENT_GET(carma, ielem, rc, igroup=igroup, shortname=shortname)
if (RC < RC_ERROR) return
if (shortname .eq. "CRDUST") then
- call CARMA_ClayMassFraction(carma, igroup, rc)
- end if
+ call CARMA_ClayMassFraction(carma, igroup, rc)
+ end if
end do
-
+
if (masterproc) then
call CARMA_Get(carma, rc, do_print=do_print, LUNOPRT=LUNOPRT)
if (rc < 0) call endrun("CARMA_InitializeModel: CARMA_Get failed.")
@@ -448,15 +442,15 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
if (do_print) then
write(carma%f_LUNOPRT,*) 'Initializing CARMA dust model ...'
write(carma%f_LUNOPRT,*) 'nClay = ', nClay, ' nSilt = ', nSilt
- write(carma%f_LUNOPRT,*) 'clay_mf = ', clay_mf
+ write(carma%f_LUNOPRT,*) 'clay_mf = ', clay_mf
write(carma%f_LUNOPRT,*) 'soil_factor = ', soil_factor
-
+
write(carma%f_LUNOPRT,*) 'CARMA dust initialization complete'
end if
end if
-
+
call addfld('CRSLERFC', horiz_only, 'A', 'fraction', 'CARMA soil erosion factor')
-
+
return
end subroutine CARMA_InitializeModel
@@ -472,7 +466,7 @@ end subroutine CARMA_InitializeModel
!! @version May-2009
subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask, q, rc)
use shr_kind_mod, only: r8 => shr_kind_r8
- use pmgrid, only: plat, plev, plon
+ use pmgrid, only: plev
implicit none
@@ -494,18 +488,18 @@ subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask,
return
end subroutine CARMA_InitializeParticle
-
+
!! Called after wet deposition has been performed. Allows the specific model to add
!! wet deposition of CARMA aerosols to the aerosols being communicated to the surface.
!!
- !! @version July-2011
- !! @author Chuck Bardeen
+ !! @version July-2011
+ !! @author Chuck Bardeen
subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
use camsrfexch, only: cam_out_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -513,14 +507,14 @@ subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
type(cam_out_t), intent(inout) :: cam_out !! cam output to surface models
type(physics_state), intent(in) :: state !! physics state variables
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
integer :: icol
-
+
! Default return code.
rc = RC_OK
-
+
return
- end subroutine CARMA_WetDeposition
+ end subroutine CARMA_WetDeposition
!! Determines the mass fraction for the clay (submicron) bins based upon
@@ -533,49 +527,49 @@ end subroutine CARMA_WetDeposition
!! NOTE: Should any mass go to bins smaller than the smallest one used by
!! Tegen and Lacis?
!!
- !! @version July-2012
- !! @author Lin Su, Pengfei Yu, Chuck Bardeen
+ !! @version July-2012
+ !! @author Lin Su, Pengfei Yu, Chuck Bardeen
subroutine CARMA_ClayMassFraction(carma, igroup, rc)
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: igroup !! the carma group index
integer, intent(inout) :: rc !! return code, negative indicates failure
! Bins and mass fraction from Tegen and Lacis.
- integer, parameter :: NBIN_TEGEN = 4
+ integer, parameter :: NBIN_TEGEN = 4
real(r8) :: tl_rmin(NBIN_TEGEN) = (/ 1.e-5_r8, 1.8e-5_r8, 3.e-5_r8, 6.e-5_r8 /)
real(r8) :: tl_rmax(NBIN_TEGEN) = (/ 1.8e-5_r8, 3.e-5_r8, 6.e-5_r8, 1.e-4_r8 /)
real(r8) :: tl_mf(NBIN_TEGEN) = (/ 0.009_r8, 0.081_r8, 0.234_r8, 0.676_r8 /)
! Local Variables
- integer, parameter :: IBELOW = 1
- integer, parameter :: IABOVE = 6
+ integer, parameter :: IBELOW = 1
+ integer, parameter :: IABOVE = 6
integer :: tl_count(NBIN_TEGEN+2) ! count number in Tegen and Lacis ranges
integer :: ind_up(NBIN_TEGEN+2)
integer :: ind_low(NBIN_TEGEN+2)
integer :: j ! local index number
integer :: ibin ! carma bin index
real(r8) :: r(carma%f_NBIN) ! CARMA bin center (cm)
-
+
! Default return code.
rc = RC_OK
-
+
! Interpolate from Tegen and Lacis.
call CARMAGROUP_GET(carma, igroup, rc, r=r)
if (RC < RC_ERROR) return
-
+
! Figure out how many of the CARMA bins are in each of the Tegen and Lacis
! ranges.
tl_count(:) = 0
-
+
do ibin = 1, NBIN
-
+
! Smaller than the range.
if (r(ibin) < tl_rmin(1)) then
tl_count(IBELOW) = tl_count(IBELOW) + 1
end if
-
+
! In the range
do j = 1, NBIN_TEGEN
if (r(ibin) < tl_rmax(j) .and. r(ibin) >= tl_rmin(j)) then
@@ -586,7 +580,7 @@ subroutine CARMA_ClayMassFraction(carma, igroup, rc)
! Bigger than the range.
if (r(ibin) >= tl_rmax(NBIN_TEGEN)) then
tl_count(IABOVE) = tl_count(IABOVE) + 1
- end if
+ end if
end do
! Determine where the boundaries are between the TEGEN bins and
@@ -595,30 +589,30 @@ subroutine CARMA_ClayMassFraction(carma, igroup, rc)
ind_low(:) = 0
ind_up (IBELOW) = tl_count(IBELOW)
ind_low(IBELOW) = min(1, tl_count(IBELOW))
-
+
do j = 1, 5
ind_up (j+1) = ind_up(j) + tl_count(j+1)
ind_low(j+1) = ind_up(j) + min(tl_count(j+1), 1)
end do
-
+
! No mass to bins smaller than the smallest size.
clay_mf(:) = 0._r8
-
+
! NOTE: This won't work right if the dust bins are coarser than
! the Tegen and Lacis bins. In this case mass fraction would need
- ! to be combined from the Tegen & Lacis bins into a CARMA bin.
+ ! to be combined from the Tegen & Lacis bins into a CARMA bin.
do j = 1, NBIN_TEGEN
if (tl_count(j+1) > 0) then
clay_mf(ind_low(j+1):ind_up(j+1)) = tl_mf(j) / tl_count(j+1)
end if
- end do
-
+ end do
+
clay_mf(ind_low(IABOVE):) = 1._r8
return
end subroutine CARMA_ClayMassFraction
-
+
!! Calculate the sea surface wind with a Weibull distribution.
!!
!! NOTE: This should be combined with a similar routine in the sea salt
@@ -627,19 +621,17 @@ end subroutine CARMA_ClayMassFraction
!!
!! @author Lin Su, Pengfei Yu, Chuck Bardeen
!! @version July-2012
- subroutine CARMA_SurfaceWind(carma, state, icol, ilat, ilon, ielem, igroup, ibin, cam_in, uv10, wwd, uth, rc)
+ subroutine CARMA_SurfaceWind(carma, state, icol, ielem, igroup, ibin, cam_in, uv10, wwd, uth, rc)
use ppgrid, only: pcols, pver
use physics_types, only: physics_state
use camsrfexch, only: cam_in_t
-
+
implicit none
! in and out field
type(carma_type), intent(in) :: carma !! the carma object
- type(physics_state), intent(in) :: state !! physics state
+ type(physics_state), intent(in) :: state !! physics state
integer, intent(in) :: icol !! column index
- integer, intent(in) :: ilat !! latitude index
- integer, intent(in) :: ilon !! longitude index
integer, intent(in) :: ielem !! element index
integer, intent(in) :: igroup !! group index
integer, intent(in) :: ibin !! bin index
@@ -652,12 +644,12 @@ subroutine CARMA_SurfaceWind(carma, state, icol, ilat, ilon, ielem, igroup, ibin
real(r8), parameter :: vk = 0.4_r8 ! von Karman constant
real(r8) :: r(NBIN) ! CARMA bin center (cm)
real(r8) :: rhop(NBIN) ! CARMA partile element density (g/cm3)
- real(r8) :: uthfact !
+ real(r8) :: uthfact !
integer :: iepart ! element in group containing the particle concentration
real(r8), parameter :: rhoa = 1.25e-3_r8 ! Air density at surface
-
+
rc = RC_OK
-
+
! Get the 10 meter wind speed
uv10 = cam_in%u10(icol)
@@ -665,11 +657,11 @@ subroutine CARMA_SurfaceWind(carma, state, icol, ilat, ilon, ielem, igroup, ibin
! note that in cgs units --> m/s
call CARMAGROUP_GET(carma, igroup, rc, r=r)
if (RC < RC_ERROR) return
-
+
! Define particle # concentration element index for current group
call CARMAELEMENT_Get(carma, ielem, rc, rho=rhop)
if (RC < RC_ERROR) return
-
+
if (cam_in%soilw(icol) > 0._r8 .AND. cam_in%soilw(icol) < 0.5_r8) then
uthfact = 1.2_r8 + 0.2_r8*log10(cam_in%soilw(icol))
if (r(ibin) > 2.825e-5_r8) then ! r(4) = 2.825e-5 cm
@@ -683,7 +675,7 @@ subroutine CARMA_SurfaceWind(carma, state, icol, ilat, ilon, ielem, igroup, ibin
endif
else
uth = uv10
- endif
+ endif
! Use Weibull with Lansing's estimate for shape.
call WeibullWind(uv10, uth, 2._r8, wwd)
@@ -702,11 +694,12 @@ end subroutine CARMA_SurfaceWind
!! @author Pengfei Yu
!! @version July-2012
subroutine CARMA_ReadSoilErosionFactor(carma, rc)
- use pmgrid, only: plat, plon
- use ioFileMod, only: getfil
+ use ppgrid, only: begchunk, endchunk, pcols
+ use ioFileMod, only: getfil
use wrap_nf
- use interpolate_data, only : lininterp_init, lininterp, interp_type, lininterp_finish
-
+ use interpolate_data, only: lininterp_init, lininterp, interp_type, lininterp_finish
+ use phys_grid, only: get_rlon_all_p, get_rlat_all_p, get_ncols_p
+
implicit none
type(carma_type), intent(in) :: carma !! the carma object
@@ -715,32 +708,36 @@ subroutine CARMA_ReadSoilErosionFactor(carma, rc)
! local variables
integer :: idvar, f_nlon, f_nlat, idlat, idlon
integer :: fid, fid_lon, fid_lat
- real(r8), allocatable, dimension(:,:) :: ero_factor, ero_factor1
+ real(r8), allocatable, dimension(:,:) :: ero_factor
character(len=256) :: ero_file
real(r8), allocatable, dimension(:) :: ero_lat ! latitude dimension
real(r8), allocatable, dimension(:) :: ero_lon ! latitude dimension
- type (interp_type) :: wgt1, wgt2
- real(r8) :: lat(plat), lon(plon)
- integer :: i
+ type (interp_type) :: lat_wght, lon_wght
+ real(r8) :: lat(pcols) ! latitude index
+ real(r8) :: lon(pcols) ! longitude index
+ integer :: i, ii
+ integer :: lchnk ! chunk identifier
+ integer :: ncol ! number of columns in chunk
+
+ real(r8), parameter :: zero=0_r8, twopi=2_r8*pi, degs2rads = pi/180._r8
rc = RC_OK
! Open the netcdf file (read only)
call getfil(carma_soilerosion_file, ero_file, 0)
call wrap_open(ero_file, 0, fid)
-
+
! Get file dimensions
call wrap_inq_dimid(fid, 'plon', fid_lon)
call wrap_inq_dimid(fid, 'plat', fid_lat)
call wrap_inq_dimlen(fid, fid_lon, f_nlon)
call wrap_inq_dimlen(fid, fid_lat, f_nlat)
-
+
allocate(ero_lat(f_nlat))
allocate(ero_lon(f_nlon))
allocate(ero_factor (f_nlon, f_nlat))
- allocate(ero_factor1(plon, plat))
- allocate(soil_factor(plat, plon))
-
+ allocate(soil_factor(pcols, begchunk:endchunk))
+
! Read in the tables.
call wrap_inq_varid(fid, 'new_source', idvar)
i = nf90_get_var (fid, idvar, ero_factor)
@@ -752,42 +749,39 @@ subroutine CARMA_ReadSoilErosionFactor(carma, rc)
call wrap_get_var_realx(fid, idlat, ero_lat)
call wrap_inq_varid(fid, 'plon', idlon)
call wrap_get_var_realx(fid, idlon, ero_lon)
-
+
+ ero_lat(:) = ero_lat(:)*degs2rads
+ ero_lon(:) = ero_lon(:)*degs2rads
+
! Close the file.
call wrap_close(fid)
-
- ! NOTE: Is there a better way to get all of the dimensions
- ! needed for the model grid? Seems like it shouldn't be hard
- ! coded here.
- do i = 1, plat
- lat(i) = 180._r8 / (plat-1) * (i-1) - 90._r8
- end do
-
- do i = 1, plon
- lon(i) = 360._r8 / plon * (i-1)
+
+ do lchnk=begchunk, endchunk
+ ncol = get_ncols_p(lchnk)
+
+ call get_rlat_all_p(lchnk, pcols, lat)
+ call get_rlon_all_p(lchnk, pcols, lon)
+
+ call lininterp_init(ero_lon, f_nlon, lon, ncol, 2, lon_wght, zero, twopi)
+ call lininterp_init(ero_lat, f_nlat, lat, ncol, 1, lat_wght)
+
+ call lininterp(ero_factor, f_nlon, f_nlat, soil_factor(1:ncol,lchnk), ncol, lon_wght, lat_wght)
+
+ call lininterp_finish(lon_wght)
+ call lininterp_finish(lat_wght)
end do
-
- call lininterp_init(ero_lat, f_nlat, lat, plat, 1, wgt1)
- call lininterp_init(ero_lon, f_nlon, lon, plon, 1, wgt2)
- call lininterp(ero_factor, f_nlon, f_nlat, ero_factor1, plon, plat, wgt2, wgt1)
- call lininterp_finish(wgt1)
- call lininterp_finish(wgt2)
-
- soil_factor(:plat, :plon) = transpose(ero_factor1(:plon, :plat))
-
+
deallocate(ero_lat)
deallocate(ero_lon)
deallocate(ero_factor)
- deallocate(ero_factor1)
-
- return
+
end subroutine CARMA_ReadSoilErosionFactor
!! Calculate the nth mean of u using Weibull wind distribution
!! considering the threshold wind velocity. This algorithm
!! integrates from uth to infinite (u^n P(u)du )
- !!
+ !!
!! @author Tianyi Fan
!! @version August-2010
subroutine WeibullWind(u, uth, n, uwb, wbk)
@@ -796,33 +790,33 @@ subroutine WeibullWind(u, uth, n, uwb, wbk)
igamma => shr_spfn_igamma
implicit none
-
+
real(r8), intent(in) :: u ! mean wind speed
real(r8), intent(in) :: uth ! threshold velocity
real(r8), intent(in) :: n ! the rank of u in the integration
real(r8), intent(out) :: uwb ! the Weibull distribution
real(r8), intent(in), optional :: wbk ! the shape parameter
-
+
! local variable
real(r8) :: k ! the shape parameter in Weibull distribution
real(r8) :: c ! the scale parameter in Weibull distribution
-
+
if (present(wbk)) then
k = wbk
else
k = 0.94*u**0.5_r8 ! follow Grini and Zender, 2004JGR
! k = 2.5_r8 ! Lansing's estimate
- end if
-
+ end if
+
! If u is 0, then k can be 0, which makes a lot of this undefined.
! Just return 0. in this case.
if (u == 0._r8) then
uwb = 0._r8
- else
- c = u * (gamma(1._r8 + 1._r8 / k))**(-1._r8)
+ else
+ c = u * (gamma(1._r8 + 1._r8 / k))**(-1._r8)
uwb = c**n * igamma(n / k + 1._r8, (uth / c)**k)
end if
end subroutine WeibullWind
-
+
end module
diff --git a/src/physics/carma/models/meteor_impact/carma_model_mod.F90 b/src/physics/carma/models/meteor_impact/carma_model_mod.F90
index d60aa02bee..717ca7bb06 100755
--- a/src/physics/carma/models/meteor_impact/carma_model_mod.F90
+++ b/src/physics/carma/models/meteor_impact/carma_model_mod.F90
@@ -1,4 +1,4 @@
-!! This module is used to define a particular CARMA microphysical model. For
+!! This module is used to define a particular CARMA microphysical model. For
!! simple cases, this may be the only code that needs to be modified. This module
!! defines several constants and has three methods:
!!
@@ -14,8 +14,8 @@
!! preliminary. Please talk to Chuck Bardeen (bardeenc@ucar.edu) if you are
!! interested in this model.
!!
-!! @version Oct-2012
-!! @author Chuck Bardeen
+!! @version Oct-2012
+!! @author Chuck Bardeen
module carma_model_mod
use carma_precision_mod
@@ -30,7 +30,7 @@ module carma_model_mod
use carma_mod
use carma_flags_mod
use carma_model_flags_mod
-
+
use shr_kind_mod, only: r8 => shr_kind_r8
use cam_abortutils, only: endrun
use physics_types, only: physics_state, physics_ptend
@@ -50,7 +50,7 @@ module carma_model_mod
public CARMA_InitializeModel
public CARMA_InitializeParticle
public CARMA_WetDeposition
-
+
! Declare public constants
integer, public, parameter :: NGROUP = 2 !! Number of particle groups
integer, public, parameter :: NELEM = 2 !! Number of particle elements
@@ -64,7 +64,7 @@ module carma_model_mod
!! humidities.
integer, public, parameter :: NMIE_RH = 8 !! Number of relative humidities for mie calculations
real(kind=f), public :: mie_rh(NMIE_RH) = (/ 0._f, 0.5_f, 0.7_f, 0.8_f, 0.9_f, 0.95_f, 0.98_f, 0.99_f /)
-
+
! Defines whether the groups should undergo deep convection in phase 1 or phase 2.
! Water vapor and cloud particles are convected in phase 1, while all other constituents
! are done in phase 2.
@@ -81,8 +81,8 @@ module carma_model_mod
integer, public, parameter :: I_ELEM_DUST = 1 !! dust aerosol element
integer, public, parameter :: I_ELEM_SOOT = 2 !! soot aerosol element
-
-
+
+
integer :: carma_dustmap(NBIN) !! mapping of the CARMA dust bins to the surface dust bins.
real(kind=f) :: carma_dustbinfactor(NBIN) !! bin weighting factor for dust emissions
real(kind=f) :: carma_sootbinfactor(NBIN) !! bin weighting factor for soot emissions
@@ -94,12 +94,12 @@ module carma_model_mod
!! Defines all the CARMA components (groups, elements, solutes and gases) and process
!! (coagulation, growth, nucleation) that will be part of the microphysical model.
!!
- !! @version May-2009
- !! @author Chuck Bardeen
+ !! @version May-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DefineModel(carma, rc)
type(carma_type), intent(inout) :: carma !! the carma object
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
! Local variables
real(kind=f), parameter :: RHO_DUST = 2.0_f ! density of dust particles (g/cm)
real(kind=f) :: RHO_SOOT ! density of soot particles (g/cm)
@@ -121,16 +121,16 @@ subroutine CARMA_DefineModel(carma, rc)
! Adjust longitudes to be 0 to 360 rather than +- 180.
if (carma_emis_minlon < 0._f) carma_emis_minlon = 360._f + carma_emis_minlon
if (carma_emis_maxlon < 0._f) carma_emis_maxlon = 360._f + carma_emis_maxlon
-
+
if (carma_emis_minlat > carma_emis_maxlat) then
- if (do_print) write(LUNOPRT,*) 'CARMA_DefineModel::ERROR - carma_emis_minlat greater than carma_emis_maxlat'
+ if (do_print) write(LUNOPRT,*) 'CARMA_DefineModel::ERROR - carma_emis_minlat greater than carma_emis_maxlat'
end if
-
+
! Report model specific namelist configuration parameters.
if (masterproc) then
call CARMA_Get(carma, rc, do_print=do_print, LUNOPRT=LUNOPRT)
if (rc < 0) call endrun("CARMA_InitializeModel: CARMA_Get failed.")
-
+
if (do_print) write(LUNOPRT,*) ''
if (do_print) write(LUNOPRT,*) 'CARMA ', trim(carma_model), ' specific settings :'
if (do_print) write(LUNOPRT,*) ' carma_emis_dust = ', carma_emis_dust, ' (kg)'
@@ -158,7 +158,7 @@ subroutine CARMA_DefineModel(carma, rc)
! is recommended by Toon et al. 2012. TBD Wagner et al. 2011 shows variability in the
! real part (0.003 (IR) to 0.05 (UV)).
refidx(:) = (1.53_f, 0.008_f)
-
+
call CARMAGROUP_Create(carma, I_GRP_DUST, "Dust", dust_rmin, dust_vmrat, I_SPHERE, 1._f, .false., &
rc, do_wetdep=.true., do_drydep=.true., solfac=0.3_f, &
scavcoef=0.1_f, shortname="CRDUST", refidx=refidx, do_mie=.true.)
@@ -167,7 +167,7 @@ subroutine CARMA_DefineModel(carma, rc)
! Use the same refractive index at all wavelengths. This value is typical of soot and
! is recommended by Toon et al. 2012.
refidx(:) = (1.8_f, 0.67_f)
-
+
if (carma_fractal_soot) then
RHO_SOOT = 1.8_f
@@ -188,8 +188,8 @@ subroutine CARMA_DefineModel(carma, rc)
scavcoef=0.1_f, shortname="CRSOOT", refidx=refidx, do_mie=.true.)
end if
if (rc < 0) call endrun('CARMA_DefineModel::CARMA_AddGroup failed.')
-
-
+
+
! Define the Elements
!
! NOTE: For CAM, the optional shortname needs to be provided for the group. These names
@@ -200,13 +200,13 @@ subroutine CARMA_DefineModel(carma, rc)
call CARMAELEMENT_Create(carma, I_ELEM_SOOT, I_GRP_SOOT, "Soot", RHO_SOOT, I_INVOLATILE, I_SOOT, rc, shortname="CRSOOT")
if (rc < 0) call endrun('CARMA_DefineModel::CARMA_AddElement failed.')
-
+
! Define the Solutes
-
+
! Define the Gases
-
+
! Define the Processes
call CARMA_AddCoagulation(carma, I_GRP_DUST, I_GRP_DUST, I_GRP_DUST, I_COLLEC_DATA, rc)
if (rc < 0) call endrun('CARMA_DefineModel::CARMA_AddCoagulation failed.')
@@ -221,8 +221,8 @@ end subroutine CARMA_DefineModel
!! Defines all the CARMA components (groups, elements, solutes and gases) and process
!! (coagulation, growth, nucleation) that will be part of the microphysical model.
!!
- !! @version May-2009
- !! @author Chuck Bardeen
+ !! @version May-2009
+ !! @author Chuck Bardeen
!!
!! @see CARMASTATE_SetDetrain
subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq, prec_str, snow_str, &
@@ -231,7 +231,7 @@ subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq,
use physconst, only: latice, latvap, cpair
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(cam_in_t), intent(in) :: cam_in !! surface input
@@ -241,27 +241,27 @@ subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq,
real(r8), intent(in) :: dt !! time step (s)
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(out), optional :: tnd_qsnow(pcols,pver) !! snow mass tendency (kg/kg/s)
real(r8), intent(out), optional :: tnd_nsnow(pcols,pver) !! snow number tendency (#/kg/s)
-
+
! Default return code.
rc = RC_OK
-
+
return
end subroutine CARMA_Detrain
!! For diagnostic groups, sets up up the CARMA bins based upon the CAM state.
!!
- !! @version July-2009
- !! @author Chuck Bardeen
+ !! @version July-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, prec_str, snow_str)
use time_manager, only: is_first_step
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(physics_state), intent(in) :: state !! physics state variables
@@ -270,32 +270,32 @@ subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, pr
real(r8), intent(in) :: dt !! time step
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(in), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
-
+
real(r8) :: mmr(pver) !! elements mass mixing ratio
integer :: ibin !! bin index
-
+
! Default return code.
rc = RC_OK
-
+
! By default, do nothing. If diagnosed groups exist, this needs to be replaced by
! code to determine the mass in each bin from the CAM state.
-
+
return
end subroutine CARMA_DiagnoseBins
-
-
+
+
!! For diagnostic groups, determines the tendencies on the CAM state from the CARMA bins.
!!
- !! @version July-2009
- !! @author Chuck Bardeen
+ !! @version July-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol, dt, rc, rliq, prec_str, snow_str, &
prec_sed, snow_sed, tnd_qsnow, tnd_nsnow, re_ice)
use camsrfexch, only: cam_out_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(cam_out_t), intent(inout) :: cam_out !! cam output to surface models
@@ -306,14 +306,14 @@ subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol,
real(r8), intent(in) :: dt !! time step
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(inout), optional :: prec_sed(pcols) !! total precip from cloud sedimentation (m/s)
real(r8), intent(inout), optional :: snow_sed(pcols) !! snow from cloud ice sedimentation (m/s)
real(r8), intent(inout), optional :: tnd_qsnow(pcols,pver) !! snow mass tendency (kg/kg/s)
real(r8), intent(inout), optional :: tnd_nsnow(pcols,pver) !! snow number tendency (#/kg/s)
real(r8), intent(out), optional :: re_ice(pcols,pver) !! ice effective radius (m)
-
+
integer :: ielem ! element index
integer :: ibin ! bin index
real(r8) :: mmr(pver) ! mass mixing ration (kg/kg)
@@ -327,19 +327,19 @@ subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol,
! NOTE: Don't give the surface model negative values for the surface fluxes.
ielem = I_ELEM_SOOT
do ibin = 1, NBIN
-
+
call CARMASTATE_GetBin(cstate, ielem, ibin, mmr, rc, sedimentationFlux=sflx)
if (rc < 0) call endrun('CARMA_DiagnoseBulk::CARMA_GetBin failed.')
-
+
cam_out%bcphidry(icol) = cam_out%bcphidry(icol) + max(sflx, 0._r8)
end do
ielem = I_ELEM_DUST
do ibin = 1, NBIN
-
+
call CARMASTATE_GetBin(cstate, ielem, ibin, mmr, rc, sedimentationFlux=sflx)
if (rc < 0) call endrun('CARMA_DiagnoseBulk::CARMA_GetBin failed.')
-
+
if (carma_dustmap(ibin) == 1) then
cam_out%dstdry1(icol) = cam_out%dstdry1(icol) + max(sflx, 0._r8)
else if (carma_dustmap(ibin) == 2) then
@@ -350,7 +350,7 @@ subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol,
cam_out%dstdry4(icol) = cam_out%dstdry4(icol) + max(sflx, 0._r8)
end if
end do
-
+
return
end subroutine CARMA_DiagnoseBulk
@@ -370,9 +370,9 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
use camsrfexch, only: cam_in_t
use tropopause, only: tropopause_find
use physconst, only: gravit
-
+
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -383,16 +383,16 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
real(r8), intent(out) :: tendency(pcols, pver) !! constituent tendency (kg/kg/s)
real(r8), intent(out) :: surfaceFlux(pcols) !! constituent surface flux (kg/m^2/s)
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
real(r8), parameter :: mu_dust_gnd = 1._r8 ! width parameter, dust, ground (km)
real(r8), parameter :: mu_dust_trop = 3._r8 ! width parameter, dust, tropopause (km)
real(r8), parameter :: mu_soot_gnd = 1._r8 ! width parameter, soot, ground (km)
real(r8), parameter :: mu_soot_trop = 3._r8 ! width parameter, soot, tropopause (km)
- integer :: tropLev(pcols) ! tropopause level index
- real(r8) :: tropP(pcols) ! tropopause pressure (Pa)
- real(r8) :: tropT(pcols) ! tropopause temperature (K)
- real(r8) :: tropZ(pcols) ! tropopause height (m)
+ integer :: tropLev(pcols) ! tropopause level index
+ real(r8) :: tropP(pcols) ! tropopause pressure (Pa)
+ real(r8) :: tropT(pcols) ! tropopause temperature (K)
+ real(r8) :: tropZ(pcols) ! tropopause height (m)
real(r8) :: lon(state%ncol) ! longitude
real(r8) :: lat(state%ncol) ! latitude
@@ -434,14 +434,14 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
! Determine the latitude and longitude of each column.
ncol = state%ncol
-
+
lat = state%lat(:ncol) * RAD2DEG
lon = state%lon(:ncol) * RAD2DEG
-
-
+
+
! Add any surface flux here.
surfaceFlux(:ncol) = 0.0_r8
-
+
! For emissions into the atmosphere, put the emission here.
!
! Use Toon et al. [2012] as the source function for soot and dust
@@ -456,13 +456,13 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
! NOTE: Perhaps some of these fields should end up in the CARMA
! model namelist, so different experiments can be run more easily.
tendency(:ncol, :pver) = 0.0_r8
-
+
! Determine the start and stop year and day of year from the namelist
! variables.
currentDate = yr * 1000 + doy
startyear = carma_emis_startdate / 1000
stopyear = carma_emis_stopdate / 1000
-
+
startdoy = mod(carma_emis_startdate, 1000)
stopdoy = mod(carma_emis_stopdate, 1000)
@@ -471,48 +471,48 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
((currentDate == carma_emis_startdate) .and. (ncsec >= carma_emis_starttime))) .and. &
((currentDate < carma_emis_stopdate) .or. &
((currentDate == carma_emis_stopdate) .and. (ncsec < carma_emis_stoptime)))) then
-
+
! Make sure to emit for at least one timestep and in multiples of the time
! step length.
! TBD - This has a leap year problem, but works otherwise ...
carma_emis_dtime = INT((((stopyear - startyear) * 365._f + (stopdoy - startdoy)) * 24._f * 3600._f + &
(carma_emis_stoptime - carma_emis_starttime)) / dt) * dt
-
+
! For simplicity, calculate the emission function at the cell midpoint and
! assume that rate is used throughout the cell.
call CARMAELEMENT_GET(carma, ielem, rc, igroup=igroup)
if (RC < RC_ERROR) return
-
+
call CARMAGROUP_GET(carma, igroup, rc, shortname=shortname)
if (RC < RC_ERROR) return
-
+
if ((shortname == "CRDUST") .or. (shortname == "CRSOOT")) then
! Find the tropopause using the default algorithm backed by the climatology.
call tropopause_find(state, tropLev, tropZ=tropZ)
-
+
! Loop over all of the columns.
do icol = 1, ncol
-
+
! Is the column one of the ones over which there should be emissions>
if ((lat(icol) > carma_emis_minlat) .and. (lat(icol) < carma_emis_maxlat) .and. &
(((carma_emis_minlon <= carma_emis_maxlon) .and. (lon(icol) >= carma_emis_minlon) .and. &
(lon(icol) <= carma_emis_maxlon)) .or. &
((carma_emis_minlon > carma_emis_maxlon) .and. &
((lon(icol) >= carma_emis_minlon) .or. (lon(icol) <= carma_emis_maxlon))))) then
-
+
! Set tendencies for any sources or sinks in the atmosphere.
do k = 1, pver
-
+
! Get the cell midpoint and height
zmid = state%zm(icol, k) / 1000._f
-
+
! Get the tropopause height.
ztrop = tropZ(icol) / 1000._f
-
- ! Use the dust emission from Toon et al. 2012.
+
+ ! Use the dust emission from Toon et al. 2012.
if (shortname == "CRDUST") then
-
+
! Determine the total emission rate for this grid box using equation 2
! from Toon et al. [2012] and also adjust for the fraction of the
! mass that goes into the specified bin based on the assumed size
@@ -521,13 +521,13 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
(1._f / mu_dust_gnd * exp(-0.5_f * ((zmid / mu_dust_gnd)**2)) + &
1._f / (2._f * mu_dust_trop) * exp(-0.5_f * (((zmid - ztrop) / mu_dust_trop)**2))) * &
(state%zi(icol, k) - state%zi(icol, k+1))
-
+
rate = carma_emis_dust * carma_dustbinfactor(ibin)
end if
-
+
! Use the soot emissions from Toon et al. 2012.
if (shortname == "CRSOOT") then
-
+
! Determine the total emission rate for this grid box using equation 2
! from Toon et al. [2012] and also adjust for the fraction of the
! mass that goes into the specified bin based on the assumed size
@@ -536,29 +536,29 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
(1._f / mu_soot_gnd * exp(-0.5_f * ((zmid / mu_soot_gnd)**2)) + &
1._f / (2._f * mu_soot_trop) * exp(-0.5_f * (((zmid - ztrop) / mu_soot_trop)**2))) * &
(state%zi(icol, k) - state%zi(icol, k+1))
-
-
+
+
rate = carma_emis_soot * carma_sootbinfactor(ibin)
end if
-
+
! Calculate a rate by dividing by total emission time.
rate = rate * vfunc(k) / carma_emis_dtime
-
+
! Scale for the fraction of the total surface area that is emitting and
! convert to kg/m2/s
massflux = rate / carma_emis_area
-
+
! Convert the mass flux to a tendency on the mass mixing ratio.
tendency(icol, k) = massflux / (state%pdel(icol, k) / gravit)
end do
-
+
! Now normalize in the vertical to preserve the total mass.
tendency(icol, :) = tendency(icol, :) / sum(vfunc(:))
end if
end do
end if
end if
-
+
return
end subroutine CARMA_EmitParticle
@@ -573,15 +573,18 @@ end subroutine CARMA_EmitParticle
!! @version May-2009
subroutine CARMA_InitializeModel(carma, lq_carma, rc)
use constituents, only: pcnst
- use dyn_grid, only: get_horiz_grid_dim_d, get_horiz_grid_d
+ use phys_grid, only: get_rlat_all_p, get_rlon_all_p, get_area_all_p, get_ncols_p
+ use shr_reprosum_mod, only: shr_reprosum_calc
+ use ppgrid, only: begchunk, endchunk
+ use spmd_utils, only: mpicom
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
logical, intent(inout) :: lq_carma(pcnst) !! flags to indicate whether the constituent
!! could have a CARMA tendency
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
! NOTE: The dust distribution has not been specified yet, but it should be different
! from the soot.
real(kind=f), parameter :: rm_dust = 0.11 ! dust mean radius (um)
@@ -590,9 +593,6 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
real(kind=f), parameter :: sigma_soot = 1.6 ! soot variance
integer :: i
- integer :: hdim1_d
- integer :: hdim2_d
- integer :: ngcols
real(kind=f) :: r(NBIN)
real(kind=f) :: dr(NBIN)
real(kind=f) :: rmass(NBIN)
@@ -600,12 +600,16 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
real(kind=f), allocatable :: lat(:)
real(kind=f), allocatable :: lon(:)
real(kind=f), allocatable :: colarea(:)
+ real(kind=f), allocatable :: local_carma_emis_area(:,:)
character(len=32) :: shortname ! the shortname of the group
-
+
integer :: LUNOPRT ! logical unit number for output
logical :: do_print ! do print output?
- 1 format(i3,5x,i3,4x,e10.3,4x,e10.3)
+ integer :: kk, lchnk, ncol
+ real(kind=f) :: wrk(1)
+
+ 1 format(i3,5x,i3,4x,e10.3,4x,e10.3)
! Default return code.
rc = RC_OK
@@ -620,7 +624,7 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
! 4 : 5.0 - 10.0 um
call CARMAGROUP_GET(carma, I_GRP_DUST, rc, r=r)
if (RC < RC_ERROR) return
-
+
do i = 1, NBIN
if (r(i) .le. 1e-4_f) then
carma_dustmap(i) = 1
@@ -632,65 +636,73 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
carma_dustmap(i) = 4
end if
end do
-
+
! Determine the weight of mass in each bin based upon the size distribution specified
! in Toon et al. [2012], for soot and dust. They are lognormal for the smaller sizes
! and dust is lognormal for larger sizes.
-
+
call CARMAGROUP_GET(carma, I_GRP_DUST, rc, shortname=shortname, r=r, dr=dr, rmass=rmass)
if (RC < RC_ERROR) return
-
+
dM(:) = rmass(:) * &
exp(-(log(r(:) * 1e4_f / rm_dust) ** 2) / (2._f * (log(sigma_dust) ** 2))) / &
log(sigma_dust) * (dr(:) / r(:))
- carma_dustbinfactor(:) = dM / sum(dM)
+ carma_dustbinfactor(:) = dM / sum(dM)
call CARMAGROUP_GET(carma, I_GRP_SOOT, rc, shortname=shortname, r=r, dr=dr, rmass=rmass)
if (RC < RC_ERROR) return
-
+
dM(:) = rmass(:) * &
exp(-(log(r(:) * 1e4_f / rm_soot) ** 2) / (2._f * (log(sigma_soot) ** 2))) / &
log(sigma_soot) * (dr(:) / r(:))
carma_sootbinfactor(:) = dM / sum(dM)
-
+
! Determine the total area in which debris will be emitted. This is used to scale
- ! the emission per column, based upon the fraction of surface area. This assumes a
- ! regular physics grid.
- call get_horiz_grid_dim_d(hdim1_d, hdim2_d)
-
- ngcols = hdim1_d*hdim2_d
-
- allocate(lat(ngcols))
- allocate(lon(ngcols))
- allocate(colarea(ngcols))
-
- call get_horiz_grid_d(ngcols, clat_d_out=lat, clon_d_out=lon, area_d_out=colarea)
-
- lat = lat * RAD2DEG
- lon = lon * RAD2DEG
-
- ! rad2 -> m2
- colarea = colarea * REARTH * REARTH / 1e4
+ ! the emission per column, based upon the fraction of surface area.
+
+ allocate(lat(pcols))
+ allocate(lon(pcols))
+ allocate(colarea(pcols))
+ allocate(local_carma_emis_area(pcols,begchunk:endchunk))
+
+ local_carma_emis_area(:,:) = 0._r8
! Integrate surface area with same checks as in the emission routine to determine
! the area where the emissions come from (m2). Assume that the grid box is either
- ! all in or all out based upon the center lat/lon. Don't include fractions of a
+ ! all in or all out based upon the center lat/lon. Don't include fractions of a
! grid box.
- carma_emis_area = 0._f
-
- do i = 1, ngcols
- if ((lat(i) >= carma_emis_minlat) .and. (lat(i) <= carma_emis_maxlat) .and. &
- (((carma_emis_minlon <= carma_emis_maxlon) .and. (lon(i) >= carma_emis_minlon) .and. &
- (lon(i) <= carma_emis_maxlon)) .or. &
- ((carma_emis_minlon > carma_emis_maxlon) .and. &
- ((lon(i) >= carma_emis_minlon) .or. (lon(i) <= carma_emis_maxlon))))) then
- carma_emis_area = carma_emis_area + colarea(i)
- end if
- end do
-
- carma_emis_area = carma_emis_area
-
+ do lchnk = begchunk,endchunk
+ ncol = get_ncols_p(lchnk)
+
+ call get_rlat_all_p(lchnk, pcols, lat)
+ call get_rlon_all_p(lchnk, pcols, lon)
+
+ ! radians -> degrees
+ lat(:ncol) = lat(:ncol) * RAD2DEG
+ lon(:ncol) = lon(:ncol) * RAD2DEG
+
+ call get_area_all_p(lchnk, pcols, colarea)
+
+ ! rad2 -> m2
+ colarea(:ncol) = colarea(:ncol) * REARTH * REARTH / 1.e4_r8
+
+ do i = 1,ncol
+ if ((lat(i) >= carma_emis_minlat) .and. (lat(i) <= carma_emis_maxlat) .and. &
+ (((carma_emis_minlon <= carma_emis_maxlon) .and. (lon(i) >= carma_emis_minlon) .and. &
+ (lon(i) <= carma_emis_maxlon)) .or. &
+ ((carma_emis_minlon > carma_emis_maxlon) .and. &
+ ((lon(i) >= carma_emis_minlon) .or. (lon(i) <= carma_emis_maxlon))))) then
+ local_carma_emis_area(i,lchnk) = colarea(i)
+ endif
+ enddo
+ enddo
+
+ kk = pcols*(endchunk-begchunk+1)
+ call shr_reprosum_calc( local_carma_emis_area, wrk,kk,kk,1, commid=mpicom )
+
+ carma_emis_area = wrk(1)
+
deallocate(lat)
deallocate(lon)
deallocate(colarea)
@@ -699,12 +711,12 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
if (masterproc) then
call CARMA_Get(carma, rc, do_print=do_print, LUNOPRT=LUNOPRT)
if (rc < 0) call endrun("CARMA_InitializeModel: CARMA_Get failed.")
-
-
+
+
if (do_print) then
write(LUNOPRT,*) ''
write(LUNOPRT,*) 'CARMA Initialization ...'
-
+
write(LUNOPRT,*) ''
write(LUNOPRT,*) 'ibin dustmap dustfactor sootfactor'
@@ -734,10 +746,9 @@ end subroutine CARMA_InitializeModel
!! @version May-2009
subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask, q, rc)
use shr_kind_mod, only: r8 => shr_kind_r8
- use pmgrid, only: plat, plev, plon
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -751,21 +762,21 @@ subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask,
rc = RC_OK
! Add initial condition here.
-
+
return
end subroutine CARMA_InitializeParticle
-
+
!! Called after wet deposition has been performed. Allows the specific model to add
!! wet deposition of CARMA aerosols to the aerosols being communicated to the surface.
!!
- !! @version July-2011
- !! @author Chuck Bardeen
+ !! @version July-2011
+ !! @author Chuck Bardeen
subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
use camsrfexch, only: cam_out_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -773,12 +784,12 @@ subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
type(cam_out_t), intent(inout) :: cam_out !! cam output to surface models
type(physics_state), intent(in) :: state !! physics state variables
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
integer :: icol
-
+
! Default return code.
rc = RC_OK
-
+
! Add the wet deposition fluxes to the hydrophilic black carbon.
!
! NOTE: Don't give the surface model negative values for the surface fluxes.
@@ -801,8 +812,8 @@ subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
end if
end do
end if
-
+
return
- end subroutine CARMA_WetDeposition
-
+ end subroutine CARMA_WetDeposition
+
end module
diff --git a/src/physics/carma/models/meteor_smoke/carma_model_mod.F90 b/src/physics/carma/models/meteor_smoke/carma_model_mod.F90
index 5bc4787ad5..0b6d83aba1 100644
--- a/src/physics/carma/models/meteor_smoke/carma_model_mod.F90
+++ b/src/physics/carma/models/meteor_smoke/carma_model_mod.F90
@@ -9,7 +9,7 @@
!! - CARMA_InitializeModel()
!!
!! @version Jan-2011
-!! @author Chuck Bardeen
+!! @author Chuck Bardeen
module carma_model_mod
use carma_precision_mod
@@ -35,7 +35,7 @@ module carma_model_mod
#if ( defined SPMD )
use mpishorthand
-#endif
+#endif
implicit none
@@ -81,9 +81,9 @@ module carma_model_mod
integer :: carma_emis_nLevs ! number of emission levels
real(r8), allocatable, dimension(:) :: carma_emis_lev ! emission levels (Pa)
real(r8), allocatable, dimension(:) :: carma_emis_rate ! emission rate lookup table (# cm-3 s-1)
- integer :: carma_emis_ilev_min ! index of minimum level in table
- integer :: carma_emis_ilev_max ! index of maximum level in table
- integer :: carma_emis_ilev_incr ! index increment to increase level
+ integer :: carma_emis_ilev_min ! index of minimum level in table
+ integer :: carma_emis_ilev_max ! index of maximum level in table
+ integer :: carma_emis_ilev_incr ! index increment to increase level
real(r8) :: carma_emis_expected ! Expected emission rate per column (kg/m2/s)
integer :: carma_escale_nLats ! number of emission scale latitudes
@@ -100,12 +100,12 @@ module carma_model_mod
!! Defines all the CARMA components (groups, elements, solutes and gases) and process
!! (coagulation, growth, nucleation) that will be part of the microphysical model.
!!
- !! @version May-2009
- !! @author Chuck Bardeen
+ !! @version May-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DefineModel(carma, rc)
type(carma_type), intent(inout) :: carma !! the carma object
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
! Local variables
real(kind=f), parameter :: RHO_METEOR_SMOKE = 2.0_f ! density of meteor smoke particles (g/cm)
real(kind=f), parameter :: rmin = 2e-8_f ! minimum radius (cm)
@@ -113,15 +113,15 @@ subroutine CARMA_DefineModel(carma, rc)
integer :: LUNOPRT ! logical unit number for output
logical :: do_print ! do print output?
-
+
! Default return code.
rc = RC_OK
-
+
! Report model specific namelist configuration parameters.
if (masterproc) then
call CARMA_Get(carma, rc, do_print=do_print, LUNOPRT=LUNOPRT)
if (rc < 0) call endrun("CARMA_InitializeModel: CARMA_Get failed.")
-
+
if (do_print) write(LUNOPRT,*) ''
if (do_print) write(LUNOPRT,*) 'CARMA ', trim(carma_model), ' specific settings :'
if (do_print) write(LUNOPRT,*) ' carma_do_escale = ', carma_do_escale
@@ -129,8 +129,8 @@ subroutine CARMA_DefineModel(carma, rc)
if (do_print) write(LUNOPRT,*) ' carma_emis_file = ', trim(carma_emis_file)
if (do_print) write(LUNOPRT,*) ' carma_escale_file= ', trim(carma_escale_file)
end if
-
-
+
+
! Define the Groups
!
! NOTE: For CAM, the optional do_wetdep and do_drydep flags should be
@@ -141,7 +141,7 @@ subroutine CARMA_DefineModel(carma, rc)
scavcoef=0.1_f, shortname="DUST")
if (rc < 0) call endrun('CARMA_DefineModel::CARMA_AddGroup failed.')
-
+
! Define the Elements
!
! NOTE: For CAM, the optional shortname needs to be provided for the group. These names
@@ -149,18 +149,18 @@ subroutine CARMA_DefineModel(carma, rc)
call CARMAELEMENT_Create(carma, I_ELEM_DUST, I_GRP_DUST, "meteor smoke", RHO_METEOR_SMOKE, &
I_INVOLATILE, I_METEOR_SMOKE, rc, shortname="DUST")
if (rc < 0) call endrun('CARMA_DefineModel::CARMA_AddElement failed.')
-
-
+
+
! Define the Solutes
-
-
+
+
! Define the Gases
-
-
+
+
! Define the Processes
call CARMA_AddCoagulation(carma, I_GRP_DUST, I_GRP_DUST, I_GRP_DUST, I_COLLEC_DATA, rc)
if (rc < 0) call endrun('CARMA_DefineModel::CARMA_AddCoagulation failed.')
-
+
return
end subroutine CARMA_DefineModel
@@ -168,8 +168,8 @@ end subroutine CARMA_DefineModel
!! Defines all the CARMA components (groups, elements, solutes and gases) and process
!! (coagulation, growth, nucleation) that will be part of the microphysical model.
!!
- !! @version May-2009
- !! @author Chuck Bardeen
+ !! @version May-2009
+ !! @author Chuck Bardeen
!!
!! @see CARMASTATE_SetDetrain
subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq, prec_str, snow_str, &
@@ -188,22 +188,22 @@ subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq,
real(r8), intent(in) :: dt !! time step (s)
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(out), optional :: tnd_qsnow(pcols,pver) !! snow mass tendency (kg/kg/s)
real(r8), intent(out), optional :: tnd_nsnow(pcols,pver) !! snow number tendency (#/kg/s)
! Default return code.
rc = RC_OK
-
+
return
end subroutine CARMA_Detrain
!! For diagnostic groups, sets up up the CARMA bins based upon the CAM state.
!!
- !! @version July-2009
- !! @author Chuck Bardeen
+ !! @version July-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, prec_str, snow_str)
use time_manager, only: is_first_step
@@ -217,32 +217,32 @@ subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, pr
real(r8), intent(in) :: dt !! time step
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(in), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
-
+
real(r8) :: mmr(pver) !! elements mass mixing ratio
integer :: ibin !! bin index
-
+
! Default return code.
rc = RC_OK
-
+
! By default, do nothing. If diagnosed groups exist, this needs to be replaced by
! code to determine the mass in each bin from the CAM state.
-
+
return
end subroutine CARMA_DiagnoseBins
!! For diagnostic groups, determines the tendencies on the CAM state from the CARMA bins.
!!
- !! @version July-2009
- !! @author Chuck Bardeen
+ !! @version July-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol, dt, rc, rliq, prec_str, snow_str, &
prec_sed, snow_sed, tnd_qsnow, tnd_nsnow, re_ice)
use camsrfexch, only: cam_out_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(cam_out_t), intent(inout) :: cam_out !! cam output to surface models
@@ -253,20 +253,20 @@ subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol,
real(r8), intent(in) :: dt !! time step
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(inout), optional :: prec_sed(pcols) !! total precip from cloud sedimentation (m/s)
real(r8), intent(inout), optional :: snow_sed(pcols) !! snow from cloud ice sedimentation (m/s)
real(r8), intent(inout), optional :: tnd_qsnow(pcols,pver) !! snow mass tendency (kg/kg/s)
real(r8), intent(inout), optional :: tnd_nsnow(pcols,pver) !! snow number tendency (#/kg/s)
real(r8), intent(out), optional :: re_ice(pcols,pver) !! ice effective radius (m)
-
+
! Default return code.
rc = RC_OK
-
+
! By default, do nothing. If diagnosed groups exist, this needs to be replaced by
! code to determine the bulk mass from the CARMA state.
-
+
return
end subroutine CARMA_DiagnoseBulk
@@ -284,9 +284,9 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
use camsrfexch, only: cam_in_t
use time_manager, only: get_curr_calday, is_perpetual, get_perp_date, get_curr_date
use physconst, only: gravit
-
+
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -297,8 +297,8 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
real(r8), intent(out) :: tendency(pcols, pver) !! constituent tendency (kg/kg/s)
real(r8), intent(out) :: surfaceFlux(pcols) !! constituent surface flux (kg/m^2/s)
integer, intent(out) :: rc !! return code, negative indicates failure
-
- integer :: ilat ! latitude index
+
+ integer :: ilat ! latitude index
integer :: iltime ! local time index
integer :: ncol ! number of columns in chunk
integer :: icol ! column index
@@ -322,7 +322,7 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
integer :: ncdate
real(r8) :: ltime ! local time
-
+
! Default return code.
rc = RC_OK
@@ -343,33 +343,33 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
! Add any surface flux here.
surfaceFlux(:ncol) = 0.0_r8
-
+
! For emissions into the atmosphere, put the emission here.
!
! NOTE: Do not set tendency to be the surface flux. Surface source is put in to
- ! the bottom layer by vertical diffusion. See vertical_solver module, line 355.
+ ! the bottom layer by vertical diffusion. See vertical_solver module, line 355.
tendency(:ncol, :pver) = 0.0_r8
! Only do emission for the first bin of the meteor smoke group.
call CARMAELEMENT_GET(carma, ielem, rc, igroup=igroup)
if (RC < RC_ERROR) return
-
+
call CARMAGROUP_GET(carma, igroup, rc, shortname=shortname, r=r, dr=dr, rmass=rmass)
if (RC < RC_ERROR) return
-
+
! For meteoritic dust, the source from the smoke only goes into the
! smallest bin (~1.3 nm). The depth that the micrometeorite penetrates
! is proportional to the pressure, so the emission is a function of
- ! pressure.
+ ! pressure.
if ((shortname .eq. "DUST") .and. (ibin .eq. 1)) then
! Set tendencies for any sources or sinks in the atmosphere.
do k = 1, pver
do icol = 1, ncol
-
+
pressure = state%pmid(icol, k)
-
+
! This is roughly a log-normal approximation to the production
! rate, but only applies from about 70 to 110 km.
!
@@ -386,32 +386,32 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
! surrounding the pressure and do a linear interpolation on the
! rate. This linear search is kind of expensive, particularly if
! there are a lot of points.
- !
+ !
! NOTE: The tendency is on a mass mixing ratio (kg/kg/s)
do ilev = carma_emis_ilev_min, (carma_emis_ilev_max - carma_emis_ilev_incr), carma_emis_ilev_incr
if ((pressure >= carma_emis_lev(ilev)) .and. (pressure <= carma_emis_lev(ilev+carma_emis_ilev_incr))) then
rate = carma_emis_rate(ilev)
-
+
if (pressure > carma_emis_lev(ilev)) then
rate = rate + &
((carma_emis_rate(ilev+carma_emis_ilev_incr) - &
carma_emis_rate(ilev)) / (carma_emis_lev(ilev+carma_emis_ilev_incr) - &
carma_emis_lev(ilev))) * (pressure - carma_emis_lev(ilev))
end if
-
+
rate = rate * (((1.3e-7_r8)**3) / (r(ibin)**3))
exit
end if
end do
-
+
! Calculate the mass flux in terms of kg/m3/s
massflux = (rate * rmass(ibin) * 1.0e-3_r8 * 1.0e6_r8)
-
+
! Calculate a scaling if appropriate.
rfScale(icol) = 1.0_r8
-
+
if (carma_do_escale) then
-
+
! Global Scaling
!
! Interpolate the global scale by latitude.
@@ -438,7 +438,7 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
if (abs((state%lat(icol) / DEG2RAD) - 90.0) <= 0.00001_r8) then
rfScale(icol) = carma_escale_grf(carma_escale_nLats, doy)
end if
-
+
! Local Time Scaling
!
! Interpolate the local scale by local time.
@@ -460,10 +460,10 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
end if
end do
endif
-
+
! Convert the mass flux to a tendency on the mass mixing ratio.
thickness = state%zi(icol, k) - state%zi(icol, k+1)
- tendency(icol, k) = (massflux * thickness) / (state%pdel(icol, k) / gravit)
+ tendency(icol, k) = (massflux * thickness) / (state%pdel(icol, k) / gravit)
end if
enddo
enddo
@@ -473,13 +473,13 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
do icol = 1, ncol
columnMass = sum(tendency(icol, :) * (state%pdel(icol, :) / gravit))
scale = carma_emis_expected / columnMass
-
+
! Also apply the relative flux scaling. This needs to be done after
! the normalization
tendency(icol, :) = tendency(icol, :) * scale * rfScale(icol)
end do
end if
-
+
return
end subroutine CARMA_EmitParticle
@@ -525,9 +525,9 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
! Add initialization here.
call CARMA_Get(carma, rc, do_print=do_print, LUNOPRT=LUNOPRT)
if (rc < 0) call endrun("CARMA_InitializeModel: CARMA_Get failed.")
-
+
! Initialize the emissions rate table.
- if (carma_do_emission) then
+ if (carma_do_emission) then
if (masterproc) then
! Open the netcdf file (read only)
@@ -540,7 +540,7 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
call wrap_inq_dimid(fid, "lev", lev_did)
call wrap_inq_dimlen(fid, lev_did, carma_emis_nLevs)
endif
-
+
#if ( defined SPMD )
call mpibcast(carma_emis_nLevs, 1, mpiint, 0, mpicom)
#endif
@@ -568,7 +568,7 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
if (carma_emis_rate(ilev) <= 0.0) then
carma_emis_ilev_min = ilev + 1
else
- exit
+ exit
endif
end do
@@ -576,7 +576,7 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
if (carma_emis_rate(ilev) <= 0.0) then
carma_emis_ilev_max = ilev - 1
else
- exit
+ exit
endif
end do
@@ -586,21 +586,21 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
carma_emis_ilev_incr = -1
tmp = carma_emis_ilev_min
carma_emis_ilev_min = carma_emis_ilev_max
- carma_emis_iLev_max = tmp
+ carma_emis_iLev_max = tmp
endif
if (do_print) write(LUNOPRT,*) ''
if (do_print) write(LUNOPRT,*) 'carma_init(): carma_emis_nLevs = ', carma_emis_nLevs
- if (do_print) write(LUNOPRT,*) 'carma_init(): carma_emis_ilev_min = ', carma_emis_ilev_min
- if (do_print) write(LUNOPRT,*) 'carma_init(): carma_emis_ilev_max = ', carma_emis_ilev_max
- if (do_print) write(LUNOPRT,*) 'carma_init(): carma_emis_ilev_incr = ', carma_emis_ilev_incr
+ if (do_print) write(LUNOPRT,*) 'carma_init(): carma_emis_ilev_min = ', carma_emis_ilev_min
+ if (do_print) write(LUNOPRT,*) 'carma_init(): carma_emis_ilev_max = ', carma_emis_ilev_max
+ if (do_print) write(LUNOPRT,*) 'carma_init(): carma_emis_ilev_incr = ', carma_emis_ilev_incr
if (do_print) write(LUNOPRT,*) ''
-
+
if (do_print) write(LUNOPRT,*) 'level, pressure (Pa), emission rate (# cm-3 sec-1)'
do ilev = carma_emis_ilev_min, carma_emis_ilev_max, carma_emis_ilev_incr
if (do_print) write(LUNOPRT,*) ilev, carma_emis_lev(ilev), carma_emis_rate(ilev)
enddo
-
+
if (do_print) write(LUNOPRT, *) 'carma_init(): Total Emission = ', carma_emis_total, ' (kt/yr)'
carma_emis_expected = ((carma_emis_total * 1e6_r8) / (3600.0_r8 * 24.0_r8 * 365.0_r8)) / &
(4.0_r8 * PI * ((REARTH / 100._r8) ** 2))
@@ -620,10 +620,10 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
#endif
endif
-
+
! Initialize the emissions scaling table.
- if (carma_do_escale) then
+ if (carma_do_escale) then
if (masterproc) then
! Open the netcdf file (read only)
@@ -638,17 +638,17 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
call wrap_inq_dimid(fid, "time", time_did)
call wrap_inq_dimlen(fid, time_did, carma_escale_nTimes)
-
+
! There should be one time for each day of the year, so
! quit if it isn't correct.
if (carma_escale_nTimes .ne. 365) then
call endrun("CARMA_InitializeModel: Emission scaling file should have entries for 365 days, but doesn't.")
endif
-
+
call wrap_inq_dimid(fid, "ltime", ltime_did)
call wrap_inq_dimlen(fid, ltime_did, carma_escale_nLTimes)
endif
-
+
#if ( defined SPMD )
call mpibcast(carma_escale_nLats, 1, mpiint, 0, mpicom)
call mpibcast(carma_escale_nTimes, 1, mpiint, 0, mpicom)
@@ -677,7 +677,7 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
call wrap_inq_varid(fid, 'ltime', ltime_vid)
call wrap_get_var_realx(fid, ltime_vid, carma_escale_ltime)
-
+
! Close the file.
call wrap_close(fid)
@@ -686,7 +686,7 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
if (do_print) write(LUNOPRT,*) 'carma_init(): carma_escale_nTimes = ', carma_escale_nTimes
if (do_print) write(LUNOPRT,*) 'carma_init(): carma_escale_nLTimes = ', carma_escale_nLTimes
if (do_print) write(LUNOPRT,*) ''
-
+
if (do_print) write(LUNOPRT,*) 'carma_init(): Done with emission scaling tables.'
endif
@@ -699,7 +699,7 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
#endif
endif
-
+
return
end subroutine CARMA_InitializeModel
@@ -715,7 +715,6 @@ end subroutine CARMA_InitializeModel
!! @version May-2009
subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask, q, rc)
use shr_kind_mod, only: r8 => shr_kind_r8
- use pmgrid, only: plat, plev, plon
implicit none
@@ -737,18 +736,18 @@ subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask,
return
end subroutine CARMA_InitializeParticle
-
-
+
+
!! Called after wet deposition has been performed. Allows the specific model to add
!! wet deposition of CARMA aerosols to the aerosols being communicated to the surface.
!!
- !! @version July-2011
- !! @author Chuck Bardeen
+ !! @version July-2011
+ !! @author Chuck Bardeen
subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
use camsrfexch, only: cam_out_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -756,13 +755,13 @@ subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
type(cam_out_t), intent(inout) :: cam_out !! cam output to surface models
type(physics_state), intent(in) :: state !! physics state variables
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
integer :: icol
-
+
! Default return code.
rc = RC_OK
-
+
return
- end subroutine CARMA_WetDeposition
+ end subroutine CARMA_WetDeposition
end module
diff --git a/src/physics/carma/models/mixed_sulfate/carma_model_mod.F90 b/src/physics/carma/models/mixed_sulfate/carma_model_mod.F90
index 803a37edd6..36ee1be358 100644
--- a/src/physics/carma/models/mixed_sulfate/carma_model_mod.F90
+++ b/src/physics/carma/models/mixed_sulfate/carma_model_mod.F90
@@ -794,7 +794,6 @@ end subroutine CARMA_InitializeModel
!! @version May-2009
subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask, q, rc)
use shr_kind_mod, only: r8 => shr_kind_r8
- use pmgrid, only: plat, plev, plon
implicit none
diff --git a/src/physics/carma/models/pmc/carma_model_mod.F90 b/src/physics/carma/models/pmc/carma_model_mod.F90
index 1ddd1b1347..eb8c6e6667 100644
--- a/src/physics/carma/models/pmc/carma_model_mod.F90
+++ b/src/physics/carma/models/pmc/carma_model_mod.F90
@@ -12,7 +12,7 @@
!!
!!
!! @version Jan-2011
-!! @author Chuck Bardeen
+!! @author Chuck Bardeen
module carma_model_mod
use carma_precision_mod
@@ -38,7 +38,7 @@ module carma_model_mod
#if ( defined SPMD )
use mpishorthand
-#endif
+#endif
implicit none
@@ -91,9 +91,9 @@ module carma_model_mod
integer :: carma_emis_nLevs ! number of emission levels
real(r8), allocatable, dimension(:) :: carma_emis_lev ! emission levels (Pa)
real(r8), allocatable, dimension(:) :: carma_emis_rate ! emission rate lookup table (# cm-3 s-1)
- integer :: carma_emis_ilev_min ! index of minimum level in table
- integer :: carma_emis_ilev_max ! index of maximum level in table
- integer :: carma_emis_ilev_incr ! index increment to increase level
+ integer :: carma_emis_ilev_min ! index of minimum level in table
+ integer :: carma_emis_ilev_max ! index of maximum level in table
+ integer :: carma_emis_ilev_incr ! index increment to increase level
real(r8) :: carma_emis_expected ! Expected emission rate per column (kg/m2/s)
integer :: carma_escale_nLats ! number of emission scale latitudes
@@ -115,15 +115,15 @@ module carma_model_mod
!! Defines all the CARMA components (groups, elements, solutes and gases) and process
!! (coagulation, growth, nucleation) that will be part of the microphysical model.
!!
- !! @version May-2009
- !! @author Chuck Bardeen
+ !! @version May-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DefineModel(carma, rc)
use ioFileMod, only: getfil
use wrap_nf
type(carma_type), intent(inout) :: carma !! the carma object
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
! Local variables
real(kind=f), parameter :: RHO_METEOR_SMOKE = 2.0_f ! density of meteor smoke particles (g/cm)
real(kind=f), parameter :: rmin = 2e-8_f ! minimum radius (cm)
@@ -137,16 +137,16 @@ subroutine CARMA_DefineModel(carma, rc)
integer :: imag_vid
character(len=256) :: efile ! refractive index file name
real(kind=f) :: interp
- complex(kind=f) :: refidx_ice(NWAVE) ! the refractive index at each CAM wavelength
+ complex(kind=f) :: refidx_ice(NWAVE) ! the refractive index at each CAM wavelength
integer :: LUNOPRT
logical :: do_print
-
+
! Default return code.
rc = RC_OK
-
+
call CARMA_Get(carma, rc, do_print=do_print, LUNOPRT=LUNOPRT, wave=wave)
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMA_Get failed.')
-
+
! Report model specific configuration parameters.
if (masterproc) then
if (do_print) then
@@ -158,8 +158,8 @@ subroutine CARMA_DefineModel(carma, rc)
write(LUNOPRT,*) ' carma_mice_file = ', trim(carma_mice_file)
end if
end if
-
-
+
+
! Define the Groups
!
! NOTE: For CAM, the optional do_wetdep and do_drydep flags should be
@@ -168,59 +168,59 @@ subroutine CARMA_DefineModel(carma, rc)
call CARMAGROUP_Create(carma, I_GRP_DUST, "meteor smoke", rmin, 2.0_f, I_SPHERE, 1._f, .false., &
rc, do_wetdep=.true., do_drydep=.true., solfac=0.3_f, &
scavcoef=0.1_f, shortname="DUST")
-
+
! Get the refractive index for ice as a function of wavelength for particle heating
! calculations.
!
! NOTE: These values probably should be a band average, but for now just do band centers.
-
+
! Read the values in from Warren et al. 2008.
if (carma_do_pheat) then
- if (masterproc) then
-
+ if (masterproc) then
+
! Open the netcdf file (read only)
call getfil(carma_mice_file, efile, fid)
if (do_print) write(LUNOPRT,*) 'carma_init(): Reading ice refractive indexes from ', efile
-
+
call wrap_open(efile, 0, fid)
-
+
! Alocate the table arrays
call wrap_inq_dimid(fid, "wavelength", wave_did)
call wrap_inq_dimlen(fid, wave_did, warren_nwave)
endif
-
+
#if ( defined SPMD )
call mpibcast(warren_nwave, 1, mpiint, 0, mpicom)
#endif
-
+
allocate(warren_wave(warren_nwave))
allocate(warren_real(warren_nwave))
allocate(warren_imag(warren_nwave))
-
+
if (masterproc) then
-
+
! Read in the tables.
call wrap_inq_varid(fid, 'wavelength', wave_vid)
call wrap_get_var_realx(fid, wave_vid, warren_wave)
warren_wave = warren_wave * 1e-4 ! um -> cm
-
+
call wrap_inq_varid(fid, 'm_real', real_vid)
call wrap_get_var_realx(fid, real_vid, warren_real)
-
+
call wrap_inq_varid(fid, 'm_imag', imag_vid)
call wrap_get_var_realx(fid, imag_vid, warren_imag)
-
+
! Close the file.
call wrap_close(fid)
end if
-
+
#if ( defined SPMD )
call mpibcast(warren_wave, warren_nwave, mpir8, 0, mpicom)
call mpibcast(warren_real, warren_nwave, mpir8, 0, mpicom)
call mpibcast(warren_imag, warren_nwave, mpir8, 0, mpicom)
#endif
-
+
! Interpolate the values.
do i = 1, NWAVE
do j = 1, warren_nwave
@@ -232,18 +232,18 @@ subroutine CARMA_DefineModel(carma, rc)
else
refidx_ice(i) = cmplx(warren_real(j), warren_imag(j))
endif
-
+
exit
end if
end do
end do
end if
-
+
call CARMAGROUP_Create(carma, I_GRP_CRICE, "ice crystal", rmin, 2.2_f, I_SPHERE, 1._f, .true., &
rc, do_mie=carma_do_pheat, refidx=refidx_ice, shortname="CRICE")
if (rc < 0) call endrun('CARMA_DefineModel::CARMAGROUP_Create failed.')
-
+
! Define the Elements
!
! NOTE: For CAM, the optional shortname needs to be provided for the group. These names
@@ -259,17 +259,17 @@ subroutine CARMA_DefineModel(carma, rc)
call CARMAELEMENT_Create(carma, I_ELEM_CRCORE, I_GRP_CRICE, "ice core", RHO_METEOR_SMOKE, &
I_COREMASS, I_METEOR_SMOKE, rc, shortname="CRCORE")
if (rc < 0) call endrun('CARMA_DefineModel::CARMA_AddElement failed.')
-
-
+
+
! Define the Solutes
-
-
+
+
! Define the Gases
call CARMAGAS_Create(carma, I_GAS_H2O, "Water Vapor", WTMOL_H2O, &
I_VAPRTN_H2O_MURPHY2005, I_GCOMP_H2O, rc, shortname="Q", ds_threshold=0.2_f)
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMAGAS_Create failed.')
-
-
+
+
! Define the Processes
call CARMA_AddCoagulation(carma, I_GRP_DUST, I_GRP_DUST, I_GRP_DUST, I_COLLEC_DATA, rc)
if (rc < 0) call endrun('CARMA_DefineModel::CARMA_AddCoagulation failed.')
@@ -283,7 +283,7 @@ subroutine CARMA_DefineModel(carma, rc)
call CARMA_AddCoagulation(carma, I_GRP_DUST, I_GRP_CRICE, I_GRP_CRICE, I_COLLEC_DATA, rc)
if (rc < 0) call endrun('CARMA_DefineModel::CARMA_AddCoagulation failed.')
-
+
return
end subroutine CARMA_DefineModel
@@ -291,8 +291,8 @@ end subroutine CARMA_DefineModel
!! Defines all the CARMA components (groups, elements, solutes and gases) and process
!! (coagulation, growth, nucleation) that will be part of the microphysical model.
!!
- !! @version May-2009
- !! @author Chuck Bardeen
+ !! @version May-2009
+ !! @author Chuck Bardeen
!!
!! @see CARMASTATE_SetDetrain
subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq, prec_str, snow_str, &
@@ -311,22 +311,22 @@ subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq,
real(r8), intent(in) :: dt !! time step (s)
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(out), optional :: tnd_qsnow(pcols,pver) !! snow mass tendency (kg/kg/s)
real(r8), intent(out), optional :: tnd_nsnow(pcols,pver) !! snow number tendency (#/kg/s)
! Default return code.
rc = RC_OK
-
+
return
end subroutine CARMA_Detrain
!! For diagnostic groups, sets up up the CARMA bins based upon the CAM state.
!!
- !! @version July-2009
- !! @author Chuck Bardeen
+ !! @version July-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, prec_str, snow_str)
use time_manager, only: is_first_step
@@ -340,32 +340,32 @@ subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, pr
real(r8), intent(in) :: dt !! time step
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(in), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
-
+
real(r8) :: mmr(pver) !! elements mass mixing ratio
integer :: ibin !! bin index
-
+
! Default return code.
rc = RC_OK
-
+
! By default, do nothing. If diagnosed groups exist, this needs to be replaced by
! code to determine the mass in each bin from the CAM state.
-
+
return
end subroutine CARMA_DiagnoseBins
!! For diagnostic groups, determines the tendencies on the CAM state from the CARMA bins.
!!
- !! @version July-2009
- !! @author Chuck Bardeen
+ !! @version July-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol, dt, rc, rliq, prec_str, snow_str, &
prec_sed, snow_sed, tnd_qsnow, tnd_nsnow, re_ice)
use camsrfexch, only: cam_out_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(cam_out_t), intent(inout) :: cam_out !! cam output to surface models
@@ -376,20 +376,20 @@ subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol,
real(r8), intent(in) :: dt !! time step
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(inout), optional :: prec_sed(pcols) !! total precip from cloud sedimentation (m/s)
real(r8), intent(inout), optional :: snow_sed(pcols) !! snow from cloud ice sedimentation (m/s)
real(r8), intent(inout), optional :: tnd_qsnow(pcols,pver) !! snow mass tendency (kg/kg/s)
real(r8), intent(inout), optional :: tnd_nsnow(pcols,pver) !! snow number tendency (#/kg/s)
real(r8), intent(out), optional :: re_ice(pcols,pver) !! ice effective radius (m)
-
+
! Default return code.
rc = RC_OK
-
+
! By default, do nothing. If diagnosed groups exist, this needs to be replaced by
! code to determine the bulk mass from the CARMA state.
-
+
return
end subroutine CARMA_DiagnoseBulk
@@ -401,9 +401,9 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
use camsrfexch, only: cam_in_t
use time_manager, only: get_curr_calday, is_perpetual, get_perp_date, get_curr_date
use physconst, only: gravit
-
+
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -414,8 +414,8 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
real(r8), intent(out) :: tendency(pcols, pver) !! constituent tendency (kg/kg/s)
real(r8), intent(out) :: surfaceFlux(pcols) !! constituent surface flux (kg/m^2/s)
integer, intent(out) :: rc !! return code, negative indicates failure
-
- integer :: ilat ! latitude index
+
+ integer :: ilat ! latitude index
integer :: iltime ! local time index
integer :: ncol ! number of columns in chunk
integer :: icol ! column index
@@ -439,7 +439,7 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
integer :: ncdate
real(r8) :: ltime ! local time
-
+
! Default return code.
rc = RC_OK
@@ -460,33 +460,33 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
! Add any surface flux here.
surfaceFlux(:ncol) = 0.0_r8
-
+
! For emissions into the atmosphere, put the emission here.
!
! NOTE: Do not set tendency to be the surface flux. Surface source is put in to
- ! the bottom layer by vertical diffusion. See vertical_solver module, line 355.
+ ! the bottom layer by vertical diffusion. See vertical_solver module, line 355.
tendency(:ncol, :pver) = 0.0_r8
! Only do emission for the first bin of the meteor smoke group.
call CARMAELEMENT_GET(carma, ielem, rc, igroup=igroup)
if (RC < RC_ERROR) return
-
+
call CARMAGROUP_GET(carma, igroup, rc, shortname=shortname, r=r, dr=dr, rmass=rmass)
if (RC < RC_ERROR) return
-
+
! For meteoritic dust, the source from the smoke only goes into the
! smallest bin (~1.3 nm). The depth that the micrometeorite penetrates
! is proportional to the pressure, so the emission is a function of
- ! pressure.
+ ! pressure.
if ((shortname .eq. "DUST") .and. (ibin .eq. 1)) then
! Set tendencies for any sources or sinks in the atmosphere.
do k = 1, pver
do icol = 1, ncol
-
+
pressure = state%pmid(icol, k)
-
+
! This is roughly a log-normal approximation to the production
! rate, but only applies from about 70 to 110 km.
!
@@ -503,32 +503,32 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
! surrounding the pressure and do a linear interpolation on the
! rate. This linear search is kind of expensive, particularly if
! there are a lot of points.
- !
+ !
! NOTE: The tendency is on a mass mixing ratio (kg/kg/s)
do ilev = carma_emis_ilev_min, (carma_emis_ilev_max - carma_emis_ilev_incr), carma_emis_ilev_incr
if ((pressure >= carma_emis_lev(ilev)) .and. (pressure <= carma_emis_lev(ilev+carma_emis_ilev_incr))) then
rate = carma_emis_rate(ilev)
-
+
if (pressure > carma_emis_lev(ilev)) then
rate = rate + &
((carma_emis_rate(ilev+carma_emis_ilev_incr) - carma_emis_rate(ilev)) / &
(carma_emis_lev(ilev+carma_emis_ilev_incr) - carma_emis_lev(ilev))) * &
(pressure - carma_emis_lev(ilev))
end if
-
+
rate = rate * (((1.3e-7_r8)**3) / (r(ibin)**3))
exit
end if
end do
-
+
! Calculate the mass flux in terms of kg/m3/s
massflux = (rate * rmass(ibin) * 1.0e-3_r8 * 1.0e6_r8)
-
+
! Calculate a scaling if appropriate.
rfScale(icol) = 1.0_r8
-
+
if (carma_do_escale) then
-
+
! Global Scaling
!
! Interpolate the global scale by latitude.
@@ -555,7 +555,7 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
if (abs((state%lat(icol) / DEG2RAD) - 90.0) <= 0.00001_r8) then
rfScale(icol) = carma_escale_grf(carma_escale_nLats, doy)
end if
-
+
! Local Time Scaling
!
! Interpolate the local scale by local time.
@@ -577,10 +577,10 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
end if
end do
endif
-
+
! Convert the mass flux to a tendency on the mass mixing ratio.
thickness = state%zi(icol, k) - state%zi(icol, k+1)
- tendency(icol, k) = (massflux * thickness) / (state%pdel(icol, k) / gravit)
+ tendency(icol, k) = (massflux * thickness) / (state%pdel(icol, k) / gravit)
end if
enddo
enddo
@@ -590,13 +590,13 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
do icol = 1, ncol
columnMass = sum(tendency(icol, :) * (state%pdel(icol, :) / gravit))
scale = carma_emis_expected / columnMass
-
+
! Also apply the relative flux scaling. This needs to be done after
! the normalization
tendency(icol, :) = tendency(icol, :) * scale * rfScale(icol)
end do
end if
-
+
return
end subroutine CARMA_EmitParticle
@@ -642,9 +642,9 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
! Add initialization here.
call CARMA_Get(carma, rc, do_print=do_print, LUNOPRT=LUNOPRT)
if (rc < 0) call endrun("CARMA_InitializeModel: CARMA_Get failed.")
-
+
! Initialize the emissions rate table.
- if (carma_do_emission) then
+ if (carma_do_emission) then
if (masterproc) then
! Open the netcdf file (read only)
@@ -657,7 +657,7 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
call wrap_inq_dimid(fid, "lev", lev_did)
call wrap_inq_dimlen(fid, lev_did, carma_emis_nLevs)
endif
-
+
#if ( defined SPMD )
call mpibcast(carma_emis_nLevs, 1, mpiint, 0, mpicom)
#endif
@@ -685,7 +685,7 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
if (carma_emis_rate(ilev) <= 0.0) then
carma_emis_ilev_min = ilev + 1
else
- exit
+ exit
endif
end do
@@ -693,7 +693,7 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
if (carma_emis_rate(ilev) <= 0.0) then
carma_emis_ilev_max = ilev - 1
else
- exit
+ exit
endif
end do
@@ -703,21 +703,21 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
carma_emis_ilev_incr = -1
tmp = carma_emis_ilev_min
carma_emis_ilev_min = carma_emis_ilev_max
- carma_emis_iLev_max = tmp
+ carma_emis_iLev_max = tmp
endif
if (do_print) write(LUNOPRT,*) ''
if (do_print) write(LUNOPRT,*) 'carma_init(): carma_emis_nLevs = ', carma_emis_nLevs
- if (do_print) write(LUNOPRT,*) 'carma_init(): carma_emis_ilev_min = ', carma_emis_ilev_min
- if (do_print) write(LUNOPRT,*) 'carma_init(): carma_emis_ilev_max = ', carma_emis_ilev_max
- if (do_print) write(LUNOPRT,*) 'carma_init(): carma_emis_ilev_incr = ', carma_emis_ilev_incr
+ if (do_print) write(LUNOPRT,*) 'carma_init(): carma_emis_ilev_min = ', carma_emis_ilev_min
+ if (do_print) write(LUNOPRT,*) 'carma_init(): carma_emis_ilev_max = ', carma_emis_ilev_max
+ if (do_print) write(LUNOPRT,*) 'carma_init(): carma_emis_ilev_incr = ', carma_emis_ilev_incr
if (do_print) write(LUNOPRT,*) ''
-
+
if (do_print) write(LUNOPRT,*) 'level, pressure (Pa), emission rate (# cm-3 sec-1)'
do ilev = carma_emis_ilev_min, carma_emis_ilev_max, carma_emis_ilev_incr
if (do_print) write(LUNOPRT,*) ilev, carma_emis_lev(ilev), carma_emis_rate(ilev)
enddo
-
+
if (do_print) write(LUNOPRT, *) 'carma_init(): Total Emission = ', carma_emis_total, ' (kt/yr)'
carma_emis_expected = ((carma_emis_total * 1e6_r8) / (3600.0_r8 * 24.0_r8 * 365.0_r8)) / &
(4.0_r8 * PI * ((REARTH / 100._r8) ** 2))
@@ -737,10 +737,10 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
#endif
endif
-
+
! Initialize the emissions scaling table.
- if (carma_do_escale) then
+ if (carma_do_escale) then
if (masterproc) then
! Open the netcdf file (read only)
@@ -755,17 +755,17 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
call wrap_inq_dimid(fid, "time", time_did)
call wrap_inq_dimlen(fid, time_did, carma_escale_nTimes)
-
+
! There should be one time for each day of the year, so
! quit if it isn't correct.
if (carma_escale_nTimes .ne. 365) then
call endrun("CARMA_InitializeModel: Emission scaling file should have entries for 365 days, but doesn't.")
endif
-
+
call wrap_inq_dimid(fid, "ltime", ltime_did)
call wrap_inq_dimlen(fid, ltime_did, carma_escale_nLTimes)
endif
-
+
#if ( defined SPMD )
call mpibcast(carma_escale_nLats, 1, mpiint, 0, mpicom)
call mpibcast(carma_escale_nTimes, 1, mpiint, 0, mpicom)
@@ -794,7 +794,7 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
call wrap_inq_varid(fid, 'ltime', ltime_vid)
call wrap_get_var_realx(fid, ltime_vid, carma_escale_ltime)
-
+
! Close the file.
call wrap_close(fid)
@@ -803,7 +803,7 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
if (do_print) write(LUNOPRT,*) 'carma_init(): carma_escale_nTimes = ', carma_escale_nTimes
if (do_print) write(LUNOPRT,*) 'carma_init(): carma_escale_nLTimes = ', carma_escale_nLTimes
if (do_print) write(LUNOPRT,*) ''
-
+
if (do_print) write(LUNOPRT,*) 'carma_init(): Done with emission scaling tables.'
endif
@@ -816,7 +816,7 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
#endif
endif
-
+
return
end subroutine CARMA_InitializeModel
@@ -832,7 +832,6 @@ end subroutine CARMA_InitializeModel
!! @version May-2009
subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask, q, rc)
use shr_kind_mod, only: r8 => shr_kind_r8
- use pmgrid, only: plat, plev, plon
implicit none
@@ -854,18 +853,18 @@ subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask,
return
end subroutine CARMA_InitializeParticle
-
-
+
+
!! Called after wet deposition has been performed. Allows the specific model to add
!! wet deposition of CARMA aerosols to the aerosols being communicated to the surface.
!!
- !! @version July-2011
- !! @author Chuck Bardeen
+ !! @version July-2011
+ !! @author Chuck Bardeen
subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
use camsrfexch, only: cam_out_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -873,13 +872,13 @@ subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
type(cam_out_t), intent(inout) :: cam_out !! cam output to surface models
type(physics_state), intent(in) :: state !! physics state variables
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
integer :: icol
-
+
! Default return code.
rc = RC_OK
-
+
return
- end subroutine CARMA_WetDeposition
+ end subroutine CARMA_WetDeposition
end module
diff --git a/src/physics/carma/models/sea_salt/carma_model_mod.F90 b/src/physics/carma/models/sea_salt/carma_model_mod.F90
index d26452d58a..db01fb4b00 100644
--- a/src/physics/carma/models/sea_salt/carma_model_mod.F90
+++ b/src/physics/carma/models/sea_salt/carma_model_mod.F90
@@ -15,7 +15,7 @@
!! - WeibullWind()
!!
!! @version Dec-2010
-!! @author Tianyi Fan, Chuck Bardeen
+!! @author Tianyi Fan, Chuck Bardeen
module carma_model_mod
use carma_precision_mod
@@ -81,22 +81,22 @@ module carma_model_mod
!! Defines all the CARMA components (groups, elements, solutes and gases) and process
!! (coagulation, growth, nucleation) that will be part of the microphysical model.
!!
- !! @version May-2009
- !! @author Chuck Bardeen
+ !! @version May-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DefineModel(carma, rc)
type(carma_type), intent(inout) :: carma !! the carma object
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
! Local variables
integer :: LUNOPRT ! logical unit number for output
logical :: do_print ! do print output?
real(kind=f), parameter :: RHO_SALT = 2.65_f ! dry density of sea salt particles (g/cm)
real(kind=f), parameter :: rmin = 1e-6_f ! minimum radius (cm)
real(kind=f), parameter :: vmrat = 4.32_f ! volume ratio
-
+
! Default return code.
rc = RC_OK
-
+
! Report model specific configuration parameters.
if (masterproc) then
call CARMA_Get(carma, rc, do_print=do_print, LUNOPRT=LUNOPRT)
@@ -106,8 +106,8 @@ subroutine CARMA_DefineModel(carma, rc)
if (do_print) write(LUNOPRT,*) 'CARMA ', trim(carma_model), ' specific settings :'
if (do_print) write(LUNOPRT,*) ' carma_seasalt_emis = ', trim(carma_seasalt_emis)
end if
-
-
+
+
! Define the Groups
!
! NOTE: For CAM, the optional do_wetdep and do_drydep flags should be
@@ -119,23 +119,23 @@ subroutine CARMA_DefineModel(carma, rc)
irhswcomp=I_SWG_SEA_SALT)
if (rc < 0) call endrun('CARMA_DefineModel::CARMA_AddGroup failed.')
-
+
! Define the Elements
!
! NOTE: For CAM, the optional shortname needs to be provided for the group. These names
! should be 6 characters or less and without spaces.
call CARMAELEMENT_Create(carma, 1, 1, "sea salt", RHO_SALT, I_INVOLATILE, I_SEA_SALT, rc, shortname="SALT")
if (rc < 0) call endrun('CARMA_DefineModel::CARMA_AddElement failed.')
-
-
+
+
! Define the Solutes
-
-
+
+
! Define the Gases
-
-
+
+
! Define the Processes
-
+
return
end subroutine CARMA_DefineModel
@@ -143,8 +143,8 @@ end subroutine CARMA_DefineModel
!! Defines all the CARMA components (groups, elements, solutes and gases) and process
!! (coagulation, growth, nucleation) that will be part of the microphysical model.
!!
- !! @version May-2009
- !! @author Chuck Bardeen
+ !! @version May-2009
+ !! @author Chuck Bardeen
!!
!! @see CARMASTATE_SetDetrain
subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq, prec_str, snow_str, &
@@ -163,22 +163,22 @@ subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq,
real(r8), intent(in) :: dt !! time step (s)
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(out), optional :: tnd_qsnow(pcols,pver) !! snow mass tendency (kg/kg/s)
real(r8), intent(out), optional :: tnd_nsnow(pcols,pver) !! snow number tendency (#/kg/s)
! Default return code.
rc = RC_OK
-
+
return
end subroutine CARMA_Detrain
!! For diagnostic groups, sets up up the CARMA bins based upon the CAM state.
!!
- !! @version July-2009
- !! @author Chuck Bardeen
+ !! @version July-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, prec_str, snow_str)
use time_manager, only: is_first_step
@@ -192,32 +192,32 @@ subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, pr
real(r8), intent(in) :: dt !! time step
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(in), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
-
+
real(r8) :: mmr(pver) !! elements mass mixing ratio
integer :: ibin !! bin index
-
+
! Default return code.
rc = RC_OK
-
+
! By default, do nothing. If diagnosed groups exist, this needs to be replaced by
! code to determine the mass in each bin from the CAM state.
-
+
return
end subroutine CARMA_DiagnoseBins
!! For diagnostic groups, determines the tendencies on the CAM state from the CARMA bins.
!!
- !! @version July-2009
- !! @author Chuck Bardeen
+ !! @version July-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol, dt, rc, rliq, prec_str, snow_str, &
prec_sed, snow_sed, tnd_qsnow, tnd_nsnow, re_ice)
use camsrfexch, only: cam_out_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(cam_out_t), intent(inout) :: cam_out !! cam output to surface models
@@ -228,20 +228,20 @@ subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol,
real(r8), intent(in) :: dt !! time step
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(inout), optional :: prec_sed(pcols) !! total precip from cloud sedimentation (m/s)
real(r8), intent(inout), optional :: snow_sed(pcols) !! snow from cloud ice sedimentation (m/s)
real(r8), intent(inout), optional :: tnd_qsnow(pcols,pver) !! snow mass tendency (kg/kg/s)
real(r8), intent(inout), optional :: tnd_nsnow(pcols,pver) !! snow number tendency (#/kg/s)
real(r8), intent(out), optional :: re_ice(pcols,pver) !! ice effective radius (m)
-
+
! Default return code.
rc = RC_OK
-
+
! By default, do nothing. If diagnosed groups exist, this needs to be replaced by
! code to determine the bulk mass from the CARMA state.
-
+
return
end subroutine CARMA_DiagnoseBulk
@@ -258,9 +258,9 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
use physics_types, only: physics_state
use phys_grid, only: get_lon_all_p, get_lat_all_p
use camsrfexch, only: cam_in_t
-
+
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -271,17 +271,15 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
real(r8), intent(out) :: tendency(pcols, pver) !! constituent tendency (kg/kg/s)
real(r8), intent(out) :: surfaceFlux(pcols) !! constituent surface flux (kg/m^2/s)
integer, intent(out) :: rc !! return code, negative indicates failure
-
- integer :: ilat(pcols) ! latitude index
- integer :: ilon(pcols) ! longitude index
+
integer :: lchnk ! chunk identifier
integer :: ncol ! number of columns in chunk
integer :: icol ! column index
integer :: igroup ! the index of the carma aerosol group
character(len=32) :: shortname ! the shortname of the group
-
+
! -------- local variables added for sea salt model ------------
- real(r8) :: rdrycm, rdry ! dry radius [cm], [um]
+ real(r8) :: rdrycm, rdry ! dry radius [cm], [um]
real(r8) :: r80cm, r80 ! wet radius at relatige humidity of 80% [cm]
real(r8) :: ncflx ! dF/dr [#/m2/s/um]
real(r8) :: Monahan, Clarke, Smith ! dF/dr [#/m2/s/um]
@@ -303,103 +301,103 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
! -------------------------------------------------------------------------------------------------
real(r8), parameter :: c41 = -2.576e35_r8
real(r8), parameter :: c42 = -2.452e33_r8
- real(r8), parameter :: c43 = 1.085e29_r8
+ real(r8), parameter :: c43 = 1.085e29_r8
real(r8), parameter :: c31 = 5.932e28_r8
real(r8), parameter :: c32 = 2.404e27_r8
- real(r8), parameter :: c33 = -9.841e23_r8
- real(r8), parameter :: c21 = -2.867e21_r8
- real(r8), parameter :: c22 = -8.148e20_r8
- real(r8), parameter :: c23 = 3.132e18_r8
+ real(r8), parameter :: c33 = -9.841e23_r8
+ real(r8), parameter :: c21 = -2.867e21_r8
+ real(r8), parameter :: c22 = -8.148e20_r8
+ real(r8), parameter :: c23 = 3.132e18_r8
real(r8), parameter :: c11 = -3.003e13_r8
- real(r8), parameter :: c12 = 1.183e14_r8
- real(r8), parameter :: c13 = -4.165e12_r8
+ real(r8), parameter :: c12 = 1.183e14_r8
+ real(r8), parameter :: c13 = -4.165e12_r8
real(r8), parameter :: c01 = -2.881e6_r8
real(r8), parameter :: c02 = -6.743e6_r8
- real(r8), parameter :: c03 = 2.181e6_r8
+ real(r8), parameter :: c03 = 2.181e6_r8
real(r8), parameter :: d41 = 7.188e37_r8
real(r8), parameter :: d42 = 7.368e35_r8
- real(r8), parameter :: d43 = -2.859e31_r8
+ real(r8), parameter :: d43 = -2.859e31_r8
real(r8), parameter :: d31 =-1.616e31_r8
real(r8), parameter :: d32 =-7.310e29_r8
- real(r8), parameter :: d33 = 2.601e26_r8
+ real(r8), parameter :: d33 = 2.601e26_r8
real(r8), parameter :: d21 = 6.791e23_r8
real(r8), parameter :: d22 = 2.528e23_r8
- real(r8), parameter :: d23 =-8.297e20_r8
+ real(r8), parameter :: d23 =-8.297e20_r8
real(r8), parameter :: d11 = 1.829e16_r8
real(r8), parameter :: d12 =-3.787e16_r8
- real(r8), parameter :: d13 = 1.105e15_r8
+ real(r8), parameter :: d13 = 1.105e15_r8
real(r8), parameter :: d01 = 7.609e8_r8
real(r8), parameter :: d02 = 2.279e9_r8
real(r8), parameter :: d03 =-5.800e8_r8
-
- real(r8) :: rpdry ! dry radius
+
+ real(r8) :: rpdry ! dry radius
real(r8) :: Ak1 ! Coefficient Ak in Martensson's source function
- real(r8) :: Ak2
- real(r8) :: Ak3
+ real(r8) :: Ak2
+ real(r8) :: Ak3
real(r8) :: Bk1 ! Coefficient Bk in Martensson's source function
real(r8) :: Bk2
real(r8) :: Bk3
Ak1(rpdry)= c41*(2._r8*rpdry)**4 + c31*(2._r8*rpdry) ** 3 + c21*(2._r8*rpdry)**2 + c11*(2._r8*rpdry)+ c01
Ak2(rpdry)= c42*(2._r8*rpdry)**4 + c32*(2._r8*rpdry) ** 3 + c22*(2._r8*rpdry)**2 + c12*(2._r8*rpdry)+ c02
- Ak3(rpdry)= c43*(2._r8*rpdry)**4 + c33*(2._r8*rpdry) ** 3 + c23*(2._r8*rpdry)**2 + c13*(2._r8*rpdry)+ c03
+ Ak3(rpdry)= c43*(2._r8*rpdry)**4 + c33*(2._r8*rpdry) ** 3 + c23*(2._r8*rpdry)**2 + c13*(2._r8*rpdry)+ c03
Bk1(rpdry)= d41*(2._r8*rpdry)**4 + d31*(2._r8*rpdry) ** 3 + d21*(2._r8*rpdry)**2 + d11*(2._r8*rpdry)+ d01
Bk2(rpdry)= d42*(2._r8*rpdry)**4 + d32*(2._r8*rpdry) ** 3 + d22*(2._r8*rpdry)**2 + d12*(2._r8*rpdry)+ d02
Bk3(rpdry)= d43*(2._r8*rpdry)**4 + d33*(2._r8*rpdry) ** 3 + d23*(2._r8*rpdry)**2 + d13*(2._r8*rpdry)+ d03
-
+
! ------------------------------------------------------------
! ---- Clarke Source Function. Coefficients for Ai -------
! ------------------------------------------------------------
real(r8), parameter :: beta01 =-5.001e3_r8
real(r8), parameter :: beta11 = 0.808e6_r8
- real(r8), parameter :: beta21 =-1.980e7_r8
+ real(r8), parameter :: beta21 =-1.980e7_r8
real(r8), parameter :: beta31 = 2.188e8_r8
real(r8), parameter :: beta41 =-1.144e9_r8
- real(r8), parameter :: beta51 = 2.290e9_r8
+ real(r8), parameter :: beta51 = 2.290e9_r8
real(r8), parameter :: beta02 = 3.854e3_r8
real(r8), parameter :: beta12 = 1.168e4_r8
real(r8), parameter :: beta22 =-6.572e4_r8
real(r8), parameter :: beta32 = 1.003e5_r8
real(r8), parameter :: beta42 =-6.407e4_r8
- real(r8), parameter :: beta52 = 1.493e4_r8
+ real(r8), parameter :: beta52 = 1.493e4_r8
real(r8), parameter :: beta03 = 4.498e2_r8
real(r8), parameter :: beta13 = 0.839e3_r8
real(r8), parameter :: beta23 =-5.394e2_r8
real(r8), parameter :: beta33 = 1.218e2_r8
real(r8), parameter :: beta43 =-1.213e1_r8
- real(r8), parameter :: beta53 = 4.514e-1_r8
+ real(r8), parameter :: beta53 = 4.514e-1_r8
real(r8) :: A1 ! Coefficient Ak in Clarkes's source function
- real(r8) :: A2
- real(r8) :: A3
+ real(r8) :: A2
+ real(r8) :: A3
A1(rpdry) = beta01 + beta11*(2._r8*rpdry) + beta21*(2._r8*rpdry)**2 + &
beta31*(2._r8*rpdry)**3 + beta41*(2._r8*rpdry)**4 + beta51*(2._r8*rpdry)**5
A2(rpdry) = beta02 + beta12*(2._r8*rpdry) + beta22*(2._r8*rpdry)**2 + &
beta32*(2._r8*rpdry)**3 + beta42*(2._r8*rpdry)**4 + beta52*(2._r8*rpdry)**5
A3(rpdry) = beta03 + beta13*(2._r8*rpdry) + beta23*(2._r8*rpdry)**2 + &
beta33*(2._r8*rpdry)**3 + beta43*(2._r8*rpdry)**4 + beta53*(2._r8*rpdry)**5
-
+
! ---------------------------------------------
! coefficient A1, A2 in Andreas's Source funcion
! ---------------------------------------------
- real(r8) ::A1A92
- real(r8) ::A2A92
-
+ real(r8) ::A1A92
+ real(r8) ::A2A92
+
! ---------------------------------------------
! coefficient in Smith's Source funcion
- ! ---------------------------------------------
- real(r8), parameter :: f1 = 3.1_r8
+ ! ---------------------------------------------
+ real(r8), parameter :: f1 = 3.1_r8
real(r8), parameter :: f2 = 3.3_r8
real(r8), parameter :: r1 = 2.1_r8
real(r8), parameter :: r2 = 9.2_r8
real(r8), parameter :: delta = 10._r8
-
+
+ ! --------------------------------------------------------------------
+ ! ---- constants in calculating the particle wet radius [Gerber, 1985]
! --------------------------------------------------------------------
- ! ---- constants in calculating the particle wet radius [Gerber, 1985]
- ! --------------------------------------------------------------------
real(r8), parameter :: c1 = 0.7674_r8 ! .
real(r8), parameter :: c2 = 3.079_r8 ! .
real(r8), parameter :: c3 = 2.573e-11_r8 ! .
real(r8), parameter :: c4 = -1.424_r8 ! constants in calculating the particel wet radius
-
+
! Default return code.
rc = RC_OK
@@ -407,25 +405,22 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
lchnk = state%lchnk
ncol = state%ncol
- call get_lat_all_p(lchnk, ncol, ilat)
- call get_lon_all_p(lchnk, ncol, ilon)
-
! Add any surface flux here.
surfaceFlux(:ncol) = 0.0_r8
-
+
! For emissions into the atmosphere, put the emission here.
!
! NOTE: Do not set tendency to be the surface flux. Surface source is put in to
- ! the bottom layer by vertical diffusion. See vertical_solver module, line 355.
+ ! the bottom layer by vertical diffusion. See vertical_solver module, line 355.
tendency(:ncol, :pver) = 0.0_r8
-
-
+
+
call CARMAELEMENT_GET(carma, ielem, rc, igroup=igroup)
if (RC < RC_ERROR) return
-
+
call CARMAGROUP_GET(carma, igroup, rc, shortname=shortname, r=r, dr=dr, rmass=rmass)
if (RC < RC_ERROR) return
-
+
if (shortname .eq. "SALT") then
! Are we configured for one of the known emission schemes?
@@ -437,174 +432,174 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
carma_seasalt_emis .ne. "CMS" .and. &
carma_seasalt_emis .ne. "NONE" .and. &
carma_seasalt_emis .ne. "CONST" ) then
-
+
call endrun('carma_EmitParticle:: Invalid sea salt emission scheme.')
end if
-
+
+ !**********************************
+ ! wet sea salt radius at RH = 80%
!**********************************
- ! wet sea salt radius at RH = 80%
- !**********************************
r80cm = (c1 * (r(ibin)) ** c2 / (c3 * r(ibin) ** c4 - log10(0.8)) + (r(ibin))**3) ** (1./3.) ! [cm]
- rdrycm = r(ibin) ! [cm]
+ rdrycm = r(ibin) ! [cm]
r80 = r80cm *1.e4_r8 ! [um]
rdry = rdrycm*1.e4_r8 ! [um]
-
+
do icol = 1,ncol
-
+
! Only generate sea salt over the ocean.
if (cam_in%ocnfrac(icol) > 0._r8) then
-
+
!**********************************
! WIND for seasalt production
- !**********************************
- call CARMA_SurfaceWind(carma, state, icol, ilat(icol), ilon(icol), cam_in, u10in, rc)
-
- ! Add any surface flux here.
+ !**********************************
+ call CARMA_SurfaceWind(carma, state, icol, cam_in, u10in, rc)
+
+ ! Add any surface flux here.
ncflx = 0.0_r8
- Monahan = 0.0_r8
+ Monahan = 0.0_r8
Clarke = 0.0_r8
- Smith = 0.0_r8
-
+ Smith = 0.0_r8
+
!**********************************
! Whitecap Coverage
!**********************************
wcap = 3.84e-6_r8 * u10in ** 3.41_r8 ! in percent, ie., 75%, wcap = 0.75
-
+
!****************************************
! Hoppel correction factor
! Smith drag coefficients and etc
!****************************************
if (u10in .le. 10._r8) then
- cd_smith = 1.14e-3_r8
+ cd_smith = 1.14e-3_r8
else
cd_smith = (0.49_r8 + 0.065_r8 * u10in) * 1.e-3_r8
end if
-
+
ustar_smith = cd_smith **0.5_r8 * u10in
-
+
! We don't have vg yet, since that is calculated by CARMA. That will require
! a different interface for the emissions, storing vg in the physics buffer,
! and/or doing some duplicate calculations for vg assuming 80% RH.
! fref = (delta/state%zm(icol, pver))**(vg(icol, ibin, igelem(i))/(xkar*ustar_smith))
fref = 1.0_r8
-
+
!**********************************
! Source Functions
!**********************************
if (carma_seasalt_emis .eq. 'NONE') then
ncflx = 0._r8
end if
-
+
if (carma_seasalt_emis .eq. 'CONST') then
ncflx = 1.e-5_r8
end if
-
+
!-------Gong source function------
- if (carma_seasalt_emis == "Gong") then
- sita_para = 30
+ if (carma_seasalt_emis == "Gong") then
+ sita_para = 30
A_para = - 4.7_r8 * (1+ sita_para * r80) ** (- 0.017_r8 * r80** (-1.44_r8))
- B_para = (0.433_r8 - log10(r80)) / 0.433_r8
+ B_para = (0.433_r8 - log10(r80)) / 0.433_r8
ncflx = 1.373_r8* u10in ** 3.41_r8 * r80 ** A_para * &
(1._r8 + 0.057_r8 * r80**3.45_r8) * 10._r8 ** (1.607_r8 * exp(- B_para **2))
! if (do_print) write(LUNOPRT, *) "Gong: ncflx = ", ncflx, ", u10n = ", u10in
end if
-
+
!------Martensson source function-----
- if (carma_seasalt_emis == "Martensson") then
+ if (carma_seasalt_emis == "Martensson") then
if (rdry .le. 0.0725_r8) then
ncflx = (Ak1(rdry*1.0e-6_r8)* (25._r8+273._r8) + Bk1(rdry*1.0e-6_r8)) * wcap ! dF/dlogr [#/s/m2]
- ncflx = ncflx / (2.30258509_r8 * rdry) ! dF/dr [#/s/m2/um]
- elseif (rdry .gt. 0.0725_r8 .and. rdry .le. 0.2095_r8) then
+ ncflx = ncflx / (2.30258509_r8 * rdry) ! dF/dr [#/s/m2/um]
+ elseif (rdry .gt. 0.0725_r8 .and. rdry .le. 0.2095_r8) then
ncflx = (Ak2(rdry*1.0e-6_r8)* (25._r8+273._r8) + Bk2(rdry*1.0e-6_r8)) * wcap ! dF/dlogr [#/s/m2]
ncflx = ncflx / (2.30258509_r8 * rdry) ! dF/dr [#/s/m2/um]
- elseif (rdry .gt. 0.2095_r8 .and. rdry .le. 1.4_r8) then
+ elseif (rdry .gt. 0.2095_r8 .and. rdry .le. 1.4_r8) then
ncflx = (Ak3(rdry*1.0e-6_r8)* (25._r8+273._r8) + Bk3(rdry*1.0e-6_r8)) * wcap ! dF/dlogr [#/s/m2]
- ncflx = ncflx / (2.30258509_r8 * rdry) ! dF/dr [#/s/m2/um]
- else
+ ncflx = ncflx / (2.30258509_r8 * rdry) ! dF/dr [#/s/m2/um]
+ else
ncflx = 0._r8
end if
end if
-
- !-------Clarke source function-------
- if (carma_seasalt_emis == "Clarke")then
+
+ !-------Clarke source function-------
+ if (carma_seasalt_emis == "Clarke")then
if (rdry .lt. 0.066_r8) then
- ncflx = A1(rdry) * 1.e4_r8 * wcap ! dF/dlogr [#/s/m2]
+ ncflx = A1(rdry) * 1.e4_r8 * wcap ! dF/dlogr [#/s/m2]
ncflx = ncflx / (2.30258509_r8 * rdry) ! dF/dr [#/s/m2/um]
- elseif (rdry .ge. 0.066_r8 .and. rdry .lt. 0.6_r8) then
- ncflx = A2(rdry) * 1.e4_r8 * wcap ! dF/dlogr [#/s/m2]
+ elseif (rdry .ge. 0.066_r8 .and. rdry .lt. 0.6_r8) then
+ ncflx = A2(rdry) * 1.e4_r8 * wcap ! dF/dlogr [#/s/m2]
ncflx = ncflx / (2.30258509_r8 * rdry) ! dF/dr [#/s/m2/um]
- elseif (rdry .ge. 0.6_r8 .and. rdry .lt. 4.0_r8) then
- ncflx = A3(rdry) * 1.e4_r8 * wcap ! dF/dlogr [#/s/m2]
+ elseif (rdry .ge. 0.6_r8 .and. rdry .lt. 4.0_r8) then
+ ncflx = A3(rdry) * 1.e4_r8 * wcap ! dF/dlogr [#/s/m2]
ncflx= ncflx / (2.30258509_r8 * rdry) ! dF/dr [#/s/m2/um]
else
ncflx = 0._r8
- end if
+ end if
end if
-
+
!-----------Caffrey source function------------
- if (carma_seasalt_emis == "Caffrey") then
-
- !Monahan
+ if (carma_seasalt_emis == "Caffrey") then
+
+ !Monahan
B_mona = (0.38_r8 - log10(r80)) / 0.65_r8
Monahan = 1.373_r8 * (u10in**3.41_r8) * r80**(-3._r8) * &
(1._r8 + 0.057 *r80**1.05_r8) * 10._r8 ** (1.19_r8 * exp(-1. * B_mona**2)) ! dF/dr
-
+
!Smith
u14 = u10in * (1._r8 + cd_smith**0.5_r8 / xkar * log(14._r8 / 10._r8)) ! 14 meter wind
A1A92 = 10._r8 ** (0.0676_r8 * u14 + 2.430_r8)
- A2A92 = 10._r8 ** (0.9590_r8 * u14**0.5_r8 - 1.476_r8)
+ A2A92 = 10._r8 ** (0.9590_r8 * u14**0.5_r8 - 1.476_r8)
Smith = A1A92*exp(-f1 *(log(r80/r1))**2) + A2A92*exp(-f2 * (log(r80/r2))**2) ! dF/dr [#/m2/s/um]
-
+
!Caffrey based on Monahan and Smith
- W_Caff = 1.136_r8 **(-1._r8 * rdry ** (-0.855_r8))*(1._r8 + 0.2_r8/rdry)
+ W_Caff = 1.136_r8 **(-1._r8 * rdry ** (-0.855_r8))*(1._r8 + 0.2_r8/rdry)
if (rdry .lt. 0.15_r8) then
ncflx = Monahan
- else
+ else
if (u10in .le. 9._r8) then
- ncflx = Monahan
+ ncflx = Monahan
else
if(Monahan .ge. Smith) then
- ncflx = Monahan
+ ncflx = Monahan
else
- ncflx = Smith
+ ncflx = Smith
end if
end if
end if
-
+
ncflx = ncflx * W_Caff
-
+
!%%%%%%%%%%%%%%%%%%%%%%%%%
! Apply Hoppel correction
!%%%%%%%%%%%%%%%%%%%%%%%%%
- ncflx = ncflx * fref
+ ncflx = ncflx * fref
end if
!--------CMS (Clarke, Monahan, and Smith source function)-------
- if (carma_seasalt_emis == "CMS") then
-
- !Clarke
+ if (carma_seasalt_emis == "CMS") then
+
+ !Clarke
if (rdry .lt. 0.066_r8) then
- Clarke = A1(rdry) * 1.e4_r8 * wcap ! dF/dlogr [#/s/m2]
+ Clarke = A1(rdry) * 1.e4_r8 * wcap ! dF/dlogr [#/s/m2]
Clarke = Clarke / (2.30258509_r8 * rdry) ! dF/dr [#/s/m2/um]
- elseif ((rdry .ge. 0.066_r8) .and. (rdry .lt. 0.6_r8)) then
- Clarke = A2(rdry) * 1.e4_r8 * wcap ! dF/dlogr [#/s/m2]
+ elseif ((rdry .ge. 0.066_r8) .and. (rdry .lt. 0.6_r8)) then
+ Clarke = A2(rdry) * 1.e4_r8 * wcap ! dF/dlogr [#/s/m2]
Clarke = Clarke / (2.30258509_r8 * rdry) ! dF/dr [#/s/m2/um]
- elseif ((rdry .ge. 0.6_r8) .and. (rdry .lt. 4.0_r8)) then
- Clarke = A3(rdry) * 1.e4_r8 * wcap ! dF/dlogr [#/s/m2]
+ elseif ((rdry .ge. 0.6_r8) .and. (rdry .lt. 4.0_r8)) then
+ Clarke = A3(rdry) * 1.e4_r8 * wcap ! dF/dlogr [#/s/m2]
Clarke= Clarke / (2.30258509_r8 * rdry) ! dF/dr [#/s/m2/um]
- end if
-
- !Monahan
- B_Mona = (0.38_r8 - log10(r80)) / 0.65_r8
+ end if
+
+ !Monahan
+ B_Mona = (0.38_r8 - log10(r80)) / 0.65_r8
Monahan = 1.373_r8 * u10in ** 3.41_r8 * r80 ** (-3._r8) * &
(1._r8 + 0.057_r8 * r80**1.05_r8) * 10._r8 ** (1.19_r8 * exp(- B_Mona **2))
-
+
!Smith
u14 = u10in * (1._r8 + cd_smith**0.5_r8 / xkar*log(14._r8 / 10._r8)) ! 14 meter wind
A1A92 = 10._r8 ** (0.0676_r8 * u14 + 2.430_r8)
- A2A92 = 10._r8 ** (0.9590_r8 * u14**0.5_r8 - 1.476_r8)
+ A2A92 = 10._r8 ** (0.9590_r8 * u14**0.5_r8 - 1.476_r8)
Smith = A1A92*exp(-f1 *(log(r80 / r1))**2) + A2A92*exp(-f2 * (log(r80 / r2))**2) ! dF/dr [#/m2/s/um]
-
+
!%%%%%%%%%%%%%%%%%%%%%%%%%
! CMS1 or CMS2
!%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -613,8 +608,8 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
if (rdry .lt. 1._r8) then ! cut at 1.0 um
! ***CMS2*****
! if (rdry .lt. 2._r8) then ! cut at 2.0 um
- ncflx = Clarke
- else
+ ncflx = Clarke
+ else
if (u10in .lt. 9._r8) then
ncflx = Monahan
else
@@ -625,14 +620,14 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
end if
end if
end if
-
+
!%%%%%%%%%%%%%%%%%%%%%%%%%
! Apply Hoppel correction
- !%%%%%%%%%%%%%%%%%%%%%%%%%
- ncflx = ncflx * fref
+ !%%%%%%%%%%%%%%%%%%%%%%%%%
+ ncflx = ncflx * fref
end if
- ! convert ncflx [#/m^2/s/um] to surfaceFlx [kg/m^2/s]
+ ! convert ncflx [#/m^2/s/um] to surfaceFlx [kg/m^2/s]
surfaceFlux(icol) = ncflx * dr(ibin) * rmass(ibin) * 10._r8 ! *1e4[um/cm] * 1.e-3[kg/g]
! if (do_print) write(LUNOPRT, *) "ibin = ", ibin, ", igroup = ", igroup
@@ -640,11 +635,11 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
! if (do_print) write(LUNOPRT, *) "ncflx = " , ncflx, ", surfaceFlux = ", surfaceFlux(icol)
! weighted by the ocean fraction
- surfaceFlux(icol) = surfaceFlux(icol) * cam_in%ocnfrac(icol)
+ surfaceFlux(icol) = surfaceFlux(icol) * cam_in%ocnfrac(icol)
end if
end do
end if
-
+
return
end subroutine CARMA_EmitParticle
@@ -667,7 +662,7 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
rc = RC_OK
! Add initialization here.
-
+
return
end subroutine CARMA_InitializeModel
@@ -683,7 +678,6 @@ end subroutine CARMA_InitializeModel
!! @version May-2009
subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask, q, rc)
use shr_kind_mod, only: r8 => shr_kind_r8
- use pmgrid, only: plat, plev, plon
implicit none
@@ -705,18 +699,18 @@ subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask,
return
end subroutine CARMA_InitializeParticle
-
+
!! Called after wet deposition has been performed. Allows the specific model to add
!! wet deposition of CARMA aerosols to the aerosols being communicated to the surface.
!!
- !! @version July-2011
- !! @author Chuck Bardeen
+ !! @version July-2011
+ !! @author Chuck Bardeen
subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
use camsrfexch, only: cam_out_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -724,37 +718,35 @@ subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
type(cam_out_t), intent(inout) :: cam_out !! cam output to surface models
type(physics_state), intent(in) :: state !! physics state variables
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
integer :: icol
-
+
! Default return code.
rc = RC_OK
-
+
return
- end subroutine CARMA_WetDeposition
+ end subroutine CARMA_WetDeposition
!! Calculate the sea surface wind with a Weibull distribution.
!!
!! @author Tianyi Fan
!! @version August-2010
- subroutine CARMA_SurfaceWind(carma, state, icol, ilat, ilon, cam_in, u10in, rc)
+ subroutine CARMA_SurfaceWind(carma, state, icol, cam_in, u10in, rc)
use ppgrid, only: pcols, pver
use physics_types, only: physics_state
use camsrfexch, only: cam_in_t
-
+
implicit none
! in and out field
type(carma_type), intent(in) :: carma !! the carma object
type(physics_state), intent(in) :: state !! physics state
integer, intent(in) :: icol !! column index
- integer, intent(in) :: ilat !! latitude index
- integer, intent(in) :: ilon !! longitude index
type(cam_in_t), intent(in) :: cam_in !! surface inputs
real(r8), intent(out) :: u10in !! the 10m wind speed put into the source function
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
! local variables
! the nth mean wind with integration using Weibull Distribution (integrate from threshold wind velocity)
real(r8) :: uWB341
@@ -763,9 +755,9 @@ subroutine CARMA_SurfaceWind(carma, state, icol, ilat, ilon, cam_in, u10in, rc)
uWB341 = 0._r8
- ! calc. the Weibull wind distribution
+ ! calc. the Weibull wind distribution
u10in = cam_in%u10(icol)
-
+
call WeibullWind(u10in, uth, 3.41_r8, uWB341)
! Asked for 3.41 moment of the wind, but return the first moment of the
@@ -779,7 +771,7 @@ end subroutine CARMA_SurfaceWind
!! Calculate the nth mean of u using Weibull wind distribution
!! considering the threshold wind velocity. This algorithm
!! integrates from uth to infinite (u^n P(u)du )
- !!
+ !!
!! @author Tianyi Fan
!! @version August-2010
subroutine WeibullWind(u, uth, n, uwb, wbk)
@@ -788,30 +780,30 @@ subroutine WeibullWind(u, uth, n, uwb, wbk)
igamma => shr_spfn_igamma
implicit none
-
+
real(r8), intent(in) :: u ! mean wind speed
real(r8), intent(in) :: uth ! threshold velocity
real(r8), intent(in) :: n ! the rank of u in the integration
real(r8), intent(out) :: uwb ! the Weibull distribution
real(r8), intent(in), optional :: wbk ! the shape parameter
-
+
! local variable
real(r8) :: k ! the shape parameter in Weibull distribution
real(r8) :: c ! the scale parameter in Weibull distribution
-
+
if (present(wbk)) then
k = wbk
else
k = 0.94*u**0.5_r8 ! follow Grini and Zender, 2004JGR
! k = 2.5_r8 ! Lansing's estimate
- end if
-
+ end if
+
! At some locations the k parameter is 0, not ocean which then
! makes the gamma functions unstable.
- if (k .eq. 0._r8) then
+ if (k .eq. 0._r8) then
c = u**n
else
- c = u * (gamma(1._r8 + 1._r8 / k))**(-1._r8)
+ c = u * (gamma(1._r8 + 1._r8 / k))**(-1._r8)
uwb = c**n * igamma(n / k + 1._r8, (uth / c)**k)
end if
diff --git a/src/physics/carma/models/sulfate/carma_model_mod.F90 b/src/physics/carma/models/sulfate/carma_model_mod.F90
index fb410e83c9..abf98d1820 100644
--- a/src/physics/carma/models/sulfate/carma_model_mod.F90
+++ b/src/physics/carma/models/sulfate/carma_model_mod.F90
@@ -11,7 +11,7 @@
!! - CARMA_EmitParticle()
!!
!! @version Dec-2010
-!! @author Tianyi Fan, Chuck Bardeen
+!! @author Tianyi Fan, Chuck Bardeen
module carma_model_mod
use carma_precision_mod
@@ -46,7 +46,7 @@ module carma_model_mod
public CARMA_InitializeModel
public CARMA_InitializeParticle
public CARMA_WetDeposition
-
+
! Declare public constants
integer, public, parameter :: NGROUP = 1 !! Number of particle groups
@@ -68,7 +68,7 @@ module carma_model_mod
! should have a unique number.
integer, public, parameter :: I_H2SO4 = 1 !! sulfate aerosol composition
integer, public, parameter :: I_WATER = 2 !! water
-
+
! Define group, element, solute and gas indexes.
integer, public, parameter :: I_GRP_SULFATE = 1 !! sulfate aerosol
@@ -88,17 +88,17 @@ module carma_model_mod
!! Defines all the CARMA components (groups, elements, solutes and gases) and process
!! (coagulation, growth, nucleation) that will be part of the microphysical model.
!!
- !! @version May-2009
- !! @author Chuck Bardeen
+ !! @version May-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DefineModel(carma, rc)
use physics_buffer, only: pbuf_add_field, dtype_r8
type(carma_type), intent(inout) :: carma !! the carma object
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
! Local variables
real(kind=f), parameter :: RHO_SULFATE = 1.923_f ! dry density of sulfate particles (g/cm3)
-! Set radius of smallest bin such that mass is that of 2 molecules of H2SO4:
+! Set radius of smallest bin such that mass is that of 2 molecules of H2SO4:
real(kind=f), parameter :: rmin = 3.43230298e-8_f ! minimum radius (cm)
real(kind=f), parameter :: vmrat = 2.4_f ! volume ratio
integer :: LUNOPRT
@@ -109,7 +109,7 @@ subroutine CARMA_DefineModel(carma, rc)
call CARMA_Get(carma, rc, do_print=do_print, LUNOPRT=LUNOPRT)
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMA_Get failed.')
-
+
! Report model specific configuration parameters.
if (masterproc) then
if (do_print) then
@@ -131,7 +131,7 @@ subroutine CARMA_DefineModel(carma, rc)
scavcoef=0.1_f, is_sulfate=.true., shortname="PURSUL")
if (rc < 0) call endrun('CARMA_DefineModel::CARMA_AddGroup failed.')
-
+
! Define the Elements
!
! NOTE: For CAM, the optional shortname needs to be provided for the group. These names
@@ -139,19 +139,19 @@ subroutine CARMA_DefineModel(carma, rc)
call CARMAELEMENT_Create(carma, I_ELEM_SULFATE, I_GRP_SULFATE, "Sulfate", RHO_SULFATE, &
I_VOLATILE, I_H2SO4, rc, shortname="PURSUL")
if (rc < 0) call endrun('CARMA_DefineModel::CARMA_AddElement failed.')
-
+
! Define the Solutes
-
-
+
+
! Define the Gases
call CARMAGAS_Create(carma, I_GAS_H2O, "Water Vapor", WTMOL_H2O, I_VAPRTN_H2O_MURPHY2005, I_GCOMP_H2O, &
rc, shortname = "Q", ds_threshold=-0.2_f)
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMAGAS_Create failed.')
-
+
call CARMAGAS_Create(carma, I_GAS_H2SO4, "Sulfuric Acid", WTMOL_H2SO4, I_VAPRTN_H2SO4_AYERS1980, &
I_GCOMP_H2SO4, rc, shortname = "H2SO4", ds_threshold=-0.2_f)
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMAGAS_Create failed.')
-
+
! Define the Processes
! Set H2SO4 to be the condensing gas, water vapor is assumed to be in equilibrium
@@ -166,7 +166,7 @@ subroutine CARMA_DefineModel(carma, rc)
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMA_AddCoagulation failed.')
call pbuf_add_field('SADSULF', 'global', dtype_r8, (/pcols, pver/), ipbuf4sad)
-
+
if (carma_rad_feedback) then
call pbuf_add_field('VOLC_RAD_GEOM', 'global', dtype_r8, (/pcols, pver/), ipbuf4reff)
call pbuf_add_field('VOLC_MMR', 'global', dtype_r8, (/pcols, pver/), ipbuf4so4mmr)
@@ -178,8 +178,8 @@ end subroutine CARMA_DefineModel
!! Defines all the CARMA components (groups, elements, solutes and gases) and process
!! (coagulation, growth, nucleation) that will be part of the microphysical model.
!!
- !! @version May-2009
- !! @author Chuck Bardeen
+ !! @version May-2009
+ !! @author Chuck Bardeen
!!
!! @see CARMASTATE_SetDetrain
subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq, prec_str, snow_str, &
@@ -198,22 +198,22 @@ subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq,
real(r8), intent(in) :: dt !! time step (s)
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(out), optional :: tnd_qsnow(pcols,pver) !! snow mass tendency (kg/kg/s)
real(r8), intent(out), optional :: tnd_nsnow(pcols,pver) !! snow number tendency (#/kg/s)
! Default return code.
rc = RC_OK
-
+
return
end subroutine CARMA_Detrain
!! For diagnostic groups, sets up up the CARMA bins based upon the CAM state.
!!
- !! @version July-2009
- !! @author Chuck Bardeen
+ !! @version July-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, prec_str, snow_str)
use time_manager, only: is_first_step
@@ -227,33 +227,33 @@ subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, pr
real(r8), intent(in) :: dt !! time step
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(in), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
-
+
real(r8) :: mmr(pver) !! elements mass mixing ratio
integer :: ibin !! bin index
-
+
! Default return code.
rc = RC_OK
-
+
! By default, do nothing. If diagnosed groups exist, this needs to be replaced by
! code to determine the mass in each bin from the CAM state.
-
+
return
end subroutine CARMA_DiagnoseBins
!! For diagnostic groups, determines the tendencies on the CAM state from the CARMA bins.
!!
- !! @version July-2009
- !! @author Chuck Bardeen
+ !! @version July-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol, dt, rc, rliq, prec_str, snow_str, &
prec_sed, snow_sed, tnd_qsnow, tnd_nsnow, re_ice)
use camsrfexch, only: cam_out_t
use physics_buffer, only: pbuf_get_field
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(cam_out_t), intent(inout) :: cam_out !! cam output to surface models
@@ -264,7 +264,7 @@ subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol,
real(r8), intent(in) :: dt !! time step
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(inout), optional :: prec_sed(pcols) !! total precip from cloud sedimentation (m/s)
real(r8), intent(inout), optional :: snow_sed(pcols) !! snow from cloud ice sedimentation (m/s)
@@ -308,11 +308,11 @@ subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol,
md(:) = md(:) + mmr(:) ! bin integrated stratospheric mass mixing ratio (kg/kg)
end if
end do
-
+
reff(:) = reff(:) / ad(:) ! wet effective radius in cm
reff(:) = reff(:) / 100.0_r8 ! cm -> m
ad(:) = ad(:) * 4.0_r8 * PI ! surface area density in cm2/cm3
-
+
call pbuf_get_field(pbuf, ipbuf4sad, sadsulf_ptr)
sadsulf_ptr(icol, :cstate%f_NZ) = ad(:cstate%f_NZ) ! stratospheric aerosol wet surface area density (cm2/cm3)
@@ -341,9 +341,9 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
use time_manager, only: get_curr_date, get_perp_date, get_curr_calday, &
is_perpetual
use camsrfexch, only: cam_in_t
-
+
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -354,13 +354,13 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
real(r8), intent(out) :: tendency(pcols, pver) !! constituent tendency (kg/kg/s)
real(r8), intent(out) :: surfaceFlux(pcols) !! constituent surface flux (kg/m^2/s)
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
! Default return code.
- rc = RC_OK
-
+ rc = RC_OK
+
! Add any surface flux here.
surfaceFlux = 0._r8
-
+
! For emissions into the atmosphere, put the emission here.
tendency = 0._r8
@@ -381,7 +381,7 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
logical, intent(inout) :: lq_carma(pcnst) !! flags to indicate whether the constituent
!! could have a CARMA tendency
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
! Default return code.
rc = RC_OK
@@ -400,7 +400,6 @@ end subroutine CARMA_InitializeModel
!! @version May-2009
subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask, q, rc)
use shr_kind_mod, only: r8 => shr_kind_r8
- use pmgrid, only: plat, plev, plon
implicit none
@@ -422,18 +421,18 @@ subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask,
return
end subroutine CARMA_InitializeParticle
-
-
+
+
!! Called after wet deposition has been performed. Allows the specific model to add
!! wet deposition of CARMA aerosols to the aerosols being communicated to the surface.
!!
- !! @version July-2011
- !! @author Chuck Bardeen
+ !! @version July-2011
+ !! @author Chuck Bardeen
subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
use camsrfexch, only: cam_out_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -441,13 +440,13 @@ subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
type(cam_out_t), intent(inout) :: cam_out !! cam output to surface models
type(physics_state), intent(in) :: state !! physics state variables
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
integer :: icol
-
+
! Default return code.
rc = RC_OK
-
+
return
- end subroutine CARMA_WetDeposition
+ end subroutine CARMA_WetDeposition
end module
diff --git a/src/physics/carma/models/test_growth/carma_model_mod.F90 b/src/physics/carma/models/test_growth/carma_model_mod.F90
index 527d917b70..ad57aed469 100644
--- a/src/physics/carma/models/test_growth/carma_model_mod.F90
+++ b/src/physics/carma/models/test_growth/carma_model_mod.F90
@@ -1,4 +1,4 @@
-!! This module is used to define a particular CARMA microphysical model. For
+!! This module is used to define a particular CARMA microphysical model. For
!! simple cases, this may be the only code that needs to be modified. This module
!! defines several constants and has three methods:
!!
@@ -15,8 +15,8 @@
!! index of (1.55, 4e-3). The particles are not subject to particle swelling, but
!! do coagulate.
!!
-!! @version May-2009
-!! @author Chuck Bardeen
+!! @version May-2009
+!! @author Chuck Bardeen
module carma_model_mod
use carma_precision_mod
@@ -30,7 +30,7 @@ module carma_model_mod
use carmastate_mod
use carma_mod
use carma_flags_mod
-
+
use shr_kind_mod, only: r8 => shr_kind_r8
use radconstants, only: nswbands, nlwbands
use cam_abortutils, only: endrun
@@ -51,18 +51,18 @@ module carma_model_mod
public CARMA_InitializeModel
public CARMA_InitializeParticle
public CARMA_WetDeposition
-
+
! Declare public constants
integer, public, parameter :: NGROUP = 2 !! Number of particle groups
integer, public, parameter :: NELEM = 3 !! Number of particle elements
integer, public, parameter :: NBIN = 16 !! Number of particle bins
integer, public, parameter :: NSOLUTE = 1 !! Number of particle solutes
integer, public, parameter :: NGAS = 1 !! Number of gases
-
+
! These need to be defined, but are only used when the particles are radiatively active.
integer, public, parameter :: NMIE_RH = 8 !! Number of relative humidities for mie calculations
real(kind=f), public :: mie_rh(NMIE_RH)
-
+
! Defines whether the groups should undergo deep convection in phase 1 or phase 2.
! Water vapor and cloud particles are convected in phase 1, while all other constituents
! are done in phase 2.
@@ -91,12 +91,12 @@ module carma_model_mod
!! Defines all the CARMA components (groups, elements, solutes and gases) and process
!! (coagulation, growth, nucleation) that will be part of the microphysical model.
!!
- !! @version May-2009
- !! @author Chuck Bardeen
+ !! @version May-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DefineModel(carma, rc)
type(carma_type), intent(inout) :: carma !! the carma object
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
! Local variables
real(kind=f), parameter :: RHO_CN = 2.65_f ! dry density of sea salt particles (g/cm)
real(kind=f), parameter :: rmin_ice = 5.e-5_f ! min radius for ice bins (cm)
@@ -104,7 +104,7 @@ subroutine CARMA_DefineModel(carma, rc)
! Default return code.
rc = RC_OK
-
+
! Define the Groups
!
! NOTE: If NWAVE > 0 then the group should have refractive indices defined.
@@ -112,7 +112,7 @@ subroutine CARMA_DefineModel(carma, rc)
! NOTE: For CAM, the optional do_wetdep and do_drydep flags should be
! defined. If wetdep is defined, then the optional solubility factor
! should also be defined.
-
+
! Since these sulfates are prescribed, don't sediment them. This will save some
! processing time.
call CARMAGROUP_Create(carma, I_GRP_CRCN, "Sulfate CN", rmin_cn, 4.0_f, I_SPHERE, 1._f, .false., &
@@ -124,8 +124,8 @@ subroutine CARMA_DefineModel(carma, rc)
rc, shortname="CRICE", ifallrtn=I_FALLRTN_STD_SHAPE)
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMAGROUP_Create failed.')
-
-
+
+
! Define the Elements
!
! NOTE: For CAM, the optional shortname needs to be provided for the group. These names
@@ -137,22 +137,22 @@ subroutine CARMA_DefineModel(carma, rc)
call CARMAELEMENT_Create(carma, I_ELEM_CRICE, I_GRP_CRICE, "Ice", RHO_I, &
I_VOLATILE, I_ICE, rc, shortname="CRICE")
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMAElement_Create failed.')
-
+
call CARMAELEMENT_Create(carma, I_ELEM_CRCORE, I_GRP_CRICE, "Core Mass", RHO_CN, &
I_COREMASS, I_H2SO4, rc, shortname="CRCORE", isolute=1)
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMAElement_Create failed.')
-
+
! Define the Solutes
call CARMASOLUTE_Create(carma, I_SOL_CRH2SO4, "Sulfuric Acid", 2, 98._f, 1.38_f, rc, shortname="CRH2SO4")
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMASOLUTE_Create failed.')
-
+
! Define the Gases
call CARMAGAS_Create(carma, I_GAS_H2O, "Water Vapor", WTMOL_H2O, I_VAPRTN_H2O_MURPHY2005, I_GCOMP_H2O, rc, shortname="Q")
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMAGAS_Create failed.')
-
+
! Define the Processes
call CARMA_AddGrowth(carma, I_ELEM_CRICE, I_GAS_H2O, rc)
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMA_AddGrowth failed.')
@@ -174,8 +174,8 @@ end subroutine CARMA_DefineModel
!! Defines all the CARMA components (groups, elements, solutes and gases) and process
!! (coagulation, growth, nucleation) that will be part of the microphysical model.
!!
- !! @version May-2009
- !! @author Chuck Bardeen
+ !! @version May-2009
+ !! @author Chuck Bardeen
!!
!! @see CARMASTATE_SetDetrain
subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq, prec_str, snow_str, &
@@ -184,7 +184,7 @@ subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq,
use physconst, only: latice, latvap, cpair
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(cam_in_t), intent(in) :: cam_in !! surface input
@@ -194,27 +194,27 @@ subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq,
real(r8), intent(in) :: dt !! time step (s)
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(out), optional :: tnd_qsnow(pcols,pver) !! snow mass tendency (kg/kg/s)
real(r8), intent(out), optional :: tnd_nsnow(pcols,pver) !! snow number tendency (#/kg/s)
-
+
! Default return code.
rc = RC_OK
-
+
return
end subroutine CARMA_Detrain
!! For diagnostic groups, sets up up the CARMA bins based upon the CAM state.
!!
- !! @version July-2009
- !! @author Chuck Bardeen
+ !! @version July-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, prec_str, snow_str)
use time_manager, only: is_first_step
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(physics_state), intent(in) :: state !! physics state variables
@@ -223,18 +223,18 @@ subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, pr
real(r8), intent(in) :: dt !! time step
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(in), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
-
+
integer :: igroup ! group index
integer :: ielem ! element index
integer :: ibin ! bin index
-
+
! Sulfate size distribution parameters
- real(r8), parameter :: n = 100._r8 ! concentration (cm-3)
+ real(r8), parameter :: n = 100._r8 ! concentration (cm-3)
real(r8), parameter :: r0 = 2.5e-6_r8 ! mean radius (cm)
real(r8), parameter :: rsig = 1.5_r8 ! distribution width
-
+
real(r8) :: arg1(NBIN)
real(r8) :: arg2(NBIN)
real(r8) :: rhop(NBIN) ! particle mass density (kg/m3)
@@ -246,7 +246,7 @@ subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, pr
! Default return code.
rc = RC_OK
-
+
! Get the air density.
call CARMASTATE_GetState(cstate, rc, rhoa_wet=rhoa_wet)
if (rc < RC_OK) call endrun('CARMA_DiagnoseBins::CARMASTATE_GetState failed.')
@@ -256,35 +256,35 @@ subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, pr
! improves the speed of the model.
igroup = 1
ielem = 1
-
+
call CARMAGROUP_Get(carma, igroup, rc, r=r, dr=dr, rmass=rmass)
if (rc < RC_OK) call endrun('CARMA_DiagnoseBins::CARMAGROUP_Get failed.')
-
+
arg1(:) = n * dr(:) / (sqrt(2._f*PI) * r(:) * log(rsig))
arg2(:) = -((log(r(:)) - log(r0))**2) / (2._f*(log(rsig))**2)
rhop(:) = arg1(:) * exp(arg2(:)) * rmass(:) * 1e6_f / 1e3_f
-
+
do ibin = 1, NBIN
mmr(ibin, :) = rhop(ibin) / rhoa_wet(:)
call CARMASTATE_SetBin(cstate, ielem, ibin, mmr(ibin, :), rc)
if (rc < RC_OK) call endrun('CARMA_DiagnoseBins::CARMAGROUP_SetBin failed.')
end do
-
+
return
end subroutine CARMA_DiagnoseBins
-
-
+
+
!! For diagnostic groups, determines the tendencies on the CAM state from the CARMA bins.
!!
- !! @version July-2009
- !! @author Chuck Bardeen
+ !! @version July-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol, dt, rc, rliq, prec_str, snow_str, &
prec_sed, snow_sed, tnd_qsnow, tnd_nsnow, re_ice)
use camsrfexch, only: cam_out_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(cam_out_t), intent(inout) :: cam_out !! cam output to surface models
@@ -295,24 +295,24 @@ subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol,
real(r8), intent(in) :: dt !! time step
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(inout), optional :: prec_sed(pcols) !! total precip from cloud sedimentation (m/s)
real(r8), intent(inout), optional :: snow_sed(pcols) !! snow from cloud ice sedimentation (m/s)
real(r8), intent(inout), optional :: tnd_qsnow(pcols,pver) !! snow mass tendency (kg/kg/s)
real(r8), intent(inout), optional :: tnd_nsnow(pcols,pver) !! snow number tendency (#/kg/s)
real(r8), intent(out), optional :: re_ice(pcols,pver) !! ice effective radius (m)
-
+
! Default return code.
rc = RC_OK
! By default, do nothing. If diagnosed groups exist, this needs to be replaced by
! code to determine the bulk mass from the CARMA state.
-
+
return
end subroutine CARMA_DiagnoseBulk
-
-
+
+
!! Calculates the emissions for CARMA aerosol particles. By default, there is no
!! emission, but this routine can be overridden for models that wish to have
!! an aerosol emission.
@@ -328,7 +328,7 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
use camsrfexch, only: cam_in_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -362,13 +362,13 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
doy = floor(calday)
ncol = state%ncol
-
+
! Add any surface flux here.
surfaceFlux(:ncol) = 0.0_r8
-
+
! For emissions into the atmosphere, put the emission here.
tendency(:ncol, :pver) = 0.0_r8
-
+
return
end subroutine CARMA_EmitParticle
@@ -384,7 +384,7 @@ end subroutine CARMA_EmitParticle
subroutine CARMA_InitializeModel(carma, lq_carma, rc)
use constituents, only : pcnst
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
logical, intent(inout) :: lq_carma(pcnst) !! flags to indicate whether the constituent
!! could have a CARMA tendency
@@ -410,10 +410,10 @@ end subroutine CARMA_InitializeModel
!! @version May-2009
subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask, q, rc)
use shr_kind_mod, only: r8 => shr_kind_r8
- use pmgrid, only: plat, plev, plon
+ use pmgrid, only: plev
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -431,12 +431,12 @@ subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask,
! Put a horizontally uniform layer of the smallest bin size
! in the model.
if (ibin == 1) then
- if (ielem == I_ELEM_CRICE) then
+ if (ielem == I_ELEM_CRICE) then
where(mask)
q(:, plev/4) = 100e-7_r8 ! 1/4
end where
end if
- if (ielem == I_ELEM_CRCORE) then
+ if (ielem == I_ELEM_CRCORE) then
where(mask)
q(:, plev/4) = 100e-9_r8 ! 1/4
end where
@@ -444,22 +444,22 @@ subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask,
! q(:, plev/2) = 100e-9_r8 ! middle
! q(:, 3*plev/4) = 100e-9_r8 ! 3/4
! q(:, plev-1) = 100e-9_r8 ! bottom
- end if
-
+ end if
+
return
end subroutine CARMA_InitializeParticle
-
-
+
+
!! Called after wet deposition has been performed. Allows the specific model to add
!! wet deposition of CARMA aerosols to the aerosols being communicated to the surface.
!!
- !! @version July-2011
- !! @author Chuck Bardeen
+ !! @version July-2011
+ !! @author Chuck Bardeen
subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
use camsrfexch, only: cam_out_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -467,13 +467,13 @@ subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
type(cam_out_t), intent(inout) :: cam_out !! cam output to surface models
type(physics_state), intent(in) :: state !! physics state variables
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
integer :: icol
-
+
! Default return code.
rc = RC_OK
-
+
return
- end subroutine CARMA_WetDeposition
+ end subroutine CARMA_WetDeposition
end module
diff --git a/src/physics/carma/models/test_passive/carma_model_mod.F90 b/src/physics/carma/models/test_passive/carma_model_mod.F90
index d616a2066a..12f4a6168e 100644
--- a/src/physics/carma/models/test_passive/carma_model_mod.F90
+++ b/src/physics/carma/models/test_passive/carma_model_mod.F90
@@ -1,4 +1,4 @@
-!! This module is used to define a particular CARMA microphysical model. For
+!! This module is used to define a particular CARMA microphysical model. For
!! simple cases, this may be the only code that needs to be modified. This module
!! defines several constants and has three methods:
!!
@@ -15,8 +15,8 @@
!! index of (1.55, 4e-3). The particles are not subject to particle swelling, but
!! do coagulate.
!!
-!! @version May-2009
-!! @author Chuck Bardeen
+!! @version May-2009
+!! @author Chuck Bardeen
module carma_model_mod
use carma_precision_mod
@@ -30,7 +30,7 @@ module carma_model_mod
use carmastate_mod
use carma_mod
use carma_flags_mod
-
+
use shr_kind_mod, only: r8 => shr_kind_r8
use cam_abortutils, only: endrun
use physics_types, only: physics_state, physics_ptend
@@ -50,18 +50,18 @@ module carma_model_mod
public CARMA_InitializeModel
public CARMA_InitializeParticle
public CARMA_WetDeposition
-
+
! Declare public constants
integer, public, parameter :: NGROUP = 1 !! Number of particle groups
integer, public, parameter :: NELEM = 1 !! Number of particle elements
integer, public, parameter :: NBIN = 16 !! Number of particle bins
integer, public, parameter :: NSOLUTE = 0 !! Number of particle solutes
integer, public, parameter :: NGAS = 0 !! Number of gases
-
+
! These need to be defined, but are only used when the particles are radiatively active.
integer, public, parameter :: NMIE_RH = 8 !! Number of relative humidities for mie calculations
real(kind=f), public :: mie_rh(NMIE_RH)
-
+
! Defines whether the groups should undergo deep convection in phase 1 or phase 2.
! Water vapor and cloud particles are convected in phase 1, while all other constituents
! are done in phase 2.
@@ -70,19 +70,19 @@ module carma_model_mod
! Define any particle compositions that are used. Each composition type
! should have a unique number.
integer, public, parameter :: I_DUST = 1 !! dust composition
-
+
contains
!! Defines all the CARMA components (groups, elements, solutes and gases) and process
!! (coagulation, growth, nucleation) that will be part of the microphysical model.
!!
- !! @version May-2009
- !! @author Chuck Bardeen
+ !! @version May-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DefineModel(carma, rc)
type(carma_type), intent(inout) :: carma !! the carma object
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
! Local variables
real(kind=f), parameter :: RHO_DUST = 2.0_f ! density of dust particles (g/cm)
real(kind=f), parameter :: rmin = 1e-5_f ! minimum radius (cm)
@@ -90,7 +90,7 @@ subroutine CARMA_DefineModel(carma, rc)
! Default return code.
rc = RC_OK
-
+
! Define the Groups
!
! NOTE: If NWAVE > 0 then the group should have refractive indices defined.
@@ -102,8 +102,8 @@ subroutine CARMA_DefineModel(carma, rc)
rc, do_wetdep=.true., do_drydep=.true., solfac=0.15_f, &
scavcoef=0.1_f, shortname="DUST")
if (rc < 0) call endrun('CARMA_DefineModel::CARMA_AddGroup failed.')
-
-
+
+
! Define the Elements
!
! NOTE: For CAM, the optional shortname needs to be provided for the group. These names
@@ -111,13 +111,13 @@ subroutine CARMA_DefineModel(carma, rc)
call CARMAELEMENT_Create(carma, 1, 1, "Dust", RHO_DUST, I_INVOLATILE, I_DUST, rc, shortname="DUST")
if (rc < 0) call endrun('CARMA_DefineModel::CARMA_AddElement failed.')
-
+
! Define the Solutes
-
+
! Define the Gases
-
+
! Define the Processes
call CARMA_AddCoagulation(carma, 1, 1, 1, I_COLLEC_DATA, rc)
if (rc < 0) call endrun('CARMA_DefineModel::CARMA_AddCoagulation failed.')
@@ -129,8 +129,8 @@ end subroutine CARMA_DefineModel
!! Defines all the CARMA components (groups, elements, solutes and gases) and process
!! (coagulation, growth, nucleation) that will be part of the microphysical model.
!!
- !! @version May-2009
- !! @author Chuck Bardeen
+ !! @version May-2009
+ !! @author Chuck Bardeen
!!
!! @see CARMASTATE_SetDetrain
subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq, prec_str, snow_str, &
@@ -139,7 +139,7 @@ subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq,
use physconst, only: latice, latvap, cpair
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(cam_in_t), intent(in) :: cam_in !! surface input
@@ -149,27 +149,27 @@ subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq,
real(r8), intent(in) :: dt !! time step (s)
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(out), optional :: tnd_qsnow(pcols,pver) !! snow mass tendency (kg/kg/s)
real(r8), intent(out), optional :: tnd_nsnow(pcols,pver) !! snow number tendency (#/kg/s)
-
+
! Default return code.
rc = RC_OK
-
+
return
end subroutine CARMA_Detrain
!! For diagnostic groups, sets up up the CARMA bins based upon the CAM state.
!!
- !! @version July-2009
- !! @author Chuck Bardeen
+ !! @version July-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, prec_str, snow_str)
use time_manager, only: is_first_step
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(physics_state), intent(in) :: state !! physics state variables
@@ -178,32 +178,32 @@ subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, pr
real(r8), intent(in) :: dt !! time step
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(in), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
-
+
real(r8) :: mmr(pver) !! elements mass mixing ratio
integer :: ibin !! bin index
-
+
! Default return code.
rc = RC_OK
-
+
! By default, do nothing. If diagnosed groups exist, this needs to be replaced by
! code to determine the mass in each bin from the CAM state.
-
+
return
end subroutine CARMA_DiagnoseBins
-
-
+
+
!! For diagnostic groups, determines the tendencies on the CAM state from the CARMA bins.
!!
- !! @version July-2009
- !! @author Chuck Bardeen
+ !! @version July-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol, dt, rc, rliq, prec_str, snow_str, &
prec_sed, snow_sed, tnd_qsnow, tnd_nsnow, re_ice)
use camsrfexch, only: cam_out_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(cam_out_t), intent(inout) :: cam_out !! cam output to surface models
@@ -214,24 +214,24 @@ subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol,
real(r8), intent(in) :: dt !! time step
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(inout), optional :: prec_sed(pcols) !! total precip from cloud sedimentation (m/s)
real(r8), intent(inout), optional :: snow_sed(pcols) !! snow from cloud ice sedimentation (m/s)
real(r8), intent(inout), optional :: tnd_qsnow(pcols,pver) !! snow mass tendency (kg/kg/s)
real(r8), intent(inout), optional :: tnd_nsnow(pcols,pver) !! snow number tendency (#/kg/s)
real(r8), intent(out), optional :: re_ice(pcols,pver) !! ice effective radius (m)
-
+
! Default return code.
rc = RC_OK
! By default, do nothing. If diagnosed groups exist, this needs to be replaced by
! code to determine the bulk mass from the CARMA state.
-
+
return
end subroutine CARMA_DiagnoseBulk
-
-
+
+
!! Calculates the emissions for CARMA aerosol particles. By default, there is no
!! emission, but this routine can be overridden for models that wish to have
!! an aerosol emission.
@@ -247,7 +247,7 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
use camsrfexch, only: cam_in_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -281,13 +281,13 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
doy = floor(calday)
ncol = state%ncol
-
+
! Add any surface flux here.
surfaceFlux(:ncol) = 0.0_r8
-
+
! For emissions into the atmosphere, put the emission here.
tendency(:ncol, :pver) = 0.0_r8
-
+
return
end subroutine CARMA_EmitParticle
@@ -303,7 +303,7 @@ end subroutine CARMA_EmitParticle
subroutine CARMA_InitializeModel(carma, lq_carma, rc)
use constituents, only : pcnst
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
logical, intent(inout) :: lq_carma(pcnst) !! flags to indicate whether the constituent
!! could have a CARMA tendency
@@ -329,10 +329,10 @@ end subroutine CARMA_InitializeModel
!! @version May-2009
subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask, q, rc)
use shr_kind_mod, only: r8 => shr_kind_r8
- use pmgrid, only: plat, plev, plon
+ use pmgrid, only: plev
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -357,22 +357,22 @@ subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask,
! q(:, 3*plev/4) = 100e-9_r8 ! 3/4
! q(:, plev-1) = 100e-9_r8 ! bottom
end where
- end if
-
+ end if
+
return
end subroutine CARMA_InitializeParticle
-
-
+
+
!! Called after wet deposition has been performed. Allows the specific model to add
!! wet deposition of CARMA aerosols to the aerosols being communicated to the surface.
!!
- !! @version July-2011
- !! @author Chuck Bardeen
+ !! @version July-2011
+ !! @author Chuck Bardeen
subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
use camsrfexch, only: cam_out_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -380,13 +380,13 @@ subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
type(cam_out_t), intent(inout) :: cam_out !! cam output to surface models
type(physics_state), intent(in) :: state !! physics state variables
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
integer :: icol
-
+
! Default return code.
rc = RC_OK
-
+
return
- end subroutine CARMA_WetDeposition
+ end subroutine CARMA_WetDeposition
end module
diff --git a/src/physics/carma/models/test_radiative/carma_model_mod.F90 b/src/physics/carma/models/test_radiative/carma_model_mod.F90
index c394c8e220..8acff28edb 100644
--- a/src/physics/carma/models/test_radiative/carma_model_mod.F90
+++ b/src/physics/carma/models/test_radiative/carma_model_mod.F90
@@ -1,4 +1,4 @@
-!! This module is used to define a particular CARMA microphysical model. For
+!! This module is used to define a particular CARMA microphysical model. For
!! simple cases, this may be the only code that needs to be modified. This module
!! defines several constants and has three methods:
!!
@@ -15,8 +15,8 @@
!! index of (1.55, 4e-3). The particles are not subject to particle swelling, but
!! do coagulate.
!!
-!! @version May-2009
-!! @author Chuck Bardeen
+!! @version May-2009
+!! @author Chuck Bardeen
module carma_model_mod
use carma_precision_mod
@@ -30,7 +30,7 @@ module carma_model_mod
use carmastate_mod
use carma_mod
use carma_flags_mod
-
+
use shr_kind_mod, only: r8 => shr_kind_r8
use cam_abortutils, only: endrun
use physics_types, only: physics_state, physics_ptend
@@ -50,7 +50,7 @@ module carma_model_mod
public CARMA_InitializeModel
public CARMA_InitializeParticle
public CARMA_WetDeposition
-
+
! Declare public constants
integer, public, parameter :: NGROUP = 1 !! Number of particle groups
integer, public, parameter :: NELEM = 1 !! Number of particle elements
@@ -64,7 +64,7 @@ module carma_model_mod
!! humidities.
integer, public, parameter :: NMIE_RH = 8 !! Number of relative humidities for mie calculations
real(kind=f), public :: mie_rh(NMIE_RH) = (/ 0._f, 0.5_f, 0.7_f, 0.8_f, 0.9_f, 0.95_f, 0.98_f, 0.99_f /)
-
+
! Defines whether the groups should undergo deep convection in phase 1 or phase 2.
! Water vapor and cloud particles are convected in phase 1, while all other constituents
! are done in phase 2.
@@ -73,19 +73,19 @@ module carma_model_mod
! Define any particle compositions that are used. Each composition type
! should have a unique number.
integer, public, parameter :: I_DUST = 1 !! dust composition
-
+
contains
!! Defines all the CARMA components (groups, elements, solutes and gases) and process
!! (coagulation, growth, nucleation) that will be part of the microphysical model.
!!
- !! @version May-2009
- !! @author Chuck Bardeen
+ !! @version May-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DefineModel(carma, rc)
type(carma_type), intent(inout) :: carma !! the carma object
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
! Local variables
real(kind=f), parameter :: RHO_DUST = 2.0_f ! density of dust particles (g/cm)
real(kind=f), parameter :: rmin = 1e-5_f ! minimum radius (cm)
@@ -94,11 +94,11 @@ subroutine CARMA_DefineModel(carma, rc)
! Default return code.
rc = RC_OK
-
+
! Use the same refractive index at all wavelengths. This value is typical of dust in
! the visible.
refidx(:) = (1.55_f, 4e-3_f)
-
+
! Define the Groups
!
! NOTE: If NWAVE > 0 then the group should have refractive indices defined.
@@ -110,8 +110,8 @@ subroutine CARMA_DefineModel(carma, rc)
rc, do_wetdep=.true., do_drydep=.true., solfac=0.15_f, &
scavcoef=0.1_f, shortname="DUST", refidx=refidx, do_mie=.true.)
if (rc < 0) call endrun('CARMA_DefineModel::CARMA_AddGroup failed.')
-
-
+
+
! Define the Elements
!
! NOTE: For CAM, the optional shortname needs to be provided for the group. These names
@@ -119,13 +119,13 @@ subroutine CARMA_DefineModel(carma, rc)
call CARMAELEMENT_Create(carma, 1, 1, "Dust", RHO_DUST, I_INVOLATILE, I_DUST, rc, shortname="DUST")
if (rc < 0) call endrun('CARMA_DefineModel::CARMA_AddElement failed.')
-
+
! Define the Solutes
-
+
! Define the Gases
-
+
! Define the Processes
call CARMA_AddCoagulation(carma, 1, 1, 1, I_COLLEC_DATA, rc)
if (rc < 0) call endrun('CARMA_DefineModel::CARMA_AddCoagulation failed.')
@@ -137,8 +137,8 @@ end subroutine CARMA_DefineModel
!! Defines all the CARMA components (groups, elements, solutes and gases) and process
!! (coagulation, growth, nucleation) that will be part of the microphysical model.
!!
- !! @version May-2009
- !! @author Chuck Bardeen
+ !! @version May-2009
+ !! @author Chuck Bardeen
!!
!! @see CARMASTATE_SetDetrain
subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq, prec_str, snow_str, &
@@ -147,7 +147,7 @@ subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq,
use physconst, only: latice, latvap, cpair
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(cam_in_t), intent(in) :: cam_in !! surface input
@@ -157,27 +157,27 @@ subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq,
real(r8), intent(in) :: dt !! time step (s)
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(out), optional :: tnd_qsnow(pcols,pver) !! snow mass tendency (kg/kg/s)
real(r8), intent(out), optional :: tnd_nsnow(pcols,pver) !! snow number tendency (#/kg/s)
-
+
! Default return code.
rc = RC_OK
-
+
return
end subroutine CARMA_Detrain
!! For diagnostic groups, sets up up the CARMA bins based upon the CAM state.
!!
- !! @version July-2009
- !! @author Chuck Bardeen
+ !! @version July-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, prec_str, snow_str)
use time_manager, only: is_first_step
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(physics_state), intent(in) :: state !! physics state variables
@@ -186,32 +186,32 @@ subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, pr
real(r8), intent(in) :: dt !! time step
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(in), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
-
+
real(r8) :: mmr(pver) !! elements mass mixing ratio
integer :: ibin !! bin index
-
+
! Default return code.
rc = RC_OK
-
+
! By default, do nothing. If diagnosed groups exist, this needs to be replaced by
! code to determine the mass in each bin from the CAM state.
-
+
return
end subroutine CARMA_DiagnoseBins
-
-
+
+
!! For diagnostic groups, determines the tendencies on the CAM state from the CARMA bins.
!!
- !! @version July-2009
- !! @author Chuck Bardeen
+ !! @version July-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol, dt, rc, rliq, prec_str, snow_str, &
prec_sed, snow_sed, tnd_qsnow, tnd_nsnow, re_ice)
use camsrfexch, only: cam_out_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(cam_out_t), intent(inout) :: cam_out !! cam output to surface models
@@ -222,20 +222,20 @@ subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol,
real(r8), intent(in) :: dt !! time step
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(inout), optional :: prec_sed(pcols) !! total precip from cloud sedimentation (m/s)
real(r8), intent(inout), optional :: snow_sed(pcols) !! snow from cloud ice sedimentation (m/s)
real(r8), intent(inout), optional :: tnd_qsnow(pcols,pver) !! snow mass tendency (kg/kg/s)
real(r8), intent(inout), optional :: tnd_nsnow(pcols,pver) !! snow number tendency (#/kg/s)
real(r8), intent(out), optional :: re_ice(pcols,pver) !! ice effective radius (m)
-
+
! Default return code.
rc = RC_OK
! By default, do nothing. If diagnosed groups exist, this needs to be replaced by
! code to determine the bulk mass from the CARMA state.
-
+
return
end subroutine CARMA_DiagnoseBulk
@@ -255,7 +255,7 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
use camsrfexch, only: cam_in_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -289,13 +289,13 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
doy = floor(calday)
ncol = state%ncol
-
+
! Add any surface flux here.
surfaceFlux(:ncol) = 0.0_r8
-
+
! For emissions into the atmosphere, put the emission here.
tendency(:ncol, :pver) = 0.0_r8
-
+
return
end subroutine CARMA_EmitParticle
@@ -311,7 +311,7 @@ end subroutine CARMA_EmitParticle
subroutine CARMA_InitializeModel(carma, lq_carma, rc)
use constituents, only : pcnst
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
logical, intent(inout) :: lq_carma(pcnst) !! flags to indicate whether the constituent
!! could have a CARMA tendency
@@ -337,10 +337,10 @@ end subroutine CARMA_InitializeModel
!! @version May-2009
subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask, q, rc)
use shr_kind_mod, only: r8 => shr_kind_r8
- use pmgrid, only: plat, plev, plon
+ use pmgrid, only: plev
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -365,22 +365,22 @@ subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask,
! q(:, 3*plev/4) = 100e-9_r8 ! 3/4
! q(:, plev-1) = 100e-9_r8 ! bottom
end where
- end if
-
+ end if
+
return
end subroutine CARMA_InitializeParticle
-
+
!! Called after wet deposition has been performed. Allows the specific model to add
!! wet deposition of CARMA aerosols to the aerosols being communicated to the surface.
!!
- !! @version July-2011
- !! @author Chuck Bardeen
+ !! @version July-2011
+ !! @author Chuck Bardeen
subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
use camsrfexch, only: cam_out_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -388,13 +388,13 @@ subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
type(cam_out_t), intent(inout) :: cam_out !! cam output to surface models
type(physics_state), intent(in) :: state !! physics state variables
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
integer :: icol
-
+
! Default return code.
rc = RC_OK
-
+
return
- end subroutine CARMA_WetDeposition
-
+ end subroutine CARMA_WetDeposition
+
end module
diff --git a/src/physics/carma/models/test_swelling/carma_model_mod.F90 b/src/physics/carma/models/test_swelling/carma_model_mod.F90
index 901f601c8a..ce55401475 100644
--- a/src/physics/carma/models/test_swelling/carma_model_mod.F90
+++ b/src/physics/carma/models/test_swelling/carma_model_mod.F90
@@ -1,4 +1,4 @@
-!! This module is used to define a particular CARMA microphysical model. For
+!! This module is used to define a particular CARMA microphysical model. For
!! simple cases, this may be the only code that needs to be modified. This module
!! defines several constants and has three methods:
!!
@@ -15,8 +15,8 @@
!! index of (1.55, 4e-3). The particles are not subject to particle swelling, but
!! do coagulate.
!!
-!! @version May-2009
-!! @author Chuck Bardeen
+!! @version May-2009
+!! @author Chuck Bardeen
module carma_model_mod
use carma_precision_mod
@@ -30,7 +30,7 @@ module carma_model_mod
use carmastate_mod
use carma_mod
use carma_flags_mod
-
+
use shr_kind_mod, only: r8 => shr_kind_r8
use radconstants, only: nswbands, nlwbands
use cam_abortutils, only: endrun
@@ -51,39 +51,39 @@ module carma_model_mod
public CARMA_InitializeModel
public CARMA_InitializeParticle
public CARMA_WetDeposition
-
+
! Declare public constants
integer, public, parameter :: NGROUP = 3 !! Number of particle groups
integer, public, parameter :: NELEM = 3 !! Number of particle elements
integer, public, parameter :: NBIN = 16 !! Number of particle bins
integer, public, parameter :: NSOLUTE = 0 !! Number of particle solutes
integer, public, parameter :: NGAS = 0 !! Number of gases
-
+
! These need to be defined, but are only used when the particles are radiatively active.
integer, public, parameter :: NMIE_RH = 8 !! Number of relative humidities for mie calculations
real(kind=f), public :: mie_rh(NMIE_RH)
-
+
! Defines whether the groups should undergo deep convection in phase 1 or phase 2.
! Water vapor and cloud particles are convected in phase 1, while all other constituents
! are done in phase 2.
logical, public :: is_convtran1(NGROUP) = .false. !! Should the group be transported in the first phase?
-
+
! Define any particle compositions that are used. Each composition type
! should have a unique number.
integer, public, parameter :: I_SEA_SALT = 1 !! sea salt composition
-
+
contains
!! Defines all the CARMA components (groups, elements, solutes and gases) and process
!! (coagulation, growth, nucleation) that will be part of the microphysical model.
!!
- !! @version May-2009
- !! @author Chuck Bardeen
+ !! @version May-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DefineModel(carma, rc)
type(carma_type), intent(inout) :: carma !! the carma object
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
! Local variables
real(kind=f), parameter :: RHO_SALT = 2.65_f ! dry density of sea salt particles (g/cm)
real(kind=f), parameter :: rmin = 1e-6_f ! minimum radius (cm)
@@ -91,7 +91,7 @@ subroutine CARMA_DefineModel(carma, rc)
! Default return code.
rc = RC_OK
-
+
! Define the Groups
!
! NOTE: For CAM, the optional do_wetdep and do_drydep flags should be
@@ -113,8 +113,8 @@ subroutine CARMA_DefineModel(carma, rc)
scavcoef=0.1_f, shortname="SALTGB", irhswell=I_GERBER, &
irhswcomp=I_SWG_SEA_SALT)
if (rc < 0) call endrun('CARMA_DefineModel::CARMA_AddGroup failed.')
-
-
+
+
! Define the Elements
!
! NOTE: For CAM, the optional shortname needs to be provided for the group. These names
@@ -124,17 +124,17 @@ subroutine CARMA_DefineModel(carma, rc)
call CARMAELEMENT_Create(carma, 2, 2, "Fitz", RHO_SALT, I_INVOLATILE, I_SEA_SALT, rc, shortname="SALTFZ")
if (rc < 0) call endrun('CARMA_DefineModel::CARMA_AddElement failed.')
-
+
call CARMAELEMENT_Create(carma, 3, 3, "Gerb", RHO_SALT, I_INVOLATILE, I_SEA_SALT, rc, shortname="SALTGB")
if (rc < 0) call endrun('CARMA_DefineModel::CARMA_AddElement failed.')
-
+
! Define the Solutes
-
+
! Define the Gases
-
+
! Define the Processes
return
@@ -144,8 +144,8 @@ end subroutine CARMA_DefineModel
!! Defines all the CARMA components (groups, elements, solutes and gases) and process
!! (coagulation, growth, nucleation) that will be part of the microphysical model.
!!
- !! @version May-2009
- !! @author Chuck Bardeen
+ !! @version May-2009
+ !! @author Chuck Bardeen
!!
!! @see CARMASTATE_SetDetrain
subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq, prec_str, snow_str, &
@@ -154,7 +154,7 @@ subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq,
use physconst, only: latice, latvap, cpair
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(cam_in_t), intent(in) :: cam_in !! surface input
@@ -164,27 +164,27 @@ subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq,
real(r8), intent(in) :: dt !! time step (s)
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(out), optional :: tnd_qsnow(pcols,pver) !! snow mass tendency (kg/kg/s)
real(r8), intent(out), optional :: tnd_nsnow(pcols,pver) !! snow number tendency (#/kg/s)
-
+
! Default return code.
rc = RC_OK
-
+
return
end subroutine CARMA_Detrain
!! For diagnostic groups, sets up up the CARMA bins based upon the CAM state.
!!
- !! @version July-2009
- !! @author Chuck Bardeen
+ !! @version July-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, prec_str, snow_str)
use time_manager, only: is_first_step
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(physics_state), intent(in) :: state !! physics state variables
@@ -193,32 +193,32 @@ subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, pr
real(r8), intent(in) :: dt !! time step
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(in), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
-
+
real(r8) :: mmr(pver) !! elements mass mixing ratio
integer :: ibin !! bin index
-
+
! Default return code.
rc = RC_OK
-
+
! By default, do nothing. If diagnosed groups exist, this needs to be replaced by
! code to determine the mass in each bin from the CAM state.
-
+
return
end subroutine CARMA_DiagnoseBins
-
-
+
+
!! For diagnostic groups, determines the tendencies on the CAM state from the CARMA bins.
!!
- !! @version July-2009
- !! @author Chuck Bardeen
+ !! @version July-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol, dt, rc, rliq, prec_str, snow_str, &
prec_sed, snow_sed, tnd_qsnow, tnd_nsnow, re_ice)
use camsrfexch, only: cam_out_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(cam_out_t), intent(inout) :: cam_out !! cam output to surface models
@@ -229,20 +229,20 @@ subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol,
real(r8), intent(in) :: dt !! time step
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(inout), optional :: prec_sed(pcols) !! total precip from cloud sedimentation (m/s)
real(r8), intent(inout), optional :: snow_sed(pcols) !! snow from cloud ice sedimentation (m/s)
real(r8), intent(inout), optional :: tnd_qsnow(pcols,pver) !! snow mass tendency (kg/kg/s)
real(r8), intent(inout), optional :: tnd_nsnow(pcols,pver) !! snow number tendency (#/kg/s)
real(r8), intent(out), optional :: re_ice(pcols,pver) !! ice effective radius (m)
-
+
! Default return code.
rc = RC_OK
! By default, do nothing. If diagnosed groups exist, this needs to be replaced by
! code to determine the bulk mass from the CARMA state.
-
+
return
end subroutine CARMA_DiagnoseBulk
@@ -262,7 +262,7 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
use camsrfexch, only: cam_in_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -296,13 +296,13 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
doy = floor(calday)
ncol = state%ncol
-
+
! Add any surface flux here.
surfaceFlux(:ncol) = 0.0_r8
-
+
! For emissions into the atmosphere, put the emission here.
tendency(:ncol, :pver) = 0.0_r8
-
+
return
end subroutine CARMA_EmitParticle
@@ -315,7 +315,7 @@ end subroutine CARMA_EmitParticle
subroutine CARMA_InitializeModel(carma, lq_carma, rc)
use constituents, only : pcnst
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
logical, intent(inout) :: lq_carma(pcnst) !! flags to indicate whether the constituent
!! could have a CARMA tendency
@@ -341,10 +341,10 @@ end subroutine CARMA_InitializeModel
!! @version May-2009
subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask, q, rc)
use shr_kind_mod, only: r8 => shr_kind_r8
- use pmgrid, only: plat, plev, plon
+ use pmgrid, only: plev
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -367,21 +367,21 @@ subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask,
! q(:, 3*plev/4) = 100e-9_r8 ! 3/4
! q(:, plev-1) = 100e-9_r8 ! bottom
end where
-
+
return
end subroutine CARMA_InitializeParticle
-
-
+
+
!! Called after wet deposition has been performed. Allows the specific model to add
!! wet deposition of CARMA aerosols to the aerosols being communicated to the surface.
!!
- !! @version July-2011
- !! @author Chuck Bardeen
+ !! @version July-2011
+ !! @author Chuck Bardeen
subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
use camsrfexch, only: cam_out_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -389,13 +389,13 @@ subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
type(cam_out_t), intent(inout) :: cam_out !! cam output to surface models
type(physics_state), intent(in) :: state !! physics state variables
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
integer :: icol
-
+
! Default return code.
rc = RC_OK
-
+
return
- end subroutine CARMA_WetDeposition
+ end subroutine CARMA_WetDeposition
end module
diff --git a/src/physics/carma/models/test_tracers/carma_model_mod.F90 b/src/physics/carma/models/test_tracers/carma_model_mod.F90
index f357a6defd..9ed84a9471 100644
--- a/src/physics/carma/models/test_tracers/carma_model_mod.F90
+++ b/src/physics/carma/models/test_tracers/carma_model_mod.F90
@@ -1,4 +1,4 @@
-!! This module is used to define a particular CARMA microphysical model. For
+!! This module is used to define a particular CARMA microphysical model. For
!! simple cases, this may be the only code that needs to be modified. This module
!! defines several constants and has three methods:
!!
@@ -11,7 +11,7 @@
!! microphysics has its own version of this file.
!!
!! This file is a test case that uses CARMA groups and bins to implement a
-!! tracer trajectory test for the Asian Monsoon region. This is the reverse of
+!! tracer trajectory test for the Asian Monsoon region. This is the reverse of
!! back trajectory calculations being done by John Bergman. In this model each
!! group is a region of the model and each bin represents a day. Emissions
!! start on the carma_launch_doy and then continue for NBINS days.
@@ -20,8 +20,8 @@
!! the number of regions or days tracked, you also need to reduce the number of
!! advected constituents added in configure.
!!
-!! @version April-2011
-!! @author Chuck Bardeen
+!! @version April-2011
+!! @author Chuck Bardeen
module carma_model_mod
use carma_precision_mod
@@ -36,7 +36,7 @@ module carma_model_mod
use carma_mod
use carma_flags_mod
use carma_model_flags_mod
-
+
use shr_kind_mod, only: r8 => shr_kind_r8
use radconstants, only: nswbands, nlwbands
use cam_abortutils, only: endrun
@@ -57,18 +57,18 @@ module carma_model_mod
public CARMA_InitializeModel
public CARMA_InitializeParticle
public CARMA_WetDeposition
-
+
! Declare public constants
integer, public, parameter :: NGROUP = 6 !! Number of particle groups
integer, public, parameter :: NELEM = 6 !! Number of particle elements
integer, public, parameter :: NBIN = 62 !! Number of particle bins
integer, public, parameter :: NSOLUTE = 0 !! Number of particle solutes
integer, public, parameter :: NGAS = 0 !! Number of gases
-
+
! These need to be defined, but are only used when the particles are radiatively active.
integer, public, parameter :: NMIE_RH = 8 !! Number of relative humidities for mie calculations
real(kind=f), public :: mie_rh(NMIE_RH)
-
+
! Defines whether the groups should undergo deep convection in phase 1 or phase 2.
! Water vapor and cloud particles are convected in phase 1, while all other constituents
! are done in phase 2.
@@ -77,10 +77,10 @@ module carma_model_mod
! Define any particle compositions that are used. Each composition type
! should have a unique number.
integer, public, parameter :: I_INERT = 1 !! tracer composition
-
+
real(kind=f), public :: rgn_minlat(NELEM-1) = (/ 0._f, 0._f, 0._f, 0._f, 0._f /)
real(kind=f), public :: rgn_maxlat(NELEM-1) = (/ 40._f, 40._f, 40._f, 40._f, 40._f /)
-
+
real(kind=f), public :: rgn_minlon(NELEM-1) = (/ 60._f, 60._f, 105._f, 60._f, 105._f /)
real(kind=f), public :: rgn_maxlon(NELEM-1) = (/ 105._f, 105._f, 140._f, 105._f, 140._f /)
@@ -96,24 +96,24 @@ module carma_model_mod
!! Defines all the CARMA components (groups, elements, solutes and gases) and process
!! (coagulation, growth, nucleation) that will be part of the microphysical model.
!!
- !! @version May-2009
- !! @author Chuck Bardeen
+ !! @version May-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DefineModel(carma, rc)
type(carma_type), intent(inout) :: carma !! the carma object
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
! Local variables
real(kind=f), parameter :: rmin = 2.5e-4_f ! minimum radius (cm)
real(kind=f), parameter :: vmrat = 1.00001_f ! volume ratio
integer :: LUNOPRT
logical :: do_print
-
+
! Default return code.
rc = RC_OK
-
+
call CARMA_Get(carma, rc, do_print=do_print, LUNOPRT=LUNOPRT)
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMA_Get failed.')
-
+
! Report model specific configuration parameters.
if (masterproc) then
if (do_print) then
@@ -133,10 +133,10 @@ subroutine CARMA_DefineModel(carma, rc)
! should also be defined.
call CARMAGROUP_Create(carma, 1, "Region 1", rmin, vmrat, I_SPHERE, 1._f, .True., rc, shortname="CRRG1")
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMAGROUP_Create failed.')
-
+
call CARMAGROUP_Create(carma, 2, "Region 2", rmin, vmrat, I_SPHERE, 1._f, .True., rc, shortname="CRRG2")
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMAGROUP_Create failed.')
-
+
call CARMAGROUP_Create(carma, 3, "Region 3", rmin, vmrat, I_SPHERE, 1._f, .True., rc, shortname="CRRG3")
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMAGROUP_Create failed.')
@@ -148,18 +148,18 @@ subroutine CARMA_DefineModel(carma, rc)
call CARMAGROUP_Create(carma, 6, "Rest of World", rmin, vmrat, I_SPHERE, 1._f, .True., rc, shortname="CRRG6")
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMAGROUP_Create failed.')
-
-
+
+
! Define the Elements
!
! NOTE: For CAM, the optional shortname needs to be provided for the group. These names
! should be 6 characters or less and without spaces.
call CARMAELEMENT_Create(carma, 1, 1, "Region 1", WTMOL_AIR, I_INVOLATILE, I_INERT, rc, shortname="CRRG1")
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMAElement_Create failed.')
-
+
call CARMAELEMENT_Create(carma, 2, 2, "Region 2", WTMOL_AIR, I_INVOLATILE, I_INERT, rc, shortname="CRRG2")
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMAElement_Create failed.')
-
+
call CARMAELEMENT_Create(carma, 3, 3, "Region 3", WTMOL_AIR, I_INVOLATILE, I_INERT, rc, shortname="CRRG3")
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMAElement_Create failed.')
@@ -172,13 +172,13 @@ subroutine CARMA_DefineModel(carma, rc)
call CARMAELEMENT_Create(carma, 6, 6, "Rest of World", WTMOL_AIR, I_INVOLATILE, I_INERT, rc, shortname="CRRG6")
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMAElement_Create failed.')
-
+
! Define the Solutes
-
+
! Define the Gases
-
+
! Define the Processes
@@ -189,8 +189,8 @@ end subroutine CARMA_DefineModel
!! Defines all the CARMA components (groups, elements, solutes and gases) and process
!! (coagulation, growth, nucleation) that will be part of the microphysical model.
!!
- !! @version May-2009
- !! @author Chuck Bardeen
+ !! @version May-2009
+ !! @author Chuck Bardeen
!!
!! @see CARMASTATE_SetDetrain
subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq, prec_str, snow_str, &
@@ -200,7 +200,7 @@ subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq,
use time_manager, only: get_curr_date, get_perp_date, get_curr_calday, is_perpetual
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(cam_in_t), intent(in) :: cam_in !! surface input
@@ -210,27 +210,27 @@ subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq,
real(r8), intent(in) :: dt !! time step (s)
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(out), optional :: tnd_qsnow(pcols,pver) !! snow mass tendency (kg/kg/s)
real(r8), intent(out), optional :: tnd_nsnow(pcols,pver) !! snow number tendency (#/kg/s)
-
+
! Default return code.
rc = RC_OK
-
+
return
end subroutine CARMA_Detrain
!! For diagnostic groups, sets up up the CARMA bins based upon the CAM state.
!!
- !! @version July-2009
- !! @author Chuck Bardeen
+ !! @version July-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, prec_str, snow_str)
use time_manager, only: is_first_step
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(physics_state), intent(in) :: state !! physics state variables
@@ -239,29 +239,29 @@ subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, pr
real(r8), intent(in) :: dt !! time step
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(in), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
-
+
real(r8) :: mmr(pver) !! elements mass mixing ratio
integer :: ibin !! bin index
-
+
! Default return code.
rc = RC_OK
-
+
! By default, do nothing. If diagnosed groups exist, this needs to be replaced by
! code to determine the mass in each bin from the CAM state.
-
+
return
end subroutine CARMA_DiagnoseBins
-
-
+
+
!! For diagnostic groups, determines the tendencies on the CAM state from the CARMA bins.
!!
!! When the tracer hits at the surface at a time other than on its launch day,
!! it will be removed from the model.
!!
- !! @version July-2009
- !! @author Chuck Bardeen
+ !! @version July-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol, dt, rc, rliq, prec_str, snow_str, &
prec_sed, snow_sed, tnd_qsnow, tnd_nsnow, re_ice)
use shr_kind_mod, only: r8 => shr_kind_r8
@@ -272,7 +272,7 @@ subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol,
use camsrfexch, only: cam_out_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(cam_out_t), intent(inout) :: cam_out !! cam output to surface models
@@ -283,14 +283,14 @@ subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol,
real(r8), intent(in) :: dt !! time step
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(inout), optional :: prec_sed(pcols) !! total precip from cloud sedimentation (m/s)
real(r8), intent(inout), optional :: snow_sed(pcols) !! snow from cloud ice sedimentation (m/s)
real(r8), intent(inout), optional :: tnd_qsnow(pcols,pver) !! snow mass tendency (kg/kg/s)
real(r8), intent(inout), optional :: tnd_nsnow(pcols,pver) !! snow number tendency (#/kg/s)
real(r8), intent(out), optional :: re_ice(pcols,pver) !! ice effective radius (m)
-
+
real(r8) :: calday ! current calendar day
integer :: yr ! year
integer :: mon ! month
@@ -298,16 +298,16 @@ subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol,
integer :: ncsec ! time of day (seconds)
integer :: doy ! day of year
integer :: elapsed ! days since launch
-
-
+
+
! Default return code.
rc = RC_OK
! By default, do nothing. If diagnosed groups exist, this needs to be replaced by
! code to determine the bulk mass from the CARMA state.
-
+
if (present(re_ice)) re_ice(:,:) = 0.0_f
-
+
! Determine the day of year.
calday = get_curr_calday()
if ( is_perpetual() ) then
@@ -316,18 +316,18 @@ subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol,
call get_curr_date(yr, mon, day, ncsec)
end if
doy = floor(calday)
-
+
! Any material that has made it to the surface from a previous day should be removed.
elapsed = doy - carma_launch_doy
-
+
if (elapsed > 1) then
cstate%f_pc(pver, 1:min(NBIN,elapsed-1), :NELEM) = 0._f
end if
-
+
return
end subroutine CARMA_DiagnoseBulk
-
-
+
+
!! Calculates the emissions for CARMA aerosol particles.
!!
!! Emit particles after the specified launch day, with each bin being used
@@ -362,7 +362,7 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
use physconst, only: gravit
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -421,10 +421,10 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
! Determine the region based upon latitude and longitude. The last region is
! defined to be rest of the world (i.e. all regions not in another region).
doRegion = .False.
-
+
if (ielem == NELEM) then
doRegion = .True.
-
+
do i = 1, NELEM-1
if ((rgn_minlat(i) < lat(icol)) .and. (lat(icol) <= rgn_maxlat(i)) .and. &
(rgn_minlon(i) < lon(icol)) .and. (lon(icol) <= rgn_maxlon(i))) then
@@ -442,7 +442,7 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
doPS = .False.
if (rgn_ps(ielem) == 0._f) then
doPS = .True.
- else
+ else
if (rgn_ps(ielem) > 0._f) then
if (state%ps(icol) > rgn_ps(ielem)) then
doPS = .True.
@@ -450,10 +450,10 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
else
if (state%ps(icol) <= abs(rgn_ps(ielem))) then
doPS = .True.
- end if
+ end if
end if
end if
-
+
! Calculate the emission rate as a constant mass.
if (doRegion .and. doPS) then
@@ -464,14 +464,14 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
else
! For mmr, calculate a tendecy to keep the surface at that emitted value,
! rather than having a constant emission rate.
-! tendency(icol, pver) = -carma_emission_rate
- tendency(icol, pver) = ((-carma_emission_rate * dt) - state%q(icol, pver, icnst)) / dt
+! tendency(icol, pver) = -carma_emission_rate
+ tendency(icol, pver) = ((-carma_emission_rate * dt) - state%q(icol, pver, icnst)) / dt
end if
end if
! Scale with the land/ocean fraction.
frac = 0._f
-
+
if (rgn_doLand(ielem)) then
frac = frac + cam_in%landfrac(icol)
end if
@@ -487,7 +487,7 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
tendency(icol, pver) = tendency(icol, pver) * frac
end do
end if
-
+
return
end subroutine CARMA_EmitParticle
@@ -503,7 +503,7 @@ end subroutine CARMA_EmitParticle
subroutine CARMA_InitializeModel(carma, lq_carma, rc)
use constituents, only : pcnst
implicit none
-
+
type(carma_type), intent(inout) :: carma !! the carma object
logical, intent(inout) :: lq_carma(pcnst) !! flags to indicate whether the constituent
!! could have a CARMA tendency
@@ -511,7 +511,7 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
! Default return code.
rc = RC_OK
-
+
return
end subroutine CARMA_InitializeModel
@@ -527,10 +527,9 @@ end subroutine CARMA_InitializeModel
!! @version May-2009
subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask, q, rc)
use shr_kind_mod, only: r8 => shr_kind_r8
- use pmgrid, only: plat, plev, plon
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -551,21 +550,21 @@ subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask,
q(:,i) = 0._r8
end where
end do
-
+
return
end subroutine CARMA_InitializeParticle
-
-
+
+
!! Called after wet deposition has been performed. Allows the specific model to add
!! wet deposition of CARMA aerosols to the aerosols being communicated to the surface.
!!
- !! @version July-2011
- !! @author Chuck Bardeen
+ !! @version July-2011
+ !! @author Chuck Bardeen
subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
use camsrfexch, only: cam_out_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -573,13 +572,13 @@ subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
type(cam_out_t), intent(inout) :: cam_out !! cam output to surface models
type(physics_state), intent(in) :: state !! physics state variables
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
integer :: icol
-
+
! Default return code.
rc = RC_OK
-
+
return
- end subroutine CARMA_WetDeposition
+ end subroutine CARMA_WetDeposition
end module
diff --git a/src/physics/carma/models/test_tracers2/carma_model_mod.F90 b/src/physics/carma/models/test_tracers2/carma_model_mod.F90
index e5595a367e..ecb3324ed8 100644
--- a/src/physics/carma/models/test_tracers2/carma_model_mod.F90
+++ b/src/physics/carma/models/test_tracers2/carma_model_mod.F90
@@ -1,4 +1,4 @@
-!! This module is used to define a particular CARMA microphysical model. For
+!! This module is used to define a particular CARMA microphysical model. For
!! simple cases, this may be the only code that needs to be modified. This module
!! defines several constants and has three methods:
!!
@@ -11,7 +11,7 @@
!! microphysics has its own version of this file.
!!
!! This file is a test case that uses CARMA groups and bins to implement a
-!! tracer trajectory test for the Guam region. This is the reverse of
+!! tracer trajectory test for the Guam region. This is the reverse of
!! back trajectory calculations being done by John Bergman. In this model each
!! group is a region of the model and each bin represents a day. Emissions
!! start on the carma_launch_doy and then continue for NBINS days.
@@ -20,8 +20,8 @@
!! the number of regions or days tracked, you also need to reduce the number of
!! advected constituents added in configure.
!!
-!! @version April-2011
-!! @author Chuck Bardeen
+!! @version April-2011
+!! @author Chuck Bardeen
module carma_model_mod
use carma_precision_mod
@@ -36,7 +36,7 @@ module carma_model_mod
use carma_mod
use carma_flags_mod
use carma_model_flags_mod
-
+
use shr_kind_mod, only: r8 => shr_kind_r8
use radconstants, only: nswbands, nlwbands
use cam_abortutils, only: endrun
@@ -57,18 +57,18 @@ module carma_model_mod
public CARMA_InitializeModel
public CARMA_InitializeParticle
public CARMA_WetDeposition
-
+
! Declare public constants
integer, public, parameter :: NGROUP = 7 !! Number of particle groups
integer, public, parameter :: NELEM = 7 !! Number of particle elements
integer, public, parameter :: NBIN = 62 !! Number of particle bins
integer, public, parameter :: NSOLUTE = 0 !! Number of particle solutes
integer, public, parameter :: NGAS = 0 !! Number of gases
-
+
! These need to be defined, but are only used when the particles are radiatively active.
integer, public, parameter :: NMIE_RH = 8 !! Number of relative humidities for mie calculations
real(kind=f), public :: mie_rh(NMIE_RH)
-
+
! Defines whether the groups should undergo deep convection in phase 1 or phase 2.
! Water vapor and cloud particles are convected in phase 1, while all other constituents
! are done in phase 2.
@@ -78,7 +78,7 @@ module carma_model_mod
! should have a unique number.
integer, public, parameter :: I_INERT = 1 !! tracer composition
- ! Regions for ATTREX
+ ! Regions for ATTREX
real(kind=f), public :: rgn_minlat(NELEM-1) = (/ 0._f, -20._f, -30._f, -20._f, -10._f, -30._f /)
real(kind=f), public :: rgn_maxlat(NELEM-1) = (/ 20._f, 0._f, 20._f, 20._f, 20._f, -10._f /)
@@ -97,24 +97,24 @@ module carma_model_mod
!! Defines all the CARMA components (groups, elements, solutes and gases) and process
!! (coagulation, growth, nucleation) that will be part of the microphysical model.
!!
- !! @version May-2009
- !! @author Chuck Bardeen
+ !! @version May-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DefineModel(carma, rc)
type(carma_type), intent(inout) :: carma !! the carma object
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
! Local variables
real(kind=f), parameter :: rmin = 2.5e-4_f ! minimum radius (cm)
real(kind=f), parameter :: vmrat = 1.00001_f ! volume ratio
integer :: LUNOPRT
logical :: do_print
-
+
! Default return code.
rc = RC_OK
-
+
call CARMA_Get(carma, rc, do_print=do_print, LUNOPRT=LUNOPRT)
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMA_Get failed.')
-
+
! Report model specific configuration parameters.
if (masterproc) then
if (do_print) then
@@ -134,10 +134,10 @@ subroutine CARMA_DefineModel(carma, rc)
! should also be defined.
call CARMAGROUP_Create(carma, 1, "Region 1", rmin, vmrat, I_SPHERE, 1._f, .True., rc, shortname="CRRG1")
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMAGROUP_Create failed.')
-
+
call CARMAGROUP_Create(carma, 2, "Region 2", rmin, vmrat, I_SPHERE, 1._f, .True., rc, shortname="CRRG2")
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMAGROUP_Create failed.')
-
+
call CARMAGROUP_Create(carma, 3, "Region 3", rmin, vmrat, I_SPHERE, 1._f, .True., rc, shortname="CRRG3")
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMAGROUP_Create failed.')
@@ -153,17 +153,17 @@ subroutine CARMA_DefineModel(carma, rc)
call CARMAGROUP_Create(carma, 7, "Rest of World", rmin, vmrat, I_SPHERE, 1._f, .True., rc, shortname="CRRG7")
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMAGROUP_Create failed.')
-
+
! Define the Elements
!
! NOTE: For CAM, the optional shortname needs to be provided for the group. These names
! should be 6 characters or less and without spaces.
call CARMAELEMENT_Create(carma, 1, 1, "Region 1", WTMOL_AIR, I_INVOLATILE, I_INERT, rc, shortname="CRRG1")
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMAElement_Create failed.')
-
+
call CARMAELEMENT_Create(carma, 2, 2, "Region 2", WTMOL_AIR, I_INVOLATILE, I_INERT, rc, shortname="CRRG2")
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMAElement_Create failed.')
-
+
call CARMAELEMENT_Create(carma, 3, 3, "Region 3", WTMOL_AIR, I_INVOLATILE, I_INERT, rc, shortname="CRRG3")
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMAElement_Create failed.')
@@ -179,13 +179,13 @@ subroutine CARMA_DefineModel(carma, rc)
call CARMAELEMENT_Create(carma, 7, 7, "Rest of World", WTMOL_AIR, I_INVOLATILE, I_INERT, rc, shortname="CRRG7")
if (rc < RC_OK) call endrun('CARMA_DefineModel::CARMAElement_Create failed.')
-
+
! Define the Solutes
-
+
! Define the Gases
-
+
! Define the Processes
@@ -196,8 +196,8 @@ end subroutine CARMA_DefineModel
!! Defines all the CARMA components (groups, elements, solutes and gases) and process
!! (coagulation, growth, nucleation) that will be part of the microphysical model.
!!
- !! @version May-2009
- !! @author Chuck Bardeen
+ !! @version May-2009
+ !! @author Chuck Bardeen
!!
!! @see CARMASTATE_SetDetrain
subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq, prec_str, snow_str, &
@@ -207,7 +207,7 @@ subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq,
use time_manager, only: get_curr_date, get_perp_date, get_curr_calday, is_perpetual
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(cam_in_t), intent(in) :: cam_in !! surface input
@@ -217,27 +217,27 @@ subroutine CARMA_Detrain(carma, cstate, cam_in, dlf, state, icol, dt, rc, rliq,
real(r8), intent(in) :: dt !! time step (s)
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(out), optional :: tnd_qsnow(pcols,pver) !! snow mass tendency (kg/kg/s)
real(r8), intent(out), optional :: tnd_nsnow(pcols,pver) !! snow number tendency (#/kg/s)
-
+
! Default return code.
rc = RC_OK
-
+
return
end subroutine CARMA_Detrain
!! For diagnostic groups, sets up up the CARMA bins based upon the CAM state.
!!
- !! @version July-2009
- !! @author Chuck Bardeen
+ !! @version July-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, prec_str, snow_str)
use time_manager, only: is_first_step
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(physics_state), intent(in) :: state !! physics state variables
@@ -246,29 +246,29 @@ subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, pr
real(r8), intent(in) :: dt !! time step
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(in), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
-
+
real(r8) :: mmr(pver) !! elements mass mixing ratio
integer :: ibin !! bin index
-
+
! Default return code.
rc = RC_OK
-
+
! By default, do nothing. If diagnosed groups exist, this needs to be replaced by
! code to determine the mass in each bin from the CAM state.
-
+
return
end subroutine CARMA_DiagnoseBins
-
-
+
+
!! For diagnostic groups, determines the tendencies on the CAM state from the CARMA bins.
!!
!! When the tracer hits at the surface at a time other than on its launch day,
!! it will be removed from the model.
!!
- !! @version July-2009
- !! @author Chuck Bardeen
+ !! @version July-2009
+ !! @author Chuck Bardeen
subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol, dt, rc, rliq, prec_str, snow_str, &
prec_sed, snow_sed, tnd_qsnow, tnd_nsnow, re_ice)
use shr_kind_mod, only: r8 => shr_kind_r8
@@ -279,7 +279,7 @@ subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol,
use camsrfexch, only: cam_out_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
type(carmastate_type), intent(inout) :: cstate !! the carma state object
type(cam_out_t), intent(inout) :: cam_out !! cam output to surface models
@@ -290,14 +290,14 @@ subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol,
real(r8), intent(in) :: dt !! time step
integer, intent(out) :: rc !! return code, negative indicates failure
real(r8), intent(inout), optional :: rliq(pcols) !! vertical integral of liquid not yet in q(ixcldliq)
- real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
+ real(r8), intent(inout), optional :: prec_str(pcols) !! [Total] sfc flux of precip from stratiform (m/s)
real(r8), intent(inout), optional :: snow_str(pcols) !! [Total] sfc flux of snow from stratiform (m/s)
real(r8), intent(inout), optional :: prec_sed(pcols) !! total precip from cloud sedimentation (m/s)
real(r8), intent(inout), optional :: snow_sed(pcols) !! snow from cloud ice sedimentation (m/s)
real(r8), intent(inout), optional :: tnd_qsnow(pcols,pver) !! snow mass tendency (kg/kg/s)
real(r8), intent(inout), optional :: tnd_nsnow(pcols,pver) !! snow number tendency (#/kg/s)
real(r8), intent(out), optional :: re_ice(pcols,pver) !! ice effective radius (m)
-
+
real(r8) :: calday ! current calendar day
integer :: yr ! year
integer :: mon ! month
@@ -305,16 +305,16 @@ subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol,
integer :: ncsec ! time of day (seconds)
integer :: doy ! day of year
integer :: elapsed ! days since launch
-
-
+
+
! Default return code.
rc = RC_OK
! By default, do nothing. If diagnosed groups exist, this needs to be replaced by
! code to determine the bulk mass from the CARMA state.
-
+
if (present(re_ice)) re_ice(:,:) = 0.0_f
-
+
! Determine the day of year.
calday = get_curr_calday()
if ( is_perpetual() ) then
@@ -323,18 +323,18 @@ subroutine CARMA_DiagnoseBulk(carma, cstate, cam_out, state, pbuf, ptend, icol,
call get_curr_date(yr, mon, day, ncsec)
end if
doy = floor(calday)
-
+
! Any material that has made it to the surface from a previous day should be removed.
elapsed = doy - carma_launch_doy
-
+
if (elapsed > 1) then
cstate%f_pc(pver, 1:min(NBIN,elapsed-1), :NELEM) = 0._f
end if
-
+
return
end subroutine CARMA_DiagnoseBulk
-
-
+
+
!! Calculates the emissions for CARMA aerosol particles.
!!
!! Emit particles after the specified launch day, with each bin being used
@@ -369,7 +369,7 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
use physconst, only: gravit
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -420,19 +420,19 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
if ((elapsed + 1) == ibin) then
! Determine the latitude and longitude of each column.
-
+
lat = state%lat(:ncol) / DEG2RAD
lon = state%lon(:ncol) / DEG2RAD
-
+
do icol = 1, ncol
! Determine the region based upon latitude and longitude. The last region is
! defined to be rest of the world (i.e. all regions not in another region).
doRegion = .False.
-
+
if (ielem == NELEM) then
doRegion = .True.
-
+
do i = 1, NELEM-1
if ((rgn_minlat(i) < lat(icol)) .and. (lat(icol) <= rgn_maxlat(i)) .and. &
(rgn_minlon(i) < lon(icol)) .and. (lon(icol) <= rgn_maxlon(i))) then
@@ -450,7 +450,7 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
doPS = .False.
if (rgn_ps(ielem) == 0._f) then
doPS = .True.
- else
+ else
if (rgn_ps(ielem) > 0._f) then
if (state%ps(icol) > rgn_ps(ielem)) then
doPS = .True.
@@ -458,10 +458,10 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
else
if (state%ps(icol) <= abs(rgn_ps(ielem))) then
doPS = .True.
- end if
+ end if
end if
end if
-
+
! Calculate the emission rate as a constant mass.
if (doRegion .and. doPS) then
@@ -472,14 +472,14 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
else
! For mmr, calculate a tendecy to keep the surface at that emitted value,
! rather than having a constant emission rate.
-! tendency(icol, pver) = -carma_emission_rate
- tendency(icol, pver) = ((-carma_emission_rate * dt) - state%q(icol, pver, icnst)) / dt
+! tendency(icol, pver) = -carma_emission_rate
+ tendency(icol, pver) = ((-carma_emission_rate * dt) - state%q(icol, pver, icnst)) / dt
end if
end if
! Scale with the land/ocean fraction.
frac = 0._f
-
+
if (rgn_doLand(ielem)) then
frac = frac + cam_in%landfrac(icol)
end if
@@ -495,7 +495,7 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
tendency(icol, pver) = tendency(icol, pver) * frac
end do
end if
-
+
return
end subroutine CARMA_EmitParticle
@@ -511,7 +511,7 @@ end subroutine CARMA_EmitParticle
subroutine CARMA_InitializeModel(carma, lq_carma, rc)
use constituents, only : pcnst
implicit none
-
+
type(carma_type), intent(inout) :: carma !! the carma object
logical, intent(inout) :: lq_carma(pcnst) !! flags to indicate whether the constituent
!! could have a CARMA tendency
@@ -519,7 +519,7 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
! Default return code.
rc = RC_OK
-
+
return
end subroutine CARMA_InitializeModel
@@ -535,10 +535,9 @@ end subroutine CARMA_InitializeModel
!! @version May-2009
subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask, q, rc)
use shr_kind_mod, only: r8 => shr_kind_r8
- use pmgrid, only: plat, plev, plon
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -559,21 +558,21 @@ subroutine CARMA_InitializeParticle(carma, ielem, ibin, latvals, lonvals, mask,
q(:,i) = 0._r8
end where
end do
-
+
return
end subroutine CARMA_InitializeParticle
-
-
+
+
!! Called after wet deposition has been performed. Allows the specific model to add
!! wet deposition of CARMA aerosols to the aerosols being communicated to the surface.
!!
- !! @version July-2011
- !! @author Chuck Bardeen
+ !! @version July-2011
+ !! @author Chuck Bardeen
subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
use camsrfexch, only: cam_out_t
implicit none
-
+
type(carma_type), intent(in) :: carma !! the carma object
integer, intent(in) :: ielem !! element index
integer, intent(in) :: ibin !! bin index
@@ -581,13 +580,13 @@ subroutine CARMA_WetDeposition(carma, ielem, ibin, sflx, cam_out, state, rc)
type(cam_out_t), intent(inout) :: cam_out !! cam output to surface models
type(physics_state), intent(in) :: state !! physics state variables
integer, intent(out) :: rc !! return code, negative indicates failure
-
+
integer :: icol
-
+
! Default return code.
rc = RC_OK
-
+
return
- end subroutine CARMA_WetDeposition
+ end subroutine CARMA_WetDeposition
end module
diff --git a/src/physics/cosp2/.cosp_sparse_checkout b/src/physics/cosp2/.cosp_sparse_checkout
new file mode 100644
index 0000000000..4f00cd9a73
--- /dev/null
+++ b/src/physics/cosp2/.cosp_sparse_checkout
@@ -0,0 +1 @@
+/src/
diff --git a/src/physics/cosp2/Makefile.in b/src/physics/cosp2/Makefile.in
index 69a37713fa..881a1a5679 100644
--- a/src/physics/cosp2/Makefile.in
+++ b/src/physics/cosp2/Makefile.in
@@ -65,10 +65,10 @@ cosp_grLidar532_interface.o: cosp_kinds.o
cosp_atlid_interface.o : cosp_kinds.o
cosp_cloudsat_interface.o : cosp_kinds.o cosp_config.o quickbeam.o
cosp_isccp_interface.o : cosp_kinds.o icarus.o
-cosp_misr_interface.o : cosp_kinds.o
+cosp_misr_interface.o : cosp_kinds.o
cosp_modis_interface.o : cosp_kinds.o cosp_config.o modis_simulator.o
cosp_rttov_interfaceSTUB.o : cosp_kinds.o cosp_config.o cosp_rttovSTUB.o
-cosp_parasol_interface.o : cosp_kinds.o
+cosp_parasol_interface.o : cosp_kinds.o
cosp_rttovSTUB.o : cosp_kinds.o cosp_config.o cosp_constants.o
MISR_simulator.o : cosp_kinds.o cosp_config.o cosp_stats.o
modis_simulator.o : cosp_kinds.o cosp_config.o cosp_stats.o
@@ -82,7 +82,7 @@ scops.o : cosp_kinds.o mo_rng.o cosp_errorHandling.o
prec_scops.o : cosp_kinds.o cosp_config.o
cosp_optics.o : cosp_kinds.o cosp_constants.o modis_simulator.o
quickbeam_optics.o : cosp_kinds.o cosp_config.o cosp_constants.o quickbeam.o \
- cosp_errorHandling.o array_lib.o math_lib.o optics_lib.o
+ cosp_errorHandling.o array_lib.o math_lib.o optics_lib.o
optics_lib.o : cosp_kinds.o cosp_errorHandling.o
array_lib.o : cosp_kinds.o cosp_errorHandling.o
math_lib.o : cosp_kinds.o array_lib.o mrgrnk.o
@@ -107,37 +107,37 @@ quickbeam.o: $(RS_PATH)/quickbeam.F90
MISR_simulator.o : $(MISR_PATH)/MISR_simulator.F90
$(F90) $(F90FLAGS) -c $<
-modis_simulator.o : $(MODIS_PATH)/modis_simulator.F90
+modis_simulator.o : $(MODIS_PATH)/modis_simulator.F90
$(F90) $(F90FLAGS) -c $<
-cosp_rttov_interfaceSTUB.o : $(COSP_PATH)/src/simulator/cosp_rttov_interfaceSTUB.F90
+cosp_rttov_interfaceSTUB.o : $(COSP_PATH)/src/src/simulator/cosp_rttov_interfaceSTUB.F90
$(F90) $(F90FLAGS) -c $<
-cosp_misr_interface.o : $(COSP_PATH)/src/simulator/cosp_misr_interface.F90
+cosp_misr_interface.o : $(COSP_PATH)/src/src/simulator/cosp_misr_interface.F90
$(F90) $(F90FLAGS) -c $<
-cosp_modis_interface.o : $(COSP_PATH)/src/simulator/cosp_modis_interface.F90
+cosp_modis_interface.o : $(COSP_PATH)/src/src/simulator/cosp_modis_interface.F90
$(F90) $(F90FLAGS) -c $<
-cosp_isccp_interface.o : $(COSP_PATH)/src/simulator/cosp_isccp_interface.F90
+cosp_isccp_interface.o : $(COSP_PATH)/src/src/simulator/cosp_isccp_interface.F90
$(F90) $(F90FLAGS) -c $<
-cosp_calipso_interface.o : $(COSP_PATH)/src/simulator/cosp_calipso_interface.F90
+cosp_calipso_interface.o : $(COSP_PATH)/src/src/simulator/cosp_calipso_interface.F90
$(F90) $(F90FLAGS) -c $<
-cosp_grLidar532_interface.o : $(COSP_PATH)/src/simulator/cosp_grLidar532_interface.F90
+cosp_grLidar532_interface.o : $(COSP_PATH)/src/src/simulator/cosp_grLidar532_interface.F90
$(F90) $(F90FLAGS) -c $<
-cosp_atlid_interface.o : $(COSP_PATH)/src/simulator/cosp_atlid_interface.F90
+cosp_atlid_interface.o : $(COSP_PATH)/src/src/simulator/cosp_atlid_interface.F90
$(F90) $(F90FLAGS) -c $<
-cosp_cloudsat_interface.o : $(COSP_PATH)/src/simulator/cosp_cloudsat_interface.F90
+cosp_cloudsat_interface.o : $(COSP_PATH)/src/src/simulator/cosp_cloudsat_interface.F90
$(F90) $(F90FLAGS) -c $<
-cosp_parasol_interface.o : $(COSP_PATH)/src/simulator/cosp_parasol_interface.F90
+cosp_parasol_interface.o : $(COSP_PATH)/src/src/simulator/cosp_parasol_interface.F90
$(F90) $(F90FLAGS) -c $<
-cosp_rttovSTUB.o : $(RT_PATH)/cosp_rttovSTUB.F90
+cosp_rttovSTUB.o : $(RT_PATH)/cosp_rttovSTUB.F90
$(F90) $(F90FLAGS) -c $<
lidar_simulator.o : $(CS_PATH)/lidar_simulator.F90
@@ -146,19 +146,19 @@ lidar_simulator.o : $(CS_PATH)/lidar_simulator.F90
parasol.o : $(PARASOL_PATH)/parasol.F90
$(F90) $(F90FLAGS) -c $<
-cosp_constants.o : $(COSP_PATH)/src/cosp_constants.F90
+cosp_constants.o : $(COSP_PATH)/src/src/cosp_constants.F90
$(F90) $(F90FLAGS) -c $<
cosp_kinds.o : $(COSP_PATH)/cosp_kinds.F90
$(F90) $(F90FLAGS) -c $<
-cosp_config.o : $(COSP_PATH)/src/cosp_config.F90
+cosp_config.o : $(COSP_PATH)/src/src/cosp_config.F90
$(F90) $(F90FLAGS) -c $<
-cosp.o : $(COSP_PATH)/src/cosp.F90
+cosp.o : $(COSP_PATH)/src/src/cosp.F90
$(F90) $(F90FLAGS) -c $<
-cosp_stats.o : $(COSP_PATH)/src/cosp_stats.F90
+cosp_stats.o : $(COSP_PATH)/src/src/cosp_stats.F90
$(F90) $(F90FLAGS) -c $<
# COSPv1.4 interface
diff --git a/src/physics/rrtmg/radiation.F90 b/src/physics/rrtmg/radiation.F90
index 31e33b183d..4ca347d749 100644
--- a/src/physics/rrtmg/radiation.F90
+++ b/src/physics/rrtmg/radiation.F90
@@ -17,7 +17,7 @@ module radiation
use time_manager, only: get_nstep, is_first_restart_step, &
get_curr_calday, get_step_size
-use rad_constituents, only: N_DIAG, rad_cnst_get_call_list, rad_cnst_get_info, &
+use rad_constituents, only: N_DIAG, rad_cnst_get_call_list, &
rad_cnst_get_gas, rad_cnst_out, oldcldoptics, &
liqcldoptics, icecldoptics
@@ -363,7 +363,6 @@ subroutine radiation_init(pbuf2d)
use rad_solar_var, only: rad_solar_var_init
use radiation_data, only: rad_data_init
use cloud_rad_props, only: cloud_rad_props_init
- use modal_aer_opt, only: modal_aer_opt_init
use rrtmg_state, only: rrtmg_state_init
use time_manager, only: is_first_step
@@ -372,7 +371,7 @@ subroutine radiation_init(pbuf2d)
type(physics_buffer_desc), pointer :: pbuf2d(:,:)
! local variables
- integer :: icall, nmodes
+ integer :: icall
logical :: active_calls(0:N_DIAG)
integer :: nstep ! current timestep number
logical :: history_amwg ! output the variables used by the AMWG diag package
@@ -417,11 +416,6 @@ subroutine radiation_init(pbuf2d)
history_budget_out = history_budget, &
history_budget_histfile_num_out = history_budget_histfile_num)
- ! Determine whether modal aerosols are affecting the climate, and if so
- ! then initialize the modal aerosol optics module
- call rad_cnst_get_info(0, nmodes=nmodes)
- if (nmodes > 0) call modal_aer_opt_init()
-
! "irad_always" is number of time steps to execute radiation continuously from start of
! initial OR restart run
nstep = get_nstep()
@@ -1564,4 +1558,3 @@ end subroutine calc_col_mean
!===============================================================================
end module radiation
-
diff --git a/src/physics/rrtmg/rrtmg_state.F90 b/src/physics/rrtmg/rrtmg_state.F90
index 2d1ca05985..62b7a2d997 100644
--- a/src/physics/rrtmg/rrtmg_state.F90
+++ b/src/physics/rrtmg/rrtmg_state.F90
@@ -233,7 +233,7 @@ subroutine rrtmg_state_update(pstate,pbuf,icall,rstate)
chi_eff(:) = chi_eff(:) / 2.1415e-5_r8 ! O3 column above in DU
endwhere
- call outfld('O3colAbove', chi_eff(:ncol), pcols, lchnk)
+ call outfld('O3colAbove', chi_eff(:ncol), ncol, lchnk)
end subroutine rrtmg_state_update
diff --git a/src/physics/simple/frierson.F90 b/src/physics/simple/frierson.F90
new file mode 100644
index 0000000000..08e524bbdc
--- /dev/null
+++ b/src/physics/simple/frierson.F90
@@ -0,0 +1,1174 @@
+module frierson
+!------------------------------------------------------------------------------------
+!
+! Purpose: Implement idealized forcings described in
+! Frierson, et al. (2006), "A Gray-Radiation
+! Aquaplanet Moist GCM. Part I. Static Stability and Eddy Scale"
+! J. Atmos. Sci., Vol. 63, 2548-2566.
+!
+! DOI: https://doi.org/10.1175/JAS3753.1
+!
+!====================================================================================
+ !
+ ! The only modules that are permitted
+ !--------------------------------------
+ use shr_kind_mod, only: r8 => shr_kind_r8
+ use shr_const_mod, only: pi => shr_const_pi
+
+ ! Set all Global values and routine to private by default
+ ! and then explicitly set their exposure
+ !---------------------------------------------------------
+ implicit none
+ private
+ save
+
+ public:: frierson_set_const
+ public:: frierson_condensate_NONE
+ public:: frierson_condensate
+ public:: frierson_condensate_TJ16
+ public:: frierson_condensate_USER
+ public:: frierson_pbl
+ public:: frierson_pbl_USER
+ public:: frierson_radiation
+ public:: frierson_radiation_USER
+
+ ! Global Tuning Parameters:
+ ! T0 and E0 are the temperature and saturation vapor pressure used
+ ! to calculate qsat values, the saturation value for Q (kg/kg)
+ !--------------------------------------------------------------------
+ real(r8):: T0
+ real(r8):: E0
+ real(r8):: Erad
+ real(r8):: Wind_min
+ real(r8):: Z0
+ real(r8):: Ri_c
+ real(r8):: Karman
+ real(r8):: Fb
+ real(r8):: Rs0
+ real(r8):: DeltaS
+ real(r8):: Tau_eqtr
+ real(r8):: Tau_pole
+ real(r8):: LinFrac
+ real(r8):: Boltz
+ real(r8):: C_ocn
+
+ ! Private data
+ !----------------------
+ real(r8),private :: gravit ! g: gravitational acceleration (m/s2)
+ real(r8),private :: cappa ! Rd/cp
+ real(r8),private :: rair ! Rd: dry air gas constant (J/K/kg)
+ real(r8),private :: cpair ! cp: specific heat of dry air (J/K/kg)
+ real(r8),private :: latvap ! L: latent heat of vaporization (J/kg)
+ real(r8),private :: rh2o ! Rv: water vapor gas constant (J/K/kg)
+ real(r8),private :: epsilo ! Rd/Rv: ratio of h2o to dry air molecular weights
+ real(r8),private :: rhoh2o ! density of liquid water (kg/m3)
+ real(r8),private :: zvir ! (rh2o/rair) - 1, needed for virtual temperature
+ real(r8),private :: ps0 ! Base state surface pressure (Pa)
+
+ real(r8),private :: latvap_div_cpair ! latvap/cpair
+ real(r8),private :: latvap_div_rh2o ! latvap/rh2o
+
+ real(r8),private,allocatable:: etamid(:) ! hybrid coordinate - midpoints
+
+
+contains
+ !=======================================================================
+ subroutine frierson_set_const(I_gravit,I_cappa ,I_rair ,I_cpair ,I_latvap , &
+ I_rh2o ,I_epsilo ,I_rhoh2o ,I_zvir ,I_ps0 , &
+ I_etamid,I_T0 ,I_E0 ,I_Erad ,I_Wind_min, &
+ I_Z0 ,I_Ri_c ,I_Karman ,I_Fb ,I_Rs0 , &
+ I_DeltaS,I_Tau_eqtr,I_Tau_pole,I_LinFrac,I_Boltz , &
+ I_Cocn )
+ !
+ ! frierson_set_const: Set parameters and constants for the Frierson
+ ! Model fomulation. Optional inputs can be provided
+ ! to over-ride the model defaults.
+ !=====================================================================
+
+ use cam_abortutils, only: handle_allocate_error
+
+ !
+ ! Passed Variables
+ !-------------------
+ real(r8),intent(in):: I_gravit
+ real(r8),intent(in):: I_cappa
+ real(r8),intent(in):: I_rair
+ real(r8),intent(in):: I_cpair
+ real(r8),intent(in):: I_latvap
+ real(r8),intent(in):: I_rh2o
+ real(r8),intent(in):: I_epsilo
+ real(r8),intent(in):: I_rhoh2o
+ real(r8),intent(in):: I_zvir
+ real(r8),intent(in):: I_ps0
+ real(r8),intent(in):: I_etamid(:)
+
+ real(r8),intent(in) :: I_T0
+ real(r8),intent(in) :: I_E0
+ real(r8),intent(in) :: I_Erad
+ real(r8),intent(in) :: I_Wind_min
+ real(r8),intent(in) :: I_Z0
+ real(r8),intent(in) :: I_Ri_c
+ real(r8),intent(in) :: I_Karman
+ real(r8),intent(in) :: I_Fb
+ real(r8),intent(in) :: I_Rs0
+ real(r8),intent(in) :: I_DeltaS
+ real(r8),intent(in) :: I_Tau_eqtr
+ real(r8),intent(in) :: I_Tau_pole
+ real(r8),intent(in) :: I_LinFrac
+ real(r8),intent(in) :: I_Boltz
+ real(r8),intent(in) :: I_Cocn
+
+ integer :: ierr
+
+ ! Set global constants for later use
+ !------------------------------------
+ gravit = I_gravit
+ cappa = I_cappa
+ rair = I_rair
+ cpair = I_cpair
+ latvap = I_latvap
+ rh2o = I_rh2o
+ epsilo = I_epsilo
+ rhoh2o = I_rhoh2o
+ zvir = I_zvir
+ ps0 = I_ps0
+ T0 = I_T0
+ E0 = I_E0
+ Erad = I_Erad
+ Wind_min = I_Wind_min
+ Z0 = I_Z0
+ Ri_c = I_Ri_c
+ Karman = I_Karman
+ Fb = I_Fb
+ Rs0 = I_Rs0
+ DeltaS = I_DeltaS
+ Tau_eqtr = I_Tau_eqtr
+ Tau_pole = I_Tau_pole
+ LinFrac = I_LinFrac
+ Boltz = I_Boltz
+ C_ocn = I_Cocn
+
+ latvap_div_cpair = latvap/cpair
+ latvap_div_rh2o = latvap/rh2o
+
+ ! allocate space and set the level information
+ !----------------------------------------------
+ allocate(etamid(size(I_etamid)),stat=ierr)
+ if (ierr /= 0) then
+ call handle_allocate_error(ierr, 'frierson_set_const', 'etamid')
+ end if
+
+ etamid = I_etamid
+
+ end subroutine frierson_set_const
+ !=======================================================================
+
+
+ !=======================================================================
+ subroutine frierson_condensate_NONE(ncol,pver,pmid,T,qv,relhum,precl)
+ !
+ ! Precip_process: Implement NO large-scale condensation/precipitation
+ !=======================================================================
+ !
+ ! Passed Variables
+ !---------------------
+ integer ,intent(in) :: ncol ! number of columns
+ integer ,intent(in) :: pver ! number of vertical levels
+ real(r8),intent(in) :: pmid (ncol,pver) ! mid-point pressure (Pa)
+ real(r8),intent(inout):: T (ncol,pver) ! temperature (K)
+ real(r8),intent(inout):: qv (ncol,pver) ! specific humidity Q (kg/kg)
+ real(r8),intent(out) :: relhum(ncol,pver) ! relative humidity
+ real(r8),intent(out) :: precl (ncol) ! large-scale precipitation rate (m/s)
+ !
+ ! Local Values
+ !-------------
+ real(r8):: qsat
+ integer :: i, k
+
+ ! Set large scale precipitation rates to zero
+ !--------------------------------------------------------------------------
+ precl(:) = 0.0_r8
+
+ ! Large-Scale Condensation and Precipitation without cloud stage
+ !---------------------------------------------------------------
+ do k = 1, pver
+ do i = 1, ncol
+ ! calculate saturation value for Q
+ !----------------------------------
+ qsat = epsilo*E0/pmid(i,k)*exp(-latvap_div_rh2o*((1._r8/T(i,k))-1._r8/T0))
+
+ ! Set percent relative humidity
+ !-------------------------------
+ relhum(i,k) = (qv(i,k)/qsat)*100._r8
+ end do
+ end do
+
+ end subroutine frierson_condensate_NONE
+ !=======================================================================
+
+
+ !=======================================================================
+ subroutine frierson_condensate(ncol,pver,dtime,pmid,pdel,T,qv,relhum,precl,evapdt,evapdq)
+ !
+ ! Precip_process: Implement large-scale condensation/precipitation
+ ! from Frierson 2006.
+ !
+ !=======================================================================
+ !
+ ! Passed Variables
+ !---------------------
+ integer ,intent(in) :: ncol ! number of columns
+ integer ,intent(in) :: pver ! number of vertical levels
+ real(r8),intent(in) :: dtime ! time step (s)
+ real(r8),intent(in) :: pmid (ncol,pver) ! mid-point pressure (Pa)
+ real(r8),intent(in) :: pdel (ncol,pver) ! layer thickness (Pa)
+ real(r8),intent(inout):: T (ncol,pver) ! temperature (K)
+ real(r8),intent(inout):: qv (ncol,pver) ! specific humidity Q (kg/kg)
+ real(r8),intent(out) :: relhum(ncol,pver) ! relative humidity
+ real(r8),intent(out) :: precl (ncol) ! large-scale precipitation rate (m/s)
+ real(r8),intent(out) :: evapdt(ncol,pver) ! T tendency due to re-evaporation
+ real(r8),intent(out) :: evapdq(ncol,pver) ! Q tendency due to re-evaporation
+ !
+ ! Local Values
+ !-------------
+ logical,parameter :: do_evap = .true.
+
+ real(r8):: esat (ncol,pver)
+ real(r8):: qsat (ncol,pver)
+ real(r8):: dqsat(ncol,pver)
+ real(r8):: qdel (ncol,pver)
+ real(r8):: tdel (ncol,pver)
+ real(r8):: qnew (ncol,pver)
+ real(r8):: tnew (ncol,pver)
+ real(r8):: qext (ncol)
+ real(r8):: qdef (ncol)
+
+ integer :: i, k
+
+ ! Large-Scale Condensation and Precipitation
+ !--------------------------------------------
+ do k = 1,pver
+
+ ! calculate saturation vapor pressure
+ !-------------------------------------
+ esat(:,k) = E0*exp(-(latvap_div_rh2o)*((1._r8/T(:,k))-1._r8/T0))
+
+ ! calculate saturation value for Q
+ !----------------------------------
+ do i = 1,ncol
+ if(pmid(i,k) > (1._r8-epsilo)*esat(i,k)) then
+ qsat (i,k) = epsilo*esat(i,k)/pmid(i,k)
+ dqsat(i,k) = (latvap_div_rh2o)*qsat(i,k)/(T(i,k)**2)
+ else
+ qsat (i,k) = 0._r8
+ dqsat(i,k) = 0._r8
+ endif
+ end do
+
+ ! if > 100% relative humidity, rain falls out
+ !---------------------------------------------
+ where(((qv(:,k)-qsat(:,k))*qsat(:,k)) > 0._r8)
+ qdel (:,k) = (qsat(:,k)-qv(:,k))/(1._r8+(latvap_div_cpair)*dqsat(:,k))
+ tdel (:,k) = -(latvap_div_cpair)*qdel(:,k)
+ else where
+ qdel (:,k) = 0._r8
+ tdel (:,k) = 0._r8
+ end where
+
+ ! Update temperature and water vapor
+ !-----------------------------------
+ qnew(:,k) = qv(:,k) + qdel(:,k)
+ tnew(:,k) = T(:,k) + tdel(:,k)
+ end do
+
+ ! optionally allow for re-evaporation of falling precip
+ !-------------------------------------------------------
+ if(do_evap) then
+ ! Initialize work array for excess Q
+ !--------------------------------------
+ qext(:) = 0._r8
+
+ ! Loop down thru the model levels
+ !---------------------------------
+ do k = 1, pver
+
+ ! Add qdel for the current level to the excess
+ !----------------------------------------------
+ where(qdel(:,k) < 0._r8) qext(:) = qext(:) - qdel(:,k)*pdel(:,k)/gravit
+
+ ! Evaporate excess Q where needed
+ !----------------------------------
+ qdef(:) = 0._r8
+ where((qdel(:,k) >= 0._r8).and.(qext(:) > 0._r8))
+ qext(:) = qext(:)*gravit/pdel(:,k)
+ qdef(:) = (qsat(:,k)-qv(:,k))/(1._r8+(latvap_div_cpair)*dqsat(:,k))
+ qdef(:) = min(qext(:),max(qdef(:),0._r8))
+ qdel(:,k) = qdel(:,k) + qdef(:)
+ tdel(:,k) = tdel(:,k) -(latvap_div_cpair)*qdef(:)
+ qext(:) = (qext(:)-qdef(:))*pdel(:,k)/gravit
+
+ ! Update temperature and water vapor
+ !-----------------------------------
+ qnew(:,k) = qv(:,k) + qdel(:,k)
+ tnew(:,k) = T(:,k) + tdel(:,k)
+ end where
+
+ ! Save T/Q tendencies due to re-evaporation
+ !--------------------------------------------
+ evapdq(:,k) = qdef(:)/dtime
+ evapdt(:,k) = -qdef(:)*latvap_div_cpair/dtime
+ end do ! k = 1, pver
+ else
+ ! Set T/Q re-evaporation tendencies to 0
+ !--------------------------------------------
+ evapdt(:,:) = 0._r8
+ evapdq(:,:) = 0._r8
+ endif
+
+ ! Set large scale precipitation rates to zero
+ !--------------------------------------------------------------------------
+ precl(:) = 0.0_r8
+
+ ! Calculate resulting precip value and relative humidity
+ !--------------------------------------------------------
+ do k = 1, pver
+ precl (:) = precl(:) - (qdel(:,k)*pdel(:,k))/(gravit*rhoh2o)
+ qsat (:,k) = (epsilo/pmid(:,k))*E0*exp(-latvap_div_rh2o*((1._r8/tnew(:,k))-1._r8/T0))
+ relhum(:,k) = (qnew(:,k)/qsat (:,k))*100._r8
+ end do
+ precl(:) = max(precl(:),0._r8)/dtime
+
+ ! Update T and qv values due to precipitation
+ !--------------------------------------------
+ qv(:,:) = qnew(:,:)
+ T (:,:) = tnew(:,:)
+
+ end subroutine frierson_condensate
+ !=======================================================================
+
+
+ !=======================================================================
+ subroutine frierson_condensate_TJ16(ncol,pver,dtime,pmid,pdel,T,qv,relhum,precl)
+ !
+ ! Precip_process: Implement large-scale condensation/precipitation
+ ! from TJ16.
+ !
+ !=======================================================================
+ !
+ ! Passed Variables
+ !---------------------
+ integer ,intent(in) :: ncol ! number of columns
+ integer ,intent(in) :: pver ! number of vertical levels
+ real(r8),intent(in) :: dtime ! time step (s)
+ real(r8),intent(in) :: pmid (ncol,pver) ! mid-point pressure (Pa)
+ real(r8),intent(in) :: pdel (ncol,pver) ! layer thickness (Pa)
+ real(r8),intent(inout):: T (ncol,pver) ! temperature (K)
+ real(r8),intent(inout):: qv (ncol,pver) ! specific humidity Q (kg/kg)
+ real(r8),intent(out) :: relhum(ncol,pver) ! relative humidity
+ real(r8),intent(out) :: precl (ncol) ! large-scale precipitation rate (m/s)
+ !
+ ! Local Values
+ !-------------
+ real(r8):: qsat
+ real(r8):: Crate
+ integer :: i, k
+
+ ! Set large scale precipitation rates to zero
+ !--------------------------------------------------------------------------
+ precl(:) = 0.0_r8
+
+ ! Large-Scale Condensation and Precipitation without cloud stage
+ !---------------------------------------------------------------
+ do k = 1, pver
+ do i = 1, ncol
+ ! calculate saturation value for Q
+ !----------------------------------
+ qsat = epsilo*E0/pmid(i,k)*exp(-latvap_div_rh2o*((1._r8/T(i,k))-1._r8/T0))
+
+ ! if > 100% relative humidity rain falls out
+ !-------------------------------------------
+ if(qv(i,k) > qsat) then
+ ! calc the condensation and large-scale precipitation(m/s) rates
+ !-------------------------------------------------------------------
+ Crate = ((qv(i,k)-qsat)/dtime) &
+ /(1._r8+(latvap_div_cpair)*(epsilo*latvap*qsat/(rair*T(i,k)**2)))
+ precl(i) = precl(i) + (Crate*pdel(i,k))/(gravit*rhoh2o)
+
+ ! Update T and qv values due to precipitation
+ !--------------------------------------------
+ T (i,k) = T (i,k) + Crate*(latvap_div_cpair)*dtime
+ qv(i,k) = qv(i,k) - Crate*dtime
+
+ ! recompute qsat with updated T
+ !-------------------------------
+ qsat = epsilo*E0/pmid(i,k)*exp(-latvap_div_rh2o*((1._r8/T(i,k))-1._r8/T0))
+ endif
+
+ ! Set percent relative humidity
+ !-------------------------------
+ relhum(i,k) = (qv(i,k)/qsat)*100._r8
+ end do
+ end do
+
+ end subroutine frierson_condensate_TJ16
+ !=======================================================================
+
+
+ !=======================================================================
+ subroutine frierson_condensate_USER(ncol,pver,dtime,pmid,pdel,T,qv,relhum,precl)
+ !
+ ! frierson_condensate_USER: This routine is a stub which users can use
+ ! to develop and test their own large scale
+ ! condensation scheme
+ !=======================================================================
+ !
+ ! Passed Variables
+ !---------------------
+ integer ,intent(in) :: ncol ! number of columns
+ integer ,intent(in) :: pver ! number of vertical levels
+ real(r8),intent(in) :: dtime ! time step (s)
+ real(r8),intent(in) :: pmid (ncol,pver) ! mid-point pressure (Pa)
+ real(r8),intent(in) :: pdel (ncol,pver) ! layer thickness (Pa)
+ real(r8),intent(inout):: T (ncol,pver) ! temperature (K)
+ real(r8),intent(inout):: qv (ncol,pver) ! specific humidity Q (kg/kg)
+ real(r8),intent(out) :: relhum(ncol,pver) ! relative humidity
+ real(r8),intent(out) :: precl (ncol) ! large-scale precipitation rate (m/s)
+ !
+ ! Local Values
+ !-------------
+ real(r8):: qsat
+ integer :: i, k
+
+ ! Set large scale precipitation rates to zero
+ !--------------------------------------------------------------------------
+ precl(:) = 0.0_r8
+
+ ! Large-Scale Condensation and Precipitation without cloud stage
+ !---------------------------------------------------------------
+ do k = 1, pver
+ do i = 1, ncol
+ ! calculate saturation value for Q
+ !----------------------------------
+ qsat = epsilo*E0/pmid(i,k)*exp(-latvap_div_rh2o*((1._r8/T(i,k))-1._r8/T0))
+
+ ! Set percent relative humidity
+ !-------------------------------
+ relhum(i,k) = (qv(i,k)/qsat)*100._r8
+ end do
+ end do
+
+ end subroutine frierson_condensate_USER
+ !=======================================================================
+
+
+ !=======================================================================
+ subroutine frierson_pbl(ncol, pver, dtime, pmid, pint, Zm, Zi, &
+ Psfc, Tsfc, Qsfc, T, U, V, Q, Fsw, Fdn, &
+ Cdrag, Km, Ke, VSE, Z_pbl, Rf, dQa, dTa, dUa, dVa, &
+ LHflux, SHflux, TUflux, TVflux )
+ !
+ ! The implicit PBL parameterization based on Frierson, et al. 2006.
+ !
+ ! frierson_pbl: This is an implementation of the implicit computation
+ ! derived from the code of the Frierson model. The
+ ! calculations are roughly divided up into sections of
+ ! the model where they should be carried out.
+ !
+ !==========================================================================
+ !
+ ! Passed Variables
+ !------------------
+ integer ,intent(in) :: ncol ! Number of columns
+ integer ,intent(in) :: pver ! Number of levels
+ real(r8),intent(in) :: dtime ! Time Step
+ real(r8),intent(in) :: pmid (ncol,pver) ! Pressure at model levels
+ real(r8),intent(in) :: pint (ncol,pver+1) ! Pressure at interface levels.
+ real(r8),intent(in) :: Zm (ncol,pver) ! Height at model levels.
+ real(r8),intent(in) :: Zi (ncol,pver) ! Height at interface levels.
+ real(r8),intent(in) :: Psfc (ncol) ! Surface Pressure.
+ real(r8),intent(inout):: Tsfc (ncol) ! SST temperature K
+ real(r8),intent(inout):: Qsfc (ncol) ! sea surface water vapor (kg/kg)
+ real(r8),intent(inout):: T (ncol,pver) ! ATM Temperature values.
+ real(r8),intent(inout):: U (ncol,pver) ! ATM Zonal Wind values.
+ real(r8),intent(inout):: V (ncol,pver) ! ATM Meridional Wind values.
+ real(r8),intent(inout):: Q (ncol,pver) ! ATM Water vapor values.
+ real(r8),intent(in) :: Fdn (ncol) ! Downward LW flux at surface
+ real(r8),intent(in) :: Fsw (ncol) ! Net SW flux at surface from gray radiation
+ real(r8),intent(out) :: Cdrag (ncol) ! Surface drage coef.
+ real(r8),intent(out) :: Km (ncol,pver+1) ! Eddy diffusivity for PBL (momentum)
+ real(r8),intent(out) :: Ke (ncol,pver+1) ! Eddy diffusivity for PBL
+ real(r8),intent(out) :: VSE (ncol,pver) ! Virtual-Dry Static energy
+ real(r8),intent(out) :: Z_pbl (ncol) ! Height of PBL layer.
+ real(r8),intent(out) :: Rf (ncol,pver)
+ real(r8),intent(out) :: dTa (ncol,pver)
+ real(r8),intent(out) :: dQa (ncol,pver)
+ real(r8),intent(out) :: dUa (ncol,pver)
+ real(r8),intent(out) :: dVa (ncol,pver)
+ real(r8),intent(out) :: LHflux(ncol) ! Latent Heat Flux
+ real(r8),intent(out) :: SHflux(ncol) ! Sensible Heat Flux
+ real(r8),intent(out) :: TUflux(ncol) ! U Surface stress
+ real(r8),intent(out) :: TVflux(ncol) ! V Surface stress
+ !
+ ! Local Values
+ !---------------
+ real(r8):: Tv (ncol,pver)
+ real(r8):: Thv (ncol,pver)
+ real(r8):: Ws (ncol,pver)
+ real(r8):: rho (ncol) ! Air density near the ground (kg/m3)
+ real(r8):: Z_sfc (ncol)
+ real(r8):: Rf_sfc(ncol)
+ real(r8):: Ri_a (ncol)
+ real(r8):: Ri (ncol,pver)
+ integer :: K_sfc (ncol)
+ integer :: K_pbl (ncol)
+ real(r8):: Ke_pbl(ncol)
+ real(r8):: Km_pbl(ncol)
+ real(r8):: Z_a (ncol) ! Height at midpoint of the lowest model level (m)
+ real(r8):: Ws_a (ncol) ! wind speed at the lowest model level (m/s)
+ real(r8):: Thv_a (ncol)
+ real(r8):: Thv_s (ncol)
+ real(r8):: Ustar (ncol)
+ real(r8):: Bstar (ncol)
+ real(r8):: ZETA,PHI
+
+ real(r8):: MU (ncol,pver)
+ real(r8):: NUe(ncol,pver)
+ real(r8):: NUm(ncol,pver)
+ real(r8):: Am (ncol,pver)
+ real(r8):: Bm (ncol,pver)
+ real(r8):: Cm (ncol,pver)
+ real(r8):: Ae (ncol,pver)
+ real(r8):: Be (ncol,pver)
+ real(r8):: Ce (ncol,pver)
+ real(r8):: FLu(ncol,pver)
+ real(r8):: FLv(ncol,pver)
+ real(r8):: FLq(ncol,pver)
+ real(r8):: FLt(ncol,pver)
+ real(r8):: Et (ncol,pver)
+ real(r8):: Eq (ncol,pver)
+ real(r8):: Eu (ncol,pver)
+ real(r8):: Ev (ncol,pver)
+
+ real(r8):: Fval_t(ncol,pver)
+ real(r8):: Fval_q(ncol,pver)
+ real(r8):: Fval_u(ncol,pver)
+ real(r8):: Fval_v(ncol,pver)
+ real(r8):: Eval_m(ncol,pver)
+ real(r8):: Eval_e(ncol,pver)
+ integer :: i, k
+
+ real(r8):: Su(ncol,pver)
+ real(r8):: Sv(ncol,pver)
+ real(r8):: St(ncol,pver)
+ real(r8):: Sq(ncol,pver)
+
+ real(r8):: Estar_u(ncol)
+ real(r8):: Estar_v(ncol)
+ real(r8):: Estar_q(ncol)
+ real(r8):: Estar_t(ncol)
+ real(r8):: dFa_dTa(ncol)
+ real(r8):: dFa_dQa(ncol)
+ real(r8):: dFa_dUa(ncol)
+ real(r8):: dFa_dVa(ncol)
+
+ real(r8):: Th_a (ncol)
+ real(r8):: Th_s (ncol)
+ real(r8):: Ft (ncol)
+ real(r8):: dFt_dTa (ncol)
+ real(r8):: dFt_dTs (ncol)
+ real(r8):: Fq (ncol)
+ real(r8):: dFq_dQa (ncol)
+ real(r8):: dFq_dTs (ncol)
+ real(r8):: Fu (ncol)
+ real(r8):: dFu_dUa (ncol)
+ real(r8):: Fv (ncol)
+ real(r8):: dFv_dVa (ncol)
+ real(r8):: Fup (ncol)
+ real(r8):: dFup_dTs(ncol)
+
+ real(r8):: FN_u (ncol)
+ real(r8):: FN_v (ncol)
+ real(r8):: EN_t (ncol)
+ real(r8):: FN_t (ncol)
+ real(r8):: EN_q (ncol)
+ real(r8):: FN_q (ncol)
+ real(r8):: Flux (ncol)
+ real(r8):: dFlux(ncol)
+ real(r8):: dTs (ncol)
+
+ real(r8):: Tsfc_bc(ncol)
+
+ !============================================================================
+ ! tphysbc():
+ !
+ ! Required Values:
+ ! T(:,:),Q(:,:),U(:,:),V(:,:)
+ ! Pmid(:,:),Pint(:,:),Zm(:,:),Zi(:,:)
+ ! Tsfc(:),Qsfc(:),Psfc(:)
+ !============================================================================
+
+ ! Sx() values allow for explicit source tendencies to be passed to
+ ! implicit PBL calculation. Set all values to 0. for now.
+ !-------------------------------------------------------------------------
+ Su(:,:) = 0._r8
+ Sv(:,:) = 0._r8
+ St(:,:) = 0._r8
+ Sq(:,:) = 0._r8
+
+ ! Calc some values we will need later on
+ !------------------------------------------
+ do k = 1, pver
+ Ws (:,k) = sqrt(U(:,k)**2 + V(:,k)**2 + Wind_min)
+ Tv (:,k) = T (:,k)*(1._r8+zvir*Q(:,k))
+ Thv(:,k) = Tv(:,k)*((ps0/pmid(:,k))**cappa)
+ VSE(:,k) = Tv(:,k)+gravit*Zm(:,k)/cpair
+ end do
+
+ ! Calculate Drag Coef and related values
+ !-----------------------------------------
+ do i = 1,ncol
+ Z_a (i) = Zm (i,pver)
+ Ws_a (i) = Ws (i,pver)
+ Thv_a(i) = Thv(i,pver)
+ Thv_s(i) = Tsfc(i)*(1._r8+zvir*Qsfc(i) )*((ps0/Psfc(i))**cappa)
+ Ri_a (i) = (gravit*Z_a(i)/(Ws_a(i)**2))*(Thv_a(i)-Thv_s(i))/Thv_s(i)
+ if(Ri_a(i) <= 0._r8) then
+ Cdrag(i) = (Karman/log((Z_a(i)/Z0)))**2
+ elseif(Ri_a(i) >= Ri_c) then
+ Cdrag(i) = 0._r8
+ else
+ Cdrag(i) = ((1._r8-(Ri_a(i)/Ri_c))*Karman/log((Z_a(i)/Z0)))**2
+ endif
+ Ustar(i) = sqrt(Cdrag(i))*Ws_a(i)
+ Bstar(i) = sqrt(Cdrag(i))*(gravit*(Thv_a(i)-Thv_s(i))/Thv_s(i))
+ end do
+
+ ! Calculate a bulk Richardson number and determine
+ ! depths of boundary/surface layers.
+ !----------------------------------------------------
+ do k = 1,pver
+ Ri(:,k) = (gravit*Zm(:,k)/(Ws(:,k)**2))*(VSE(:,k)-VSE(:,pver))/VSE(:,pver)
+ Rf(:,k) = Ri(:,k)/Ri_c
+ end do
+
+ do i =1,ncol
+ Z_pbl(i) = Zm(i,pver)
+ K_pbl(i) = pver
+ do k = (pver-1),1,-1
+ if(Rf(i,k) > 1._r8) then
+ K_pbl(i) = k + 1
+ Z_pbl(i) = (Zm(i,k+1)*(Rf(i,k)- 1._r8 ) &
+ +Zm(i,k )*( 1._r8 - Rf(i,k+1)))/(Rf(i,k)-Rf(i,k+1))
+ exit
+ endif
+ end do
+
+ ! surface layer height is a fixed fraction of the PBL
+ ! determine the corresponding level index and Rf value
+ !-----------------------------------------------------
+ Z_sfc(i) = Fb*Z_pbl(i)
+ K_sfc(i) = pver
+ do k = (pver-1),1,-1
+ if(Zm(i,k) > Z_sfc(i)) then
+ K_sfc (i) = k + 1
+ Rf_sfc(i) = (Rf(i,k+1)*(Zm(i,k) - Z_sfc(i) ) &
+ + Rf(i,k )*(Z_sfc(i) - Zm(i,k+1)))/(Zm(i,k)-Zm(i,k+1))
+ exit
+ endif
+ end do
+ end do ! i =1,ncol
+
+ ! Compute diffusion coefs
+ !-------------------------
+ Ke(:,:) = 0._r8
+ Ke_pbl(:) = 0._r8
+ do i = 1,ncol
+ if (Cdrag(i) /= 0._r8) then
+ do k = pver,K_pbl(i),-1
+ ZETA = Zi(i,k)*Karman*Bstar(i)/(Ustar(i)*Ustar(i))
+ if(ZETA < 0._r8) then
+ if(k >= K_sfc(i)) then
+ Ke(i,k) = Karman*Ustar(i)*Zi(i,k)
+ else
+ Ke(i,k) = Karman*Ustar(i)*Zi(i,k) &
+ *(((Z_pbl(i)-Zi(i,k))/(Z_pbl(i)-Z_sfc(i)))**2)
+ endif
+ elseif (ZETA < Ri_c) then
+ PHI = 1._r8 + ZETA
+ if(k >= K_sfc(i)) then
+ Ke(i,k) = Karman*Ustar(i)*Zi(i,k)/PHI
+ else
+ Ke(i,k) = Karman*Ustar(i)*Zi(i,k) &
+ *(((Z_pbl(i)-Zi(i,k))/(Z_pbl(i)-Z_sfc(i)))**2)/PHI
+ endif
+ endif
+ end do
+ Ke_pbl(i) = Ke(i,K_sfc(i))*Z_sfc(i)/Zi(i,K_sfc(i))
+ endif
+ end do
+
+ ! The Same coefs used for momentum
+ !-----------------------------------
+ Km(:,:) = Ke(:,:)
+ Km_pbl(:) = Ke_pbl(:)
+
+ ! Compute downward values for the implicit PBL scheme
+ !-----------------------------------------------------
+ do k = 1,pver
+ MU (:,k) = gravit*dtime/(Pint(:,k+1) - Pint(:,k))
+ end do
+
+ NUe(:,:) = 0._r8
+ NUm(:,:) = 0._r8
+ do k = 2,pver
+ rho(:) = 2._r8*Pint(:,k)/(rair*(Tv(:,k)+Tv(:,k-1)))
+ NUe(:,k) = rho(:)*Ke(:,k)/(Zm(:,k)-Zm(:,k-1))
+ NUm(:,k) = rho(:)*Km(:,k)/(Zm(:,k)-Zm(:,k-1))
+ end do
+
+ Am(:,1 ) = MU(:,1)*NUm(:,2)
+ Cm(:,1 ) = 0._r8
+ Am(:,pver) = 0._r8
+ Cm(:,pver) = MU(:,pver)*NUm(:,pver)
+ Ae(:,1 ) = MU(:,1 )*NUe(:,2)
+ Ce(:,1 ) = 0._r8
+ Ae(:,pver) = 0._r8
+ Ce(:,pver) = MU(:,pver)*NUe(:,pver)
+ do k = 2,(pver-1)
+ Am(:,k) = MU(:,k)*NUm(:,k+1)
+ Cm(:,k) = MU(:,k)*NUm(:,k )
+ Ae(:,k) = MU(:,k)*NUe(:,k+1)
+ Ce(:,k) = MU(:,k)*NUe(:,k )
+ end do
+ Bm(:,:) = 1._r8 - Am(:,:) - Cm(:,:)
+ Be(:,:) = 1._r8 - Ae(:,:) - Ce(:,:)
+
+ FLu(:,1) = 0._r8
+ FLv(:,1) = 0._r8
+ FLq(:,1) = 0._r8
+ FLt(:,1) = 0._r8
+ do k = 2,pver
+ FLu(:,k) = NUm(:,k)*(U (:,k)-U (:,k-1))
+ FLv(:,k) = NUm(:,k)*(V (:,k)-V (:,k-1))
+ FLq(:,k) = NUe(:,k)*(Q (:,k)-Q (:,k-1))
+ FLt(:,k) = NUe(:,k)*(VSE(:,k)-VSE(:,k-1))
+ end do
+ do k = 1,(pver-1)
+ Eu(:,k) = Su(:,k) + MU(:,k)*(FLu(:,k)-FLu(:,k+1))
+ Ev(:,k) = Sv(:,k) + MU(:,k)*(FLv(:,k)-FLv(:,k+1))
+ Eq(:,k) = Sq(:,k) + MU(:,k)*(FLq(:,k)-FLq(:,k+1))
+ Et(:,k) = St(:,k) + MU(:,k)*(FLt(:,k)-FLt(:,k+1))
+ end do
+ Eu(:,pver) = Su(:,pver) + MU(:,pver)*FLu(:,pver)
+ Ev(:,pver) = Sv(:,pver) + MU(:,pver)*FLv(:,pver)
+ Eq(:,pver) = Sq(:,pver) + MU(:,pver)*FLq(:,pver)
+ Et(:,pver) = St(:,pver) + MU(:,pver)*FLt(:,pver)
+
+ Eval_m(:,1) = -Am(:,1)/Bm(:,1)
+ Eval_e(:,1) = -Ae(:,1)/Be(:,1)
+ Fval_u(:,1) = Eu(:,1)/Bm(:,1)
+ Fval_v(:,1) = Ev(:,1)/Bm(:,1)
+ Fval_q(:,1) = Eq(:,1)/Be(:,1)
+ Fval_t(:,1) = Et(:,1)/Be(:,1)
+ do k = 2,(pver-1)
+ Eval_m(:,k) = -Am(:,k)/(Bm(:,k)+Cm(:,k)*Eval_m(:,k-1))
+ Eval_e(:,k) = -Ae(:,k)/(Be(:,k)+Ce(:,k)*Eval_e(:,k-1))
+ Fval_u(:,k) = (Eu(:,k)-Cm(:,k)*Fval_u(:,k-1)) &
+ /(Bm(:,k)+Cm(:,k)*Eval_m(:,k-1))
+ Fval_v(:,k) = (Ev(:,k)-Cm(:,k)*Fval_v(:,k-1)) &
+ /(Bm(:,k)+Cm(:,k)*Eval_m(:,k-1))
+ Fval_q(:,k) = (Eq(:,k)-Ce(:,k)*Fval_q(:,k-1)) &
+ /(Be(:,k)+Ce(:,k)*Eval_e(:,k-1))
+ Fval_t(:,k) = (Et(:,k)-Ce(:,k)*Fval_t(:,k-1)) &
+ /(Be(:,k)+Ce(:,k)*Eval_e(:,k-1))
+ end do
+ Eval_m(:,pver) = 0._r8
+ Eval_e(:,pver) = 0._r8
+ Fval_u(:,pver) = 0._r8
+ Fval_v(:,pver) = 0._r8
+ Fval_q(:,pver) = 0._r8
+ Fval_t(:,pver) = 0._r8
+
+ Estar_u(:) = (Eu(:,pver)-Cm(:,pver)*Fval_u(:,pver-1))
+ Estar_v(:) = (Ev(:,pver)-Cm(:,pver)*Fval_v(:,pver-1))
+ Estar_q(:) = (Eq(:,pver)-Ce(:,pver)*Fval_q(:,pver-1))
+ Estar_t(:) = (Et(:,pver)-Ce(:,pver)*Fval_t(:,pver-1))
+
+ dFa_dTa(:) = NUe(:,pver)*(1._r8-Eval_e(:,pver-1))
+ dFa_dQa(:) = NUe(:,pver)*(1._r8-Eval_e(:,pver-1))
+ dFa_dUa(:) = NUm(:,pver)*(1._r8-Eval_m(:,pver-1))
+ dFa_dVa(:) = NUm(:,pver)*(1._r8-Eval_m(:,pver-1))
+
+ !============================================================================
+ ! flux calculation():
+ !
+ ! Required Values:
+ ! Passed from :
+ ! T(:,pver),Q(:,pver),U(:,pver),V(:,pver),Cdrag(:),Pmid(:,pver)
+ ! MU(:,pver),dFa_dTa(:),dFa_dQa(:),dFa_dUa(:),dFa_dVa(:)
+ ! Estar_t(:),Estar_q(:),Estar_u(:),Estar_v(:)
+ ! Passed from :
+ ! Tsfc(:),Qsfc(:),Psfc(:)
+ !
+ !============================================================================
+
+ ! Calculate Surface flux values and their derivatives
+ !--------------------------------------------------------
+ do i = 1, ncol
+ Th_a(i) = T (i,pver)*((ps0/pmid(i,pver))**cappa)
+ Th_s(i) = Tsfc(i) *((ps0/Psfc (i) )**cappa)
+ rho (i) = pmid (i,pver)/(rair*Tv(i,pver))
+
+ Ft (i) = rho(i)*Cdrag(i)*Ws_a(i)*(Th_s (i) - Th_a(i))
+ Fq (i) = rho(i)*Cdrag(i)*Ws_a(i)*(Qsfc(i) - Q(i,pver))
+ Fu (i) = -rho(i)*Cdrag(i)*Ws_a(i)*U(i,pver)
+ Fv (i) = -rho(i)*Cdrag(i)*Ws_a(i)*V(i,pver)
+ Fup (i) = Boltz*Tsfc(i)**4
+
+ dFt_dTa(i) = -rho(i)*Cdrag(i)*Ws_a(i)*((ps0/pmid(i,pver))**cappa)
+ dFq_dQa(i) = -rho(i)*Cdrag(i)*Ws_a(i)
+ dFu_dUa(i) = -rho(i)*Cdrag(i)*Ws_a(i)
+ dFv_dVa(i) = -rho(i)*Cdrag(i)*Ws_a(i)
+
+ dFt_dTs(i) = rho(i)*Cdrag(i)*Ws_a(i)*((ps0/Psfc (i) )**cappa)
+ dFq_dTs(i) = rho(i)*Cdrag(i)*Ws_a(i)*Qsfc(i)*latvap/(rh2o*(Tsfc(i)**2))
+ dFup_dTs(i) = 4._r8*Boltz*Tsfc(i)**3
+ end do
+
+ ! Incorporate surface fluxes into implicit scheme, then
+ ! update flux values and derivatives
+ !------------------------------------------
+ FN_u (:) = (Estar_u(:) + MU(:,pver)*Fu(:)) &
+ /(1._r8-MU(:,pver)*(dFa_dUa(:)+dFu_dUa(:)))
+ FN_v (:) = (Estar_v(:) + MU(:,pver)*Fv(:)) &
+ /(1._r8-MU(:,pver)*(dFa_dVa(:)+dFv_dVa(:)))
+ FN_t (:) = (Estar_t(:) + MU(:,pver)*Ft(:)) &
+ /(1._r8-MU(:,pver)*(dFa_dTa(:)+dFt_dTa(:)))
+ FN_q (:) = (Estar_q(:) + MU(:,pver)*Fq(:)) &
+ /(1._r8-MU(:,pver)*(dFa_dQa(:)+dFq_dQa(:)))
+
+ EN_t (:) = ( MU(:,pver)*dFt_dTs(:) ) &
+ /(1._r8-MU(:,pver)*(dFa_dTa(:)+dFt_dTa(:)))
+ EN_q (:) = ( MU(:,pver)*dFq_dTs(:) ) &
+ /(1._r8-MU(:,pver)*(dFa_dQa(:)+dFq_dQa(:)))
+
+ Ft (:) = Ft(:) + dFt_dTa(:)*FN_t(:)
+ Fq (:) = Fq(:) + dFq_dQa(:)*FN_q(:)
+
+ dFt_dTs(:) = dFt_dTs(:) + dFt_dTa(:)*EN_t(:)
+ dFq_dTs(:) = dFq_dTs(:) + dFq_dQa(:)*EN_q(:)
+
+ !============================================================================
+ ! surface calculation():
+ !
+ ! Required Values:
+ ! Passed from :
+ ! Fup(:),Ft(:),Fq(:)
+ ! dFup_dTs(:),dFt_dTs(:),dFq_dTs(:)
+ ! Fsw(:)
+ ! Passed from :
+ ! Fdn(:)
+ !
+ !============================================================================
+
+ ! Update surface values
+ !-----------------------
+ Tsfc_bc(:) = Tsfc(:)
+
+ Flux (:) = (dtime/C_ocn)*(Fdn(:) - Fup(:) + Fsw(:) &
+ -cpair*Ft(:) -latvap*Fq(:) )
+ dFlux(:) = (dtime/C_ocn)*(-dFup_dTs(:) -cpair*dFt_dTs(:) -latvap*dFq_dTs(:))
+ Tsfc (:) = Tsfc(:) + (Flux(:)/(1._r8-dFlux(:)))
+ Qsfc (:) = epsilo*E0/Psfc(:)*exp(-latvap_div_rh2o*((1._r8/Tsfc(:))-1._r8/T0))
+ dTs (:) = Tsfc(:) - Tsfc_bc(:)
+
+ LHflux(:) = latvap*Fq(:)
+ SHflux(:) = cpair *Ft(:)
+ TUflux(:) = Fu(:)
+ TVflux(:) = Fv(:)
+
+ !============================================================================
+ ! tphysac():
+ !
+ ! Required Values:
+ ! Passed from :
+ ! FN_t(:),FN_q(:),FN_u(:),FN_v(:)
+ ! EN_t(:),EN_q(:),dTs(:)
+ ! Passed from :
+ ! Fval_t(:),Fval_q(:),Fval_u(:),Fval_v(:)
+ ! Eval_e(:),Eval_m(:)
+ !
+ !============================================================================
+
+ ! Compute upward values for the implicit PBL scheme
+ !-----------------------------------------------------
+ dTa(:,pver) = FN_t(:) + EN_t(:)*dTs(:)
+ dQa(:,pver) = FN_q(:) + EN_q(:)*dTs(:)
+ dUa(:,pver) = FN_u(:)
+ dVa(:,pver) = FN_v(:)
+ do k=(pver-1),1,-1
+ dTa(:,k) = Fval_t(:,k) + Eval_e(:,k)*dTa(:,k+1)
+ dQa(:,k) = Fval_q(:,k) + Eval_e(:,k)*dQa(:,k+1)
+ dUa(:,k) = Fval_u(:,k) + Eval_m(:,k)*dUa(:,k+1)
+ dVa(:,k) = Fval_v(:,k) + Eval_m(:,k)*dVa(:,k+1)
+ end do
+
+ ! Update atmosphere values
+ !--------------------------
+ U(:,:) = U(:,:) + dUa(:,:)
+ V(:,:) = V(:,:) + dVa(:,:)
+ Q(:,:) = Q(:,:) + dQa(:,:)
+ T(:,:) = T(:,:) + dTa(:,:)
+
+ ! Return resulting Tendency values
+ !----------------------------------
+ dUa(:,:) = dUa(:,:)/dtime
+ dVa(:,:) = dVa(:,:)/dtime
+ dQa(:,:) = dQa(:,:)/dtime
+ dTa(:,:) = dTa(:,:)/dtime
+
+ end subroutine frierson_pbl
+ !=======================================================================
+
+
+ !=======================================================================
+ subroutine frierson_pbl_USER(ncol, pver, dtime, pmid, pint, Zm, Zi, &
+ Psfc, Tsfc, Qsfc, T, U, V, Q, Fsw, Fdn, &
+ Cdrag, Km, Ke, VSE, Z_pbl, Rf, dQa, dTa, dUa, dVa, &
+ LHflux, SHflux, TUflux, TVflux )
+ !
+ ! frierson_pbl_USER: This routine is a stub which users can use
+ ! to develop and test their own PBL scheme
+ !==========================================================================
+ !
+ ! Passed Variables
+ !------------------
+ integer ,intent(in) :: ncol ! Number of columns
+ integer ,intent(in) :: pver ! Number of levels
+ real(r8),intent(in) :: dtime ! Time Step
+ real(r8),intent(in) :: pmid (ncol,pver) ! Pressure at model levels
+ real(r8),intent(in) :: pint (ncol,pver+1) ! Pressure at interface levels.
+ real(r8),intent(in) :: Zm (ncol,pver) ! Height at model levels.
+ real(r8),intent(in) :: Zi (ncol,pver) ! Height at interface levels.
+ real(r8),intent(in) :: Psfc (ncol) ! Surface Pressure.
+ real(r8),intent(inout):: Tsfc (ncol) ! SST temperature K
+ real(r8),intent(inout):: Qsfc (ncol) ! sea surface water vapor (kg/kg)
+ real(r8),intent(inout):: T (ncol,pver) ! ATM Temperature values.
+ real(r8),intent(inout):: U (ncol,pver) ! ATM Zonal Wind values.
+ real(r8),intent(inout):: V (ncol,pver) ! ATM Meridional Wind values.
+ real(r8),intent(inout):: Q (ncol,pver) ! ATM Water vapor values.
+ real(r8),intent(in) :: Fdn (ncol) ! Downward LW flux at surface
+ real(r8),intent(in) :: Fsw (ncol) ! Net SW flux at surface from gray radiation
+ real(r8),intent(out) :: Cdrag (ncol) ! Surface drage coef.
+ real(r8),intent(out) :: Km (ncol,pver+1) ! Eddy diffusivity for PBL
+ real(r8),intent(out) :: Ke (ncol,pver+1) ! Eddy diffusivity for PBL
+ real(r8),intent(out) :: VSE (ncol,pver) ! Virtual-Dry Static energy.(huh?)
+ real(r8),intent(out) :: Z_pbl (ncol) ! Height of PBL layer.
+ real(r8),intent(out) :: Rf (ncol,pver)
+ real(r8),intent(out) :: dTa (ncol,pver)
+ real(r8),intent(out) :: dQa (ncol,pver)
+ real(r8),intent(out) :: dUa (ncol,pver)
+ real(r8),intent(out) :: dVa (ncol,pver)
+ real(r8),intent(out) :: LHflux(ncol) ! Latent Heat Flux
+ real(r8),intent(out) :: SHflux(ncol) ! Sensible Heat Flux
+ real(r8),intent(out) :: TUflux(ncol) ! U Surface stress
+ real(r8),intent(out) :: TVflux(ncol) ! V Surface stress
+ !
+ ! Local Values
+ !---------------
+
+
+ Cdrag = 0._r8
+ Km = 0._r8
+ Ke = 0._r8
+ VSE = 0._r8
+ Z_pbl = 0._r8
+ Rf = 0._r8
+ dTa = 0._r8
+ dQa = 0._r8
+ dUa = 0._r8
+ dVa = 0._r8
+ LHflux = 0._r8
+ SHflux = 0._r8
+ TUflux = 0._r8
+ TVflux = 0._r8
+
+ end subroutine frierson_pbl_USER
+ !=======================================================================
+
+
+ !=======================================================================
+ subroutine frierson_radiation(ncol,pver,dtime,clat,pint,pmid, &
+ Psfc,Tsfc,Qsfc,T,qv,dtdt_rad, &
+ Fsolar,Fup_s,Fdown_s,Fup_toa,Fdown_toa)
+ !
+ ! The gray radiation parameterization based on Frierson, et al. 2006.
+ !
+ ! frierson_radiation: This is an implementation of the gray radiation
+ ! scheme used in the Frierson model.
+ !==========================================================================
+ !
+ ! Passed Variables
+ !-------------------
+ integer ,intent(in) :: ncol ! number of columns
+ integer ,intent(in) :: pver ! number of vertical levels
+ real(r8),intent(in) :: dtime ! time step (s)
+ real(r8),intent(in) :: clat (ncol) ! latitude
+ real(r8),intent(in) :: pint (ncol,pver+1) ! mid-point pressure (Pa)
+ real(r8),intent(in) :: pmid (ncol,pver) ! mid-point pressure (Pa)
+ real(r8),intent(in) :: Psfc (ncol) ! surface pressure
+ real(r8),intent(in) :: Tsfc (ncol) ! surface temperature (K)
+ real(r8),intent(in) :: Qsfc (ncol)
+ real(r8),intent(inout):: T (ncol,pver) ! temperature (K)
+ real(r8),intent(in) :: qv (ncol,pver) ! Q (kg/kg)
+ real(r8),intent(out) :: dtdt_rad(ncol,pver) ! temperature tendency in K/s from relaxation
+ real(r8),intent(out) :: Fsolar (ncol) !
+ real(r8),intent(out) :: Fup_s (ncol) !
+ real(r8),intent(out) :: Fdown_toa(ncol) !
+ real(r8),intent(out) :: Fup_toa (ncol) !
+ real(r8),intent(out) :: Fdown_s (ncol) !
+ !
+ ! Local Values
+ !-------------
+ real(r8):: sinsq (ncol) ! sinlat**2
+ real(r8):: Tv_srf (ncol)
+ real(r8):: Tv (ncol,pver )
+ real(r8):: Zm (ncol,pver )
+ real(r8):: Zscl (ncol)
+ real(r8):: Tbar (ncol)
+ real(r8):: Tdif (ncol)
+ real(r8):: Zfrac (ncol)
+ real(r8):: Pfrac (ncol)
+ real(r8):: Tau_lat(ncol)
+ real(r8):: Tau (ncol,pver+1)
+ real(r8):: Zi (ncol,pver+1)
+ real(r8):: Fup (ncol,pver+1)
+ real(r8):: Fdown (ncol,pver+1)
+ real(r8):: Bval (ncol,pver)
+ real(r8):: Etau (ncol,pver)
+ integer :: k
+
+ ! Calc current Tv values
+ !---------------------------------
+ Tv_srf(:) = Tsfc(:)*(1._r8+zvir*Qsfc(:))
+ do k = 1, pver
+ Tv(:,k) = T(:,k)*(1._r8+zvir*qv(:,k))
+ end do
+
+ ! Calc Geopotential Heights at model interface
+ ! levels and at model layer levels
+ !----------------------------------------------
+ Zi(:,pver+1) = 0._r8
+ Zm(:,pver ) = rair*((Tv(:,pver)+Tv_srf(:))/2._r8)*log(Psfc(:)/pmid(:,pver))/gravit
+ do k = pver-1,1,-1
+ Zscl (:) = rair*log(pmid(:,k+1)/pmid(:,k))/gravit
+ Tbar (:) = (Tv(:,k)+Tv(:,k+1))/2._r8
+ Tdif (:) = (Tv(:,k)-Tv(:,k+1))/2._r8
+ Zfrac (:) = log(pint(:,k+1)/pmid(:,k+1))/log(pmid(:,k)/pmid(:,k+1))
+ Zm(:,k ) = Zm(:,k+1) + Zscl(:)*Tbar(:)
+ Zi(:,k+1) = Zm(:,k+1) + Zscl(:)*((Tv(:,k+1)-2._r8*Tdif(:))*Zfrac(:) &
+ + Tdif(:) *Zfrac(:)**2)
+ end do
+ Zfrac(:) = log(pint(:,1)/pmid(:,2))/log(pmid(:,1)/pmid(:,2))
+ Zi(:,1) = Zm(:,2) + Zscl(:)*((Tv(:,2)-2._r8*Tdif(:))*Zfrac(:) &
+ + Tdif(:) *Zfrac(:)**2)
+
+ ! Set Solar flux
+ !------------------------
+ sinsq (:) = sin(clat(:))*sin(clat(:))
+ Fsolar(:) = (Rs0/4._r8)*(1._r8 + DeltaS*(1._r8 - 3._r8*sinsq(:))/4._r8)
+
+ ! Calc optical depths
+ !------------------------
+ Tau_lat(:) = Tau_eqtr + (Tau_pole-Tau_eqtr)*sinsq(:)
+ do k = 1,pver+1
+ Pfrac(:) = pint(:,k)/Psfc(:)
+ Tau(:,k) = Tau_lat(:)*(LinFrac*Pfrac(:) + (1._r8-LinFrac)*Pfrac(:)**4)
+ end do
+
+ ! Lowest order solution for up/down flux assumes B is constant for the layer
+ !----------------------------------------------------------------------------
+ do k=1,pver
+ Bval(:,k) = Boltz*T(:,k)**4
+ Etau(:,k) = exp(Tau(:,k)-Tau(:,k+1))
+ end do
+
+ Fup(:,pver+1) = Boltz*Tsfc(:)**4
+ do k=pver,1,-1
+ Fup(:,k) = Fup(:,k+1)*Etau(:,k) + Bval(:,k)*(1._r8-Etau(:,k))
+ end do
+
+ Fdown(:,1) = 0._r8
+ do k=1,pver
+ Fdown(:,k+1) = Fdown(:,k)*Etau(:,k) + Bval(:,k)*(1._r8-Etau(:,k))
+ end do
+
+ ! Calc Radiative heating
+ !-------------------------
+ do k=1,pver
+ dtdt_rad(:,k) = -(cappa*Tv(:,k)/pmid(:,k)) &
+ *((Fup(:,k+1)-Fdown(:,k+1)) - (Fup(:,k)-Fdown(:,k))) &
+ /( Zi(:,k+1) - Zi(:,k) )
+ end do
+
+ ! Return Upward/Downward long wave radiation at Surface and TOA
+ !----------------------------------------------------------
+ Fup_s (:) = Fup (:,pver+1)
+ Fdown_s(:) = Fdown(:,pver+1)
+ Fup_toa (:) = Fup (:,1)
+ Fdown_toa(:) = Fdown(:,1)
+
+ ! Update T values
+ !-------------------
+ do k=1,pver
+ T(:,k) = T(:,k) + dtdt_rad(:,k)*dtime
+ end do
+
+ end subroutine frierson_radiation
+ !=======================================================================
+
+
+ !=======================================================================
+ subroutine frierson_radiation_USER(ncol,pver,dtime,clat,pint,pmid, &
+ Psfc,Tsfc,Qsfc,T,qv,dtdt_rad, &
+ Fsolar,Fup_s,Fdown_s,Fup_toa,Fdown_toa)
+ !
+ ! frierson_radiation_USER: This routine is a stub which users can use
+ ! to develop and test their own radiation scheme
+ !==========================================================================
+ !
+ ! Passed Variables
+ !-------------------
+ integer ,intent(in) :: ncol ! number of columns
+ integer ,intent(in) :: pver ! number of vertical levels
+ real(r8),intent(in) :: dtime ! time step (s)
+ real(r8),intent(in) :: clat (ncol) ! latitude
+ real(r8),intent(in) :: pint (ncol,pver+1) ! mid-point pressure (Pa)
+ real(r8),intent(in) :: pmid (ncol,pver) ! mid-point pressure (Pa)
+ real(r8),intent(in) :: Psfc (ncol) ! surface pressure
+ real(r8),intent(in) :: Tsfc (ncol) ! surface temperature (K)
+ real(r8),intent(in) :: Qsfc (ncol)
+ real(r8),intent(inout):: T (ncol,pver) ! temperature (K)
+ real(r8),intent(in) :: qv (ncol,pver) ! Q (kg/kg)
+ real(r8),intent(out) :: dtdt_rad(ncol,pver) ! temperature tendency in K/s from relaxation
+ real(r8),intent(out) :: Fsolar (ncol) !
+ real(r8),intent(out) :: Fup_s (ncol) !
+ real(r8),intent(out) :: Fdown_s (ncol) !
+ real(r8),intent(out) :: Fup_toa (ncol) !
+ real(r8),intent(out) :: Fdown_toa(ncol) !
+ !
+ ! Local Values
+ !-------------
+
+ dtdt_rad = 0._r8
+ Fsolar = 0._r8
+ Fup_s = 0._r8
+ Fdown_s = 0._r8
+ Fup_toa = 0._r8
+ Fdown_toa = 0._r8
+
+
+ end subroutine frierson_radiation_USER
+ !=======================================================================
+
+end module frierson
diff --git a/src/physics/simple/frierson_cam.F90 b/src/physics/simple/frierson_cam.F90
new file mode 100644
index 0000000000..0fe9d824bb
--- /dev/null
+++ b/src/physics/simple/frierson_cam.F90
@@ -0,0 +1,1046 @@
+module frierson_cam
+!-----------------------------------------------------------------------
+!
+! Purpose: Implement idealized forcings described in
+! Frierson, et al. (2006), " A Gray-Radiation Aquaplanet
+! Moist GCM, Part I. Static Stability and Eddy Scale"
+! J. Atmos. Sci, Vol 63, 2548-2566.
+! doi: 10.1175/JAS3753.1
+!
+!============================================================================
+ ! Useful modules
+ !-------------------
+ use shr_kind_mod, only: r8 => shr_kind_r8
+ use shr_const_mod, only: pi => shr_const_pi
+ use physconst, only: gravit, cappa, rair, cpair, latvap, rh2o, epsilo, rhoh2o, zvir
+ use ppgrid, only: pcols, pver, pverp, begchunk, endchunk
+ use constituents, only: pcnst
+ use physics_buffer, only: dtype_r8, pbuf_add_field, physics_buffer_desc, &
+ pbuf_set_field, pbuf_get_field
+ use camsrfexch, only: cam_in_t,cam_out_t
+ use cam_history, only: outfld
+ use time_manager, only: is_first_step
+ use cam_abortutils, only: endrun
+ use spmd_utils, only: masterproc
+ use cam_logfile, only: iulog
+ use hycoef, only: ps0, etamid
+ use spmd_utils, only: mpicom, mstrid=>masterprocid, mpi_real8
+
+ use pio ,only: file_desc_t, var_desc_t, io_desc_t, pio_double, pio_def_var
+ use pio ,only: pio_write_darray, pio_read_darray, pio_inq_varid
+ use cam_grid_support,only: cam_grid_id, cam_grid_dimensions, cam_grid_get_decomp
+ use shr_const_mod, only: SHR_CONST_STEBOL, SHR_CONST_REARTH, SHR_CONST_KARMAN, SHR_CONST_TKTRIP
+
+ ! Set all Global values and routines to private by default
+ ! and then explicitly set their exposure.
+ !---------------------------------------------------------
+ implicit none
+ private
+ save
+
+ public :: frierson_register
+ public :: frierson_readnl
+ public :: frierson_init
+ public :: frierson_condensate_tend
+ public :: frierson_pbl_tend
+ public :: frierson_radiative_tend
+ public :: frierson_restart_init
+ public :: frierson_restart_write
+ public :: frierson_restart_read
+
+ private :: frierson_surface_init
+
+ ! PBL Configuatons
+ !------------------
+ integer,parameter :: PBL_FRIERSON = 0 ! Implementation of Frierson PBL
+ integer,parameter :: PBL_USER = 1 ! Optional call for user defined PBL
+
+ ! Tags to identify optional model formulations
+ !------------------------------------------------
+ integer,parameter :: CONDENSATE_NONE = 0 ! No Condensation, PRECL=0
+ integer,parameter :: CONDENSATE_FRIERSON = 1 ! Frierson condensation w/ re-evaporation
+ integer,parameter :: CONDENSATE_TJ16 = 2 ! Condensation from TJ2016 model.
+ integer,parameter :: CONDENSATE_USER = 3 ! Optional user defined Condensation scheme
+
+ integer,parameter :: RADIATION_FRIERSON = 0 ! Frierson Gray radiation.
+ integer,parameter :: RADIATION_USER = 1 ! Optional user defined Radiation scheme
+
+ ! Options selecting which PRECIP, PBL, RADIATION, etc.. formulations to use.
+ !---------------------------------------------------------------------------------
+ integer,parameter :: PBL_OPT = PBL_FRIERSON
+ integer,parameter :: CONDENSATE_OPT = CONDENSATE_FRIERSON
+ integer,parameter :: RADIATION_OPT = RADIATION_FRIERSON
+
+ ! Global Constants
+ !---------------------
+ real(r8),parameter :: frierson_T0 = SHR_CONST_TKTRIP ! Reference Temperature for E0
+ real(r8),parameter :: frierson_E0 = 610.78_r8 ! Saturation Vapor pressure @ T0
+ real(r8),parameter :: frierson_Rs0 = 1360.0_r8 ! Solar Constant
+ real(r8),parameter :: frierson_Erad = SHR_CONST_REARTH ! Earth Radius
+ real(r8),parameter :: frierson_Karman = SHR_CONST_KARMAN ! Von Karman constant
+ real(r8),parameter :: frierson_Boltz = SHR_CONST_STEBOL ! Stefan-Boltzmann constant
+
+ ! Some Physics buffer indices
+ !-------------------------------
+ integer :: prec_pcw_idx = 0
+ integer :: prec_dp_idx = 0
+ integer :: relhum_idx = 0
+
+ ! Global values for Surface Temp, surface fluxes, and radiative heating
+ !----------------------------------------------------------------------
+ type(var_desc_t) :: Tsurf_desc ! Vardesc for restarts
+ type(var_desc_t) :: Qsurf_desc ! Vardesc for restarts
+ real(r8),allocatable :: Tsurf (:,:) ! Surface Temp
+ real(r8),allocatable :: Qsurf (:,:) ! Surface Q
+ real(r8),allocatable :: Fsolar(:,:) ! Net Solar Heating
+ real(r8),allocatable :: Fup (:,:) ! Upward Longwave flux
+ real(r8),allocatable :: Fdown (:,:) ! Downward Longwave flux
+ real(r8),allocatable :: Fup_toa (:,:) ! Upward Longwave flux at TOA
+ real(r8),allocatable :: Fdown_toa(:,:) ! Downward Longwave flux at TOA
+ real(r8),allocatable :: SHflux(:,:) ! Sensible Heat flux
+ real(r8),allocatable :: LHflux(:,:) ! Latent Heat Flux
+ real(r8),allocatable :: TUflux(:,:) ! U stress momentum flux
+ real(r8),allocatable :: TVflux(:,:) ! V stress momentum flux
+ real(r8),allocatable :: Cd (:,:) ! Surface Drag
+ real(r8),allocatable :: clat (:,:) ! latitudes(radians) for columns
+ real(r8),allocatable :: Fnet (:,:) ! Net Radiative Surface Heating
+ real(r8),allocatable :: Fnet_toa(:,:) ! Net Radiative Surface Heating at TOA
+
+ real(r8), parameter :: unset_r8 = huge(1.0_r8)
+
+ ! Global Tuning values
+ !------------------------
+ real(r8) :: frierson_Wind_min = unset_r8 ! Minimum wind threshold
+ real(r8) :: frierson_Z0 = unset_r8 ! Roughness Length
+ real(r8) :: frierson_Ri_c = unset_r8 ! Crit. Richardson # for stable mixing
+ real(r8) :: frierson_Fb = unset_r8 ! Surface layer Fraction
+ real(r8) :: frierson_Albedo = unset_r8 ! Frierson Albedo
+ real(r8) :: frierson_DeltaS = unset_r8 ! Lat variation of shortwave radiation
+ real(r8) :: frierson_Tau_eqtr = unset_r8 ! Longwave optical depth at Equator
+ real(r8) :: frierson_Tau_pole = unset_r8 ! Longwave optical depth at poles.
+ real(r8) :: frierson_LinFrac = unset_r8 ! Stratosphere Linear optical depth param
+ real(r8) :: frierson_C0 = unset_r8 ! Ocean mixed layer heat capacity
+ real(r8) :: frierson_WetDryCoef = unset_r8 ! E0 Scale factor to control moisture
+ real(r8) :: frierson_Tmin = unset_r8 ! IC: Minimum sst (K)
+ real(r8) :: frierson_Tdlt = unset_r8 ! IC: eq-polar difference sst (K)
+ real(r8) :: frierson_Twidth = unset_r8 ! IC: Latitudinal width parameter for sst (degrees latitude)
+
+contains
+ !==============================================================================
+ subroutine frierson_register()
+ !
+ ! frierson_register: Register physics buffer values
+ !=====================================================================
+
+ call pbuf_add_field('PREC_PCW','physpkg',dtype_r8, (/pcols/), prec_pcw_idx)
+ call pbuf_add_field('PREC_DP' ,'physpkg',dtype_r8, (/pcols/), prec_dp_idx )
+ call pbuf_add_field('RELHUM' ,'physpkg',dtype_r8, (/pcols,pver/),relhum_idx )
+
+ end subroutine frierson_register
+ !==============================================================================
+
+
+ !==============================================================================
+ subroutine frierson_readnl(nlfile)
+ !
+ ! frierson_readnl: Read in parameters controlling Frierson parameterizations.
+ !=====================================================================
+ use namelist_utils,only: find_group_name
+ use units ,only: getunit, freeunit
+ !
+ ! Passed Variables
+ !------------------
+ character(len=*),intent(in):: nlfile
+ !
+ ! Local Values
+ !--------------
+ integer:: ierr,unitn
+
+ character(len=*), parameter :: sub = 'frierson_readnl'
+
+ namelist /frierson_nl/ frierson_Wind_min, frierson_Z0 , frierson_Ri_c , &
+ frierson_Fb , frierson_Albedo , frierson_DeltaS , &
+ frierson_Tau_eqtr, frierson_Tau_pole , frierson_LinFrac, &
+ frierson_C0 , frierson_WetDryCoef, frierson_Tmin , &
+ frierson_Tdlt , frierson_Twidth
+
+ ! Read in namelist values
+ !-------------------------
+ if(masterproc) then
+ unitn = getunit()
+ open(unitn,file=trim(nlfile),status='old')
+ call find_group_name(unitn,'frierson_nl',status=ierr)
+ if(ierr == 0) then
+ read(unitn,frierson_nl,iostat=ierr)
+ if(ierr /= 0) then
+ call endrun(sub//': ERROR reading namelist')
+ endif
+ endif
+ close(unitn)
+ call freeunit(unitn)
+ endif
+
+ ! Broadcast namelist values
+ !---------------------------
+ call mpi_bcast(frierson_Wind_min , 1, mpi_real8 , mstrid, mpicom, ierr)
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: frierson_Wind_min")
+ call mpi_bcast(frierson_Z0 , 1, mpi_real8 , mstrid, mpicom, ierr)
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: frierson_Z0")
+ call mpi_bcast(frierson_Ri_c , 1, mpi_real8 , mstrid, mpicom, ierr)
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: frierson_Ri_c")
+ call mpi_bcast(frierson_Fb , 1, mpi_real8 , mstrid, mpicom, ierr)
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: frierson_Fb")
+ call mpi_bcast(frierson_Albedo , 1, mpi_real8 , mstrid, mpicom, ierr)
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: frierson_Albedo")
+ call mpi_bcast(frierson_DeltaS , 1, mpi_real8 , mstrid, mpicom, ierr)
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: frierson_DeltaS")
+ call mpi_bcast(frierson_Tau_eqtr , 1, mpi_real8 , mstrid, mpicom, ierr)
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: frierson_Tau_eqtr")
+ call mpi_bcast(frierson_Tau_pole , 1, mpi_real8 , mstrid, mpicom, ierr)
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: frierson_Tau_pole")
+ call mpi_bcast(frierson_LinFrac , 1, mpi_real8 , mstrid, mpicom, ierr)
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: frierson_LinFrac")
+ call mpi_bcast(frierson_C0 , 1, mpi_real8 , mstrid, mpicom, ierr)
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: frierson_C0")
+ call mpi_bcast(frierson_Tmin , 1, mpi_real8 , mstrid, mpicom, ierr)
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: frierson_Tmin")
+ call mpi_bcast(frierson_Tdlt , 1, mpi_real8 , mstrid, mpicom, ierr)
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: frierson_Tdlt")
+ call mpi_bcast(frierson_Twidth , 1, mpi_real8 , mstrid, mpicom, ierr)
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: frierson_Twidth")
+ call mpi_bcast(frierson_WetDryCoef, 1, mpi_real8 , mstrid, mpicom, ierr)
+ if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: frierson_WetDryCoef")
+
+ end subroutine frierson_readnl
+ !==============================================================================
+
+
+ !==============================================================================
+ subroutine frierson_init(phys_state,pbuf2d)
+ !
+ ! frierson_init: allocate space for global arrays and initialize values.
+ ! Add variables to history outputs
+ !=====================================================================
+ use physics_types, only: physics_state
+ use error_messages,only: alloc_err
+ use cam_history, only: addfld, add_default,horiz_only
+ use phys_grid, only: get_ncols_p, get_rlat_p
+ use frierson, only: frierson_set_const
+ !
+ ! Passed Variables
+ !------------------
+ type(physics_state) ,pointer:: phys_state(:)
+ type(physics_buffer_desc),pointer:: pbuf2d (:,:)
+ !
+ ! Local Values
+ !---------------
+ integer :: istat,lchnk,icol,ncol
+ real(r8):: adjusted_E0
+ real(r8):: frierson_Rs
+
+ ! Initialize constants in Frierson module
+ !------------------------------------------
+ adjusted_E0 = frierson_WetDryCoef*frierson_E0
+ frierson_Rs = frierson_Rs0*(1._r8-frierson_Albedo)
+ call frierson_set_const(gravit,cappa,rair,cpair,latvap,rh2o,epsilo,rhoh2o,zvir,ps0,etamid, &
+ frierson_T0 ,adjusted_E0 ,frierson_Erad ,frierson_Wind_min, &
+ frierson_Z0 ,frierson_Ri_c ,frierson_Karman ,frierson_Fb , &
+ frierson_Rs ,frierson_DeltaS,frierson_Tau_eqtr,frierson_Tau_pole, &
+ frierson_LinFrac,frierson_Boltz ,frierson_C0 )
+
+ ! Add values for history output
+ !---------------------------------
+ call addfld('gray_QRL' ,(/'lev' /),'A','K/s' ,'Longwave heating rate for gray atmosphere' )
+ call addfld('gray_QRS' ,(/'lev' /),'A','K/s' ,'Solar heating rate for gray atmosphere' )
+ call addfld('gray_DTCOND',(/'lev' /),'A','K/s' ,'T tendency - gray atmosphere moist process' )
+ call addfld('gray_DQCOND',(/'lev' /),'A','kg/kg/s','Q tendency - gray atmosphere moist process' )
+ call addfld('gray_EVAPDT',(/'lev' /),'A','K/s' ,'T tendency due to re-evaporation' )
+ call addfld('gray_EVAPDQ',(/'lev' /),'A','kg/kg/s','Q tendency due to re-evaporation' )
+ call addfld('gray_KVH' ,(/'ilev'/),'A','m2/s' ,'Vertical diffusion diffusivities (heat/moisture)')
+ call addfld('gray_KVM' ,(/'ilev'/),'A','m2/s' ,'Vertical diffusion diffusivities (momentum)' )
+ call addfld('gray_VSE' ,(/'lev' /),'A','K' ,'VSE: (Tv + gZ/Cp)' )
+ call addfld('gray_Zm' ,(/'lev' /),'A','m' ,'Geopotential height' )
+ call addfld('gray_Rf' ,(/'lev' /),'A','1' ,'Bulk Richardson number (Frierson et al 2006, eq 16) / Ri_c' )
+ call addfld('gray_DTV' ,(/'lev' /),'A','K/s' ,'T tendency due to vertical diffusion' )
+ call addfld('gray_DUV' ,(/'lev' /),'A','m/s2' ,'U tendency due to vertical diffusion' )
+ call addfld('gray_DVV' ,(/'lev' /),'A','m/s2' ,'V tendency due to vertical diffusion' )
+ call addfld('gray_VD01' ,(/'lev' /),'A','kg/kg/s','Q tendency (vertical diffusion)' )
+ call addfld('gray_PRECL' ,horiz_only,'A','m/s' ,'Large-scale precipitation rate' )
+ call addfld('gray_PRECC' ,horiz_only,'A','m/s' ,'Convective precipitation rate' )
+ call addfld('gray_Tsurf ',horiz_only,'I','K' ,'Surface Temperature' )
+ call addfld('gray_Qsurf ',horiz_only,'I','kg/kg' ,'Surface Water Vapor' )
+ call addfld('gray_Cdrag' ,horiz_only,'A','1' ,'Surface Drag Coefficient' )
+ call addfld('gray_Zpbl' ,horiz_only,'I','m' ,'PBL Height' )
+ call addfld('gray_SWflux',horiz_only,'I','W/m2' ,'SW Solar Flux' )
+ call addfld('gray_LUflux',horiz_only,'I','W/m2' ,'LW Upward Radiative Flux at Surface' )
+ call addfld('gray_LDflux',horiz_only,'I','W/m2' ,'LW Downward Radiative Flux at Surface' )
+ call addfld('gray_LWflux',horiz_only,'I','W/m2' ,'LW Net Radiative Flux at Surface' )
+ call addfld('gray_LUflux_TOA',horiz_only,'I','W/m2' ,'LW Upward Radiative Flux at TOA' )
+ call addfld('gray_LDflux_TOA',horiz_only,'I','W/m2' ,'LW Downward Radiative Flux at TOA' )
+ call addfld('gray_LWflux_TOA',horiz_only,'I','W/m2' ,'LW Net Radiative Flux at TOA' )
+ call addfld('gray_SHflux',horiz_only,'I','W/m2' , 'Sensible Heat Flux' )
+ call addfld('gray_LHflux',horiz_only,'I','W/m2' , 'Latent Heat Flux' )
+ call addfld('gray_TauU' ,horiz_only,'I','N/m2' , 'U Surface Stress' )
+ call addfld('gray_TauV' ,horiz_only,'I','N/m2' , 'V Surface Stress' )
+
+ call add_default('gray_QRL' ,1,' ')
+ call add_default('gray_QRS' ,1,' ')
+ call add_default('gray_DTCOND',1,' ')
+ call add_default('gray_DQCOND',1,' ')
+ call add_default('gray_EVAPDT',1,' ')
+ call add_default('gray_EVAPDQ',1,' ')
+ call add_default('gray_KVH' ,1,' ')
+ call add_default('gray_KVM' ,1,' ')
+ call add_default('gray_VSE' ,1,' ')
+ call add_default('gray_Zm' ,1,' ')
+ call add_default('gray_Rf' ,1,' ')
+ call add_default('gray_DTV' ,1,' ')
+ call add_default('gray_DUV' ,1,' ')
+ call add_default('gray_DVV' ,1,' ')
+ call add_default('gray_VD01' ,1,' ')
+ call add_default('gray_PRECC' ,1,' ')
+ call add_default('gray_PRECL' ,1,' ')
+ call add_default('gray_Tsurf' ,1,' ')
+ call add_default('gray_Qsurf' ,1,' ')
+ call add_default('gray_Cdrag' ,1,' ')
+ call add_default('gray_Zpbl' ,1,' ')
+ call add_default('gray_SWflux',1,' ')
+ call add_default('gray_LUflux',1,' ')
+ call add_default('gray_LDflux',1,' ')
+ call add_default('gray_LWflux',1,' ')
+ call add_default('gray_LUflux_TOA',1,' ')
+ call add_default('gray_LDflux_TOA',1,' ')
+ call add_default('gray_LWflux_TOA',1,' ')
+ call add_default('gray_SHflux',1,' ')
+ call add_default('gray_LHflux',1,' ')
+ call add_default('gray_TauU' ,1,' ')
+ call add_default('gray_TauV' ,1,' ')
+
+ ! Allocate Global arrays
+ !-------------------------
+ allocate(Fsolar(pcols,begchunk:endchunk) ,stat=istat)
+ call alloc_err(istat,'Frierson INIT','Fsolar',pcols*(endchunk-begchunk+1))
+ allocate(Fup (pcols,begchunk:endchunk) ,stat=istat)
+ call alloc_err(istat,'Frierson INIT','Fup' ,pcols*(endchunk-begchunk+1))
+ allocate(Fdown (pcols,begchunk:endchunk) ,stat=istat)
+ call alloc_err(istat,'Frierson INIT','Fdown' ,pcols*(endchunk-begchunk+1))
+ allocate(Fup_toa (pcols,begchunk:endchunk) ,stat=istat)
+ call alloc_err(istat,'Frierson INIT','Fup_toa' ,pcols*(endchunk-begchunk+1))
+ allocate(Fdown_toa (pcols,begchunk:endchunk) ,stat=istat)
+ call alloc_err(istat,'Frierson INIT','Fdown_toa' ,pcols*(endchunk-begchunk+1))
+ allocate(Fnet(pcols,begchunk:endchunk) ,stat=istat)
+ call alloc_err(istat,'Frierson INIT','Fnet',pcols*(endchunk-begchunk+1))
+ allocate(Fnet_toa(pcols,begchunk:endchunk) ,stat=istat)
+ call alloc_err(istat,'Frierson INIT','Fnet_toa' ,pcols*(endchunk-begchunk+1))
+
+ allocate(SHflux(pcols,begchunk:endchunk) ,stat=istat)
+ call alloc_err(istat,'Frierson INIT','SHflux',pcols*(endchunk-begchunk+1))
+ allocate(LHflux(pcols,begchunk:endchunk) ,stat=istat)
+ call alloc_err(istat,'Frierson INIT','LHflux',pcols*(endchunk-begchunk+1))
+ allocate(TUflux(pcols,begchunk:endchunk) ,stat=istat)
+ call alloc_err(istat,'Frierson INIT','TUflux',pcols*(endchunk-begchunk+1))
+ allocate(TVflux(pcols,begchunk:endchunk) ,stat=istat)
+ call alloc_err(istat,'Frierson INIT','TVflux',pcols*(endchunk-begchunk+1))
+ allocate(Cd (pcols,begchunk:endchunk) ,stat=istat)
+ call alloc_err(istat,'Frierson INIT','Cd' ,pcols*(endchunk-begchunk+1))
+ allocate(clat (pcols,begchunk:endchunk) ,stat=istat)
+ call alloc_err(istat,'Frierson INIT','clat' ,pcols*(endchunk-begchunk+1))
+
+ ! Initialize time indices and latitudes
+ !----------------------------------------
+ do lchnk = begchunk,endchunk
+ ncol = get_ncols_p(lchnk)
+ do icol = 1,ncol
+ clat(icol,lchnk) = get_rlat_p(lchnk,icol)
+ end do
+ end do
+
+ ! At first model step, initialize some values
+ !-----------------------------------------------
+ if(is_first_step()) then
+ ! Initialize physics buffer values
+ !----------------------------------
+ call pbuf_set_field(pbuf2d, prec_pcw_idx, 0._r8)
+ call pbuf_set_field(pbuf2d, prec_dp_idx , 0._r8)
+
+ ! Allocate Surface fields
+ !-------------------------
+ allocate(Tsurf (pcols,begchunk:endchunk),stat=istat)
+ call alloc_err(istat,'Frierson INIT','Tsurf' ,pcols*(endchunk-begchunk+1))
+ allocate(Qsurf (pcols,begchunk:endchunk) ,stat=istat)
+ call alloc_err(istat,'Frierson INIT','Qsurf' ,pcols*(endchunk-begchunk+1))
+
+ ! Initialize Surface temperatures and Q
+ !-----------------------------------------------------------------------
+ do lchnk = begchunk,endchunk
+ ncol = get_ncols_p(lchnk)
+
+ ! Set to reference values for initialization
+ !------------------------------------------------------------
+ phys_state(lchnk)%ps(:ncol) = ps0
+
+ call frierson_surface_init(ncol, clat(:ncol,lchnk), &
+ phys_state(lchnk)%ps(:ncol), &
+ Tsurf(:ncol,lchnk), &
+ Qsurf(:ncol,lchnk) )
+ end do
+ endif
+
+ ! Initialize radiation and flux values to 0.0
+ !---------------------------------------------------------------------------
+ do lchnk = begchunk,endchunk
+ Fsolar(:,lchnk) = 0._r8
+ Fup (:,lchnk) = 0._r8
+ Fdown (:,lchnk) = 0._r8
+ Fup_toa (:,lchnk) = 0._r8
+ Fdown_toa (:,lchnk) = 0._r8
+ SHflux(:,lchnk) = 0._r8
+ LHflux(:,lchnk) = 0._r8
+ TUflux(:,lchnk) = 0._r8
+ TVflux(:,lchnk) = 0._r8
+ Cd (:,lchnk) = 0._r8
+ Fnet (:,lchnk) = 0._r8
+ end do
+
+ ! Informational Output
+ !----------------------
+ if(masterproc) then
+ write(iulog,*) ' '
+ write(iulog,*) '-----------------------------------------------------------'
+ write(iulog,*) ' FRIERSON MODULE INITIALIZED WITH THE FOLLOWING SETTINGS: '
+ write(iulog,*) '-----------------------------------------------------------'
+ write(iulog,*) 'FRIERSON: gravit=' , gravit
+ write(iulog,*) 'FRIERSON: cappa=' , cappa
+ write(iulog,*) 'FRIERSON: rair =' , rair
+ write(iulog,*) 'FRIERSON: cpair=' , cpair
+ write(iulog,*) 'FRIERSON: latvap=' , latvap
+ write(iulog,*) 'FRIERSON: rh2o=' , rh2o
+ write(iulog,*) 'FRIERSON: epsilo=' , epsilo
+ write(iulog,*) 'FRIERSON: rhoh2o=' , rhoh2o
+ write(iulog,*) 'FRIERSON: zvir=' , zvir
+ write(iulog,*) 'FRIERSON: ps0=' , ps0
+ write(iulog,*) 'FRIERSON: etamid=' , etamid
+ write(iulog,*) 'FRIERSON: T0=' , frierson_T0
+ write(iulog,*) 'FRIERSON: E0=' , frierson_E0
+ write(iulog,*) 'FRIERSON: Erad=' , frierson_Erad
+ write(iulog,*) 'FRIERSON: Wind_min=' , frierson_Wind_min
+ write(iulog,*) 'FRIERSON: Z0=' , frierson_Z0
+ write(iulog,*) 'FRIERSON: Ri_c=' , frierson_Ri_c
+ write(iulog,*) 'FRIERSON: Karman=' , frierson_Karman
+ write(iulog,*) 'FRIERSON: Fb=' , frierson_Fb
+ write(iulog,*) 'FRIERSON: Rs0=' , frierson_Rs0
+ write(iulog,*) 'FRIERSON: Albedo=' , frierson_Albedo
+ write(iulog,*) 'FRIERSON: Rs=' , frierson_Rs
+ write(iulog,*) 'FRIERSON: DeltaS=' , frierson_DeltaS
+ write(iulog,*) 'FRIERSON: Tau_eqtr=' , frierson_Tau_eqtr
+ write(iulog,*) 'FRIERSON: Tau_pole=' , frierson_Tau_pole
+ write(iulog,*) 'FRIERSON: LinFrac=' , frierson_LinFrac
+ write(iulog,*) 'FRIERSON: Boltz=' , frierson_Boltz
+ write(iulog,*) 'FRIERSON: C0=' , frierson_C0
+ write(iulog,*) 'FRIERSON: Tmin=' , frierson_Tmin
+ write(iulog,*) 'FRIERSON: Tdlt=' , frierson_Tdlt
+ write(iulog,*) 'FRIERSON: Twidth=' , frierson_Twidth
+ write(iulog,*) 'FRIERSON: WetDryCoef=', frierson_WetDryCoef
+ write(iulog,*) ' '
+ endif
+
+ end subroutine frierson_init
+ !==============================================================================
+
+
+ !==============================================================================
+
+
+ !==============================================================================
+ subroutine frierson_condensate_tend(state, ptend, ztodt, pbuf)
+ !
+ ! frierson_condensate_tend: Run the selected process to compute precipitation
+ ! due to large scale condensation.
+ !=====================================================================
+ use physics_types,only: physics_state, physics_ptend
+ use physics_types,only: physics_ptend_init
+ use frierson, only: frierson_condensate_NONE,frierson_condensate
+ use frierson, only: frierson_condensate_USER,frierson_condensate_TJ16
+ !
+ ! Passed Variables
+ !------------------
+ type(physics_state) ,intent(inout):: state
+ real(r8) ,intent(in) :: ztodt
+ type(physics_ptend) ,intent(out) :: ptend
+ type(physics_buffer_desc),pointer :: pbuf(:)
+ !
+ ! Local Values
+ !-----------------
+ real(r8),pointer:: relhum (:,:)
+ real(r8),pointer:: prec_pcw(:) ! large scale precip
+ real(r8) :: prec_cnv(state%ncol) ! Convective Precip
+ real(r8) :: evapdt(state%ncol, pver) ! T tendency due to re-evaporation of condensation
+ real(r8) :: evapdq(state%ncol, pver) ! Q tendency due to re-evaporation of condensation
+ real(r8) :: dtcond(state%ncol, pver) ! Temperature tendency due to condensation
+ real(r8) :: dqcond(state%ncol, pver) ! Q tendency due to condensation
+ real(r8) :: T (state%ncol, pver) ! T temporary
+ real(r8) :: qv (state%ncol, pver) ! Q temporary
+ logical :: lq(pcnst) ! Calc tendencies?
+ integer :: lchnk ! chunk identifier
+ integer :: ncol ! number of atmospheric columns
+ integer :: k
+
+ ! Set local copies of values
+ !---------------------------------
+ lchnk = state%lchnk
+ ncol = state%ncol
+ T (:ncol,:) = state%T(:ncol,:)
+ qv(:ncol,:) = state%Q(:ncol,:,1)
+
+ ! initialize individual parameterization tendencies
+ !---------------------------------------------------
+ lq = .false.
+ lq(1) = .true.
+ call physics_ptend_init(ptend, state%psetcols, 'Frierson condensate', &
+ ls=.true., lu=.true., lv=.true., lq=lq)
+
+ ! Get values from the physics buffer
+ !------------------------------------
+ call pbuf_get_field(pbuf,prec_pcw_idx,prec_pcw)
+ call pbuf_get_field(pbuf, relhum_idx,relhum )
+
+ ! Initialize values for condensate tendencies
+ !---------------------------------------------
+ do k = 1, pver
+ dtcond(:ncol,k) = state%T(:ncol,k)
+ dqcond(:ncol,k) = state%q(:ncol,k,1)
+ end do
+
+ ! Call the Selected condensation routine ~~DEVO style~~
+ !--------------------------------------------------------
+ if(CONDENSATE_OPT == CONDENSATE_NONE) then
+ prec_cnv(:ncol) = 0._r8
+ evapdt (:ncol,:) = 0._r8
+ evapdq (:ncol,:) = 0._r8
+ call frierson_condensate_NONE(ncol,pver,state%pmid(:ncol,:), &
+ T(:ncol,:), &
+ qv(:ncol,:), &
+ relhum(:ncol,:), &
+ prec_pcw(:ncol) )
+ elseif(CONDENSATE_OPT == CONDENSATE_FRIERSON) then
+ prec_cnv(:ncol) = 0._r8
+ call frierson_condensate(ncol,pver,ztodt,state%pmid(:ncol,:), &
+ state%pdel(:ncol,:), &
+ T(:ncol,:), &
+ qv(:ncol,:), &
+ relhum(:ncol,:), &
+ prec_pcw(:ncol) , &
+ evapdt(:ncol,:), &
+ evapdq(:ncol,:) )
+ elseif(CONDENSATE_OPT == CONDENSATE_TJ16) then
+ prec_cnv(:ncol) = 0._r8
+ evapdt (:ncol,:) = 0._r8
+ evapdq (:ncol,:) = 0._r8
+ call frierson_condensate_TJ16(ncol,pver,ztodt,state%pmid(:ncol,:), &
+ state%pdel(:ncol,:), &
+ T(:ncol,:), &
+ qv(:ncol,:), &
+ relhum(:ncol,:), &
+ prec_pcw(:ncol) )
+ elseif(CONDENSATE_OPT == CONDENSATE_USER) then
+ prec_cnv(:ncol) = 0._r8
+ evapdt (:ncol,:) = 0._r8
+ evapdq (:ncol,:) = 0._r8
+ call frierson_condensate_USER(ncol,pver,ztodt,state%pmid(:ncol,:), &
+ state%pdel(:ncol,:), &
+ T(:ncol,:), &
+ qv(:ncol,:), &
+ relhum(:ncol,:), &
+ prec_pcw(:ncol) )
+ else
+ ! ERROR: Unknown CONDENSATE_OPT value
+ !-------------------------------------
+ write(iulog,*) 'ERROR: unknown CONDENSATE_OPT=',CONDENSATE_OPT
+ call endrun('frierson_condensate_tend() CONDENSATE_OPT ERROR')
+ endif
+
+ ! Back out temperature and specific humidity
+ ! tendencies from updated fields
+ !--------------------------------------------
+ do k = 1, pver
+ ptend%s(:ncol,k) = (T (:,k)-state%T(:ncol,k) )/ztodt*cpair
+ ptend%q(:ncol,k,1) = (qv(:,k)-state%q(:ncol,k,1))/ztodt
+ end do
+
+ ! Output condensate tendencies
+ !------------------------------
+ do k = 1, pver
+ dtcond(:ncol,k) = (T (:ncol,k) - dtcond(:ncol,k))/ztodt
+ dqcond(:ncol,k) = (qv(:ncol,k) - dqcond(:ncol,k))/ztodt
+ end do
+ call outfld('gray_EVAPDT',evapdt ,ncol,lchnk)
+ call outfld('gray_EVAPDQ',evapdq ,ncol,lchnk)
+ call outfld('gray_DTCOND',dtcond ,ncol,lchnk)
+ call outfld('gray_DQCOND',dqcond ,ncol,lchnk)
+ call outfld('gray_PRECL' ,prec_pcw,ncol,lchnk)
+ call outfld('gray_PRECC' ,prec_cnv,ncol,lchnk)
+
+ end subroutine frierson_condensate_tend
+ !==============================================================================
+
+
+ !============================================================================
+ subroutine frierson_pbl_tend(state, ptend, ztodt, cam_in)
+ !
+ ! frierson_pbl_tend: Run the selected PBL process.
+ !=========================================================================
+ use physics_types,only: physics_state, physics_ptend
+ use physics_types,only: physics_ptend_init
+ use phys_grid, only: get_rlat_all_p
+ use frierson, only: frierson_pbl,frierson_pbl_USER
+ !
+ ! Passed Variables
+ !-------------------
+ type(physics_state),intent(in) :: state
+ real(r8), intent(in) :: ztodt
+ type(physics_ptend),intent(out) :: ptend
+ type(cam_in_t), intent(inout):: cam_in
+ !
+ ! Local Values
+ !----------------
+ real(r8) :: T (state%ncol,pver) ! T temporary
+ real(r8) :: qv (state%ncol,pver) ! Q temporary (specific humidity)
+ real(r8) :: U (state%ncol,pver) ! U temporary
+ real(r8) :: V (state%ncol,pver) ! V temporary
+ real(r8) :: dqdt_vdiff(state%ncol,pver) ! PBL Q vertical diffusion tend kg/kg/s
+ real(r8) :: dtdt_vdiff(state%ncol,pver) ! PBL T vertical diffusion tend K/s
+ real(r8) :: dudt_vdiff(state%ncol,pver) ! PBL U vertical diffusion tend m/s/s
+ real(r8) :: dvdt_vdiff(state%ncol,pver) ! PBL V vertical diffusion tend m/s/s
+ real(r8) :: Km (state%ncol,pverp) ! Eddy diffusivity at layer interfaces (m2/s)
+ real(r8) :: Ke (state%ncol,pverp) ! Eddy diffusivity at layer interfaces (m2/s)
+ real(r8) :: VSE (state%ncol,pver) ! Dry Static Energy divided by Cp (K)
+ real(r8) :: Zm (state%ncol,pver) !
+ real(r8) :: Zi (state%ncol,pver) !
+ real(r8) :: Z_pbl (state%ncol) !
+ real(r8) :: Rf (state%ncol,pver) !
+ real(r8) :: Tsfc (state%ncol) ! Surface T
+ real(r8) :: Qsfc (state%ncol) ! Surface Q (saturated)
+ real(r8) :: Cdrag (state%ncol) ! Cdrag coef from surface calculation
+
+ logical :: lq (pcnst) ! Calc tendencies?
+ real(r8) :: dTs (state%ncol)
+ real(r8) :: dUa (state%ncol,pver)
+ real(r8) :: dVa (state%ncol,pver)
+ real(r8) :: dTa (state%ncol,pver)
+ real(r8) :: dQa (state%ncol,pver)
+ integer :: lchnk ! chunk identifier
+ integer :: ncol ! number of atmospheric columns
+ integer :: kk ! loop index
+
+ ! Set local copies of values
+ !---------------------------------
+ lchnk = state%lchnk
+ ncol = state%ncol
+ Zm (:ncol,:) = state%zm (:ncol,:)
+ Zi (:ncol,1:pver) = state%zi (:ncol,1:pver)
+ T (:ncol,:) = state%T (:ncol,:)
+ U (:ncol,:) = state%U (:ncol,:)
+ V (:ncol,:) = state%V (:ncol,:)
+ qv (:ncol,:) = state%Q (:ncol,:,1)
+
+ ! Initialize individual parameterization tendencies
+ !-----------------------------------------------------
+ lq = .false.
+ lq(1) = .true.
+ call physics_ptend_init(ptend,state%psetcols,'Frierson pbl_tend', &
+ ls=.true., lu=.true., lv=.true., lq=lq)
+
+ ! Call the Selected PBL routine
+ !--------------------------------------------------------
+ Tsfc(:ncol) = Tsurf(:ncol,lchnk)
+ Qsfc(:ncol) = Qsurf(:ncol,lchnk)
+ if(PBL_OPT == PBL_FRIERSON) then
+ ! Call Frierson PBL scheme
+ !--------------------------------------------------
+ call frierson_pbl(ncol, pver, ztodt,state%pmid (:ncol,:), &
+ state%pint (:ncol,:), &
+ Zm(:ncol,:), &
+ Zi(:ncol,:), &
+ state%ps(:ncol) , &
+ Tsfc(:ncol) , &
+ Qsfc(:ncol) , &
+ T(:ncol,:), &
+ U(:ncol,:), &
+ V(:ncol,:), &
+ qv(:ncol,:), &
+ Fsolar(:ncol,lchnk), &
+ Fdown(:ncol,lchnk), &
+ Cdrag(:ncol) , &
+ Km(:ncol,:), &
+ Ke(:ncol,:), &
+ VSE(:ncol,:), &
+ Z_pbl(:ncol) , &
+ Rf(:ncol,:), &
+ dqdt_vdiff(:ncol,:), &
+ dtdt_vdiff(:ncol,:), &
+ dudt_vdiff(:ncol,:), &
+ dvdt_vdiff(:ncol,:), &
+ LHflux(:ncol,lchnk), &
+ SHflux(:ncol,lchnk), &
+ TUflux(:ncol,lchnk), &
+ TVflux(:ncol,lchnk) )
+ elseif(PBL_OPT == PBL_USER) then
+ ! Call USER implemented routine in frierson module
+ !--------------------------------------------------
+ call frierson_pbl_USER(ncol, pver, ztodt,state%pmid (:ncol,:), &
+ state%pint (:ncol,:), &
+ Zm(:ncol,:), &
+ Zi(:ncol,:), &
+ state%ps(:ncol) , &
+ Tsfc(:ncol) , &
+ Qsfc(:ncol) , &
+ T(:ncol,:), &
+ U(:ncol,:), &
+ V(:ncol,:), &
+ qv(:ncol,:), &
+ Fsolar(:ncol,lchnk), &
+ Fdown(:ncol,lchnk), &
+ Cdrag(:ncol) , &
+ Km(:ncol,:), &
+ Ke(:ncol,:), &
+ VSE(:ncol,:), &
+ Z_pbl(:ncol) , &
+ Rf(:ncol,:), &
+ dqdt_vdiff(:ncol,:), &
+ dtdt_vdiff(:ncol,:), &
+ dudt_vdiff(:ncol,:), &
+ dvdt_vdiff(:ncol,:), &
+ LHflux(:ncol,lchnk), &
+ SHflux(:ncol,lchnk), &
+ TUflux(:ncol,lchnk), &
+ TVflux(:ncol,lchnk) )
+ else
+ ! ERROR: Unknown PBL_OPT value
+ !-------------------------------------
+ write(iulog,*) 'ERROR: unknown PBL_OPT=',PBL_OPT
+ call endrun('frierson_pbl_tend() PBL_OPT ERROR')
+ endif
+ Tsurf(:ncol,lchnk) = Tsfc (:ncol)
+ Qsurf(:ncol,lchnk) = Qsfc (:ncol)
+ Cd (:ncol,lchnk) = Cdrag(:ncol)
+
+ ! Back out tendencies from updated fields
+ !-----------------------------------------
+ do kk = 1, pver
+ ptend%s(:ncol,kk ) = (T (:,kk)-state%T(:ncol,kk ))/ztodt*cpair
+ ptend%u(:ncol,kk ) = (U (:,kk)-state%U(:ncol,kk ))/ztodt
+ ptend%v(:ncol,kk ) = (V (:,kk)-state%V(:ncol,kk ))/ztodt
+ ptend%q(:ncol,kk,1) = (qv(:,kk)-state%q(:ncol,kk,1))/ztodt
+ end do
+
+ ! Archive diagnostic fields
+ !----------------------------
+ call outfld('gray_Tsurf' ,Tsurf(:ncol,lchnk) ,ncol,lchnk)
+ call outfld('gray_Qsurf' ,Qsurf(:ncol,lchnk) ,ncol,lchnk)
+ call outfld('gray_Cdrag' ,Cd (:ncol,lchnk) ,ncol,lchnk)
+ call outfld('gray_Zpbl' ,Z_pbl ,ncol,lchnk) !
+ call outfld('gray_KVH' ,Ke ,ncol,lchnk) ! Eddy diffusivity (heat and moisture,m2/s)
+ call outfld('gray_KVM' ,Km ,ncol,lchnk) ! Eddy diffusivity (momentum, m2/s)
+ call outfld('gray_VSE' ,VSE ,ncol,lchnk) ! Virtual Dry Static Energy divided by Cp (K)
+ call outfld('gray_Zm' ,Zm ,ncol,lchnk) !
+ call outfld('gray_Rf' ,Rf ,ncol,lchnk) !
+ call outfld('gray_DTV' ,dtdt_vdiff ,ncol,lchnk) ! PBL + surface flux T tendency (K/s)
+ call outfld('gray_DUV' ,dudt_vdiff ,ncol,lchnk) ! PBL u tendency (m/s2)
+ call outfld('gray_DVV' ,dvdt_vdiff ,ncol,lchnk) ! PBL v tendency (m/s2)
+ call outfld('gray_VD01' ,dqdt_vdiff ,ncol,lchnk) ! PBL + surface flux Q tendency (kg/kg/s)
+ call outfld('gray_SHflux',SHflux(:ncol,lchnk),ncol,lchnk) ! Sensible Heat Flux
+ call outfld('gray_LHflux',LHflux(:ncol,lchnk),ncol,lchnk) ! Latent Heat Flux
+ call outfld('gray_TauU' ,TUflux(:ncol,lchnk),ncol,lchnk) ! U Surface Stress
+ call outfld('gray_TauV' ,TVflux(:ncol,lchnk),ncol,lchnk) ! V Surface Stress
+
+ end subroutine frierson_pbl_tend
+ !============================================================================
+
+
+ !============================================================================
+ subroutine frierson_radiative_tend(state, ptend, ztodt,cam_in,cam_out)
+ !
+ ! frierson_radiative_tend: Run the radiative process
+ !=========================================================================
+ use physics_types,only: physics_state, physics_ptend
+ use physics_types,only: physics_ptend_init
+ use phys_grid, only: get_rlat_all_p
+ use frierson, only: frierson_radiation,frierson_radiation_USER
+ !
+ ! Passed Variables
+ !------------------
+ type(physics_state),intent(in) :: state
+ real(r8) ,intent(in) :: ztodt
+ type(physics_ptend),intent(out) :: ptend
+ type(cam_in_t), intent(inout):: cam_in
+ type(cam_out_t), intent(inout):: cam_out
+ !
+ ! Local Values
+ !---------------
+ real(r8):: T (state%ncol,pver) ! T temporary
+ real(r8):: qv (state%ncol,pver) ! Q temporary
+ real(r8):: dtdt_heating(state%ncol,pver) ! Longwave heating tendency K/s
+ real(r8):: dtdt_solar (state%ncol,pver) ! Shortwave heating tendency K/s
+ real(r8):: Tsfc (state%ncol) ! Surface T
+ real(r8):: Qsfc (state%ncol) ! Surface Q (saturated)
+ logical :: lq(pcnst) ! Calc tendencies?
+ integer :: lchnk ! chunk identifier
+ integer :: ncol ! number of atmospheric columns
+ integer :: k ! loop index
+
+ ! Copy to local values
+ !-------------------------------------------------
+ lchnk = state%lchnk
+ ncol = state%ncol
+ T (:ncol,:) = state%T(:ncol,:)
+ qv (:ncol,:) = state%Q(:ncol,:,1)
+
+ !--------------------------------------
+ Tsfc(:ncol) = Tsurf(:ncol,lchnk)
+ Qsfc(:ncol) = Qsurf(:ncol,lchnk)
+
+ ! initialize individual parameterization tendencies
+ !---------------------------------------------------
+ lq(:) = .false.
+ call physics_ptend_init(ptend, state%psetcols, 'Frierson radiative_tend', &
+ ls=.true., lu=.false., lv=.false., lq=lq)
+
+ ! Call the Selected radiative routine
+ !--------------------------------------------------------
+ if(RADIATION_OPT == RADIATION_FRIERSON) then
+ call frierson_radiation(ncol,pver,ztodt,clat(:ncol,lchnk), &
+ state%pint(:ncol,:), &
+ state%pmid(:ncol,:), &
+ state%ps(:ncol), &
+ Tsfc(:ncol), &
+ Qsfc(:ncol), &
+ T(:ncol,:), &
+ qv(:ncol,:), &
+ dtdt_heating(:ncol,:), &
+ Fsolar(:ncol,lchnk), &
+ Fup(:ncol,lchnk), &
+ Fdown(:ncol,lchnk), &
+ Fup_toa(:ncol,lchnk), &
+ Fdown_toa(:ncol,lchnk) )
+ dtdt_solar(:ncol,:) = 0._r8
+ elseif(RADIATION_OPT == RADIATION_USER) then
+ call frierson_radiation_USER(ncol,pver,ztodt,clat(:ncol,lchnk), &
+ state%pint(:ncol,:), &
+ state%pmid(:ncol,:), &
+ state%ps(:ncol), &
+ Tsfc(:ncol), &
+ Qsfc(:ncol), &
+ T(:ncol,:), &
+ qv(:ncol,:), &
+ dtdt_heating(:ncol,:), &
+ Fsolar(:ncol,lchnk), &
+ Fup(:ncol,lchnk), &
+ Fdown(:ncol,lchnk), &
+ Fup_toa(:ncol,lchnk), &
+ Fdown_toa(:ncol,lchnk) )
+ dtdt_solar(:ncol,:) = 0._r8
+ else
+ ! ERROR: Unknown RADIATION_OPT value
+ !-------------------------------------
+ write(iulog,*) 'ERROR: unknown RADIATION_OPT=',RADIATION_OPT
+ call endrun('frierson_pbl_tend() RADIATION_OPT ERROR')
+ endif
+
+ Fnet (:ncol,lchnk) = Fup(:ncol,lchnk) - Fdown (:ncol,lchnk)
+ Fnet_toa (:ncol,lchnk) = Fup_toa(:ncol,lchnk) - Fdown_toa (:ncol,lchnk)
+
+ ! Copy downward LW radiative heating values to cam_out%
+ !---------------------------------------------------------
+ cam_out%flwds(:ncol) = Fdown (:ncol,lchnk)
+ cam_out%netsw(:ncol) = Fsolar(:ncol,lchnk)
+ cam_out%sols (:ncol) = Fsolar(:ncol,lchnk)
+ cam_out%solsd(:ncol) = Fsolar(:ncol,lchnk)
+ cam_out%soll (:ncol) = Fsolar(:ncol,lchnk)
+ cam_out%solld(:ncol) = Fsolar(:ncol,lchnk)
+
+ ! Back out tendencies from updated T field
+ !--------------------------------------------
+ do k = 1, pver
+ ptend%s(:ncol,k) = (T(:,k)-state%T(:ncol,k))/ztodt*cpair
+ end do
+
+ ! Archive T tendency from temperature relaxation (mimics radiation, K/s)
+ !-----------------------------------------------------------------------
+ call outfld('gray_QRL' ,dtdt_heating, ncol,lchnk)
+ call outfld('gray_QRS' ,dtdt_solar , ncol,lchnk)
+ call outfld('gray_SWflux',Fsolar(:ncol,lchnk) , ncol,lchnk)
+ call outfld('gray_LUflux',Fup(:ncol,lchnk) , ncol,lchnk)
+ call outfld('gray_LDflux',Fdown(:ncol,lchnk) , ncol,lchnk)
+ call outfld('gray_LWflux',Fnet(:ncol,lchnk) , ncol,lchnk)
+ call outfld('gray_LUflux_TOA',Fup_toa(:ncol,lchnk) , ncol,lchnk)
+ call outfld('gray_LDflux_TOA',Fdown_toa(:ncol,lchnk) , ncol,lchnk)
+ call outfld('gray_LWflux_TOA',Fnet_toa(:ncol,lchnk) , ncol,lchnk)
+
+ end subroutine frierson_radiative_tend
+ !============================================================================
+
+
+ !=======================================================================
+ subroutine frierson_surface_init(ncol, clat, PS, Tsfc, Qsfc)
+ !
+ !
+ !==========================================================================
+ !
+ ! Passed variables
+ !--------------------
+ integer ,intent(in) :: ncol
+ real(r8),intent(in) :: clat (ncol)
+ real(r8),intent(in) :: PS (ncol)
+ real(r8),intent(out):: Tsfc(ncol)
+ real(r8),intent(out):: Qsfc(ncol)
+ !
+ ! Local values
+ !--------------
+ integer :: ii
+ real(r8):: T_width
+
+ ! set SST profile
+ !------------------
+ T_width = frierson_Twidth*pi/180.0_r8
+ do ii = 1, ncol
+ Tsfc(ii) = frierson_Tmin + frierson_Tdlt*exp(-((clat(ii)/T_width)**2)/2.0_r8)
+ Qsfc(ii) = epsilo*frierson_E0/PS(ii) &
+ *exp(-latvap/rh2o*((1._r8/Tsfc(ii))-1._r8/frierson_T0))
+ end do
+
+ end subroutine frierson_surface_init
+ !=======================================================================
+
+
+ !=======================================================================
+ subroutine frierson_restart_init(File,hdimids,hdimcnt)
+ !
+ ! frierson_restart_init:
+ !==========================================================================
+ !
+ ! Passed variables
+ !--------------------
+ type(file_desc_t),intent(inout):: File
+ integer ,intent(in) :: hdimcnt
+ integer ,intent(in) :: hdimids(1:hdimcnt)
+ !
+ ! Local values
+ !--------------
+ integer:: ierr
+
+ ierr = pio_def_var(File,'Frierson_Tsfc',pio_double, hdimids, Tsurf_desc)
+ if (ierr /= 0) then
+ call endrun('frierson_restart_init: ERROR defining Frierson_Tsfc')
+ end if
+
+ ierr = pio_def_var(File,'Frierson_Qsfc',pio_double, hdimids, Qsurf_desc)
+ if (ierr /= 0) then
+ call endrun('frierson_restart_init: ERROR defining Frierson_Qsfc')
+ end if
+
+ end subroutine frierson_restart_init
+ !=======================================================================
+
+
+ !=======================================================================
+ subroutine frierson_restart_write(File)
+ !
+ ! frierson_restart_write:
+ !==========================================================================
+ !
+ ! Passed variables
+ !--------------------
+ type(file_desc_t),intent(inout):: File
+ !
+ ! Local values
+ !--------------
+ type(io_desc_t),pointer:: iodesc
+ integer:: dims(3),gdims(3),nhdims
+ integer:: physgrid
+ integer:: ierr
+
+ ! Get the iodesc for write calls
+ !---------------------------------
+ dims(1) = pcols
+ dims(2) = endchunk - begchunk + 1
+ physgrid = cam_grid_id('physgrid')
+ call cam_grid_dimensions(physgrid, gdims(1:2), nhdims)
+ call cam_grid_get_decomp(physgrid, dims(1:2), gdims(1:nhdims), pio_double, iodesc)
+
+ ! Write Surface values
+ !---------------------
+ call pio_write_darray(File, Tsurf_desc, iodesc, Tsurf, ierr)
+ if (ierr /= 0) then
+ call endrun('frierson_restart_write: ERROR writing Tsurf')
+ end if
+
+ call pio_write_darray(File, Qsurf_desc, iodesc, Qsurf, ierr)
+ if (ierr /= 0) then
+ call endrun('frierson_restart_write: ERROR writing Qsurf')
+ end if
+
+ end subroutine frierson_restart_write
+ !=======================================================================
+
+
+ !=======================================================================
+ subroutine frierson_restart_read(File)
+ !
+ ! frierson_restart_read:
+ !==========================================================================
+ use error_messages,only: alloc_err
+ !
+ ! Passed variables
+ !--------------------
+ type(file_desc_t),intent(inout):: File
+ !
+ ! Local values
+ !--------------
+ type( io_desc_t),pointer:: iodesc
+ type(var_desc_t) :: vardesc
+ integer:: dims(3),gdims(3),nhdims
+ integer:: physgrid
+ integer:: ierr
+
+ ! Allocate space for the restart fields
+ !-----------------------------------------
+ allocate(Tsurf (pcols,begchunk:endchunk),stat=ierr)
+ call alloc_err(ierr,'Frierson RESTART','Tsurf' ,pcols*(endchunk-begchunk+1))
+ allocate(Qsurf (pcols,begchunk:endchunk) ,stat=ierr)
+ call alloc_err(ierr,'Frierson RESTART','Qsurf' ,pcols*(endchunk-begchunk+1))
+
+ ! Get the iodesc for read calls
+ !---------------------------------
+ dims(1) = pcols
+ dims(2) = endchunk - begchunk + 1
+ physgrid = cam_grid_id('physgrid')
+ call cam_grid_dimensions(physgrid, gdims(1:2), nhdims)
+ call cam_grid_get_decomp(physgrid, dims(1:2), gdims(1:nhdims), pio_double, iodesc)
+
+ ! Read Surface values
+ !---------------------
+ ierr = pio_inq_varid(File,'Frierson_Tsfc',vardesc)
+ if (ierr /= 0) then
+ call endrun('frierson_restart_read: ERROR PIO unable to find variable Frierson_Tsfc')
+ end if
+
+ call pio_read_darray(File, vardesc, iodesc, Tsurf, ierr)
+ if (ierr /= 0) then
+ call endrun('frierson_restart_read: ERROR PIO unable to read variable Tsurf')
+ end if
+
+ ierr = pio_inq_varid(File,'Frierson_Qsfc',vardesc)
+ if (ierr /= 0) then
+ call endrun('frierson_restart_read: ERROR PIO unable to find variable Frierson_Qsfc')
+ end if
+
+ call pio_read_darray(File, vardesc, iodesc, Qsurf, ierr)
+ if (ierr /= 0) then
+ call endrun('frierson_restart_read: ERROR PIO unable to read variable Qsurf')
+ end if
+
+ end subroutine frierson_restart_read
+ !=======================================================================
+
+end module frierson_cam
+
diff --git a/src/physics/simple/held_suarez_cam.F90 b/src/physics/simple/held_suarez_cam.F90
index 68df115d18..78def4b354 100644
--- a/src/physics/simple/held_suarez_cam.F90
+++ b/src/physics/simple/held_suarez_cam.F90
@@ -1,13 +1,13 @@
module held_suarez_cam
- !-----------------------------------------------------------------------
- !
+ !-----------------------------------------------------------------------
+ !
! Purpose: Implement idealized Held-Suarez forcings
! Held, I. M., and M. J. Suarez, 1994: 'A proposal for the
! intercomparison of the dynamical cores of atmospheric general
! circulation models.'
! Bulletin of the Amer. Meteor. Soc., vol. 75, pp. 1825-1830.
- !
+ !
!-----------------------------------------------------------------------
use shr_kind_mod, only: r8 => shr_kind_r8
@@ -31,24 +31,22 @@ module held_suarez_cam
real(r8), parameter :: ka = 1._r8/(86400._r8 * efolda) ! 1./efolding_time for temperature diss.
real(r8), parameter :: ks = 1._r8/(86400._r8 * efolds)
-!=======================================================================
+!=======================================================================
contains
-!=======================================================================
+!=======================================================================
- subroutine held_suarez_init(pbuf2d)
+ subroutine held_suarez_init()
use physics_buffer, only: physics_buffer_desc
use cam_history, only: addfld, add_default
- use physconst, only: cappa, cpair
- use ref_pres, only: pref_mid_norm, psurf_ref
+ use ref_pres, only: psurf_ref
use held_suarez_1994, only: held_suarez_1994_init
- type(physics_buffer_desc), pointer :: pbuf2d(:,:)
-
- character(len=512) :: errmsg
- integer :: errflg
+ ! Local variables
+ character(len=512) :: errmsg
+ integer :: errflg
! Set model constant values
- call held_suarez_1994_init(pver, cappa, cpair, psurf_ref, pref_mid_norm, errmsg, errflg)
+ call held_suarez_1994_init(psurf_ref, errmsg, errflg)
! This field is added by radiation when full physics is used
call addfld('QRS', (/ 'lev' /), 'A', 'K/s', &
@@ -57,7 +55,8 @@ subroutine held_suarez_init(pbuf2d)
end subroutine held_suarez_init
subroutine held_suarez_tend(state, ptend, ztodt)
- use air_composition, only: cpairv
+ use air_composition, only: cappav, cpairv
+ use ref_pres, only: pref_mid_norm
use phys_grid, only: get_rlat_all_p
use physics_types, only: physics_state, physics_ptend
use physics_types, only: physics_ptend_init
@@ -84,8 +83,9 @@ subroutine held_suarez_tend(state, ptend, ztodt)
real(r8) :: pmid(pcols,pver) ! mid-point pressure
integer :: i, k ! Longitude, level indices
- character(len=512) :: errmsg
- integer :: errflg
+ character(len=64) :: scheme_name ! CCPP-required variables (not used in CAM)
+ character(len=512) :: errmsg
+ integer :: errflg
!
!-----------------------------------------------------------------------
@@ -104,8 +104,11 @@ subroutine held_suarez_tend(state, ptend, ztodt)
! initialize individual parameterization tendencies
call physics_ptend_init(ptend, state%psetcols, 'held_suarez', ls=.true., lu=.true., lv=.true.)
- call held_suarez_1994_run(pver, ncol, clat, state%pmid, &
- state%u, state%v, state%t, ptend%u, ptend%v, ptend%s, errmsg, errflg)
+ call held_suarez_1994_run(pver, ncol, pref_mid_norm, clat, cappav(1:ncol,:,lchnk), &
+ cpairv(1:ncol,:,lchnk), state%pmid(1:ncol,:), &
+ state%u(1:ncol,:), state%v(1:ncol,:), state%t(1:ncol,:), &
+ ptend%u(1:ncol,:), ptend%v(1:ncol,:), ptend%s(1:ncol,:), &
+ scheme_name, errmsg, errflg)
! Note, we assume that there are no subcolumns in simple physics
pmid(:ncol,:) = ptend%s(:ncol, :)/cpairv(:ncol,:,lchnk)
diff --git a/src/physics/simple/kessler_cam.F90 b/src/physics/simple/kessler_cam.F90
index d6319962f1..93e961cd97 100644
--- a/src/physics/simple/kessler_cam.F90
+++ b/src/physics/simple/kessler_cam.F90
@@ -39,22 +39,26 @@ end subroutine kessler_register
!========================================================================================
- subroutine kessler_cam_init(pbuf2d)
+ subroutine kessler_cam_init()
- use physconst, only: cpair, latvap,pstd, rair, rhoh2o
+ use physconst, only: latvap, rhoh2o
+ use ref_pres, only: psurf_ref
use constituents, only: cnst_name, cnst_longname, bpcnst, apcnst
- use cam_history, only: addfld, add_default, horiz_only
+ use cam_history, only: addfld, add_default
use cam_abortutils, only: endrun
- use state_converters, only: pres_to_density_dry_init
- use kessler, only: kessler_init
- use state_converters, only: calc_exner_init
+ use kessler, only: kessler_init
- integer :: errflg
- character(len=512) :: errmsg
+ !
+ !---------------------------Local workspace-----------------------------
+ !
+ integer :: errflg
+ character(len=512) :: errmsg
- type(physics_buffer_desc), pointer :: pbuf2d(:,:)
+ !
+ !-----------------------------------------------------------------------
+ !
errflg = 0
@@ -68,52 +72,43 @@ subroutine kessler_cam_init(pbuf2d)
call add_default(cnst_name(ixrain), 1, ' ')
! Initialize Kessler with CAM physical constants
-
- if (errflg == 0) then
- call kessler_init(cpair, latvap, pstd, rair, rhoh2o, errmsg, errflg)
- if (errflg /=0) then
- call endrun('kessler_cam_init error: Error returned from kessler_init: '//trim(errmsg))
- end if
- end if
- if (errflg == 0) then
- call pres_to_density_dry_init(cpair, rair, errmsg, errflg)
- if (errflg /=0) then
- call endrun('kessler_cam_init error: Error returned from pres_to_density_dry_init: '//trim(errmsg))
- end if
- end if
- if (errflg == 0) then
- call calc_exner_init(errmsg, errflg)
- if (errflg /=0) then
- call endrun('kessler_cam_init error: Error returned from calc_exner_init: '//trim(errmsg))
- end if
- end if
+ call kessler_init(latvap, psurf_ref, rhoh2o, errmsg, errflg)
+ if (errflg /=0) then
+ call endrun('kessler_cam_init error: Error returned from kessler_init: '//trim(errmsg))
+ end if
end subroutine kessler_cam_init
!========================================================================================
subroutine kessler_tend(state, ptend, ztodt, pbuf)
- !-----------------------------------------------------------------------
- !
+ !-----------------------------------------------------------------------
+ !
! Purpose: Run Kessler physics (see kessler.F90)
- !
+ !
!-----------------------------------------------------------------------
- use shr_kind_mod, only: SHR_KIND_CM
- use physconst, only: cpair, rair, zvir
- use physics_types, only: physics_state, physics_ptend
- use physics_types, only: physics_ptend_init
- use constituents, only: pcnst, cnst_name, cnst_type
+ use shr_kind_mod, only: SHR_KIND_CM
+ use ref_pres, only: psurf_ref
+ use physconst, only: rh2o
+ use air_composition, only: cpairv, rairv
+ use physics_types, only: physics_state, physics_ptend
+ use physics_types, only: physics_ptend_init
+ use constituents, only: pcnst, cnst_name, cnst_type
use kessler, only: kessler_run
- use state_converters, only: wet_to_dry_run
- use state_converters, only: dry_to_wet_run
- use state_converters, only: pres_to_density_dry_run
+ use state_converters, only: wet_to_dry_water_vapor_run
+ use state_converters, only: wet_to_dry_cloud_liquid_water_run
+ use state_converters, only: wet_to_dry_rain_run
+ use state_converters, only: dry_to_wet_water_vapor_run
+ use state_converters, only: dry_to_wet_cloud_liquid_water_run
+ use state_converters, only: dry_to_wet_rain_run
use state_converters, only: temp_to_potential_temp_run
use state_converters, only: calc_exner_run
+ use state_converters, only: calc_dry_air_ideal_gas_density_run
use state_converters, only: potential_temp_to_temp_run
- use cam_abortutils, only: endrun
- use cam_history, only: outfld
+ use cam_abortutils, only: endrun
+ use cam_history, only: outfld
! arguments
@@ -122,28 +117,36 @@ subroutine kessler_tend(state, ptend, ztodt, pbuf)
type(physics_ptend), intent(out) :: ptend ! Package tendencies
type(physics_buffer_desc), pointer :: pbuf(:)
+ !
!---------------------------Local workspace-----------------------------
!
- integer :: lchnk ! chunk identifier
- integer :: ncol ! number of atmospheric columns
+ integer :: lchnk ! chunk identifier
+ integer :: ncol ! number of atmospheric columns
integer :: lyr_surf
integer :: lyr_toa
- real(r8) :: rho(pcols,pver) ! Dry air density
- real(r8) :: pk(pcols,pver) ! exner func.
- real(r8) :: th(pcols,pver) ! Potential temp.
- real(r8) :: temp(pcols,pver) ! temperature
- real(r8) :: qv(pcols,pver) ! Water vapor
- real(r8) :: qc(pcols,pver) ! Cloud water
- real(r8) :: qr(pcols,pver) ! Rain water
- integer :: k,rk ! vert. indices
- logical :: lq(pcnst) ! Calc tendencies?
- character(len=SHR_KIND_CM) :: errmsg
+ real(r8) :: zvirv(pcols,pver) ! ratio of water vapor to dry air constants - 1
+ real(r8) :: rho(pcols,pver) ! Dry air density
+ real(r8) :: pk(pcols,pver) ! exner func.
+ real(r8) :: th(pcols,pver) ! Potential temp.
+ real(r8) :: temp(pcols,pver) ! temperature
+ real(r8) :: qv(pcols,pver) ! Water vapor mixing ratio wrt moist air
+ real(r8) :: qc(pcols,pver) ! Cloud water mixing ratio wrt moist air
+ real(r8) :: qr(pcols,pver) ! Rain mixing ratio wrt moist air
+ real(r8) :: qv_dry(pcols,pver) ! Water vapor mixing ratio wrt dry air
+ real(r8) :: qc_dry(pcols,pver) ! Cloud water mixing ratio wrt dry air
+ real(r8) :: qr_dry(pcols,pver) ! Rain mixing ratio wrt dry air
- integer :: errflg
+ integer :: k,rk ! vert. indices
+ logical :: lq(pcnst) ! Calc tendencies?
+ character(len=SHR_KIND_CM) :: errmsg ! CCPP physics scheme error message
+
+ integer :: errflg ! CCPP physics scheme error flag
- real(r8), pointer :: prec_sed(:) ! total precip from cloud sedimentation
- real(r8), pointer :: relhum(:,:) ! relative humidity
+ character(len=64) :: scheme_name ! CCPP physics scheme name (not used in CAM)
+
+ real(r8), pointer :: prec_sed(:) ! total precip from cloud sedimentation
+ real(r8), pointer :: relhum(:,:) ! relative humidity
integer :: i
@@ -169,63 +172,110 @@ subroutine kessler_tend(state, ptend, ztodt, pbuf)
call pbuf_get_field(pbuf, relhum_idx, relhum)
do k = 1, pver
- ! Create temporaries for state variables changed by Kessler routine
- temp(:ncol,k) = state%t(:ncol,k)
- qv(:ncol,k) = state%q(:ncol,k,1)
- qc(:ncol,k) = state%q(:ncol,k,ixcldliq)
- qr(:ncol,k) = state%q(:ncol,k,ixrain)
+ ! Create temporaries for state variables changed by Kessler routine
+ temp(:ncol,k) = state%t(:ncol,k)
+ qv(:ncol,k) = state%q(:ncol,k,1)
+ qc(:ncol,k) = state%q(:ncol,k,ixcldliq)
+ qr(:ncol,k) = state%q(:ncol,k,ixrain)
+
+ !Also calculate gas constant ratio:
+ zvirv(:ncol,k) = rh2o/rairv(:ncol,k, lchnk) - 1._r8
end do
-
- if (errflg == 0) then
- call calc_exner_run(ncol, pver, cpair, rair, state%pmid, pk, errmsg, errflg)
- if (errflg /=0) then
- call endrun('kessler_tend error: Error returned from calc_exner_run: '//trim(errmsg))
- end if
+
+ ! Calculate Exner function:
+ call calc_exner_run(ncol, pver, cpairv(1:ncol,:,lchnk), rairv(1:ncol,:,lchnk), &
+ psurf_ref, state%pmid(1:ncol,:), pk(1:ncol,:), errmsg, errflg)
+ if (errflg /=0) then
+ call endrun('kessler_tend error: Error returned from calc_exner_run: '//trim(errmsg))
+ end if
+
+ ! Calculate potential temperature:
+ call temp_to_potential_temp_run(ncol, pver, temp(1:ncol,:), pk(1:ncol,:), &
+ th(1:ncol,:), errmsg, errflg)
+ if (errflg /=0) then
+ call endrun('kessler_tend error: Error returned from temp_to_potential_temp_run: '//trim(errmsg))
end if
- if (errflg == 0) then
- call temp_to_potential_temp_run(ncol, pver, temp, pk, th, errmsg, errflg)
- if (errflg /=0) then
- call endrun('kessler_tend error: Error returned from temp_to_potential_temp_run: '//trim(errmsg))
- end if
+
+ ! Calculate density using ideal gas law:
+ call calc_dry_air_ideal_gas_density_run(ncol, pver, rairv(1:ncol,:,lchnk), &
+ state%pmiddry(1:ncol,:), temp(1:ncol,:), &
+ rho(1:ncol,:), errmsg, errflg)
+ if (errflg /=0) then
+ call endrun('kessler_tend error: Error returned from pres_to_density_dry_run: '//trim(errmsg))
end if
- if (errflg == 0) then
- call pres_to_density_dry_run(ncol, pver, state%pmiddry, temp, rho, errmsg, errflg)
- if (errflg /=0) then
- call endrun('kessler_tend error: Error returned from pres_to_density_dry_run: '//trim(errmsg))
- end if
+
+ ! Convert moist air mixing ratios to dry air mixing ratios:
+ !---------------------------------------------------------
+ call wet_to_dry_water_vapor_run(ncol, pver, state%pdel(1:ncol,:), &
+ state%pdeldry(1:ncol,:), qv(1:ncol,:), &
+ qv_dry(1:ncol,:), errmsg, errflg)
+ if (errflg /=0) then
+ call endrun('kessler_tend error: Error returned from wet_to_dry_water_vapor_run: '//trim(errmsg))
end if
- if (errflg == 0) then
- call wet_to_dry_run(ncol, pver, state%pdel, state%pdeldry, qv, qc, qr, errmsg, errflg)
- if (errflg /=0) then
- call endrun('kessler_tend error: Error returned from wet_to_dry_run: '//trim(errmsg))
- end if
+
+ call wet_to_dry_cloud_liquid_water_run(ncol, pver, state%pdel(1:ncol,:), &
+ state%pdeldry(1:ncol,:), qc(1:ncol,:), &
+ qc_dry(1:ncol,:), errmsg, errflg)
+ if (errflg /=0) then
+ call endrun('kessler_tend error: Error returned from wet_to_dry_cloud_liquid_water_run: '//trim(errmsg))
end if
- if (errflg == 0) then
- call kessler_run(ncol, pver, ztodt, lyr_surf, lyr_toa, &
- rho, state%zm, pk, th, qv, qc, qr, prec_sed, relhum, errmsg, errflg)
- if (errflg /=0) then
- call endrun('kessler_tend error: Error returned from kessler_run: '//trim(errmsg))
- end if
+
+ call wet_to_dry_rain_run(ncol, pver, state%pdel(1:ncol,:), &
+ state%pdeldry(1:ncol,:), qr(1:ncol,:), &
+ qr_dry(1:ncol,:), errmsg, errflg)
+ if (errflg /=0) then
+ call endrun('kessler_tend error: Error returned from wet_to_dry_rain_run: '//trim(errmsg))
end if
- if (errflg == 0) then
- call potential_temp_to_temp_run(ncol, pver, th, pk, temp, errmsg, errflg)
- if (errflg /=0) then
- call endrun('kessler_tend error: Error returned from potential_temp_to_temp_run: '//trim(errmsg))
- end if
+ !---------------------------------------------------------
+
+ ! Run Kessler physics scheme:
+ call kessler_run(ncol, pver, ztodt, lyr_surf, lyr_toa, cpairv(1:ncol,:,lchnk), &
+ rairv(1:ncol,:,lchnk), rho(1:ncol,:), state%zm(1:ncol,:), &
+ pk(1:ncol,:), th(1:ncol,:), qv_dry(1:ncol,:), qc_dry(1:ncol,:), &
+ qr_dry(1:ncol,:), prec_sed(1:ncol), relhum(1:ncol,:), &
+ scheme_name, errmsg, errflg)
+ if (errflg /=0) then
+ call endrun('kessler_tend error: Error returned from kessler_run: '//trim(errmsg))
end if
- if (errflg == 0) then
- call dry_to_wet_run(ncol, pver, state%pdel, state%pdeldry, qv, qc, qr, errmsg, errflg)
- if (errflg /=0) then
- call endrun('kessler_tend error: Error returned from dry_to_wet_run: '//trim(errmsg))
- end if
+
+ ! Calculate air temperature from potential temperature:
+ call potential_temp_to_temp_run(ncol, pver, th(1:ncol,:), pk(1:ncol,:), &
+ temp(1:ncol,:), errmsg, errflg)
+ if (errflg /=0) then
+ call endrun('kessler_tend error: Error returned from potential_temp_to_temp_run: '//trim(errmsg))
+ end if
+
+ ! Convert dry air mixing ratios to moist air mixing ratios:
+ !---------------------------------------------------------
+ call dry_to_wet_water_vapor_run(ncol, pver, state%pdel(1:ncol,:), &
+ state%pdeldry(1:ncol,:), qv_dry(1:ncol,:), &
+ qv(1:ncol,:), errmsg, errflg)
+ if (errflg /=0) then
+ call endrun('kessler_tend error: Error returned from dry_to_wet_water_vapor_run: '//trim(errmsg))
+ end if
+
+ call dry_to_wet_cloud_liquid_water_run(ncol, pver, state%pdel(1:ncol,:), &
+ state%pdeldry(1:ncol,:), &
+ qc_dry(1:ncol,:), qc(1:ncol,:), errmsg, &
+ errflg)
+ if (errflg /=0) then
+ call endrun('kessler_tend error: Error returned from dry_to_wet_cloud_liquid_water_run: '//trim(errmsg))
+ end if
+
+ call dry_to_wet_rain_run(ncol, pver, state%pdel(1:ncol,:), &
+ state%pdeldry(1:ncol,:), qr_dry(1:ncol,:), &
+ qr(1:ncol,:), errmsg, errflg)
+ if (errflg /=0) then
+ call endrun('kessler_tend error: Error returned from dry_to_wet_rain_run: '//trim(errmsg))
end if
+ !---------------------------------------------------------
! Back out tendencies from updated fields
do k = 1, pver
- ptend%s(:ncol,k) = (th(:ncol,k)*pk(:ncol,k) - state%t(:ncol,k)) * cpair / ztodt
- ptend%q(:ncol,k,1) = (qv(:ncol,k) - state%q(:ncol,k,1)) / ztodt
- ptend%q(:ncol,k,ixcldliq) = (qc(:ncol,k) - state%q(:ncol,k,ixcldliq)) / ztodt
- ptend%q(:ncol,k,ixrain) = (qr(:ncol,k) - state%q(:ncol,k,ixrain)) / ztodt
+ ptend%s(:ncol,k) = (th(:ncol,k)*pk(:ncol,k) - state%t(:ncol,k)) * cpairv(:ncol,k,lchnk) / ztodt
+ ptend%q(:ncol,k,1) = (qv(:ncol,k) - state%q(:ncol,k,1)) / ztodt
+ ptend%q(:ncol,k,ixcldliq) = (qc(:ncol,k) - state%q(:ncol,k,ixcldliq)) / ztodt
+ ptend%q(:ncol,k,ixrain) = (qr(:ncol,k) - state%q(:ncol,k,ixrain)) / ztodt
end do
! Output liquid tracers
diff --git a/src/physics/simple/physpkg.F90 b/src/physics/simple/physpkg.F90
index 353c245318..a296fd2fdb 100644
--- a/src/physics/simple/physpkg.F90
+++ b/src/physics/simple/physpkg.F90
@@ -19,7 +19,7 @@ module physpkg
use camsrfexch, only: cam_out_t, cam_in_t, cam_export
! Note: ideal_phys is true for Held-Suarez (1994) physics
- use cam_control_mod, only: moist_physics, adiabatic, ideal_phys, kessler_phys, tj2016_phys
+ use cam_control_mod, only: moist_physics, adiabatic, ideal_phys, kessler_phys, tj2016_phys, frierson_phys
use phys_control, only: phys_getopts
use perf_mod, only: t_barrierf, t_startf, t_stopf, t_adj_detailf
use cam_logfile, only: iulog
@@ -47,6 +47,8 @@ module physpkg
integer :: qini_idx = 0
integer :: cldliqini_idx = 0
integer :: cldiceini_idx = 0
+ integer :: totliqini_idx = 0
+ integer :: toticeini_idx = 0
logical :: state_debug_checks ! Debug physics_state.
@@ -78,6 +80,7 @@ subroutine phys_register
use check_energy, only: check_energy_register
use kessler_cam, only: kessler_register
use tj2016_cam, only: thatcher_jablonowski_register
+ use frierson_cam, only: frierson_register
!---------------------------Local variables-----------------------------
!
@@ -109,6 +112,8 @@ subroutine phys_register
call kessler_register()
else if (tj2016_phys) then
call thatcher_jablonowski_register()
+ else if (frierson_phys) then
+ call frierson_register()
end if
! Fields for physics package diagnostics
@@ -117,6 +122,8 @@ subroutine phys_register
if (moist_physics) then
call pbuf_add_field('CLDLIQINI', 'physpkg', dtype_r8, (/pcols,pver/), cldliqini_idx)
call pbuf_add_field('CLDICEINI', 'physpkg', dtype_r8, (/pcols,pver/), cldiceini_idx)
+ call pbuf_add_field('TOTLIQINI', 'physpkg', dtype_r8, (/pcols,pver/), totliqini_idx)
+ call pbuf_add_field('TOTICEINI', 'physpkg', dtype_r8, (/pcols,pver/), toticeini_idx)
end if
! check energy package
@@ -193,11 +200,16 @@ subroutine phys_init( phys_state, phys_tend, pbuf2d, cam_in, cam_out )
use held_suarez_cam, only: held_suarez_init
use kessler_cam, only: kessler_cam_init
use tj2016_cam, only: thatcher_jablonowski_init
+ use frierson_cam, only: frierson_init
use tracers, only: tracers_init
use wv_saturation, only: wv_sat_init
use phys_debug_util, only: phys_debug_init
use qneg_module, only: qneg_init
+ use nudging, only: Nudge_Model, nudging_init
use cam_snapshot, only: cam_snapshot_init
+ use cam_budget, only: cam_budget_init
+
+ use ccpp_constituent_prop_mod, only: ccpp_const_props_init
! Input/output arguments
type(physics_state), pointer :: phys_state(:)
@@ -238,7 +250,7 @@ subroutine phys_init( phys_state, phys_tend, pbuf2d, cam_in, cam_out )
! wv_saturation is relatively independent of everything else and
! low level, so init it early. Must at least do this before radiation.
- if (kessler_phys .or. tj2016_phys) then
+ if (kessler_phys .or. tj2016_phys .or. frierson_phys) then
call wv_sat_init()
end if
@@ -249,24 +261,37 @@ subroutine phys_init( phys_state, phys_tend, pbuf2d, cam_in, cam_out )
end if
if (ideal_phys) then
- call held_suarez_init(pbuf2d)
+ call held_suarez_init()
else if (kessler_phys) then
- call kessler_cam_init(pbuf2d)
+ call kessler_cam_init()
else if (tj2016_phys) then
call thatcher_jablonowski_init(pbuf2d)
+ else if (frierson_phys) then
+ call frierson_init(phys_state,pbuf2d)
end if
+ ! Initialize Nudging Parameters
+ !--------------------------------
+ if(Nudge_Model) call nudging_init
+
if (chem_is_active()) then
! Prognostic chemistry.
call chem_init(phys_state,pbuf2d)
end if
+ ! Initialize CAM CCPP constituent properties array
+ ! for use in CCPP-ized physics schemes:
+ call ccpp_const_props_init()
+
! Initialize qneg3 and qneg4
call qneg_init()
! Initialize the snapshot capability
call cam_snapshot_init(cam_in, cam_out, pbuf2d, begchunk)
+ ! Initialize energy budgets
+ call cam_budget_init()
+
end subroutine phys_init
!======================================================================================
@@ -468,9 +493,17 @@ subroutine tphysac (ztodt, cam_in, cam_out, state, tend, pbuf)
use constituents, only: cnst_get_ind, pcnst
use cam_diagnostics, only: diag_phys_tend_writeout, diag_surf
use tj2016_cam, only: thatcher_jablonowski_sfc_pbl_hs_tend
+ use frierson_cam, only: frierson_pbl_tend
use dycore, only: dycore_is
- use check_energy, only: calc_te_and_aam_budgets
+ use check_energy, only: tot_energy_phys
use cam_history, only: hist_fld_active
+ use cam_thermo, only: cam_thermo_water_update
+ use cam_budget, only: thermo_budget_history
+ use dyn_tests_utils, only: vc_dycore, vc_height, vc_dry_pressure
+ use air_composition, only: cpairv, cp_or_cv_dycore
+ use time_manager, only: get_nstep
+ use nudging, only: Nudge_Model, Nudge_ON, nudging_timestep_tend
+ use check_energy, only: check_energy_chng
! Arguments
!
@@ -484,6 +517,9 @@ subroutine tphysac (ztodt, cam_in, cam_out, state, tend, pbuf)
!---------------------------Local workspace-----------------------------
+ integer :: nstep ! current timestep number
+ real(r8):: zero(pcols) ! array of zeros
+
type(physics_ptend) :: ptend ! indivdual parameterization tendencies
real(r8) :: tmp_q(pcols, pver)
real(r8) :: tmp_cldliq(pcols, pver)
@@ -492,20 +528,28 @@ subroutine tphysac (ztodt, cam_in, cam_out, state, tend, pbuf)
real(r8), pointer :: qini(:,:)
real(r8), pointer :: cldliqini(:,:)
real(r8), pointer :: cldiceini(:,:)
+ real(r8), pointer :: totliqini(:,:)
+ real(r8), pointer :: toticeini(:,:)
integer :: ixcldliq
integer :: ixcldice
integer :: k
- integer :: ncol
+ integer :: ncol, lchnk
integer :: itim_old
logical :: moist_mixing_ratio_dycore
real(r8) :: tmp_trac (pcols,pver,pcnst) ! tmp space
real(r8) :: tmp_pdel (pcols,pver) ! tmp space
real(r8) :: tmp_ps (pcols) ! tmp space
+ real(r8) :: scaling(pcols,pver)
!--------------------------------------------------------------------------
+ ! get nstep and zero array for energy checker
+ zero = 0._r8
+ nstep = get_nstep()
+
! number of active atmospheric columns
ncol = state%ncol
+ lchnk = state%lchnk
! Associate pointers with physics buffer fields
itim_old = pbuf_old_tim_idx()
@@ -518,11 +562,17 @@ subroutine tphysac (ztodt, cam_in, cam_out, state, tend, pbuf)
if (moist_physics) then
call pbuf_get_field(pbuf, cldliqini_idx, cldliqini)
call pbuf_get_field(pbuf, cldiceini_idx, cldiceini)
+ call pbuf_get_field(pbuf, totliqini_idx, totliqini)
+ call pbuf_get_field(pbuf, toticeini_idx, toticeini)
else
allocate(cldliqini(pcols, pver))
cldliqini = 0.0_r8
allocate(cldiceini(pcols, pver))
cldiceini = 0.0_r8
+ allocate(totliqini(pcols, pver))
+ totliqini = 0.0_r8
+ allocate(toticeini(pcols, pver))
+ toticeini = 0.0_r8
end if
!=========================
@@ -534,17 +584,33 @@ subroutine tphysac (ztodt, cam_in, cam_out, state, tend, pbuf)
call physics_update(state, ptend, ztodt, tend)
end if
- call calc_te_and_aam_budgets(state, 'phAP')
- call calc_te_and_aam_budgets(state, 'dyAP',vc=vc_dycore)
-
+ if (frierson_phys) then
+ ! Update surface, PBL
+ call frierson_pbl_tend(state, ptend, ztodt, cam_in)
+ call physics_update(state, ptend, ztodt, tend)
+ end if
+
+ ! Update Nudging values, if needed
+ !----------------------------------
+ if (Nudge_Model .and. Nudge_ON) then
+ call nudging_timestep_tend(state,ptend)
+ call physics_update(state, ptend, ztodt, tend)
+ call check_energy_chng(state, tend, "nudging", nstep, ztodt, zero, zero, zero, zero)
+ endif
+
+ call tot_energy_phys(state, 'phAP')
+ call tot_energy_phys(state, 'dyAP',vc=vc_dycore)
+
! FV: convert dry-type mixing ratios to moist here because
! physics_dme_adjust assumes moist. This is done in p_d_coupling for
! other dynamics. Bundy, Feb 2004.
!
- moist_mixing_ratio_dycore = dycore_is('LR').or. dycore_is('FV3')
- if (moist_physics .and. moist_mixing_ratio_dycore) then
- call set_dry_to_wet(state) ! Physics had dry, dynamics wants moist
- end if
+ moist_mixing_ratio_dycore = dycore_is('LR').or. dycore_is('FV3')
+ !
+ ! update cp/cv for energy computation based in updated water variables
+ !
+ call cam_thermo_water_update(state%q(:ncol,:,:), lchnk, ncol, vc_dycore,&
+ to_dry_factor=state%pdel(:ncol,:)/state%pdeldry(:ncol,:))
if (moist_physics) then
! Scale dry mass and energy (does nothing if dycore is EUL or SLD)
@@ -561,44 +627,59 @@ subroutine tphysac (ztodt, cam_in, cam_out, state, tend, pbuf)
else
tmp_cldice(:ncol,:pver) = 0.0_r8
end if
-
- ! for dry mixing ratio dycore, physics_dme_adjust is called for energy diagnostic purposes only.
+ !
+ ! for dry mixing ratio dycore, physics_dme_adjust is called for energy diagnostic purposes only.
! So, save off tracers
- if (.not.moist_mixing_ratio_dycore.and.&
- (hist_fld_active('SE_phAM').or.hist_fld_active('KE_phAM').or.hist_fld_active('WV_phAM').or.&
- hist_fld_active('WL_phAM').or.hist_fld_active('WI_phAM').or.hist_fld_active('MR_phAM').or.&
- hist_fld_active('MO_phAM'))) then
- tmp_trac(:ncol,:pver,:pcnst) = state%q(:ncol,:pver,:pcnst)
- tmp_pdel(:ncol,:pver) = state%pdel(:ncol,:pver)
- tmp_ps(:ncol) = state%ps(:ncol)
+ if (.not.moist_mixing_ratio_dycore) then
+ !
+ ! for dry-mixing ratio based dycores dme_adjust takes place in the dynamical core
!
- ! pint, lnpint,rpdel are altered by dme_adjust but not used for tendencies in dynamics of SE
- ! we do not reset them to pre-dme_adjust values
+ ! only compute dme_adjust for diagnostics purposes
+ !
+ if (thermo_budget_history) then
+ tmp_trac(:ncol,:pver,:pcnst) = state%q(:ncol,:pver,:pcnst)
+ tmp_pdel(:ncol,:pver) = state%pdel(:ncol,:pver)
+ tmp_ps(:ncol) = state%ps(:ncol)
+ call physics_dme_adjust(state, tend, qini, totliqini, toticeini, ztodt)
+ call tot_energy_phys(state, 'phAM')
+ call tot_energy_phys(state, 'dyAM', vc=vc_dycore)
+ ! Restore pre-"physics_dme_adjust" tracers
+ state%q(:ncol,:pver,:pcnst) = tmp_trac(:ncol,:pver,:pcnst)
+ state%pdel(:ncol,:pver) = tmp_pdel(:ncol,:pver)
+ state%ps(:ncol) = tmp_ps(:ncol)
+ end if
+ else
+ !
+ ! for moist-mixing ratio based dycores
+ !
+ ! Note: this operation will NOT be reverted with set_wet_to_dry after set_dry_to_wet call
!
call set_dry_to_wet(state)
-
- call physics_dme_adjust(state, tend, qini, ztodt)
-
- call calc_te_and_aam_budgets(state, 'phAM')
- call calc_te_and_aam_budgets(state, 'dyAM',vc=vc_dycore)
- ! Restore pre-"physics_dme_adjust" tracers
- state%q(:ncol,:pver,:pcnst) = tmp_trac(:ncol,:pver,:pcnst)
- state%pdel(:ncol,:pver) = tmp_pdel(:ncol,:pver)
- state%ps(:ncol) = tmp_ps(:ncol)
- end if
-
- if (moist_mixing_ratio_dycore) then
- call physics_dme_adjust(state, tend, qini, ztodt)
- call calc_te_and_aam_budgets(state, 'phAM')
- call calc_te_and_aam_budgets(state, 'dyAM',vc=vc_dycore)
+ call physics_dme_adjust(state, tend, qini, totliqini, toticeini, ztodt)
+ call tot_energy_phys(state, 'phAM')
+ call tot_energy_phys(state, 'dyAM', vc=vc_dycore)
+ endif
+ if (vc_dycore == vc_height.or.vc_dycore == vc_dry_pressure) then
+ !
+ ! MPAS and SE specific scaling of temperature for enforcing energy consistency
+ ! (and to make sure that temperature dependent diagnostic tendencies
+ ! are computed correctly; e.g. dtcore)
+ !
+ scaling(1:ncol,:) = cpairv(:ncol,:,lchnk)/cp_or_cv_dycore(:ncol,:,lchnk)
+ state%T(1:ncol,:) = state%temp_ini(1:ncol,:)+&
+ scaling(1:ncol,:)*(state%T(1:ncol,:)-state%temp_ini(1:ncol,:))
+ tend%dtdt(:ncol,:) = scaling(:ncol,:)*tend%dtdt(:ncol,:)
+ !
+ ! else: do nothing for dycores with energy consistent with CAM physics
+ !
end if
else
tmp_q (:ncol,:pver) = 0.0_r8
tmp_cldliq(:ncol,:pver) = 0.0_r8
tmp_cldice(:ncol,:pver) = 0.0_r8
- call calc_te_and_aam_budgets(state, 'phAM')
- call calc_te_and_aam_budgets(state, 'dyAM',vc=vc_dycore)
+ call tot_energy_phys(state, 'phAM')
+ call tot_energy_phys(state, 'dyAM',vc=vc_dycore)
end if
! store T in buffer for use in computing dynamics T-tendency in next timestep
@@ -609,13 +690,15 @@ subroutine tphysac (ztodt, cam_in, cam_out, state, tend, pbuf)
end do
call diag_phys_tend_writeout (state, pbuf, tend, ztodt, &
- tmp_q, tmp_cldliq, tmp_cldice, qini, cldliqini, cldiceini)
+ qini, cldliqini, cldiceini)
call diag_surf(cam_in, cam_out, state, pbuf)
if (.not. moist_physics) then
deallocate(cldliqini)
deallocate(cldiceini)
+ deallocate(totliqini)
+ deallocate(toticeini)
end if
end subroutine tphysac
@@ -647,15 +730,19 @@ subroutine tphysbc (ztodt, state, tend, pbuf, cam_out, cam_in )
use time_manager, only: get_nstep
use check_energy, only: check_energy_chng, check_energy_fix, check_energy_timestep_init
use check_energy, only: check_tracers_data, check_tracers_init, check_tracers_chng
- use check_energy, only: calc_te_and_aam_budgets
+ use check_energy, only: tot_energy_phys
use chemistry, only: chem_is_active, chem_timestep_tend
use held_suarez_cam, only: held_suarez_tend
use kessler_cam, only: kessler_tend
use tj2016_cam, only: thatcher_jablonowski_precip_tend
+ use frierson_cam, only: frierson_condensate_tend
+ use frierson_cam, only: frierson_radiative_tend
use dycore, only: dycore_is
use cam_snapshot_common,only: cam_snapshot_all_outfld
use cam_snapshot_common,only: cam_snapshot_ptend_outfld
use physics_types, only: dyn_te_idx
+ use air_composition, only: thermodynamic_active_species_liq_num,thermodynamic_active_species_liq_idx
+ use air_composition, only: thermodynamic_active_species_ice_num,thermodynamic_active_species_ice_idx
! Arguments
real(r8), intent(in) :: ztodt ! model time increment
@@ -676,12 +763,15 @@ subroutine tphysbc (ztodt, state, tend, pbuf, cam_out, cam_in )
integer :: itim_old
integer :: ixcldliq
integer :: ixcldice
+ integer :: m, m_cnst
! physics buffer fields for total energy and mass adjustment
real(r8), pointer :: teout(:)
real(r8), pointer :: qini(:,:)
real(r8), pointer :: cldliqini(:,:)
real(r8), pointer :: cldiceini(:,:)
+ real(r8), pointer :: totliqini(:,:)
+ real(r8), pointer :: toticeini(:,:)
real(r8), pointer :: dtcore(:,:)
real(r8) :: zero(pcols) ! array of zeros
@@ -709,6 +799,8 @@ subroutine tphysbc (ztodt, state, tend, pbuf, cam_out, cam_in )
if (moist_physics) then
call pbuf_get_field(pbuf, cldliqini_idx, cldliqini)
call pbuf_get_field(pbuf, cldiceini_idx, cldiceini)
+ call pbuf_get_field(pbuf, totliqini_idx, totliqini)
+ call pbuf_get_field(pbuf, toticeini_idx, toticeini)
end if
! Set accumulated physics tendencies to 0
@@ -733,8 +825,8 @@ subroutine tphysbc (ztodt, state, tend, pbuf, cam_out, cam_in )
!===================================================
! Global mean total energy fixer and AAM diagnostics
!===================================================
- call calc_te_and_aam_budgets(state, 'phBF')
- call calc_te_and_aam_budgets(state, 'dyBF',vc=vc_dycore)
+ call tot_energy_phys(state, 'phBF')
+ call tot_energy_phys(state, 'dyBF',vc=vc_dycore)
call t_startf('energy_fixer')
@@ -747,8 +839,8 @@ subroutine tphysbc (ztodt, state, tend, pbuf, cam_out, cam_in )
call t_stopf('energy_fixer')
- call calc_te_and_aam_budgets(state, 'phBP')
- call calc_te_and_aam_budgets(state, 'dyBP',vc=vc_dycore)
+ call tot_energy_phys(state, 'phBP')
+ call tot_energy_phys(state, 'dyBP',vc=vc_dycore)
! Save state for convective tendency calculations.
call diag_conv_tend_ini(state, pbuf)
@@ -764,8 +856,17 @@ subroutine tphysbc (ztodt, state, tend, pbuf, cam_out, cam_in )
if (ixcldice > 0) then
cldiceini(:ncol,:pver) = state%q(:ncol,:pver,ixcldice)
end if
+ totliqini(:ncol,:pver) = 0.0_r8
+ do m_cnst=1,thermodynamic_active_species_liq_num
+ m = thermodynamic_active_species_liq_idx(m_cnst)
+ totliqini(:ncol,:pver) = totliqini(:ncol,:pver)+state%q(:ncol,:pver,m)
+ end do
+ toticeini(:ncol,:pver) = 0.0_r8
+ do m_cnst=1,thermodynamic_active_species_ice_num
+ m = thermodynamic_active_species_ice_idx(m_cnst)
+ toticeini(:ncol,:pver) = toticeini(:ncol,:pver)+state%q(:ncol,:pver,m)
+ end do
end if
-
call outfld('TEOUT', teout , pcols, lchnk )
call outfld('TEINP', state%te_ini(:,dyn_te_idx), pcols, lchnk )
call outfld('TEFIX', state%te_cur(:,dyn_te_idx), pcols, lchnk )
@@ -830,6 +931,37 @@ subroutine tphysbc (ztodt, state, tend, pbuf, cam_out, cam_in )
if (trim(cam_take_snapshot_after) == "thatcher_jablonowski_precip_tend") then
call cam_snapshot_all_outfld(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf)
end if
+ else if (frierson_phys) then
+ ! Compute the large-scale precipitation
+ !----------------------------------------
+ if (trim(cam_take_snapshot_before) == "frierson_condensate_tend") then
+ call cam_snapshot_all_outfld(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf)
+ end if
+ call frierson_condensate_tend(state, ptend, ztodt, pbuf)
+ if ( (trim(cam_take_snapshot_after) == "frierson_condensate_tend") .and. &
+ (trim(cam_take_snapshot_before) == trim(cam_take_snapshot_after))) then
+ call cam_snapshot_ptend_outfld(ptend, lchnk)
+ end if
+ call physics_update(state, ptend, ztodt, tend)
+ if (trim(cam_take_snapshot_after) == "frierson_condensate_tend") then
+ call cam_snapshot_all_outfld(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf)
+ end if
+
+ ! Compute the radiative tendencies
+ !-----------------------------------
+ if (trim(cam_take_snapshot_before) == "frierson_radiative_tend") then
+ call cam_snapshot_all_outfld(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf)
+ end if
+ call frierson_radiative_tend(state, ptend, ztodt, cam_in, cam_out)
+ if ( (trim(cam_take_snapshot_after) == "frierson_radiative_tend") .and. &
+ (trim(cam_take_snapshot_before) == trim(cam_take_snapshot_after))) then
+ call cam_snapshot_ptend_outfld(ptend, lchnk)
+ end if
+ call physics_update(state, ptend, ztodt, tend)
+ if (trim(cam_take_snapshot_after) == "frierson_radiative_tend") then
+ call cam_snapshot_all_outfld(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf)
+ end if
+
end if
! Can't turn on conservation error messages unless the appropriate heat
@@ -889,6 +1021,7 @@ subroutine phys_timestep_init(phys_state, cam_in, cam_out, pbuf2d)
!--------------------------------------------------------------------------
use physics_types, only: physics_state
use physics_buffer, only: physics_buffer_desc
+ use nudging, only: Nudge_Model, nudging_timestep_init
implicit none
@@ -900,6 +1033,10 @@ subroutine phys_timestep_init(phys_state, cam_in, cam_out, pbuf2d)
!--------------------------------------------------------------------------
+ ! Update Nudging values, if needed
+ !----------------------------------
+ if(Nudge_Model) call nudging_timestep_init(phys_state)
+
end subroutine phys_timestep_init
!======================================================================================
diff --git a/src/physics/simple/radconstants.F90 b/src/physics/simple/radconstants.F90
index 0649a6f730..b69fac1552 100644
--- a/src/physics/simple/radconstants.F90
+++ b/src/physics/simple/radconstants.F90
@@ -19,6 +19,7 @@ module radconstants
integer, parameter, public :: ot_length = 32
public :: rad_gas_index
+public :: get_lw_spectral_boundaries
integer, public, parameter :: gasnamelength = 1
integer, public, parameter :: nradgas = 1
@@ -37,4 +38,15 @@ integer function rad_gas_index(gasname)
end function rad_gas_index
+!------------------------------------------------------------------------------
+subroutine get_lw_spectral_boundaries(low_boundaries, high_boundaries, units)
+ ! stub should not be called
+
+ real(r8), intent(out) :: low_boundaries(nlwbands), high_boundaries(nlwbands)
+ character(*), intent(in) :: units ! requested units
+
+ call endrun('get_lw_spectral_boundaries: ERROR: this is a stub')
+
+end subroutine get_lw_spectral_boundaries
+
end module radconstants
diff --git a/src/physics/simple/restart_physics.F90 b/src/physics/simple/restart_physics.F90
index ef8f8795ef..fb40c5921b 100644
--- a/src/physics/simple/restart_physics.F90
+++ b/src/physics/simple/restart_physics.F90
@@ -13,6 +13,9 @@ module restart_physics
pio_inq_varid, pio_def_var, pio_def_dim, &
pio_put_var, pio_get_var
+ use cam_control_mod, only: frierson_phys
+ use frierson_cam,only: frierson_restart_init, frierson_restart_write, frierson_restart_read
+
implicit none
private
save
@@ -59,6 +62,10 @@ subroutine init_restart_physics ( File, pbuf2d)
call pbuf_init_restart(File, pbuf2d)
+ if (frierson_phys) then
+ call frierson_restart_init(File,hdimids,hdimcnt)
+ end if
+
end subroutine init_restart_physics
subroutine write_restart_physics (File, cam_in, cam_out, pbuf2d)
@@ -85,6 +92,10 @@ subroutine write_restart_physics (File, cam_in, cam_out, pbuf2d)
! Physics buffer
call pbuf_write_restart(File, pbuf2d)
+ if (frierson_phys) then
+ call frierson_restart_write(File)
+ end if
+
end subroutine write_restart_physics
!#######################################################################
@@ -110,6 +121,9 @@ subroutine read_restart_physics(File, cam_in, cam_out, pbuf2d)
call pbuf_read_restart(File, pbuf2d)
+ if (frierson_phys) then
+ call frierson_restart_read(File)
+ end if
end subroutine read_restart_physics
end module restart_physics
diff --git a/src/physics/spcam/crmclouds_camaerosols.F90 b/src/physics/spcam/crmclouds_camaerosols.F90
index 08f4e3f246..3d8f2e315f 100644
--- a/src/physics/spcam/crmclouds_camaerosols.F90
+++ b/src/physics/spcam/crmclouds_camaerosols.F90
@@ -388,6 +388,9 @@ subroutine crmclouds_mixnuc_tend( aero_props, aero_state, state, ptend, dtime, c
type(physics_ptend), intent(out) :: ptend ! package tendencies
! Local variables
+
+ real(r8), parameter :: wsub_min_asf = 0.1D0
+
integer i,k,m, k1, k2
integer ifld, itim
integer ixcldliq, ixcldice, ixnumliq
@@ -580,7 +583,8 @@ subroutine crmclouds_mixnuc_tend( aero_props, aero_state, state, ptend, dtime, c
! should we set omega to be zero ??
omega(:ncol, :) = state%omega(:ncol, :)
- call dropmixnuc(aero_props, aero_state, state, ptend, dtime, pbuf, wsub, lcldn, lcldo, cldliqf, tendnd, factnum, dommf )
+ call dropmixnuc(aero_props, aero_state, state, ptend, dtime, pbuf, wsub, wsub_min_asf, lcldn, lcldo, cldliqf, tendnd, factnum, &
+ dommf )
! this part is moved into tphysbc after aerosol stuffs.
!
@@ -595,7 +599,7 @@ subroutine crmclouds_convect_tend(state, ptend, ztodt, pbuf)
!-----------------------------------------------------------------
!
! Purpose: to do convective transport of tracer species using the cloud fields from CRM and using the
-! subroutine of convtran.
+! subroutine of zm_conv_convtran_run.
!
! Minghuai Wang, July, 2009: adopted from zm_conv_tend_2
!
@@ -604,7 +608,7 @@ subroutine crmclouds_convect_tend(state, ptend, ztodt, pbuf)
use time_manager, only: get_nstep
use physics_buffer, only: physics_buffer_desc, pbuf_old_tim_idx, pbuf_get_index, pbuf_get_field
use constituents, only: pcnst, cnst_get_ind
- use zm_conv, only: convtran
+ use zm_conv_convtran,only: zm_conv_convtran_run
use error_messages, only: alloc_err
! Arguments
@@ -658,7 +662,7 @@ subroutine crmclouds_convect_tend(state, ptend, ztodt, pbuf)
lq(ixcldice) = .false.
lq(ixcldliq) = .false.
- call physics_ptend_init(ptend,state%psetcols,'convtran2',lq=lq)
+ call physics_ptend_init(ptend,state%psetcols,'zm_conv_convtran_run2',lq=lq)
!
! Associate pointers with physics buffer fields
@@ -715,7 +719,7 @@ subroutine crmclouds_convect_tend(state, ptend, ztodt, pbuf)
end do
!
-! initialize dpdry for call to convtran
+! initialize dpdry for call to zm_conv_convtran_run
! it is used for tracers of dry smixing ratio type
!
dpdry = 0._r8
@@ -724,15 +728,18 @@ subroutine crmclouds_convect_tend(state, ptend, ztodt, pbuf)
dp(i,:) = state%pdel(ideep(i),:)/100._r8
end do
-! dsubdld is not used in convtran, and is set to be zero.
+! dsubdld is not used in zm_conv_convtran_run, and is set to be zero.
dsubcld = 0._r8
- call convtran (lchnk, &
- ptend%lq,state%q, pcnst, mu(:,:), md(:,:), &
- du(:,:), eu(:,:), ed(:,:), dp(:,:), dsubcld(:), &
- jt(:),maxg(:),ideep(:), 1, lengath, &
- nstep, fracis, ptend%q, dpdry, ztodt )
+ !REMOVECAM - no longer need these when CAM is retired and pcols no longer exists
+ ptend%q(:,:,:) = 0._r8
+ !REMOVECAM_END
+ call zm_conv_convtran_run (ncol,pver, &
+ ptend%lq,state%q(:ncol,:,:), pcnst, mu(:ncol,:), md(:ncol,:), &
+ du(:ncol,:), eu(:ncol,:), ed(:ncol,:), dp(:ncol,:), dsubcld(:ncol), &
+ jt(:ncol),maxg(:ncol),ideep(:ncol), 1, lengath, &
+ nstep, fracis(:ncol,:,:), ptend%q(:ncol,:,:), dpdry(:ncol,:), ztodt )
end subroutine crmclouds_convect_tend
!=====================================================================================================
diff --git a/src/physics/spcam/spcam_drivers.F90 b/src/physics/spcam/spcam_drivers.F90
index 2c850286df..ebe6507607 100644
--- a/src/physics/spcam/spcam_drivers.F90
+++ b/src/physics/spcam/spcam_drivers.F90
@@ -2053,7 +2053,7 @@ subroutine spcam_radiation_finalize_sam1mom(cam_in, state, pbuf, rad_avgdata, ca
call outfld('FSN200 ',rad_avgdata%fsn200_m(:),pcols,lchnk)
call outfld('FSN200C ',rad_avgdata%fsn200c_m(:),pcols,lchnk)
call outfld('FSNR' ,rad_avgdata%fsnr_m(:) ,pcols,lchnk)
- call outfld('SWCF ',rad_avgdata%fsntoa_m(:ncol)-rad_avgdata%fsntoac_m(:ncol) ,pcols,lchnk)
+ call outfld('SWCF ',rad_avgdata%fsntoa_m(:ncol)-rad_avgdata%fsntoac_m(:ncol) ,ncol,lchnk)
do i=1, Nday
do k=1, pver
diff --git a/src/physics/waccm/mo_aurora.F90 b/src/physics/waccm/mo_aurora.F90
index e6fe8cd5c0..f6e5039570 100644
--- a/src/physics/waccm/mo_aurora.F90
+++ b/src/physics/waccm/mo_aurora.F90
@@ -476,8 +476,8 @@ subroutine aurora_prod( tn, o2, o1, mbar, rlats, &
!-----------------------------------------------------------------------
! ... output mag lons, lats
!-----------------------------------------------------------------------
- call outfld( 'ALONM', r2d*alonm(:ncol,lchnk), pcols, lchnk )
- call outfld( 'ALATM', r2d*alatm(:ncol,lchnk), pcols, lchnk )
+ call outfld( 'ALONM', r2d*alonm(:ncol,lchnk), ncol, lchnk )
+ call outfld( 'ALATM', r2d*alatm(:ncol,lchnk), ncol, lchnk )
if (indxQTe>0) then
call pbuf_get_field(pbuf, indxQTe, qteaur)
diff --git a/src/utils/air_composition.F90 b/src/utils/air_composition.F90
index 367f52811a..6046ffebf1 100644
--- a/src/utils/air_composition.F90
+++ b/src/utils/air_composition.F90
@@ -1,4 +1,5 @@
-! air_composition module defines major species of the atmosphere and manages the physical properties that are dependent on the composition of air
+! air_composition module defines major species of the atmosphere and manages
+! the physical properties that are dependent on the composition of air
module air_composition
use shr_kind_mod, only: r8 => shr_kind_r8
@@ -10,7 +11,9 @@ module air_composition
public :: air_composition_readnl
public :: air_composition_init
- public :: air_composition_update
+ public :: dry_air_composition_update
+ public :: water_composition_update
+
! get_cp_dry: (generalized) heat capacity for dry air
public :: get_cp_dry
! get_cp: (generalized) heat capacity
@@ -102,7 +105,9 @@ module air_composition
real(r8), public, protected, allocatable :: cappav(:,:,:)
! mbarv: composition dependent atmosphere mean mass
real(r8), public, protected, allocatable :: mbarv(:,:,:)
-
+ ! cp_or_cv_dycore: enthalpy or internal energy scaling factor for
+ ! energy consistency
+ real(r8), public, protected, allocatable :: cp_or_cv_dycore(:,:,:)
!
! Interfaces for public routines
interface get_cp_dry
@@ -230,7 +235,6 @@ subroutine air_composition_init()
use physconst, only: r_universal, cpair, rair, cpwv, rh2o, cpliq, cpice, mwdry
use constituents, only: cnst_get_ind, cnst_mw
use ppgrid, only: pcols, pver, begchunk, endchunk
-
integer :: icnst, ix, isize, ierr, idx
integer :: liq_num, ice_num
integer :: liq_idx(water_species_in_air_num)
@@ -330,6 +334,10 @@ subroutine air_composition_init()
if (ierr /= 0) then
call endrun(errstr//"mbarv")
end if
+ allocate(cp_or_cv_dycore(pcols,pver,begchunk:endchunk), stat=ierr)
+ if (ierr /= 0) then
+ call endrun(errstr//"cp_or_cv_dycore")
+ end if
thermodynamic_active_species_idx = -HUGE(1)
thermodynamic_active_species_idx_dycore = -HUGE(1)
@@ -620,27 +628,63 @@ end subroutine air_composition_init
!===========================================================================
!-----------------------------------------------------------------------
- ! air_composition_update: Update the physics "constants" that vary
+ ! dry_air_composition_update: Update the physics "constants" that vary
!-------------------------------------------------------------------------
!===========================================================================
- subroutine air_composition_update(mmr, lchnk, ncol, to_moist_factor)
-
- real(r8), intent(in) :: mmr(:,:,:) ! constituents array
+ subroutine dry_air_composition_update(mmr, lchnk, ncol, to_dry_factor)
+ use cam_abortutils, only: endrun
+ !(mmr = dry mixing ratio, if not, use to_dry_factor to convert!)
+ real(r8), intent(in) :: mmr(:,:,:) ! mixing ratios for species dependent dry air
integer, intent(in) :: lchnk ! Chunk number
integer, intent(in) :: ncol ! number of columns
- real(r8), optional, intent(in) :: to_moist_factor(:,:)
+ real(r8), optional, intent(in) :: to_dry_factor(:,:)
call get_R_dry(mmr(:ncol, :, :), thermodynamic_active_species_idx, &
- rairv(:ncol, :, lchnk), fact=to_moist_factor)
- call get_cp_dry(mmr(:ncol,:,:), thermodynamic_active_species_idx, &
- cpairv(:ncol,:,lchnk), fact=to_moist_factor)
- call get_mbarv(mmr(:ncol,:,:), thermodynamic_active_species_idx, &
- mbarv(:ncol,:,lchnk), fact=to_moist_factor)
-
+ rairv(:ncol, :, lchnk), fact=to_dry_factor)
+ call get_cp_dry(mmr(:ncol,:,:), thermodynamic_active_species_idx, &
+ cpairv(:ncol,:,lchnk), fact=to_dry_factor)
+ call get_mbarv(mmr(:ncol,:,:), thermodynamic_active_species_idx, &
+ mbarv(:ncol,:,lchnk), fact=to_dry_factor)
cappav(:ncol,:,lchnk) = rairv(:ncol,:,lchnk) / cpairv(:ncol,:,lchnk)
+ end subroutine dry_air_composition_update
- end subroutine air_composition_update
+ !===========================================================================
+ !---------------------------------------------------------------------------
+ ! water_composition_update: Update generalized cp or cv depending on dycore
+ !---------------------------------------------------------------------------
+ !===========================================================================
+
+ subroutine water_composition_update(mmr, lchnk, ncol, vcoord, to_dry_factor)
+ use cam_abortutils, only: endrun
+ use string_utils, only: int2str
+ use dyn_tests_utils, only: vc_height, vc_moist_pressure, vc_dry_pressure
+ real(r8), intent(in) :: mmr(:,:,:) ! constituents array
+ integer, intent(in) :: lchnk ! Chunk number
+ integer, intent(in) :: ncol ! number of columns
+ integer, intent(in) :: vcoord
+ real(r8), optional, intent(in) :: to_dry_factor(:,:)
+
+ character(len=*), parameter :: subname = 'water_composition_update'
+
+ if (vcoord==vc_dry_pressure) then
+ call get_cp(mmr(:ncol,:,:),.false.,cp_or_cv_dycore(:ncol,:,lchnk), factor=to_dry_factor, &
+ active_species_idx_dycore=thermodynamic_active_species_idx,cpdry=cpairv(:ncol,:,lchnk))
+ else if (vcoord==vc_height) then
+ call get_R(mmr(:ncol,:,:), thermodynamic_active_species_idx, &
+ cp_or_cv_dycore(:ncol,:,lchnk), fact=to_dry_factor, Rdry=rairv(:ncol,:,lchnk))
+ !
+ ! internal energy coefficient for MPAS
+ ! (equation 92 in Eldred et al. 2023; https://rmets.onlinelibrary.wiley.com/doi/epdf/10.1002/qj.4353)
+ !
+ cp_or_cv_dycore(:ncol,:,lchnk)=cp_or_cv_dycore(:ncol,:,lchnk)*&
+ (cpairv(:ncol,:,lchnk)-rairv(:ncol,:,lchnk)) /rairv(:ncol,:,lchnk)
+ else if (vcoord==vc_moist_pressure) then
+ ! no update needed for moist pressure vcoord
+ else
+ call endrun(subname//" vertical coordinate not supported; vcoord="// int2str(vcoord))
+ end if
+ end subroutine water_composition_update
!===========================================================================
!***************************************************************************
@@ -750,29 +794,35 @@ end subroutine get_cp_dry_2hd
!
!***************************************************************************
!
- subroutine get_cp_1hd(tracer, inv_cp, cp, dp_dry, active_species_idx_dycore)
+ subroutine get_cp_1hd(tracer, inv_cp, cp, factor, active_species_idx_dycore, cpdry)
use cam_abortutils, only: endrun
use string_utils, only: int2str
! Dummy arguments
- ! tracedr: Tracer array
+ ! tracer: Tracer array
+ !
+ ! factor not present then tracer must be dry mixing ratio
+ ! if factor present tracer*factor must be dry mixing ratio
+ !
real(r8), intent(in) :: tracer(:,:,:)
- real(r8), optional, intent(in) :: dp_dry(:,:)
! inv_cp: output inverse cp instead of cp
logical, intent(in) :: inv_cp
real(r8), intent(out) :: cp(:,:)
+ ! dp: if provided then tracer is mass not mixing ratio
+ real(r8), optional, intent(in) :: factor(:,:)
! active_species_idx_dycore: array of indices for index of
! thermodynamic active species in dycore tracer array
! (if different from physics index)
integer, optional, intent(in) :: active_species_idx_dycore(:)
+ real(r8),optional, intent(in) :: cpdry(:,:)
- ! Local variables
+ ! LOCAL VARIABLES
integer :: qdx, itrac
real(r8) :: sum_species(SIZE(cp, 1), SIZE(cp, 2))
real(r8) :: sum_cp(SIZE(cp, 1), SIZE(cp, 2))
- real(r8) :: factor(SIZE(cp, 1), SIZE(cp, 2))
+ real(r8) :: factor_local(SIZE(cp, 1), SIZE(cp, 2))
integer :: idx_local(thermodynamic_active_species_num)
- character(len=*), parameter :: subname = 'get_cp_1hd: '
+ character(LEN=*), parameter :: subname = 'get_cp_1hd: '
if (present(active_species_idx_dycore)) then
if (SIZE(active_species_idx_dycore) /= &
@@ -786,51 +836,57 @@ subroutine get_cp_1hd(tracer, inv_cp, cp, dp_dry, active_species_idx_dycore)
idx_local = thermodynamic_active_species_idx
end if
- if (present(dp_dry)) then
- factor = 1.0_r8 / dp_dry
+ if (present(factor)) then
+ factor_local = factor
else
- factor = 1.0_r8
+ factor_local = 1.0_r8
end if
+
sum_species = 1.0_r8 ! all dry air species sum to 1
do qdx = dry_air_species_num + 1, thermodynamic_active_species_num
- itrac = idx_local(qdx)
- sum_species(:,:) = sum_species(:,:) + &
- (tracer(:,:,itrac) * factor(:,:))
+ itrac = idx_local(qdx)
+ sum_species(:,:) = sum_species(:,:) + (tracer(:,:,itrac) * factor_local(:,:))
end do
if (dry_air_species_num == 0) then
sum_cp = thermodynamic_active_species_cp(0)
+ else if (present(cpdry)) then
+ !
+ ! if cpdry is known don't recompute
+ !
+ sum_cp = cpdry
else
- call get_cp_dry(tracer, idx_local, sum_cp, fact=factor)
+ call get_cp_dry(tracer, idx_local, sum_cp, fact=factor_local)
end if
do qdx = dry_air_species_num + 1, thermodynamic_active_species_num
- itrac = idx_local(qdx)
- sum_cp(:,:) = sum_cp(:,:) + &
- (thermodynamic_active_species_cp(qdx) * tracer(:,:,itrac) * &
- factor(:,:))
+ itrac = idx_local(qdx)
+ sum_cp(:,:) = sum_cp(:,:)+ &
+ thermodynamic_active_species_cp(qdx) * tracer(:,:,itrac)* factor_local(:,:)
end do
if (inv_cp) then
- cp = sum_species / sum_cp
+ cp = sum_species / sum_cp
else
- cp = sum_cp / sum_species
+ cp = sum_cp / sum_species
end if
-
- end subroutine get_cp_1hd
+ end subroutine get_cp_1hd
!===========================================================================
- subroutine get_cp_2hd(tracer, inv_cp, cp, dp_dry, active_species_idx_dycore)
+ subroutine get_cp_2hd(tracer, inv_cp, cp, factor, active_species_idx_dycore, cpdry)
! Version of get_cp for arrays that have a second horizontal index
use cam_abortutils, only: endrun
use string_utils, only: int2str
! Dummy arguments
! tracer: Tracer array
+ !
real(r8), intent(in) :: tracer(:,:,:,:)
- real(r8), optional, intent(in) :: dp_dry(:,:,:)
! inv_cp: output inverse cp instead of cp
logical, intent(in) :: inv_cp
real(r8), intent(out) :: cp(:,:,:)
+ real(r8), optional, intent(in) :: factor(:,:,:)
+ real(r8), optional, intent(in) :: cpdry(:,:,:)
+
! active_species_idx_dycore: array of indicies for index of
! thermodynamic active species in dycore tracer array
! (if different from physics index)
@@ -842,11 +898,17 @@ subroutine get_cp_2hd(tracer, inv_cp, cp, dp_dry, active_species_idx_dycore)
character(len=*), parameter :: subname = 'get_cp_2hd: '
do jdx = 1, SIZE(cp, 2)
- if (present(dp_dry)) then
- call get_cp(tracer(:, jdx, :, :), inv_cp, cp(:, jdx, :), &
- dp_dry=dp_dry(:, jdx, :), active_species_idx_dycore=active_species_idx_dycore)
+ if (present(factor).and.present(cpdry)) then
+ call get_cp(tracer(:, jdx, :, :), inv_cp, cp(:, jdx, :),&
+ factor=factor(:, jdx, :), active_species_idx_dycore=active_species_idx_dycore, cpdry=cpdry(:,jdx,:))
+ else if (present(factor)) then
+ call get_cp(tracer(:, jdx, :, :), inv_cp, cp(:, jdx, :),&
+ factor=factor(:, jdx, :), active_species_idx_dycore=active_species_idx_dycore)
+ else if (present(cpdry)) then
+ call get_cp(tracer(:, jdx, :, :), inv_cp, cp(:, jdx, :),&
+ active_species_idx_dycore=active_species_idx_dycore, cpdry=cpdry(:,jdx,:))
else
- call get_cp(tracer(:, jdx, :, :), inv_cp, cp(:, jdx, :), &
+ call get_cp(tracer(:, jdx, :, :), inv_cp, cp(:, jdx, :),&
active_species_idx_dycore=active_species_idx_dycore)
end if
end do
@@ -955,9 +1017,10 @@ end subroutine get_R_dry_2hd
!
!***************************************************************************
!
- subroutine get_R_1hd(tracer, active_species_idx, R, fact)
+ subroutine get_R_1hd(tracer, active_species_idx, R, fact, Rdry)
use cam_abortutils, only: endrun
use string_utils, only: int2str
+ use physconst, only: rair
! Dummy arguments
! tracer: !tracer array
@@ -968,6 +1031,7 @@ subroutine get_R_1hd(tracer, active_species_idx, R, fact)
real(r8), intent(out) :: R(:, :)
! fact: optional factor for converting tracer to dry mixing ratio
real(r8), optional, intent(in) :: fact(:, :)
+ real(r8), optional, intent(in) :: Rdry(:, :)
! Local variables
integer :: qdx, itrac
@@ -986,12 +1050,19 @@ subroutine get_R_1hd(tracer, active_species_idx, R, fact)
call endrun(subname//"SIZE mismatch in dimension 2 "// &
int2str(SIZE(fact, 2))//' /= '//int2str(SIZE(factor, 2)))
end if
- call get_R_dry(tracer, active_species_idx, R, fact=fact)
factor = fact(:,:)
else
- call get_R_dry(tracer, active_species_idx, R)
factor = 1.0_r8
end if
+
+ if (dry_air_species_num == 0) then
+ R = rair
+ else if (present(Rdry)) then
+ R = Rdry
+ else
+ call get_R_dry(tracer, active_species_idx, R, fact=factor)
+ end if
+
idx_local = active_species_idx
sum_species = 1.0_r8 ! all dry air species sum to 1
do qdx = dry_air_species_num + 1, thermodynamic_active_species_num
@@ -1046,7 +1117,7 @@ end subroutine get_R_2hd
!*************************************************************************************************************************
!
subroutine get_mbarv_1hd(tracer, active_species_idx, mbarv_in, fact)
- use physconst, only: mwdry, rair, cpair
+ use physconst, only: mwdry
real(r8), intent(in) :: tracer(:,:,:) !tracer array
integer, intent(in) :: active_species_idx(:) !index of active species in tracer
real(r8), intent(out) :: mbarv_in(:,:) !molecular weight of dry air
diff --git a/src/utils/cam_ccpp/ccpp_constituent_prop_mod.F90 b/src/utils/cam_ccpp/ccpp_constituent_prop_mod.F90
new file mode 100644
index 0000000000..edbc4d59e9
--- /dev/null
+++ b/src/utils/cam_ccpp/ccpp_constituent_prop_mod.F90
@@ -0,0 +1,190 @@
+! This module is the CAM version of the CCPP generated module of the same name
+module ccpp_constituent_prop_mod
+
+ implicit none
+ private
+
+ ! Define CAM version of constituent properties mod
+ type, public :: ccpp_constituent_prop_ptr_t
+ logical, private :: thermo_active = .false.
+ logical, private :: water_species = .false.
+ contains
+ procedure :: standard_name => ccp_get_standard_name
+ procedure :: is_thermo_active => ccp_is_thermo_active
+ procedure :: is_water_species => ccp_is_water_species
+ procedure :: set_thermo_active => ccp_set_thermo_active
+ procedure :: set_water_species => ccp_set_water_species
+ end type ccpp_constituent_prop_ptr_t
+
+ ! CCPP properties init routine
+ public :: ccpp_const_props_init
+
+ ! Public properties DDT variable:
+ type(ccpp_constituent_prop_ptr_t), allocatable, public :: ccpp_const_props(:)
+
+contains
+
+!+++++++++++++++++++++++++++++++++++++++
+!CCPP constituent properties DDT methods
+!+++++++++++++++++++++++++++++++++++++++
+
+ subroutine ccp_get_standard_name(this, std_name, errcode, errmsg)
+ ! Return this constituent's standard name
+
+ ! Dummy arguments
+ class(ccpp_constituent_prop_ptr_t), intent(in) :: this
+ character(len=*), intent(out) :: std_name
+ integer, optional, intent(out) :: errcode
+ character(len=*), optional, intent(out) :: errmsg
+
+ std_name = 'Not Used!'
+
+ ! Provide err values if requested:
+ if(present(errcode)) then
+ errcode = 0
+ end if
+ if(present(errmsg)) then
+ errmsg = 'Still Not Used!'
+ end if
+
+ end subroutine ccp_get_standard_name
+
+ !------
+
+ subroutine ccp_is_thermo_active(this, val_out, errcode, errmsg)
+
+ ! Dummy arguments
+ class(ccpp_constituent_prop_ptr_t), intent(in) :: this
+ logical, intent(out) :: val_out
+ integer, optional, intent(out) :: errcode
+ character(len=*), optional, intent(out) :: errmsg
+
+ ! Pass back thermo active property:
+ val_out = this%thermo_active
+
+ ! Provide err values if requested:
+ if(present(errcode)) then
+ errcode = 0
+ end if
+ if(present(errmsg)) then
+ errmsg = ''
+ end if
+
+ end subroutine ccp_is_thermo_active
+
+ !------
+
+ subroutine ccp_is_water_species(this, val_out, errcode, errmsg)
+
+ ! Dummy arguments
+ class(ccpp_constituent_prop_ptr_t), intent(in) :: this
+ logical, intent(out) :: val_out
+ integer, optional, intent(out) :: errcode
+ character(len=*), optional, intent(out) :: errmsg
+
+ ! Pass back water species property:
+ val_out = this%water_species
+
+ ! Provide err values if requested:
+ if(present(errcode)) then
+ errcode = 0
+ end if
+ if(present(errmsg)) then
+ errmsg = ''
+ end if
+
+ end subroutine ccp_is_water_species
+
+ !------
+
+ subroutine ccp_set_thermo_active(this, thermo_flag, errcode, errmsg)
+ ! Set whether this constituent is thermodynamically active, which
+ ! means that certain physics schemes will use this constitutent
+ ! when calculating thermodynamic quantities (e.g. enthalpy).
+
+ ! Dummy arguments
+ class(ccpp_constituent_prop_ptr_t), intent(inout) :: this
+ logical, intent(in) :: thermo_flag
+ integer, optional, intent(out) :: errcode
+ character(len=*), optional, intent(out) :: errmsg
+
+ ! Set thermodynamically active flag for this constituent:
+ this%thermo_active = thermo_flag
+
+ ! Provide err values if requested:
+ if(present(errcode)) then
+ errcode = 0
+ end if
+ if(present(errmsg)) then
+ errmsg = ''
+ end if
+
+ end subroutine ccp_set_thermo_active
+
+ !------
+
+ subroutine ccp_set_water_species(this, water_flag, errcode, errmsg)
+ ! Set whether this constituent is a water species, which means
+ ! that this constituent represents a particular phase or type
+ ! of water in the atmosphere.
+
+ ! Dummy arguments
+ class(ccpp_constituent_prop_ptr_t), intent(inout) :: this
+ logical, intent(in) :: water_flag
+ integer, optional, intent(out) :: errcode
+ character(len=*), optional, intent(out) :: errmsg
+
+ ! Set thermodynamically active flag for this constituent:
+ this%water_species = water_flag
+
+ ! Provide err values if requested:
+ if(present(errcode)) then
+ errcode = 0
+ end if
+ if(present(errmsg)) then
+ errmsg = ''
+ end if
+
+ end subroutine ccp_set_water_species
+
+!+++++++++++++++++++++++++++++++++++++++++++++++++++++++
+!CAM-equivalent CCPP constituents initialization routine
+!+++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+subroutine ccpp_const_props_init()
+
+ ! Use statements:
+ use constituents, only: pcnst
+ use cam_abortutils, only: handle_allocate_error
+ use air_composition, only: dry_air_species_num
+ use air_composition, only: thermodynamic_active_species_idx
+
+ ! Local variables:
+ integer :: ierr
+ integer :: m
+
+ character(len=*), parameter :: subname = 'ccpp_const_prop_init:'
+
+ ! Allocate constituents object:
+ allocate(ccpp_const_props(pcnst), stat=ierr)
+
+ ! Check if allocation succeeded:
+ call handle_allocate_error(ierr, subname, 'ccpp_const_props(pcnst)')
+
+ ! Set "thermo_active" property:
+ do m = 1,pcnst
+ if(any(thermodynamic_active_species_idx == m)) then
+ call ccpp_const_props(m)%set_thermo_active(.true.)
+ end if
+ end do
+
+ ! Set "water_species" property:
+ do m=1,pcnst
+ if(any(thermodynamic_active_species_idx(dry_air_species_num+1:) == m)) then
+ call ccpp_const_props(m)%set_water_species(.true.)
+ end if
+ end do
+
+end subroutine ccpp_const_props_init
+
+end module ccpp_constituent_prop_mod
diff --git a/src/utils/ccpp_kinds.F90 b/src/utils/cam_ccpp/ccpp_kinds.F90
similarity index 65%
rename from src/utils/ccpp_kinds.F90
rename to src/utils/cam_ccpp/ccpp_kinds.F90
index 505001a625..c95c2b08c3 100644
--- a/src/utils/ccpp_kinds.F90
+++ b/src/utils/cam_ccpp/ccpp_kinds.F90
@@ -1,4 +1,4 @@
-! This module is a placeholder for the CCPP generated module of the same name
+! This module is the CAM version of the CCPP generated module of the same name
module ccpp_kinds
use shr_kind_mod, only: kind_phys => shr_kind_r8
diff --git a/src/utils/cam_grid_support.F90 b/src/utils/cam_grid_support.F90
index 30ffe78576..de3cbb210b 100644
--- a/src/utils/cam_grid_support.F90
+++ b/src/utils/cam_grid_support.F90
@@ -15,6 +15,11 @@ module cam_grid_support
public iMap
integer, parameter, public :: max_hcoordname_len = 16
+ integer, parameter, public :: maxsplitfiles = 2
+
+ type, public :: vardesc_ptr_t
+ type(var_desc_t), pointer :: p => NULL()
+ end type vardesc_ptr_t
!---------------------------------------------------------------------------
!
! horiz_coord_t: Information for horizontal dimension attributes
@@ -32,8 +37,8 @@ module cam_grid_support
integer(iMap), pointer :: map(:) => NULL() ! map (dof) for dist. coord
logical :: latitude ! .false. means longitude
real(r8), pointer :: bnds(:,:) => NULL() ! bounds, if present
- type(var_desc_t), pointer :: vardesc => NULL() ! If we are to write coord
- type(var_desc_t), pointer :: bndsvdesc => NULL() ! If we are to write bounds
+ type(vardesc_ptr_t) :: vardesc(maxsplitfiles) ! If we are to write coord
+ type(vardesc_ptr_t) :: bndsvdesc(maxsplitfiles) ! If we are to write bounds
contains
procedure :: get_coord_len => horiz_coord_len
procedure :: num_elem => horiz_coord_num_elem
@@ -54,7 +59,7 @@ module cam_grid_support
type, abstract :: cam_grid_attribute_t
character(len=max_hcoordname_len) :: name = '' ! attribute name
character(len=max_chars) :: long_name = '' ! attribute long_name
- type(var_desc_t), pointer :: vardesc => NULL()
+ type(vardesc_ptr_t) :: vardesc(maxsplitfiles)
! We aren't going to use this until we sort out PGI issues
class(cam_grid_attribute_t), pointer :: next => NULL()
contains
@@ -156,7 +161,7 @@ module cam_grid_support
type(horiz_coord_t), pointer :: lon_coord => NULL() ! Longitude coord
logical :: unstructured ! Is this needed?
logical :: block_indexed ! .false. for lon/lat
- logical :: attrs_defined = .false.
+ logical :: attrs_defined(2) = .false.
logical :: zonal_grid = .false.
type(cam_filemap_t), pointer :: map => null() ! global dim map (dof)
type(cam_grid_attr_ptr_t), pointer :: attributes => NULL()
@@ -266,12 +271,13 @@ module cam_grid_support
! NB: This will not compile on some pre-13 Intel compilers
! (fails on 12.1.0.233 on Frankfurt, passes on 13.0.1.117 on Yellowstone)
abstract interface
- subroutine write_cam_grid_attr(attr, File)
+ subroutine write_cam_grid_attr(attr, File, file_index)
use pio, only: file_desc_t
import :: cam_grid_attribute_t
! Dummy arguments
class(cam_grid_attribute_t), intent(inout) :: attr
type(file_desc_t), intent(inout) :: File ! PIO file Handle
+ integer, optional, intent(in) :: file_index
end subroutine write_cam_grid_attr
end interface
@@ -314,6 +320,8 @@ end subroutine print_attr_spec
public :: cam_grid_is_zonal
! Functions for dealing with patch masks
public :: cam_grid_compute_patch
+ ! Functions for dealing with grid areas
+ public :: cam_grid_get_areawt
interface cam_grid_attribute_register
module procedure add_cam_grid_attribute_0d_int
@@ -543,7 +551,7 @@ end function horiz_coord_create
!
!---------------------------------------------------------------------------
- subroutine write_horiz_coord_attr(this, File, dimid_out)
+ subroutine write_horiz_coord_attr(this, File, dimid_out, file_index)
use pio, only: file_desc_t, pio_put_att, pio_noerr, pio_double
use pio, only: pio_bcast_error, pio_seterrorhandling, pio_inq_varid
use cam_pio_utils, only: cam_pio_def_dim, cam_pio_def_var
@@ -552,6 +560,7 @@ subroutine write_horiz_coord_attr(this, File, dimid_out)
class(horiz_coord_t), intent(inout) :: this
type(file_desc_t), intent(inout) :: File ! PIO file Handle
integer, optional, intent(out) :: dimid_out
+ integer, optional, intent(in) :: file_index
! Local variables
type(var_desc_t) :: vardesc
@@ -560,9 +569,16 @@ subroutine write_horiz_coord_attr(this, File, dimid_out)
integer :: bnds_dimid ! PIO dim ID for bounds
integer :: err_handling
integer :: ierr
+ integer :: file_index_loc
! We will handle errors for this routine
- call pio_seterrorhandling(File, PIO_BCAST_ERROR,err_handling)
+ call pio_seterrorhandling(File, PIO_BCAST_ERROR,err_handling)
+
+ if (present(file_index)) then
+ file_index_loc = file_index
+ else
+ file_index_loc = 1
+ end if
! Make sure the dimension exists in the file
call this%get_dim_name(dimname)
@@ -572,33 +588,33 @@ subroutine write_horiz_coord_attr(this, File, dimid_out)
ierr = pio_inq_varid(File, trim(this%name), vardesc)
if (ierr /= PIO_NOERR) then
! Variable not already defined, it is up to us to define the variable
- if (associated(this%vardesc)) then
+ if (associated(this%vardesc(file_index_loc)%p)) then
! This should not happen (i.e., internal error)
call endrun('write_horiz_coord_attr: vardesc already allocated for '//trim(dimname))
end if
- allocate(this%vardesc)
+ allocate(this%vardesc(file_index_loc)%p)
call cam_pio_def_var(File, trim(this%name), pio_double, &
- (/ dimid /), this%vardesc, existOK=.false.)
+ (/ dimid /), this%vardesc(file_index_loc)%p, existOK=.false.)
! long_name
- ierr=pio_put_att(File, this%vardesc, 'long_name', trim(this%long_name))
+ ierr=pio_put_att(File, this%vardesc(file_index_loc)%p, 'long_name', trim(this%long_name))
call cam_pio_handle_error(ierr, 'Error writing "long_name" attr in write_horiz_coord_attr')
! units
- ierr=pio_put_att(File, this%vardesc, 'units', trim(this%units))
+ ierr=pio_put_att(File, this%vardesc(file_index_loc)%p, 'units', trim(this%units))
call cam_pio_handle_error(ierr, 'Error writing "units" attr in write_horiz_coord_attr')
! Take care of bounds if they exist
if (associated(this%bnds)) then
- allocate(this%bndsvdesc)
- ierr=pio_put_att(File, this%vardesc, 'bounds', trim(this%name)//'_bnds')
+ allocate(this%bndsvdesc(file_index_loc)%p)
+ ierr=pio_put_att(File, this%vardesc(file_index_loc)%p, 'bounds', trim(this%name)//'_bnds')
call cam_pio_handle_error(ierr, 'Error writing "'//trim(this%name)//'_bnds" attr in write_horiz_coord_attr')
call cam_pio_def_dim(File, 'nbnd', 2, bnds_dimid, existOK=.true.)
call cam_pio_def_var(File, trim(this%name)//'_bnds', pio_double, &
- (/ bnds_dimid, dimid /), this%bndsvdesc, existOK=.false.)
+ (/ bnds_dimid, dimid /), this%bndsvdesc(file_index_loc)%p, existOK=.false.)
call cam_pio_handle_error(ierr, 'Error defining "'//trim(this%name)//'bnds" in write_horiz_coord_attr')
! long_name
- ierr=pio_put_att(File, this%bndsvdesc, 'long_name', trim(this%name)//' bounds')
+ ierr=pio_put_att(File, this%bndsvdesc(file_index_loc)%p, 'long_name', trim(this%name)//' bounds')
call cam_pio_handle_error(ierr, 'Error writing bounds "long_name" attr in write_horiz_coord_attr')
! units
- ierr=pio_put_att(File, this%bndsvdesc, 'units', trim(this%units))
+ ierr=pio_put_att(File, this%bndsvdesc(file_index_loc)%p, 'units', trim(this%units))
call cam_pio_handle_error(ierr, 'Error writing bounds "units" attr in write_horiz_coord_attr')
end if ! There are bounds for this coordinate
end if ! We define the variable
@@ -620,7 +636,7 @@ end subroutine write_horiz_coord_attr
!
!---------------------------------------------------------------------------
- subroutine write_horiz_coord_var(this, File)
+ subroutine write_horiz_coord_var(this, File, file_index)
use cam_pio_utils, only: cam_pio_get_decomp
use pio, only: file_desc_t, pio_double, iosystem_desc_t
use pio, only: pio_put_var, pio_write_darray
@@ -635,6 +651,7 @@ subroutine write_horiz_coord_var(this, File)
! Dummy arguments
class(horiz_coord_t), intent(inout) :: this
type(file_desc_t), intent(inout) :: File ! PIO file Handle
+ integer, optional, intent(in) :: file_index
! Local variables
character(len=120) :: errormsg
@@ -643,12 +660,19 @@ subroutine write_horiz_coord_var(this, File)
integer :: fdims(1)
integer :: err_handling
type(io_desc_t) :: iodesc
+ integer :: file_index_loc
!!XXgoldyXX: HACK to get around circular dependencies. Fix this!!
type(iosystem_desc_t), pointer :: piosys
!!XXgoldyXX: End of this part of the hack
+ if (present(file_index)) then
+ file_index_loc = file_index
+ else
+ file_index_loc = 1
+ end if
+
! Check to make sure we are supposed to write this var
- if (associated(this%vardesc)) then
+ if (associated(this%vardesc(file_index_loc)%p)) then
! We will handle errors for this routine
call pio_seterrorhandling(File, PIO_BCAST_ERROR,err_handling)
@@ -660,22 +684,22 @@ subroutine write_horiz_coord_var(this, File)
call this%get_coord_len(fdims(1))
allocate(iodesc)
call cam_pio_get_decomp(iodesc, ldims, fdims, PIO_DOUBLE, this%map)
- call pio_write_darray(File, this%vardesc, iodesc, this%values, ierr)
+ call pio_write_darray(File, this%vardesc(file_index_loc)%p, iodesc, this%values, ierr)
nullify(iodesc) ! CAM PIO system takes over memory management of iodesc
#else
!!XXgoldyXX: HACK to get around circular dependencies. Fix this!!
piosys => shr_pio_getiosys(atm_id)
call pio_initdecomp(piosys, pio_double, (/this%dimsize/), this%map, &
iodesc)
- call pio_write_darray(File, this%vardesc, iodesc, this%values, ierr)
+ call pio_write_darray(File, this%vardesc(file_index_loc)%p, iodesc, this%values, ierr)
call pio_syncfile(File)
call pio_freedecomp(File, iodesc)
! Take care of bounds if they exist
- if (associated(this%bnds) .and. associated(this%bndsvdesc)) then
+ if (associated(this%bnds) .and. associated(this%bndsvdesc(file_index_loc)%p)) then
call pio_initdecomp(piosys, pio_double, (/2, this%dimsize/), &
this%map, iodesc)
- call pio_write_darray(File, this%bndsvdesc, iodesc, this%bnds, ierr)
+ call pio_write_darray(File, this%bndsvdesc(file_index_loc)%p, iodesc, this%bnds, ierr)
call pio_syncfile(File)
call pio_freedecomp(File, iodesc)
end if
@@ -683,10 +707,10 @@ subroutine write_horiz_coord_var(this, File)
!!XXgoldyXX: End of this part of the hack
else
! This is a local variable, pio_put_var should work fine
- ierr = pio_put_var(File, this%vardesc, this%values)
+ ierr = pio_put_var(File, this%vardesc(file_index_loc)%p, this%values)
! Take care of bounds if they exist
- if (associated(this%bnds) .and. associated(this%bndsvdesc)) then
- ierr = pio_put_var(File, this%bndsvdesc, this%bnds)
+ if (associated(this%bnds) .and. associated(this%bndsvdesc(file_index_loc)%p)) then
+ ierr = pio_put_var(File, this%bndsvdesc(file_index_loc)%p, this%bnds)
end if
end if
write(errormsg, *) 'Error writing variable values for ',trim(this%name),&
@@ -697,12 +721,12 @@ subroutine write_horiz_coord_var(this, File)
call pio_seterrorhandling(File, err_handling)
! We are done with this variable descriptor, reset for next file
- deallocate(this%vardesc)
- nullify(this%vardesc)
+ deallocate(this%vardesc(file_index_loc)%p)
+ nullify(this%vardesc(file_index_loc)%p)
! Same with the bounds descriptor
- if (associated(this%bndsvdesc)) then
- deallocate(this%bndsvdesc)
- nullify(this%bndsvdesc)
+ if (associated(this%bndsvdesc(file_index_loc)%p)) then
+ deallocate(this%bndsvdesc(file_index_loc)%p)
+ nullify(this%bndsvdesc(file_index_loc)%p)
end if
end if ! Do we write the variable?
@@ -1616,6 +1640,59 @@ function cam_grid_get_lonvals(id) result(lonvals)
end if
end function cam_grid_get_lonvals
+ function cam_grid_get_areawt(id) result(wtvals)
+
+ ! Dummy argument
+ integer, intent(in) :: id
+ real(r8), pointer :: wtvals(:)
+
+ ! Local variables
+ character(len=max_chars) :: wtname
+ integer :: gridind
+ class(cam_grid_attribute_t), pointer :: attrptr
+ character(len=120) :: errormsg
+
+ nullify(attrptr)
+ gridind = get_cam_grid_index(id)
+ if (gridind > 0) then
+ select case(cam_grids(gridind)%name)
+ case('GLL')
+ wtname='area_weight_gll'
+ case('EUL')
+ wtname='gw'
+ case('FV')
+ wtname='gw'
+ case('INI')
+ wtname='area_weight_ini'
+ case('physgrid')
+ wtname='areawt'
+ case('FVM')
+ wtname='area_weight_fvm'
+ case('mpas_cell')
+ wtname='area_weight_mpas'
+ case default
+ call endrun('cam_grid_get_areawt: Invalid gridname:'//trim(cam_grids(gridind)%name))
+ end select
+
+ call find_cam_grid_attr(gridind, trim(wtname), attrptr)
+ if (.not.associated(attrptr)) then
+ write(errormsg, '(4a)') &
+ 'cam_grid_get_areawt: error retrieving weight attribute ', trim(wtname), &
+ ' for cam grid ', cam_grids(gridind)%name
+ call endrun(errormsg)
+ else
+ call attrptr%print_attr()
+ select type(attrptr)
+ type is (cam_grid_attribute_1d_r8_t)
+ wtvals => attrptr%values
+ class default
+ call endrun('cam_grid_get_areawt: wt attribute is not a real datatype')
+ end select
+ end if
+ end if
+
+ end function cam_grid_get_areawt
+
! Find the longitude and latitude of a range of map entries
! beg and end are the range of the first source index. blk is a block or chunk index
subroutine cam_grid_get_coords(id, beg, end, blk, lon, lat)
@@ -2115,7 +2192,7 @@ end subroutine setAttrPtrNext
!
!---------------------------------------------------------------------------
- subroutine write_cam_grid_attr_0d_int(attr, File)
+ subroutine write_cam_grid_attr_0d_int(attr, File, file_index)
use pio, only: file_desc_t, pio_put_att, pio_noerr, pio_int, &
pio_inq_att, PIO_GLOBAL
use cam_pio_utils, only: cam_pio_def_var
@@ -2123,23 +2200,30 @@ subroutine write_cam_grid_attr_0d_int(attr, File)
! Dummy arguments
class(cam_grid_attribute_0d_int_t), intent(inout) :: attr
type(file_desc_t), intent(inout) :: File ! PIO file Handle
+ integer, optional, intent(in) :: file_index
! Local variables
- character(len=120) :: errormsg
integer :: attrtype
integer(imap) :: attrlen
integer :: ierr
+ integer :: file_index_loc
+
+ if (present(file_index)) then
+ file_index_loc = file_index
+ else
+ file_index_loc = 1
+ end if
! Since more than one grid can share an attribute, assume that if the
! vardesc is associated, that grid defined the attribute
- if (.not. associated(attr%vardesc)) then
+ if (.not. associated(attr%vardesc(file_index_loc)%p)) then
if (len_trim(attr%long_name) > 0) then
! This 0d attribute is a scalar variable with a long_name attribute
! First, define the variable
- allocate(attr%vardesc)
- call cam_pio_def_var(File, trim(attr%name), pio_int, attr%vardesc, &
+ allocate(attr%vardesc(file_index_loc)%p)
+ call cam_pio_def_var(File, trim(attr%name), pio_int, attr%vardesc(file_index_loc)%p, &
existOK=.false.)
- ierr=pio_put_att(File, attr%vardesc, 'long_name', trim(attr%long_name))
+ ierr=pio_put_att(File, attr%vardesc(file_index_loc)%p, 'long_name', trim(attr%long_name))
call cam_pio_handle_error(ierr, 'Error writing "long_name" attr in write_cam_grid_attr_0d_int')
else
! This 0d attribute is a global attribute
@@ -2163,23 +2247,30 @@ end subroutine write_cam_grid_attr_0d_int
!
!---------------------------------------------------------------------------
- subroutine write_cam_grid_attr_0d_char(attr, File)
+ subroutine write_cam_grid_attr_0d_char(attr, File, file_index)
use pio, only: file_desc_t, pio_put_att, pio_noerr, &
pio_inq_att, PIO_GLOBAL
! Dummy arguments
class(cam_grid_attribute_0d_char_t), intent(inout) :: attr
type(file_desc_t), intent(inout) :: File ! PIO file Handle
+ integer, optional, intent(in) :: file_index
! Local variables
- character(len=120) :: errormsg
integer :: attrtype
integer(imap) :: attrlen
integer :: ierr
+ integer :: file_index_loc
+
+ if (present(file_index)) then
+ file_index_loc = file_index
+ else
+ file_index_loc = 1
+ end if
! Since more than one grid can share an attribute, assume that if the
! vardesc is associated, that grid defined the attribute
- if (.not. associated(attr%vardesc)) then
+ if (.not. associated(attr%vardesc(file_index_loc)%p)) then
! The 0d char attributes are global attribues
! Check to see if the attribute already exists in the file
ierr = pio_inq_att(File, PIO_GLOBAL, attr%name, attrtype, attrlen)
@@ -2200,7 +2291,7 @@ end subroutine write_cam_grid_attr_0d_char
!
!---------------------------------------------------------------------------
- subroutine write_cam_grid_attr_1d_int(attr, File)
+ subroutine write_cam_grid_attr_1d_int(attr, File, file_index)
use pio, only: file_desc_t, pio_put_att, pio_noerr
use pio, only: pio_inq_dimid, pio_int
use cam_pio_utils, only: cam_pio_def_var, cam_pio_closefile
@@ -2208,15 +2299,23 @@ subroutine write_cam_grid_attr_1d_int(attr, File)
! Dummy arguments
class(cam_grid_attribute_1d_int_t), intent(inout) :: attr
type(file_desc_t), intent(inout) :: File ! PIO file Handle
+ integer, optional, intent(in) :: file_index
! Local variables
integer :: dimid ! PIO dimension ID
character(len=120) :: errormsg
integer :: ierr
+ integer :: file_index_loc
+
+ if (present(file_index)) then
+ file_index_loc = file_index
+ else
+ file_index_loc = 1
+ end if
! Since more than one grid can share an attribute, assume that if the
! vardesc is associated, that grid defined the attribute
- if (.not. associated(attr%vardesc)) then
+ if (.not. associated(attr%vardesc(file_index_loc)%p)) then
! Check to see if the dimension already exists in the file
ierr = pio_inq_dimid(File, trim(attr%dimname), dimid)
if (ierr /= PIO_NOERR) then
@@ -2228,10 +2327,10 @@ subroutine write_cam_grid_attr_1d_int(attr, File)
call endrun(errormsg)
end if
! Time to define the variable
- allocate(attr%vardesc)
+ allocate(attr%vardesc(file_index_loc)%p)
call cam_pio_def_var(File, trim(attr%name), pio_int, (/dimid/), &
- attr%vardesc, existOK=.false.)
- ierr = pio_put_att(File, attr%vardesc, 'long_name', trim(attr%long_name))
+ attr%vardesc(file_index_loc)%p, existOK=.false.)
+ ierr = pio_put_att(File, attr%vardesc(file_index_loc)%p, 'long_name', trim(attr%long_name))
call cam_pio_handle_error(ierr, 'Error writing "long_name" attr in write_cam_grid_attr_1d_int')
end if
@@ -2245,7 +2344,7 @@ end subroutine write_cam_grid_attr_1d_int
!
!---------------------------------------------------------------------------
- subroutine write_cam_grid_attr_1d_r8(attr, File)
+ subroutine write_cam_grid_attr_1d_r8(attr, File, file_index)
use pio, only: file_desc_t, pio_put_att, pio_noerr, pio_double, &
pio_inq_dimid
use cam_pio_utils, only: cam_pio_def_var, cam_pio_closefile
@@ -2253,15 +2352,23 @@ subroutine write_cam_grid_attr_1d_r8(attr, File)
! Dummy arguments
class(cam_grid_attribute_1d_r8_t), intent(inout) :: attr
type(file_desc_t), intent(inout) :: File ! PIO file Handle
+ integer, optional, intent(in) :: file_index
! Local variables
integer :: dimid ! PIO dimension ID
character(len=120) :: errormsg
integer :: ierr
+ integer :: file_index_loc
+
+ if (present(file_index)) then
+ file_index_loc = file_index
+ else
+ file_index_loc = 1
+ end if
! Since more than one grid can share an attribute, assume that if the
! vardesc is associated, that grid defined the attribute
- if (.not. associated(attr%vardesc)) then
+ if (.not. associated(attr%vardesc(file_index_loc)%p)) then
! Check to see if the dimension already exists in the file
ierr = pio_inq_dimid(File, trim(attr%dimname), dimid)
if (ierr /= PIO_NOERR) then
@@ -2273,11 +2380,11 @@ subroutine write_cam_grid_attr_1d_r8(attr, File)
call endrun(errormsg)
end if
! Time to define the variable
- allocate(attr%vardesc)
+ allocate(attr%vardesc(file_index_loc)%p)
call cam_pio_def_var(File, trim(attr%name), pio_double, (/dimid/), &
- attr%vardesc, existOK=.false.)
+ attr%vardesc(file_index_loc)%p, existOK=.false.)
! long_name
- ierr = pio_put_att(File, attr%vardesc, 'long_name', trim(attr%long_name))
+ ierr = pio_put_att(File, attr%vardesc(file_index_loc)%p, 'long_name', trim(attr%long_name))
call cam_pio_handle_error(ierr, 'Error writing "long_name" attr in write_cam_grid_attr_1d_r8')
end if
@@ -2333,14 +2440,14 @@ end subroutine cam_grid_attribute_copy
! coordinates.
!
!---------------------------------------------------------------------------
- subroutine cam_grid_write_attr(File, grid_id, header_info)
+ subroutine cam_grid_write_attr(File, grid_id, header_info, file_index)
use pio, only: file_desc_t, PIO_BCAST_ERROR, pio_seterrorhandling
- use pio, only: pio_inq_dimid
! Dummy arguments
type(file_desc_t), intent(inout) :: File ! PIO file Handle
integer, intent(in) :: grid_id
type(cam_grid_header_info_t), intent(inout) :: header_info
+ integer, optional, intent(in) :: file_index
! Local variables
integer :: gridind
@@ -2348,13 +2455,19 @@ subroutine cam_grid_write_attr(File, grid_id, header_info)
type(cam_grid_attr_ptr_t), pointer :: attrPtr
integer :: dimids(2)
integer :: err_handling
+ integer :: file_index_loc
+
+ if (present(file_index)) then
+ file_index_loc = file_index
+ else
+ file_index_loc = 1
+ end if
gridind = get_cam_grid_index(grid_id)
!! Fill this in to make sure history finds grid
header_info%grid_id = grid_id
if (allocated(header_info%hdims)) then
- ! This shouldn't happen but, no harm, no foul
deallocate(header_info%hdims)
end if
@@ -2368,7 +2481,7 @@ subroutine cam_grid_write_attr(File, grid_id, header_info)
end if
! Only write this grid if not already defined
- if (cam_grids(gridind)%attrs_defined) then
+ if (cam_grids(gridind)%attrs_defined(file_index_loc)) then
! We need to fill out the hdims info for this grid
call cam_grids(gridind)%find_dimids(File, dimids)
if (dimids(2) < 0) then
@@ -2380,8 +2493,8 @@ subroutine cam_grid_write_attr(File, grid_id, header_info)
end if
else
! Write the horizontal coord attributes first so that we have the dims
- call cam_grids(gridind)%lat_coord%write_attr(File, dimids(2))
- call cam_grids(gridind)%lon_coord%write_attr(File, dimids(1))
+ call cam_grids(gridind)%lat_coord%write_attr(File, dimids(2), file_index=file_index_loc)
+ call cam_grids(gridind)%lon_coord%write_attr(File, dimids(1), file_index=file_index_loc)
if (dimids(2) == dimids(1)) then
allocate(header_info%hdims(1))
@@ -2399,7 +2512,7 @@ subroutine cam_grid_write_attr(File, grid_id, header_info)
!!XXgoldyXX: Is this not working in PGI?
! attr => attrPtr%getAttr()
attr => attrPtr%attr
- call attr%write_attr(File)
+ call attr%write_attr(File, file_index=file_index_loc)
!!XXgoldyXX: Is this not working in PGI?
! attrPtr => attrPtr%getNext()
attrPtr => attrPtr%next
@@ -2407,140 +2520,168 @@ subroutine cam_grid_write_attr(File, grid_id, header_info)
! Back to previous I/O error handling
call pio_seterrorhandling(File, err_handling)
-
- cam_grids(gridind)%attrs_defined = .true.
+ cam_grids(gridind)%attrs_defined(file_index_loc) = .true.
end if
end subroutine cam_grid_write_attr
- subroutine write_cam_grid_val_0d_int(attr, File)
- use pio, only: file_desc_t, pio_inq_varid, pio_put_var
+ subroutine write_cam_grid_val_0d_int(attr, File, file_index)
+ use pio, only: file_desc_t, pio_put_var
! Dummy arguments
class(cam_grid_attribute_0d_int_t), intent(inout) :: attr
type(file_desc_t), intent(inout) :: File
+ integer, optional, intent(in) :: file_index
! Local variables
- character(len=120) :: errormsg
integer :: ierr
+ integer :: file_index_loc
+
+ if (present(file_index)) then
+ file_index_loc = file_index
+ else
+ file_index_loc = 1
+ end if
! We only write this var if it is a variable
- if (associated(attr%vardesc)) then
- ierr = pio_put_var(File, attr%vardesc, attr%ival)
+ if (associated(attr%vardesc(file_index_loc)%p)) then
+ ierr = pio_put_var(File, attr%vardesc(file_index_loc)%p, attr%ival)
call cam_pio_handle_error(ierr, 'Error writing value in write_cam_grid_val_0d_int')
- deallocate(attr%vardesc)
- nullify(attr%vardesc)
+ deallocate(attr%vardesc(file_index_loc)%p)
+ nullify(attr%vardesc(file_index_loc)%p)
end if
end subroutine write_cam_grid_val_0d_int
- subroutine write_cam_grid_val_0d_char(attr, File)
+ subroutine write_cam_grid_val_0d_char(attr, File, file_index)
use pio, only: file_desc_t
! Dummy arguments
class(cam_grid_attribute_0d_char_t), intent(inout) :: attr
type(file_desc_t), intent(inout) :: File
+ integer, optional, intent(in) :: file_index
! This subroutine is a stub because global attributes are written
! in define mode
return
end subroutine write_cam_grid_val_0d_char
- subroutine write_cam_grid_val_1d_int(attr, File)
+ subroutine write_cam_grid_val_1d_int(attr, File, file_index)
use pio, only: file_desc_t, pio_put_var, pio_int, &
- pio_inq_varid, pio_write_darray, io_desc_t, pio_freedecomp
+ pio_write_darray, io_desc_t, pio_freedecomp
use cam_pio_utils, only: cam_pio_newdecomp
! Dummy arguments
class(cam_grid_attribute_1d_int_t), intent(inout) :: attr
type(file_desc_t), intent(inout) :: File
+ integer, optional, intent(in) :: file_index
! Local variables
- character(len=120) :: errormsg
integer :: ierr
type(io_desc_t), pointer :: iodesc
+ integer :: file_index_loc
+
+ if (present(file_index)) then
+ file_index_loc = file_index
+ else
+ file_index_loc = 1
+ end if
nullify(iodesc)
! Since more than one grid can share an attribute, assume that if the
! vardesc is not associated, another grid write the values
- if (associated(attr%vardesc)) then
+ if (associated(attr%vardesc(file_index_loc)%p)) then
! Write out the values for this dimension variable
if (associated(attr%map)) then
! This is a distributed variable, use pio_write_darray
allocate(iodesc)
call cam_pio_newdecomp(iodesc, (/attr%dimsize/), attr%map, pio_int)
- call pio_write_darray(File, attr%vardesc, iodesc, attr%values, ierr)
+ call pio_write_darray(File, attr%vardesc(file_index_loc)%p, iodesc, attr%values, ierr)
call pio_freedecomp(File, iodesc)
deallocate(iodesc)
nullify(iodesc)
else
! This is a local variable, pio_put_var should work fine
- ierr = pio_put_var(File, attr%vardesc, attr%values)
+ ierr = pio_put_var(File, attr%vardesc(file_index_loc)%p, attr%values)
end if
call cam_pio_handle_error(ierr, 'Error writing variable values in write_cam_grid_val_1d_int')
- deallocate(attr%vardesc)
- nullify(attr%vardesc)
+ deallocate(attr%vardesc(file_index_loc)%p)
+ nullify(attr%vardesc(file_index_loc)%p)
end if
end subroutine write_cam_grid_val_1d_int
- subroutine write_cam_grid_val_1d_r8(attr, File)
+ subroutine write_cam_grid_val_1d_r8(attr, File, file_index)
use pio, only: file_desc_t, pio_put_var, pio_double, &
- pio_inq_varid, pio_write_darray, io_desc_t, pio_freedecomp
+ pio_write_darray, io_desc_t, pio_freedecomp
use cam_pio_utils, only: cam_pio_newdecomp
! Dummy arguments
class(cam_grid_attribute_1d_r8_t), intent(inout) :: attr
type(file_desc_t), intent(inout) :: File
+ integer, optional, intent(in) :: file_index
! Local variables
- character(len=120) :: errormsg
integer :: ierr
type(io_desc_t), pointer :: iodesc
+ integer :: file_index_loc
+
+ if (present(file_index)) then
+ file_index_loc = file_index
+ else
+ file_index_loc = 1
+ end if
nullify(iodesc)
! Since more than one grid can share an attribute, assume that if the
! vardesc is not associated, another grid write the values
- if (associated(attr%vardesc)) then
+ if (associated(attr%vardesc(file_index_loc)%p)) then
! Write out the values for this dimension variable
if (associated(attr%map)) then
! This is a distributed variable, use pio_write_darray
allocate(iodesc)
call cam_pio_newdecomp(iodesc, (/attr%dimsize/), attr%map, pio_double)
- call pio_write_darray(File, attr%vardesc, iodesc, attr%values, ierr)
+ call pio_write_darray(File, attr%vardesc(file_index_loc)%p, iodesc, attr%values, ierr)
call pio_freedecomp(File, iodesc)
deallocate(iodesc)
nullify(iodesc)
else
! This is a local variable, pio_put_var should work fine
- ierr = pio_put_var(File, attr%vardesc, attr%values)
+ ierr = pio_put_var(File, attr%vardesc(file_index_loc)%p, attr%values)
end if
call cam_pio_handle_error(ierr, 'Error writing variable values in write_cam_grid_val_1d_r8')
- deallocate(attr%vardesc)
- nullify(attr%vardesc)
+ deallocate(attr%vardesc(file_index_loc)%p)
+ nullify(attr%vardesc(file_index_loc)%p)
end if
end subroutine write_cam_grid_val_1d_r8
- subroutine cam_grid_write_var(File, grid_id)
+ subroutine cam_grid_write_var(File, grid_id, file_index)
use pio, only: file_desc_t, pio_bcast_error, pio_seterrorhandling
! Dummy arguments
type(file_desc_t), intent(inout) :: File ! PIO file Handle
integer, intent(in) :: grid_id
+ integer, optional, intent(in) :: file_index
! Local variables
integer :: gridind
integer :: err_handling
class(cam_grid_attribute_t), pointer :: attr
type(cam_grid_attr_ptr_t), pointer :: attrPtr
+ integer :: file_index_loc
+ if (present(file_index)) then
+ file_index_loc = file_index
+ else
+ file_index_loc = 1
+ end if
gridind = get_cam_grid_index(grid_id)
! Only write if not already done
- if (cam_grids(gridind)%attrs_defined) then
+ if (cam_grids(gridind)%attrs_defined(file_index_loc)) then
! Write the horizontal coorinate values
- call cam_grids(gridind)%lon_coord%write_var(File)
- call cam_grids(gridind)%lat_coord%write_var(File)
+ call cam_grids(gridind)%lon_coord%write_var(File, file_index)
+ call cam_grids(gridind)%lat_coord%write_var(File, file_index)
! We will handle errors for this routine
call pio_seterrorhandling(File, PIO_BCAST_ERROR,err_handling)
@@ -2551,7 +2692,7 @@ subroutine cam_grid_write_var(File, grid_id)
!!XXgoldyXX: Is this not working in PGI?
! attr => attrPtr%getAttr()
attr => attrPtr%attr
- call attr%write_val(File)
+ call attr%write_val(File, file_index=file_index_loc)
!!XXgoldyXX: Is this not working in PGI?
! attrPtr => attrPtr%getNext()
attrPtr => attrPtr%next
@@ -2560,7 +2701,7 @@ subroutine cam_grid_write_var(File, grid_id)
! Back to previous I/O error handling
call pio_seterrorhandling(File, err_handling)
- cam_grids(gridind)%attrs_defined = .false.
+ cam_grids(gridind)%attrs_defined(file_index_loc) = .false.
end if
end subroutine cam_grid_write_var
@@ -2999,7 +3140,7 @@ subroutine cam_grid_find_dimids(this, File, dimids)
integer, intent(out) :: dimids(:)
! Local vaariables
- integer :: dsize, ierr
+ integer :: ierr
integer :: err_handling
character(len=max_hcoordname_len) :: dimname1, dimname2
@@ -3880,8 +4021,6 @@ subroutine cam_grid_patch_get_decomp(this, field_lens, file_lens, dtype, &
end subroutine cam_grid_patch_get_decomp
subroutine cam_grid_patch_compact(this, collected_output)
- use spmd_utils, only: mpi_sum, mpi_integer, mpicom
- use shr_mpi_mod, only: shr_mpi_chkerr
! Dummy arguments
class(cam_grid_patch_t) :: this
diff --git a/src/utils/cam_thermo.F90 b/src/utils/cam_thermo.F90
index eaea52f328..f65649c4ef 100644
--- a/src/utils/cam_thermo.F90
+++ b/src/utils/cam_thermo.F90
@@ -7,7 +7,6 @@ module cam_thermo
use air_composition, only: thermodynamic_active_species_idx
use air_composition, only: thermodynamic_active_species_idx_dycore
use air_composition, only: thermodynamic_active_species_cp
- use air_composition, only: thermodynamic_active_species_cv
use air_composition, only: thermodynamic_active_species_R
use air_composition, only: thermodynamic_active_species_mwi
use air_composition, only: thermodynamic_active_species_kv
@@ -18,6 +17,7 @@ module cam_thermo
use air_composition, only: thermodynamic_active_species_liq_idx_dycore
use air_composition, only: thermodynamic_active_species_ice_idx
use air_composition, only: thermodynamic_active_species_ice_idx_dycore
+ use air_composition, only: dry_air_species_num
use air_composition, only: enthalpy_reference_state
use air_composition, only: mmro2, mmrn2, o2_mwi, n2_mwi, mbar
@@ -33,8 +33,10 @@ module cam_thermo
! cam_thermo_init: Initialize constituent dependent properties
public :: cam_thermo_init
- ! cam_thermo_update: Update constituent dependent properties
- public :: cam_thermo_update
+ ! cam_thermo_dry_air_update: Update dry air composition dependent properties
+ public :: cam_thermo_dry_air_update
+ ! cam_thermo_water_update: Update water dependent properties
+ public :: cam_thermo_water_update
! get_enthalpy: enthalpy quantity = dp*cp*T
public :: get_enthalpy
! get_virtual_temp: virtual temperature
@@ -170,6 +172,38 @@ module cam_thermo
! 2-d interface is not needed (but can easily be added)
end interface get_hydrostatic_energy
+ integer, public, parameter :: thermo_budget_num_vars = 10
+ integer, public, parameter :: wvidx = 1
+ integer, public, parameter :: wlidx = 2
+ integer, public, parameter :: wiidx = 3
+ integer, public, parameter :: seidx = 4 ! enthalpy or internal energy (W/m2) index
+ integer, public, parameter :: poidx = 5 ! surface potential or potential energy index
+ integer, public, parameter :: keidx = 6 ! kinetic energy index
+ integer, public, parameter :: mridx = 7
+ integer, public, parameter :: moidx = 8
+ integer, public, parameter :: ttidx = 9
+ integer, public, parameter :: teidx = 10
+ character (len = 2) ,public, dimension(thermo_budget_num_vars) :: thermo_budget_vars = &
+ (/"WV" ,"WL" ,"WI" ,"SE" ,"PO" ,"KE" ,"MR" ,"MO" ,"TT" ,"TE" /)
+ character (len = 46) ,public, dimension(thermo_budget_num_vars) :: thermo_budget_vars_descriptor = (/&
+ "Total column water vapor ",&
+ "Total column liquid water ",&
+ "Total column frozen water ",&
+ "Total column enthalpy or internal energy ",&
+ "Total column srf potential or potential energy",&
+ "Total column kinetic energy ",&
+ "Total column wind axial angular momentum ",&
+ "Total column mass axial angular momentum ",&
+ "Total column test_tracer ",&
+ "Total column energy (ke + se + po) "/)
+
+ character (len = 14), public, dimension(thermo_budget_num_vars) :: &
+ thermo_budget_vars_unit = (/&
+ "kg/m2 ","kg/m2 ","kg/m2 ","J/m2 ",&
+ "J/m2 ","J/m2 ","kg*m2/s*rad2 ","kg*m2/s*rad2 ",&
+ "kg/m2 ","J/m2 "/)
+ logical ,public, dimension(thermo_budget_num_vars) :: thermo_budget_vars_massv = (/&
+ .true.,.true.,.true.,.false.,.false.,.false.,.false.,.false.,.true.,.false./)
CONTAINS
!===========================================================================
@@ -177,7 +211,6 @@ module cam_thermo
subroutine cam_thermo_init()
use shr_infnan_mod, only: assignment(=), shr_infnan_qnan
use ppgrid, only: pcols, pver, pverp, begchunk, endchunk
- use physconst, only: cpair, rair, mwdry
integer :: ierr
character(len=*), parameter :: subname = "cam_thermo_init"
@@ -202,48 +235,65 @@ subroutine cam_thermo_init()
kmcnd(:pcols, :pver, begchunk:endchunk) = shr_infnan_qnan
end subroutine cam_thermo_init
-
- !===========================================================================
-
+ !
!***************************************************************************
!
- ! cam_thermo_update: update species dependent constants for physics
+ ! cam_thermo_dry_air_update: update dry air species dependent constants for physics
!
!***************************************************************************
!
- subroutine cam_thermo_update(mmr, T, lchnk, ncol, to_moist_factor)
- use air_composition, only: air_composition_update
+ subroutine cam_thermo_dry_air_update(mmr, T, lchnk, ncol, to_dry_factor)
+ use air_composition, only: dry_air_composition_update
use string_utils, only: int2str
- !-----------------------------------------------------------------------
- ! Update the physics "constants" that vary
- !-------------------------------------------------------------------------
-
!------------------------------Arguments----------------------------------
-
+ !(mmr = dry mixing ratio, if not use to_dry_factor to convert)
real(r8), intent(in) :: mmr(:,:,:) ! constituents array
real(r8), intent(in) :: T(:,:) ! temperature
integer, intent(in) :: lchnk ! Chunk number
integer, intent(in) :: ncol ! number of columns
- real(r8), optional, intent(in) :: to_moist_factor(:,:)
+ real(r8), optional, intent(in) :: to_dry_factor(:,:)!if mmr moist convert
!
!---------------------------Local storage-------------------------------
real(r8):: sponge_factor(SIZE(mmr, 2))
character(len=*), parameter :: subname = 'cam_thermo_update: '
-
- if (present(to_moist_factor)) then
- if (SIZE(to_moist_factor, 1) /= ncol) then
- call endrun(subname//'DIM 1 of to_moist_factor is'//int2str(SIZE(to_moist_factor,1))//'but should be'//int2str(ncol))
- end if
+ if (present(to_dry_factor)) then
+ if (SIZE(to_dry_factor, 1) /= ncol) then
+ call endrun(subname//'DIM 1 of to_dry_factor is'//int2str(SIZE(to_dry_factor,1))//'but should be'//int2str(ncol))
+ end if
end if
- sponge_factor = 1.0_r8
- call air_composition_update(mmr, lchnk, ncol, to_moist_factor=to_moist_factor)
+ sponge_factor = 1.0_r8
+ call dry_air_composition_update(mmr, lchnk, ncol, to_dry_factor=to_dry_factor)
call get_molecular_diff_coef(T(:ncol,:), .true., sponge_factor, kmvis(:ncol,:,lchnk), &
- kmcnd(:ncol,:,lchnk), tracer=mmr(:ncol,:,:), fact=to_moist_factor, &
+ kmcnd(:ncol,:,lchnk), tracer=mmr(:ncol,:,:), fact=to_dry_factor, &
active_species_idx_dycore=thermodynamic_active_species_idx)
+ end subroutine cam_thermo_dry_air_update
+ !
+ !***************************************************************************
+ !
+ ! cam_thermo_water+update: update water species dependent constants for physics
+ !
+ !***************************************************************************
+ !
+ subroutine cam_thermo_water_update(mmr, lchnk, ncol, vcoord, to_dry_factor)
+ use air_composition, only: water_composition_update
+ !-----------------------------------------------------------------------
+ ! Update the physics "constants" that vary
+ !-------------------------------------------------------------------------
+
+ !------------------------------Arguments----------------------------------
+
+ real(r8), intent(in) :: mmr(:,:,:) ! constituents array
+ integer, intent(in) :: lchnk ! Chunk number
+ integer, intent(in) :: ncol ! number of columns
+ integer, intent(in) :: vcoord
+ real(r8), optional, intent(in) :: to_dry_factor(:,:)
+ !
+ logical :: lcp
- end subroutine cam_thermo_update
+ call water_composition_update(mmr, lchnk, ncol, vcoord, to_dry_factor=to_dry_factor)
+ end subroutine cam_thermo_water_update
!===========================================================================
@@ -687,7 +737,6 @@ subroutine get_pmid_from_dpdry_1hd(tracer, mixing_ratio, active_species_idx, dp_
real(r8) :: dp_local(SIZE(tracer, 1), SIZE(tracer, 2)) ! local pressure level thickness
real(r8) :: pint_local(SIZE(tracer, 1), SIZE(tracer, 2) + 1)! local interface pressure
- integer :: kdx
call get_dp(tracer, mixing_ratio, active_species_idx, dp_dry, dp_local)
@@ -1258,7 +1307,8 @@ subroutine get_molecular_diff_coef_1hd(temp, get_at_interfaces, sponge_factor, k
real(r8), intent(in) :: temp(:,:) ! temperature
logical, intent(in) :: get_at_interfaces ! true: compute kmvis and kmcnd at interfaces
! false: compute kmvis and kmcnd at mid-levels
- real(r8), intent(in) :: sponge_factor(:) ! multiply kmvis and kmcnd with sponge_factor (for sponge layer)
+ real(r8), intent(in) :: sponge_factor(:) ! multiply kmvis and kmcnd with sponge_factor
+ ! (for sponge layer)
real(r8), intent(out) :: kmvis(:,:)
real(r8), intent(out) :: kmcnd(:,:)
real(r8), intent(in) :: tracer(:,:,:) ! tracer array
@@ -1334,7 +1384,8 @@ subroutine get_molecular_diff_coef_1hd(temp, get_at_interfaces, sponge_factor, k
residual = 1.0_r8
do icnst = 1, dry_air_species_num
ispecies = idx_local(icnst)
- mm = 0.5_r8 * (tracer(idx, kdx, ispecies) * factor(idx, kdx) + tracer(idx, kdx - 1, ispecies) * factor(idx, kdx-1))
+ mm = 0.5_r8 * (tracer(idx, kdx, ispecies) * factor(idx, kdx) + &
+ tracer(idx, kdx - 1, ispecies) * factor(idx, kdx-1))
kmvis(idx, kdx) = kmvis(idx, kdx) + thermodynamic_active_species_kv(icnst) * &
thermodynamic_active_species_mwi(icnst) * mm
kmcnd(idx, kdx) = kmcnd(idx, kdx) + thermodynamic_active_species_kc(icnst) * &
@@ -1396,7 +1447,8 @@ subroutine get_molecular_diff_coef_2hd(temp, get_at_interfaces, sponge_factor, k
real(r8), intent(in) :: temp(:,:,:) ! temperature
logical, intent(in) :: get_at_interfaces ! true: compute kmvis and kmcnd at interfaces
! false: compute kmvis and kmcnd at mid-levels
- real(r8), intent(in) :: sponge_factor(:) ! multiply kmvis and kmcnd with sponge_factor (for sponge layer)
+ real(r8), intent(in) :: sponge_factor(:) ! multiply kmvis and kmcnd with sponge_factor
+ ! (for sponge layer)
real(r8), intent(out) :: kmvis(:,:,:)
real(r8), intent(out) :: kmcnd(:,:,:)
real(r8), intent(in) :: tracer(:,:,:,:) ! tracer array
@@ -1523,20 +1575,23 @@ end subroutine cam_thermo_calc_kappav_2hd
!
!***************************************************************************
!
- subroutine get_hydrostatic_energy_1hd(tracer, pdel, cp_or_cv, U, V, T, &
- vcoord, ps, phis, z_mid, dycore_idx, qidx, te, se, ke, &
- wv, H2O, liq, ice)
+ subroutine get_hydrostatic_energy_1hd(tracer, moist_mixing_ratio, pdel_in, &
+ cp_or_cv, U, V, T, vcoord, ptop, phis, z_mid, dycore_idx, qidx, &
+ te, se, po, ke, wv, H2O, liq, ice)
use cam_logfile, only: iulog
use dyn_tests_utils, only: vc_height, vc_moist_pressure, vc_dry_pressure
use air_composition, only: wv_idx
- use physconst, only: gravit, latvap, latice
+ use physconst, only: rga, latvap, latice
! Dummy arguments
! tracer: tracer mixing ratio
+ !
+ ! note - if pdeldry passed to subroutine then tracer mixing ratio must be dry
real(r8), intent(in) :: tracer(:,:,:)
+ logical, intent(in) :: moist_mixing_ratio
! pdel: pressure level thickness
- real(r8), intent(in) :: pdel(:,:)
+ real(r8), intent(in) :: pdel_in(:,:)
! cp_or_cv: dry air heat capacity under constant pressure or
! constant volume (depends on vcoord)
real(r8), intent(in) :: cp_or_cv(:,:)
@@ -1544,7 +1599,7 @@ subroutine get_hydrostatic_energy_1hd(tracer, pdel, cp_or_cv, U, V, T, &
real(r8), intent(in) :: V(:,:)
real(r8), intent(in) :: T(:,:)
integer, intent(in) :: vcoord ! vertical coordinate
- real(r8), intent(in), optional :: ps(:)
+ real(r8), intent(in), optional :: ptop(:)
real(r8), intent(in), optional :: phis(:)
real(r8), intent(in), optional :: z_mid(:,:)
! dycore_idx: use dycore index for thermodynamic active species
@@ -1557,8 +1612,12 @@ subroutine get_hydrostatic_energy_1hd(tracer, pdel, cp_or_cv, U, V, T, &
real(r8), intent(out), optional :: te (:)
! KE: vertically integrated kinetic energy
real(r8), intent(out), optional :: ke (:)
- ! SE: vertically integrated internal+geopotential energy
+ ! SE: vertically integrated enthalpy (pressure coordinate)
+ ! or internal energy (z coordinate)
real(r8), intent(out), optional :: se (:)
+ ! PO: vertically integrated PHIS term (pressure coordinate)
+ ! or potential energy (z coordinate)
+ real(r8), intent(out), optional :: po (:)
! WV: vertically integrated water vapor
real(r8), intent(out), optional :: wv (:)
! liq: vertically integrated liquid
@@ -1568,10 +1627,12 @@ subroutine get_hydrostatic_energy_1hd(tracer, pdel, cp_or_cv, U, V, T, &
! Local variables
real(r8) :: ke_vint(SIZE(tracer, 1)) ! Vertical integral of KE
- real(r8) :: se_vint(SIZE(tracer, 1)) ! Vertical integral of SE
+ real(r8) :: se_vint(SIZE(tracer, 1)) ! Vertical integral of enthalpy or internal energy
+ real(r8) :: po_vint(SIZE(tracer, 1)) ! Vertical integral of PHIS or potential energy
real(r8) :: wv_vint(SIZE(tracer, 1)) ! Vertical integral of wv
real(r8) :: liq_vint(SIZE(tracer, 1)) ! Vertical integral of liq
real(r8) :: ice_vint(SIZE(tracer, 1)) ! Vertical integral of ice
+ real(r8) :: pdel(SIZE(tracer, 1),SIZE(tracer, 2)) !moist pressure level thickness
real(r8) :: latsub ! latent heat of sublimation
integer :: ierr
@@ -1618,51 +1679,56 @@ subroutine get_hydrostatic_energy_1hd(tracer, pdel, cp_or_cv, U, V, T, &
wvidx = wv_idx
end if
+ if (moist_mixing_ratio) then
+ pdel = pdel_in
+ else
+ pdel = pdel_in
+ do qdx = dry_air_species_num+1, thermodynamic_active_species_num
+ pdel(:,:) = pdel(:,:) + pdel_in(:, :)*tracer(:,:,species_idx(qdx))
+ end do
+ end if
+
+ ke_vint = 0._r8
+ se_vint = 0._r8
select case (vcoord)
case(vc_moist_pressure, vc_dry_pressure)
- if ((.not. present(ps)) .or. (.not. present(phis))) then
- write(iulog, *) subname, ' ps and phis must be present for ', &
+ if (.not. present(ptop).or. (.not. present(phis))) then
+ write(iulog, *) subname, ' ptop and phis must be present for ', &
'moist/dry pressure vertical coordinate'
- call endrun(subname//': ps and phis must be present for '// &
+ call endrun(subname//': ptop and phis must be present for '// &
'moist/dry pressure vertical coordinate')
end if
- ke_vint = 0._r8
- se_vint = 0._r8
- wv_vint = 0._r8
+ po_vint = ptop
do kdx = 1, SIZE(tracer, 2)
do idx = 1, SIZE(tracer, 1)
ke_vint(idx) = ke_vint(idx) + (pdel(idx, kdx) * &
- 0.5_r8 * (U(idx, kdx)**2 + V(idx, kdx)**2) / gravit)
+ 0.5_r8 * (U(idx, kdx)**2 + V(idx, kdx)**2)) * rga
se_vint(idx) = se_vint(idx) + (T(idx, kdx) * &
- cp_or_cv(idx, kdx) * pdel(idx, kdx) / gravit)
- wv_vint(idx) = wv_vint(idx) + (tracer(idx, kdx, wvidx) * &
- pdel(idx, kdx) / gravit)
+ cp_or_cv(idx, kdx) * pdel(idx, kdx) * rga)
+ po_vint(idx) = po_vint(idx)+pdel(idx, kdx)
+
end do
end do
do idx = 1, SIZE(tracer, 1)
- se_vint(idx) = se_vint(idx) + (phis(idx) * ps(idx) / gravit)
+ po_vint(idx) = (phis(idx) * po_vint(idx) * rga)
end do
case(vc_height)
- if (.not. present(z_mid)) then
- write(iulog, *) subname, &
- ' z_mid must be present for height vertical coordinate'
- call endrun(subname//': z_mid must be present for height '// &
- 'vertical coordinate')
+ if (.not. present(phis)) then
+ write(iulog, *) subname, ' phis must be present for ', &
+ 'heigt-based vertical coordinate'
+ call endrun(subname//': phis must be present for '// &
+ 'height-based vertical coordinate')
end if
- ke_vint = 0._r8
- se_vint = 0._r8
- wv_vint = 0._r8
+ po_vint = 0._r8
do kdx = 1, SIZE(tracer, 2)
do idx = 1, SIZE(tracer, 1)
ke_vint(idx) = ke_vint(idx) + (pdel(idx, kdx) * &
- 0.5_r8 * (U(idx, kdx)**2 + V(idx, kdx)**2) / gravit)
+ 0.5_r8 * (U(idx, kdx)**2 + V(idx, kdx)**2) * rga)
se_vint(idx) = se_vint(idx) + (T(idx, kdx) * &
- cp_or_cv(idx, kdx) * pdel(idx, kdx) / gravit)
+ cp_or_cv(idx, kdx) * pdel(idx, kdx) * rga)
! z_mid is height above ground
- se_vint(idx) = se_vint(idx) + (z_mid(idx, kdx) + &
- phis(idx) / gravit) * pdel(idx, kdx)
- wv_vint(idx) = wv_vint(idx) + (tracer(idx, kdx, wvidx) * &
- pdel(idx, kdx) / gravit)
+ po_vint(idx) = po_vint(idx) + (z_mid(idx, kdx) + &
+ phis(idx) * rga) * pdel(idx, kdx)
end do
end do
case default
@@ -1670,26 +1736,39 @@ subroutine get_hydrostatic_energy_1hd(tracer, pdel, cp_or_cv, U, V, T, &
call endrun(subname//': vertical coordinate not supported')
end select
if (present(te)) then
- te = se_vint + ke_vint
+ te = se_vint + po_vint+ ke_vint
end if
if (present(se)) then
se = se_vint
end if
+ if (present(po)) then
+ po = po_vint
+ end if
if (present(ke)) then
ke = ke_vint
end if
- if (present(wv)) then
- wv = wv_vint
- end if
!
! vertical integral of total liquid water
!
+ if (.not.moist_mixing_ratio) then
+ pdel = pdel_in! set pseudo density to dry
+ end if
+
+ wv_vint = 0._r8
+ do kdx = 1, SIZE(tracer, 2)
+ do idx = 1, SIZE(tracer, 1)
+ wv_vint(idx) = wv_vint(idx) + (tracer(idx, kdx, wvidx) * &
+ pdel(idx, kdx) * rga)
+ end do
+ end do
+ if (present(wv)) wv = wv_vint
+
liq_vint = 0._r8
do qdx = 1, thermodynamic_active_species_liq_num
do kdx = 1, SIZE(tracer, 2)
do idx = 1, SIZE(tracer, 1)
- liq_vint(idx) = liq_vint(idx) + (pdel(idx, kdx) * &
- tracer(idx, kdx, species_liq_idx(qdx)) / gravit)
+ liq_vint(idx) = liq_vint(idx) + (pdel(idx, kdx) * &
+ tracer(idx, kdx, species_liq_idx(qdx)) * rga)
end do
end do
end do
@@ -1703,7 +1782,7 @@ subroutine get_hydrostatic_energy_1hd(tracer, pdel, cp_or_cv, U, V, T, &
do kdx = 1, SIZE(tracer, 2)
do idx = 1, SIZE(tracer, 1)
ice_vint(idx) = ice_vint(idx) + (pdel(idx, kdx) * &
- tracer(idx, kdx, species_ice_idx(qdx)) / gravit)
+ tracer(idx, kdx, species_ice_idx(qdx)) * rga)
end do
end do
end do
@@ -1731,9 +1810,6 @@ subroutine get_hydrostatic_energy_1hd(tracer, pdel, cp_or_cv, U, V, T, &
end select
end if
deallocate(species_idx, species_liq_idx, species_ice_idx)
-
- end subroutine get_hydrostatic_energy_1hd
-
- !===========================================================================
+ end subroutine get_hydrostatic_energy_1hd
end module cam_thermo
diff --git a/src/utils/physconst.F90 b/src/utils/physconst.F90
index 828ddf45b9..a06f347640 100644
--- a/src/utils/physconst.F90
+++ b/src/utils/physconst.F90
@@ -67,6 +67,7 @@ module physconst
real(r8), public, parameter :: c0 = 2.99792458e8_r8 ! Speed of light in a vacuum (m s-1)
real(r8), public, parameter :: planck = 6.6260755e-34_r8 ! Planck's constant (J.s)
+ real(r8), public, parameter :: amu = 1.66053886e-27_r8 ! Atomic Mass Unit (kg)
! Molecular weights (g mol-1)
real(r8), public, parameter :: mwco2 = 44._r8 ! molecular weight co2
diff --git a/src/utils/table_interp_mod.F90 b/src/utils/table_interp_mod.F90
new file mode 100644
index 0000000000..9daac52b51
--- /dev/null
+++ b/src/utils/table_interp_mod.F90
@@ -0,0 +1,214 @@
+!----------------------------------------------------------------------------
+! Utility module used for interpolation of aerosol optics table
+! NOTE: Results will be set to table edges for interpolations beyond
+! the edges -- no extropolations
+!----------------------------------------------------------------------------
+module table_interp_mod
+ use shr_kind_mod, only: r8=>shr_kind_r8
+
+ implicit none
+
+ private
+ public :: table_interp
+ public :: table_interp_wghts
+ public :: table_interp_calcwghts
+
+ ! overload the interpolation routines
+ interface table_interp
+ module procedure interp1d
+ module procedure interp2d
+ module procedure interp4d
+ end interface table_interp
+
+ ! interpolation weights and indices
+ type :: table_interp_wghts
+ real(r8) :: wt1
+ real(r8) :: wt2
+ integer :: ix1
+ integer :: ix2
+ end type table_interp_wghts
+
+contains
+
+ !--------------------------------------------------------------------------
+ ! 1-D interpolation
+ !--------------------------------------------------------------------------
+ pure function interp1d( ncol, nxs, xwghts, tbl ) result(res)
+
+ integer, intent(in) :: ncol ! number of model columns
+ integer, intent(in) :: nxs ! table size
+ real(r8), intent(in) :: tbl(nxs) ! table values to be interpolated
+ type(table_interp_wghts), intent(in) :: xwghts(ncol) ! interpolation weights and indices
+
+ real(r8) :: res(ncol)
+
+ integer :: i
+
+ do i = 1,ncol
+
+ res(i) = xwghts(i)%wt1*tbl(xwghts(i)%ix1) &
+ + xwghts(i)%wt2*tbl(xwghts(i)%ix2)
+
+ end do
+
+ end function interp1d
+
+ !--------------------------------------------------------------------------
+ ! 2-D interpolation
+ !--------------------------------------------------------------------------
+ pure function interp2d( ncoef, ncol, nxs, nys, xwghts, ywghts, tbl ) result(res)
+
+ integer, intent(in) :: ncoef ! number chebyshev coefficients
+ integer, intent(in) :: ncol ! number of model columns
+ integer, intent(in) :: nxs ! table x-dimension size
+ integer, intent(in) :: nys ! table y-dimension size
+ real(r8), intent(in) :: tbl(ncoef,nxs,nys) ! table values to be interpolated
+ type(table_interp_wghts), intent(in) :: xwghts(ncol) ! x interpolation weights and indices
+ type(table_interp_wghts), intent(in) :: ywghts(ncol) ! y interpolation weights and indices
+
+ real(r8) :: res(ncoef,ncol)
+
+ real(r8) :: fx(ncoef,2)
+
+ integer :: i
+
+ do i = 1,ncol
+
+ ! interp x dir
+ fx(:,1) = xwghts(i)%wt1*tbl(:,xwghts(i)%ix1,ywghts(i)%ix1) & ! @ y1
+ + xwghts(i)%wt2*tbl(:,xwghts(i)%ix2,ywghts(i)%ix1)
+ fx(:,2) = xwghts(i)%wt1*tbl(:,xwghts(i)%ix1,ywghts(i)%ix2) & ! @ y2
+ + xwghts(i)%wt2*tbl(:,xwghts(i)%ix2,ywghts(i)%ix2)
+
+ ! interp y dir
+ res(:,i) = ywghts(i)%wt1*fx(:,1) + ywghts(i)%wt2*fx(:,2)
+
+ end do
+
+ end function interp2d
+
+ !--------------------------------------------------------------------------
+ ! 4-D interpolation
+ !--------------------------------------------------------------------------
+ pure function interp4d( ncol, nxs, nys, nzs, nts, xwghts, ywghts, zwghts, twghts, tbl ) result(res)
+
+ integer, intent(in) :: ncol ! number of model columns
+ integer, intent(in) :: nxs ! table x-dimension size
+ integer, intent(in) :: nys ! table y-dimension size
+ integer, intent(in) :: nzs ! table z-dimension size
+ integer, intent(in) :: nts ! table t-dimension size
+ real(r8), intent(in) :: tbl(nxs,nys,nzs,nts) ! table values to be interpolated
+ type(table_interp_wghts), intent(in) :: xwghts(ncol) ! x interpolation weights and indices
+ type(table_interp_wghts), intent(in) :: ywghts(ncol) ! y interpolation weights and indices
+ type(table_interp_wghts), intent(in) :: zwghts(ncol) ! z interpolation weights and indices
+ type(table_interp_wghts), intent(in) :: twghts(ncol) ! t interpolation weights and indices
+
+ real(r8) :: res(ncol)
+
+ real(r8) :: fx(8)
+ real(r8) :: fy(4)
+ real(r8) :: fz(2)
+
+ integer :: i
+
+ do i = 1,ncol
+
+ ! interp x dir
+ fx(1) = xwghts(i)%wt1*tbl(xwghts(i)%ix1,ywghts(i)%ix1,zwghts(i)%ix1,twghts(i)%ix1) & ! @ y1, z1, t1
+ + xwghts(i)%wt2*tbl(xwghts(i)%ix2,ywghts(i)%ix1,zwghts(i)%ix1,twghts(i)%ix1)
+ fx(2) = xwghts(i)%wt1*tbl(xwghts(i)%ix1,ywghts(i)%ix2,zwghts(i)%ix1,twghts(i)%ix1) & ! @ y2, z1, t1
+ + xwghts(i)%wt2*tbl(xwghts(i)%ix2,ywghts(i)%ix2,zwghts(i)%ix1,twghts(i)%ix1)
+
+ fx(3) = xwghts(i)%wt1*tbl(xwghts(i)%ix1,ywghts(i)%ix1,zwghts(i)%ix2,twghts(i)%ix1) & ! @ y1, z2, t1
+ + xwghts(i)%wt2*tbl(xwghts(i)%ix2,ywghts(i)%ix1,zwghts(i)%ix2,twghts(i)%ix1)
+ fx(4) = xwghts(i)%wt1*tbl(xwghts(i)%ix1,ywghts(i)%ix2,zwghts(i)%ix2,twghts(i)%ix1) & ! @ y2, z2, t1
+ + xwghts(i)%wt2*tbl(xwghts(i)%ix2,ywghts(i)%ix2,zwghts(i)%ix2,twghts(i)%ix1)
+
+ fx(5) = xwghts(i)%wt1*tbl(xwghts(i)%ix1,ywghts(i)%ix1,zwghts(i)%ix1,twghts(i)%ix2) & ! @ y1, z1, t2
+ + xwghts(i)%wt2*tbl(xwghts(i)%ix2,ywghts(i)%ix1,zwghts(i)%ix1,twghts(i)%ix2)
+ fx(6) = xwghts(i)%wt1*tbl(xwghts(i)%ix1,ywghts(i)%ix2,zwghts(i)%ix1,twghts(i)%ix2) & ! @ y2, z1, t2
+ + xwghts(i)%wt2*tbl(xwghts(i)%ix2,ywghts(i)%ix2,zwghts(i)%ix1,twghts(i)%ix2)
+
+ fx(7) = xwghts(i)%wt1*tbl(xwghts(i)%ix1,ywghts(i)%ix1,zwghts(i)%ix2,twghts(i)%ix2) & ! @ y1, z2, t2
+ + xwghts(i)%wt2*tbl(xwghts(i)%ix2,ywghts(i)%ix1,zwghts(i)%ix2,twghts(i)%ix2)
+ fx(8) = xwghts(i)%wt1*tbl(xwghts(i)%ix1,ywghts(i)%ix2,zwghts(i)%ix2,twghts(i)%ix2) & ! @ y2, z2, t2
+ + xwghts(i)%wt2*tbl(xwghts(i)%ix2,ywghts(i)%ix2,zwghts(i)%ix2,twghts(i)%ix2)
+
+ ! interp y dir
+ fy(1) = ywghts(i)%wt1*fx(1) + ywghts(i)%wt2*fx(2) ! @ z1, t1
+ fy(2) = ywghts(i)%wt1*fx(3) + ywghts(i)%wt2*fx(4) ! @ z2, t1
+ fy(3) = ywghts(i)%wt1*fx(5) + ywghts(i)%wt2*fx(6) ! @ z1, t2
+ fy(4) = ywghts(i)%wt1*fx(7) + ywghts(i)%wt2*fx(8) ! @ z2, t2
+
+ ! interp z dir
+ fz(1) = zwghts(i)%wt1*fy(1) + zwghts(i)%wt2*fy(2) ! @ t1
+ fz(2) = zwghts(i)%wt1*fy(3) + zwghts(i)%wt2*fy(4) ! @ t2
+
+ ! interp t dir
+ res(i) = twghts(i)%wt1*fz(1) + twghts(i)%wt2*fz(2)
+
+ end do
+
+ end function interp4d
+
+ !--------------------------------------------------------------------------
+ ! determines interpolation weights and indices for given values at the model columns
+ !--------------------------------------------------------------------------
+ pure function table_interp_calcwghts( ngrid, xgrid, ncols, xcols ) result(wghts)
+
+ integer, intent(in) :: ngrid ! number of grid point values
+ real(r8), intent(in) :: xgrid(ngrid) ! grid point values
+ integer, intent(in) :: ncols ! number of model columns
+ real(r8), intent(in) :: xcols(ncols) ! values at the model columns
+
+ type(table_interp_wghts) :: wghts(ncols) ! interpolations weights at the model columns
+
+ integer :: i
+ real(r8) :: xs(ncols)
+
+ xs(:) = xcols(:)
+
+ ! do not extrapolate beyond the edges of the table
+ where(xs < xgrid(1))
+ xs = xgrid(1)
+ end where
+ where(xs > xgrid(ngrid))
+ xs = xgrid(ngrid)
+ end where
+
+ do i = 1,ncols
+ wghts(i)%ix2 = find_index(ngrid,xgrid,xs(i))
+ wghts(i)%ix1 = wghts(i)%ix2 - 1
+ wghts(i)%wt1 = (xgrid(wghts(i)%ix2)-xs(i)) &
+ /(xgrid(wghts(i)%ix2)-xgrid(wghts(i)%ix1))
+ wghts(i)%wt2 = 1._r8 - wghts(i)%wt1
+ end do
+
+ end function table_interp_calcwghts
+
+ ! private methods
+ !--------------------------------------------------------------------------
+ !--------------------------------------------------------------------------
+ ! determines last index of grid vals of which is greater then or equal to
+ ! value vx
+ !--------------------------------------------------------------------------
+ pure function find_index( nvals, vals, vx ) result(res)
+ integer, intent(in) :: nvals
+ real(r8), intent(in) :: vals(nvals)
+ real(r8), intent(in) :: vx
+ integer :: res
+
+ integer :: ndx
+
+ res = -1
+
+ find_ndx: do ndx = 2, nvals
+ if (vals(ndx)>=vx) then
+ res = ndx
+ exit find_ndx
+ end if
+ end do find_ndx
+
+ end function find_index
+
+end module table_interp_mod
diff --git a/src/utils/zonal_mean_mod.F90 b/src/utils/zonal_mean_mod.F90
index 3c41a4b4ec..25e3f8564a 100644
--- a/src/utils/zonal_mean_mod.F90
+++ b/src/utils/zonal_mean_mod.F90
@@ -1318,105 +1318,32 @@ subroutine Invert_Matrix(I_Mat,Nbas,O_InvMat)
!
! Invert_Matrix: Given the NbasxNbas matrix, calculate and return
! the inverse of the matrix.
+ !
+ ! Implemented with the LAPACK DGESV routine.
+ !
!====================================================================
- real(r8),parameter:: TINY = 1.e-20_r8
!
! Passed Variables
!------------------
- real(r8),intent(in ):: I_Mat (:,:)
- integer ,intent(in ):: Nbas
- real(r8),intent(out):: O_InvMat(:,:)
+ real(r8), intent(inout) :: I_Mat(:,:) ! input matrix contains P*L*U
+ ! decomposition on output
+ integer, intent(in) :: Nbas
+ real(r8), intent(out) :: O_InvMat(:,:)
!
! Local Values
!-------------
- real(r8),allocatable:: Mwrk(:,:),Rscl(:)
- integer ,allocatable:: Indx(:)
- real(r8):: Psgn,Mmax,Mval,Sval
- integer :: ii,jj,kk,ndx,i2,ii_max, astat
+ integer, allocatable :: Indx(:) ! pivot indices
+ integer :: astat, ii
character(len=*), parameter :: subname = 'Invert_Matrix'
+ character(len=80) :: msg
+
+ external DGESV
! Allocate work space
!---------------------
- allocate(Mwrk(Nbas,Nbas), stat=astat)
- call handle_allocate_error(astat, subname, 'Mwrk')
- allocate(Rscl(Nbas), stat=astat)
- call handle_allocate_error(astat, subname, 'Rscl')
allocate(Indx(Nbas), stat=astat)
call handle_allocate_error(astat, subname, 'Indx')
- ! Copy the Input matrix so it can be decomposed
- !-------------------------------------------------
- Mwrk(1:Nbas,1:Nbas) = I_Mat(1:Nbas,1:Nbas)
-
- ! Initailize Row scales
- !----------------------
- Psgn = 1._r8
- do ii=1,Nbas
- Mmax = 0._r8
- do jj=1,Nbas
- if(abs(Mwrk(ii,jj))>Mmax) Mmax = abs(Mwrk(ii,jj))
- end do
- if(Mmax==0._r8) then
- call endrun('Invert_Matrix: Singular Matrix')
- endif
- Rscl(ii) = 1._r8/Mmax
- end do
-
- ! Decompose the matrix
- !-----------------------
- do jj=1,Nbas
-
- if(jj>1) then
- do ii=1,(jj-1)
- Sval = Mwrk(ii,jj)
- if(ii>1) then
- do kk=1,(ii-1)
- Sval = Sval - Mwrk(ii,kk)*Mwrk(kk,jj)
- end do
- Mwrk(ii,jj) = Sval
- endif
- end do
- endif
-
- Mmax = 0._r8
- do ii=jj,Nbas
- Sval = Mwrk(ii,jj)
- if(jj>1) then
- do kk=1,(jj-1)
- Sval = Sval - Mwrk(ii,kk)*Mwrk(kk,jj)
- end do
- Mwrk(ii,jj) = Sval
- endif
- Mval = Rscl(ii)*abs(Sval)
- if(Mval>=Mmax) then
- ii_max = ii
- Mmax = Mval
- endif
- end do
-
- if(jj/=ii_max) then
- do kk=1,Nbas
- Mval = Mwrk(ii_max,kk)
- Mwrk(ii_max,kk) = Mwrk(jj,kk)
- Mwrk(jj,kk) = Mval
- end do
- Psgn = -Psgn
- Rscl(ii_max) = Rscl(jj)
- endif
-
- Indx(jj) = ii_max
- if(jj/=Nbas) then
- if(Mwrk(jj,jj)==0._r8) Mwrk(jj,jj) = TINY
- Mval = 1._r8/Mwrk(jj,jj)
- do ii=(jj+1),Nbas
- Mwrk(ii,jj) = Mwrk(ii,jj)*Mval
- end do
- endif
-
- end do ! jj=1,Nbas
-
- if(Mwrk(Nbas,Nbas)==0._r8) Mwrk(Nbas,Nbas) = TINY
-
! Initialize the inverse array with the identity matrix
!-------------------------------------------------------
O_InvMat(:,:) = 0._r8
@@ -1424,41 +1351,15 @@ subroutine Invert_Matrix(I_Mat,Nbas,O_InvMat)
O_InvMat(ii,ii) = 1._r8
end do
- ! Back substitution to construct the inverse
- !---------------------------------------------
- do kk=1,Nbas
-
- i2 = 0
- do ii=11,Nbas
- ndx = Indx(ii)
- Sval = O_InvMat(ndx,kk)
- O_InvMat(ndx,kk) = O_InvMat(ii,kk)
- if(i2/=0) then
- do jj=i2,(ii-1)
- Sval = Sval - Mwrk(ii,jj)*O_InvMat(jj,kk)
- end do
- elseif(Sval/=0._r8) then
- i2 = ii
- endif
- O_InvMat(ii,kk) = Sval
- end do
+ call DGESV(Nbas, Nbas, I_Mat, Nbas, Indx, O_InvMat, Nbas, astat)
- do ii=Nbas,1,-1
- Sval = O_InvMat(ii,kk)
- if(ii 0) then
+ call endrun(subname//': DGESV error return: matrix is singular')
+ end if
- ! Clean up this mess
- !---------------------
- deallocate(Mwrk)
- deallocate(Rscl)
deallocate(Indx)
end subroutine Invert_Matrix
diff --git a/test/system/TR8.sh b/test/system/TR8.sh
index e107c702d3..f56c9bc636 100755
--- a/test/system/TR8.sh
+++ b/test/system/TR8.sh
@@ -54,12 +54,12 @@ fi
#Check Chemistry
if [ -d "${CAM_ROOT}/components/cam" ]; then
-ruby $ADDREALKIND_EXE -r r8 -l 1 -d $CAM_ROOT/components/cam/src/chemistry
+ruby $ADDREALKIND_EXE -r r8 -l 1 -d $CAM_ROOT/components/cam/src/chemistry -s geoschem
rc=`expr $? + $rc`
else
-ruby $ADDREALKIND_EXE -r r8 -l 1 -d $CAM_ROOT/src/chemistry
+ruby $ADDREALKIND_EXE -r r8 -l 1 -d $CAM_ROOT/src/chemistry -s geoschem
rc=`expr $? + $rc`
fi
diff --git a/test/system/archive_baseline.sh b/test/system/archive_baseline.sh
index adab681a88..8460923a1f 100755
--- a/test/system/archive_baseline.sh
+++ b/test/system/archive_baseline.sh
@@ -12,7 +12,7 @@ cat << EOF1
NAME
archive_baseline.sh - archive pretag baselines to set locations on
- hobart, izumi and cheyenne.
+ hobart, izumi and derecho.
SYNOPSIS
@@ -32,7 +32,7 @@ BASELINE ARCHIVED LOCATION
hobart, izumi: /fs/cgd/csm/models/atm/cam/pretag_bl/TAGNAME_pgi
/fs/cgd/csm/models/atm/cam/pretag_bl/TAGNAME_nag
- cheyenne: /glade/p/cesm/amwg/cesm_baselines/TAGNAME
+ derecho: /glade/campaign/cesm/community/amwg/cam_baselines/TAGNAME
@@ -93,14 +93,14 @@ case $hostname in
baselinedir="/fs/cgd/csm/models/atm/cam/pretag_bl/$cam_tag"
;;
- ch*)
- echo "server: cheyenne"
+ de*)
+ echo "server: derecho"
if [ -z "$CAM_FC" ]; then
CAM_FC="INTEL"
fi
- test_file_list="tests_pretag_cheyenne"
+ test_file_list="tests_pretag_derecho"
cam_tag=$1
- baselinedir="/glade/p/cesm/amwg/cesm_baselines/$cam_tag"
+ baselinedir="/glade/campaign/cesm/community/amwg/cam_baselines/$cam_tag"
;;
* ) echo "ERROR: machine $hostname not currently supported"; exit 1 ;;
@@ -122,7 +122,7 @@ if [ -n "$CESM_TESTDIR" ]; then
cp -r $CESM_TESTDIR/baselines/. $root_baselinedir/$cam_tag
else
echo "Using bless_test_results to archive baselines."
- ../../cime/scripts/Tools/bless_test_results -p -t '' -c '' -r $CESM_TESTDIR --baseline-root $root_baselinedir -b $cam_tag -f -s
+ ../../cime/CIME/Tools/bless_test_results -p -t '' -c '' -r $CESM_TESTDIR --baseline-root $root_baselinedir -b $cam_tag -f -s
fi
echo " "
diff --git a/test/system/test_driver.sh b/test/system/test_driver.sh
index 964f647793..80a632b14f 100755
--- a/test/system/test_driver.sh
+++ b/test/system/test_driver.sh
@@ -2,7 +2,7 @@
#
# test_driver.sh: driver for the testing of CAM with standalone scripts
#
-# usage on hobart, izumi, leehill, cheyenne
+# usage on hobart, izumi, leehill, derecho
# ./test_driver.sh
#
# **more details in the CAM testing user's guide, accessible
@@ -220,9 +220,9 @@ hostname=`hostname`
case $hostname in
- ##cheyenne
- ch* | r* )
- submit_script_cime="`pwd -P`/test_driver_cheyenne_cime_${cur_time}.sh"
+ ##derecho
+ derecho* | dec* )
+ submit_script_cime="`pwd -P`/test_driver_derecho_cime_${cur_time}.sh"
if [ -z "$CAM_ACCOUNT" ]; then
echo "ERROR: Must set the environment variable CAM_ACCOUNT"
@@ -230,30 +230,34 @@ case $hostname in
fi
if [ -z "$CAM_BATCHQ" ]; then
- export CAM_BATCHQ="regular"
+ export CAM_BATCHQ="main"
fi
# wallclock for run job
wallclock_limit="5:00:00"
if [ $gmake_j = 0 ]; then
- gmake_j=36
+ gmake_j=128
fi
- # run tests on 2 nodes using 18 tasks/node, 2 threads/task
- CAM_TASKS=36
+ # run tests on 1 node using 64 tasks/node, 2 threads/task
+ # These settings are ignored on derecho.
+ # PE layouts come from config_pes.xml.
+ CAM_TASKS=64
CAM_THREADS=2
- # change parallel configuration on 2 nodes using 32 tasks, 1 threads/task
+ # change parallel configuration on 1 nodes using 32 tasks, 1 threads/task
+ # These settings are ignored on derecho.
+ # PE layouts come from config_pes.xml.
CAM_RESTART_TASKS=32
CAM_RESTART_THREADS=1
- mach_workspace="/glade/scratch"
+ mach_workspace="/glade/derecho/scratch"
# Check for CESM baseline directory
if [ -n "${BL_TESTDIR}" ] && [ ! -d "${BL_TESTDIR}" ]; then
echo "CESM_BASELINE ${BL_TESTDIR} not found. Check BL_TESTDIR for correct tag name."
- exit
+ exit 3
fi
#-------------------------------------------
@@ -264,16 +268,16 @@ cat > ${submit_script_cime} << EOF
#PBS -N cime-tests
#PBS -q $CAM_BATCHQ
#PBS -A $CAM_ACCOUNT
-#PBS -l walltime=4:00:00
-#PBS -l select=1:ncpus=36:mpiprocs=36
+#PBS -l walltime=$wallclock_limit
+#PBS -l select=1:ncpus=128:mpiprocs=128
#PBS -j oe
-#PBS -l inception=login
EOF
##^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to batch script ^^^^^^^^^^^^^^^^^^^
;;
+
##hobart
hob* | h[[:digit:]]* )
submit_script_cime="`pwd -P`/test_driver_hobart_cime_${cur_time}.sh"
@@ -431,7 +435,7 @@ cat > ${submit_script_cime} << EOF
#PBS -N cime-tests
#PBS -q $CAM_BATCHQ
#PBS -A $CAM_ACCOUNT
-#PBS -l walltime=2:00:00
+#PBS -l walltime=$wallclock_limit
#PBS -l select=1:ncpus=36:mpiprocs=36:mem=300GB
#PBS -j oe
#PBS -V
@@ -448,8 +452,8 @@ esac
cesm_test_mach=""
comp=""
-if [ "${hostname:0:4}" == "chey" ]; then
- cesm_test_mach="cheyenne"
+if [ "${hostname:0:5}" == "derec" ] || [ "${hostname:0:3}" == "dec" ]; then
+ cesm_test_mach="derecho"
fi
if [ "${hostname:0:6}" == "hobart" ]; then
cesm_test_mach="hobart"
@@ -465,7 +469,7 @@ if [ -n "${CAM_FC}" ]; then
fi
if [ "${cesm_test_suite}" != "none" -a -n "${cesm_test_mach}" ]; then
- if [ "${hostname:0:5}" != "izumi" ]; then
+ if [ "${hostname:0:5}" != "izumi" ] && [ "${hostname:0:7}" != "derecho" ]; then
module load python
fi
@@ -547,8 +551,8 @@ if [ "${cesm_test_suite}" != "none" -a -n "${cesm_test_mach}" ]; then
testargs="${testargs} --xml-compiler intel"
fi
case $hostname in
- # cheyenne
- chey* | r* )
+ # derecho
+ derec* | dec* )
testargs="${testargs} --queue ${CAM_BATCHQ} --test-root ${cesm_testdir} --output-root ${cesm_testdir}"
;;
# casper
@@ -631,6 +635,13 @@ if [ "${cesm_test_suite}" != "none" -a -n "${cesm_test_mach}" ]; then
qsub ${submit_script_cime}
fi
+ if [ "${hostname:0:2}" == "de" ]; then
+ echo "cd ${script_dir}" >> ${submit_script_cime}
+ echo './create_test' ${testargs} >> ${submit_script_cime}
+ chmod u+x ${submit_script_cime}
+ qsub ${submit_script_cime}
+ fi
+
if [ "${hostname:0:6}" == "hobart" ]; then
echo "cd ${script_dir}" >> ${submit_script_cime}
echo './create_test' ${testargs} >> ${submit_script_cime}