diff --git a/bld/config_files/definition.xml b/bld/config_files/definition.xml
index f7ad495271..b11d767f18 100644
--- a/bld/config_files/definition.xml
+++ b/bld/config_files/definition.xml
@@ -310,5 +310,8 @@ SPCAM horizontal grid spacing, m
SPCAM time step, s
+
+Turns on aerocom
+
diff --git a/bld/configure b/bld/configure
index 97b6fa37ec..6447ecb64a 100755
--- a/bld/configure
+++ b/bld/configure
@@ -110,6 +110,7 @@ OPTIONS
Options used to determine the CAM model configuration. These options will have an
effect whether running CAM as part of CCSM or running in a CAM standalone mode:
+ -aerocom Enable AEROCOM cpp-def for OSLO_AERO
-[no]age_of_air_trcs Switch on [off] age of air tracers. Default: on for waccm_phys, otherwise off.
-analytic_ic Enables the (namelist controlled) dycore testing infrastructure
-aquaplanet Switch on aqua-planet mode.
@@ -290,6 +291,7 @@ my %opts = (
cache => "config_cache.xml",
);
GetOptions(
+ "aerocom!" => \$opts{'aerocom'},
"age_of_air_trcs!" => \$opts{'age_of_air_trcs'},
"analytic_ic" => \$opts{'analytic_ic'},
"aquaplanet" => \$opts{'aquaplanet'},
@@ -1437,7 +1439,6 @@ if ($chem_pkg =~ '_mam3') {
}
if ($chem_pkg =~ '_oslo') {
- #$chem_cppdefs = ' -DOSLO_AERO -DAEROCOM'
$chem_cppdefs = ' -DOSLO_AERO'
}
@@ -1974,6 +1975,14 @@ if ($clubb_sgs == 1) {
$cfg_cppdefs .= " -DCLUBB_REAL_TYPE=dp";
}
+# Turn on aerocom
+my $aerocom_opt = (defined $opts{'aerocom'}) ? 1 : 0;
+$cfg_ref->set('aerocom', $aerocom_opt);
+my $aerocom = $cfg_ref->get('aerocom');
+if ($aerocom eq 1) {
+ $cfg_cppdefs .= ' -DAEROCOM';
+}
+
# UNICON
if ($unicon) { $cfg_cppdefs .= ' -DUSE_UNICON'; }
diff --git a/cime_config/buildcpp b/cime_config/buildcpp
index 6fe4700825..4738a3ff70 100644
--- a/cime_config/buildcpp
+++ b/cime_config/buildcpp
@@ -40,6 +40,7 @@ def buildcpp(case):
compiler = case.get_value("COMPILER") # for chem preprocessor
nthrds_atm = case.get_value("NTHRDS_ATM")
cam_config_opts = case.get_value("CAM_CONFIG_OPTS")
+ cam_aerocom = case.get_value("CAM_AEROCOM")
# level information for CAM is part of the atm grid name - and must be stripped out
nlev = ''
@@ -99,6 +100,10 @@ def buildcpp(case):
if "-cosp" in config_opts:
config_opts += ["-cosp_libdir", os.path.join(exeroot, "atm", "obj", "cosp")]
+ print(f"cam_aerocom is {cam_aerocom}")
+ if cam_aerocom:
+ config_opts += [" -aerocom"]
+
camconf = os.path.join(caseroot, "Buildconf", "camconf")
if not os.path.isdir(camconf):
os.makedirs(camconf)
diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml
index b78f418f36..62172b9226 100644
--- a/cime_config/config_component.xml
+++ b/cime_config/config_component.xml
@@ -105,6 +105,14 @@
CAM dynamical core
+
+ logical
+ FALSE
+ build_component_cam
+ env_build.xml
+ If true, turn on aerocom diagnostics for oslo-aerosol package
+
+
char
diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml
index 615741931d..fab2d27a81 100644
--- a/cime_config/config_compsets.xml
+++ b/cime_config/config_compsets.xml
@@ -29,16 +29,15 @@
ALL data models must have a %phys option that corresponds to the data model mode
Each compset node is associated with the following elements
- - lname
- - alias
- - support (optional description of the support level for this compset)
-
+ - lname
+ - alias
+ - support (optional description of the support level for this compset)
Each compset node can also have the following attributes
- - grid (optional regular expression match for grid to work with the compset)
+ - grid (optional regular expression match for grid to work with the compset)
-
+
@@ -56,48 +55,50 @@
HIST_CAM60_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
+
-
-
+(1) CAM60%NORESM versus CAM60%PTAERO :
+CAM60%NORESM : the compsets used and created for CMIP6 use "NORESM" to activate typically NorESM2 settings
+CAM60%PTAERO : older compsets use "PTAERO" to activate typically NorESM2 settings
+
+(2) presence of frc2 (FRC2) in the compset name :
+WITHOUT "frc2" in name : uses multiple emission files per species (leads on fram HPC to irreprudicibility for fully-coupled compsets)
+WITH "frc2" in name : uses sligthly differently organized emission files
+- these emissions are very similar to "WITHOUT frc2"
+- they avoid the non-reproducibility issue on the fram HPC for fully-coupled simulations
+
+In the fully-coupled simulations most CMIP6 experiments have been run in the following way (as a general rule) :
+(i) f09 resolution : all simulations have been done WITH frc2.
+(ii) f19 resolution :
+piControl + historical + perturbed historical (hist-aer, hist-GHG, hist-nat) have been done WITHOUT frc2
+scenarios + perturbed scenarios : have been done WITH frc2
+
+Therefore, to have the best correspondence between atmosphere-only and fully-coupled simulations :
+some atmosphere-only compsets use FRC2, whereas others do not.
+
+
+(3) norbc, norpibc, norpddmsbc : refers to the type of boundary condtions used for SST, sea-ice cover, and upper-ocean DMS concentration
+norbc [ nor (NorESM) derived bc (boundary conditions) ] :
+boundary conditions are derived from a fully-coupled NorESM2 simulation (e.g., N1850 or NHIST)
+boundary conditions follow the "corresponding" fully coupled equivalent
+(e.g., NFHISTnorbc will use bc from NHIST, NF1850norbc will use bc from N1850)
+norpibc [ nor (NorESM) derived pi (pre-industrial) bc (boundary condtions) ] :
+boundary conditions are derived from a fully-coupled pre-industrial NorESM2 simulation (N1850).
+you impose explicitly that the "pre-industrial" boundary conditions are used : e.g., NFHISTnorpibc uses bc from N1850
+norpddmsbc [ nor (NorESM) derived pd (present-day) dms (DMS) bc (boundary conditions) ] :
+only DMS boundary conditions come from a fully-coupled NorESM2 simulation
+SST and sea-ice boundary conditions com from standard observation-based data set
+
+(4) grids
+f09_f09 and f19_f19 :
+When using NorESM-derived boundary conditions, we have opted to use the same land-sea mask (mtn14)
+
+ -->
+
+
NF1850
1850_CAM60%NORESM_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
@@ -138,110 +139,92 @@
NFHISTnorbc
HIST_CAM60%NORESM%NORBC_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NFHISTnorbc_pintcf
HIST_CAM60%NORESM%NORBC%PINTCF_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NFHISTnorbc_piaer
HIST_CAM60%NORESM%NORBC%PIAER_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NFHISTnorpibc
HIST_CAM60%NORESM%NORPIBC_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NFHISTnorpibc_ghgonly
1850_CAM60%NORESM%NORPIBC%GHGONLY_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NFHISTnorpibc_natonly
1850_CAM60%NORESM%NORPIBC%NATONLY_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NFHISTnorpibc_aeroxidonly
1850_CAM60%NORESM%NORPIBC%AEROXIDONLY_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NFHISTnorpibc_aeronly
1850_CAM60%NORESM%NORPIBC%AERONLY_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NFHISTnorpibc_oxidonly
1850_CAM60%NORESM%NORPIBC%OXIDONLY_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NFHISTnorpibc_ozoneonly
1850_CAM60%NORESM%NORPIBC%OZONEONLY_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NFHISTnorpibc_luonly
1850_CAM60%NORESM%NORPIBC%LUONLY_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NFSSP370frc2norbc
SSP370_CAM60%NORESM%NORBC%FRC2_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NFSSP370frc2norbc_aerlow
SSP370_CAM60%NORESM%NORBC%AERLOW%FRC2_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NFSSP245frc2norpibc
SSP245_CAM60%NORESM%NORPIBC%FRC2_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NFSSP245frc2norpibc_ghgonly
SSP245_CAM60%NORESM%NORPIBC%GHGONLY%FRC2_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NFSSP245frc2norpibc_natonly
SSP245_CAM60%NORESM%NORPIBC%NATONLY%FRC2_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NFSSP245frc2norpibc_aeronly
SSP245_CAM60%NORESM%NORPIBC%AERONLY%FRC2_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NFSSP245frc2norpibc_aeroxidonly
SSP245_CAM60%NORESM%NORPIBC%AEROXIDONLY%FRC2_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
@@ -253,157 +236,131 @@
NF1850norbc
1850_CAM60%NORESM%NORBC_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850frc2norbc
1850_CAM60%NORESM%NORBC%FRC2_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850norbc_4xco2
1850_CAM60%NORESM%NORBC%4xCO2_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850frc2norbc_4xco2
1850_CAM60%NORESM%NORBC%FRC2%4xCO2_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850norbc_2xco2
1850_CAM60%NORESM%NORBC%2xCO2_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850norbc_ghg2014
1850_CAM60%NORESM%NORBC%GHG2014_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850norbc_ghgnoh2o2014
1850_CAM60%NORESM%NORBC%GHGNOH2O2014_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850norbc_co22014
1850_CAM60%NORESM%NORBC%CO22014_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850norbc_n2o2014
1850_CAM60%NORESM%NORBC%N2O2014_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850norbc_ch42014
1850_CAM60%NORESM%NORBC%CH42014_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850norbc_ch4noh2o2014
1850_CAM60%NORESM%NORBC%CH4NOH2O2014_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850norbc_bc2014
1850_CAM60%NORESM%NORBC%BC2014_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850norbc_oc2014
1850_CAM60%NORESM%NORBC%OC2014_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850norbc_so22014
1850_CAM60%NORESM%NORBC%SO22014_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850norbc_aer2014
1850_CAM60%NORESM%NORBC%AER2014_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850frc2norbc_aer2014
1850_CAM60%NORESM%NORBC%AER2014%FRC2_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850norbc_aeroxid2014
1850_CAM60%NORESM%NORBC%AEROXID2014_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850frc2norbc_aeroxid2014
1850_CAM60%NORESM%NORBC%AEROXID2014%FRC2_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850norbc_ntcf2014
1850_CAM60%NORESM%NORBC%NTCF2014_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850norbc_anthro2014
1850_CAM60%NORESM%NORBC%ANTHRO2014_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850norbc_ghgozonelu2014
1850_CAM60%NORESM%NORBC%GHGOZONELU2014_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850norbc_so2oxid2014
1850_CAM60%NORESM%NORBC%SO2OXID2014_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850norbc_ozone2014
1850_CAM60%NORESM%NORBC%OZONE2014_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850norbc_h2o2014
1850_CAM60%NORESM%NORBC%H2O2014_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850norbc_oxid2014
1850_CAM60%NORESM%NORBC%OXID2014_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
NF1850frc2norbc_oxid2014
1850_CAM60%NORESM%NORBC%OXID2014%FRC2_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV
-
@@ -411,23 +368,16 @@
FDABIP04
2000_CAM%DABIP04_SLND_SICE_SOCN_SROF_SGLC_SWAV
-
-
-
FSCAM
2000_CAM60%SCAM_CLM50%SP_CICE%PRES_DOCN%DOM_SROF_SGLC_SWAV
-
FHS94
2000_CAM%HS94_SLND_SICE_SOCN_SROF_SGLC_SWAV
-
-
-
@@ -474,7 +424,6 @@
-
FHIST_DARTC6
HIST_CAM60_CLM50%SP_CICE%PRES_DOCN%DOM_SROF_SGLC_SWAV
@@ -704,135 +653,27 @@
- 1997-06-18
- 1979-01-01
+ 1997-06-18
+ 1979-01-01
2000-01-01
- 1979-01-01
- 1950-01-01
- 1995-01-01
- 1995-01-01
- 1995-01-01
- 2005-01-01
+ 1979-01-01
+ 1950-01-01
+ 1995-01-01
+ 1995-01-01
+ 1995-01-01
+ 2005-01-01
2015-01-01
- 2005-01-01
- 2010-01-01
- 2000-01-01
- 2004-01-01
- 1950-01-01
+ 2005-01-01
+ 2010-01-01
+ 2000-01-01
+ 2004-01-01
+ 1950-01-01
- 84585
-
-
-
-
-
-
- 288
-
-
-
-
-
- TRUE
-
-
-
-
-
-
- GREGORIAN
- GREGORIAN
-
-
-
-
-
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_48x96_clim_c050526.nc
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_1.9x2.5_clim_c061031.nc
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.9x1.25_clim_c040926.nc
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.47x0.63_clim_c061106.nc
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.23x0.31_clim_c110526.nc
-
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_1x1_1850_2017_c180507.nc
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_48x96_1850_2017_c180507.nc
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_1.9x2.5_1850_2017_c180507.nc
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.9x1.25_1850_2017_c180507.nc
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.47x0.63_1850_2017_c180507.nc
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.23x0.31_1850_2017_c180507.nc
-
-
- $DIN_LOC_ROOT/noresm-only/atm/cam/sst/fice-micom-divocn_sst-micom-dow_NHIST_f19_tn14_20190625_1849-2015_series_version20190726_ts.nc
- $DIN_LOC_ROOT/noresm-only/atm/cam/sst/fice-micom-divocn_sst-micom-dow_NSSP370frc2_f19_tn14_20191014_2014-2101_series_version20200109_ts.nc
-
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_1x1_clim_pi_c101029.nc
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_48x96_clim_pi_c101028.nc
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_1.9x2.5_clim_pi_c101028.nc
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.9x1.25_clim_pi_c101028.nc
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.47x0.63_clim_pi_c101028.nc
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.23x0.31_clim_pi_c101028.nc
-
-
- $DIN_LOC_ROOT/noresm-only/atm/cam/sst/fice-micom-divocn_sst-micom-dow_N1850frc2_f09_tn14_20191012_1351-1380_series_version20200106_clim.nc
- $DIN_LOC_ROOT/noresm-only/atm/cam/sst/fice-micom-divocn_sst-micom-dow_N1850_f19_tn14_20190621_1751-1780_series_version20190726_clim.nc
- $DIN_LOC_ROOT/noresm-only/atm/cam/sst/fice-micom-divocn_sst-micom-dow_N1850frc2_f09_tn14_20191012_1351-1380_series_version20200106_clim.nc
- $DIN_LOC_ROOT/noresm-only/atm/cam/sst/fice-micom-divocn_sst-micom-dow_N1850_f19_tn14_20190621_1751-1780_series_version20190726_clim.nc
-
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_1x1_2000climo_c180511.nc
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_48x96_2000climo_c180511.nc
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_1.9x2.5_2000climo_c180511.nc
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.9x1.25_2000climo_c180511.nc
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.47x0.63_2000climo_c180511.nc
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.23x0.31_2000climo_c180511.nc
-
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.9x1.25_clim_c040926.nc
- $DIN_LOC_ROOT/atm/cam/sst/f2000.waccm-mam3_1.9x2.5_L70.cam2.i.0017-01-01.c120410.nc
-
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_1x1_2010climo_c180511.nc
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_48x96_2010climo_c180511.nc
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_1.9x2.5_2010climo_c180511.nc
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.9x1.25_2010climo_c180511.nc
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.47x0.63_2010climo_c180511.nc
- $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.23x0.31_2010climo_c180511.nc
-
-
-
-
-
- $DIN_LOC_ROOT/atm/cam/ocnfrac/domain.ocn.fv0.9x1.25_tnx1v4.170609_djlo.nc
- $DIN_LOC_ROOT/atm/cam/ocnfrac/domain.ocn.fv1.9x2.5_tnx1v4.170609_djlo.nc
- $DIN_LOC_ROOT/atm/cam/ocnfrac/domain.ocn.fv0.9x1.25_tnx1v4.170609_djlo.nc
- $DIN_LOC_ROOT/atm/cam/ocnfrac/domain.ocn.fv1.9x2.5_tnx1v4.170609_djlo.nc
- $DIN_LOC_ROOT/atm/cam/ocnfrac/domain.camocn.48x96_gx3v7_100114.nc
- $DIN_LOC_ROOT/atm/cam/ocnfrac/domain.camocn.1.9x2.5_gx1v6_090403.nc
- $DIN_LOC_ROOT/atm/cam/ocnfrac/domain.camocn.0.9x1.25_gx1v6_090403.nc
- $DIN_LOC_ROOT/share/domains/domain.ocn.fv0.9x1.25_gx1v7.151020.nc
- $DIN_LOC_ROOT/atm/cam/ocnfrac/domain.camocn.0.47x0.63_gx1v6_090408.nc
- $DIN_LOC_ROOT/atm/cam/ocnfrac/domain.camocn.0.23x0.31_gx1v6_101108.nc
- $DIN_LOC_ROOT/ocn/docn7/domain.ocn.1x1.111007.nc
- $DIN_LOC_ROOT/atm/cam/ocnfrac/domain.camocn.48x96_gx3v7_100114.nc
- $DIN_LOC_ROOT/atm/cam/ocnfrac/domain.camocn.1.9x2.5_gx1v6_090403.nc
- $DIN_LOC_ROOT/atm/cam/ocnfrac/domain.camocn.0.9x1.25_gx1v6_090403.nc
- $DIN_LOC_ROOT/share/domains/domain.ocn.fv0.9x1.25_gx1v7.151020.nc
- $DIN_LOC_ROOT/atm/cam/ocnfrac/domain.camocn.0.47x0.63_gx1v6_090408.nc
- $DIN_LOC_ROOT/atm/cam/ocnfrac/domain.camocn.0.23x0.31_gx1v6_101108.nc
- $DIN_LOC_ROOT/ocn/docn7/domain.ocn.1x1.111007.nc
- $DIN_LOC_ROOT/atm/cam/ocnfrac/domain.camocn.48x96_gx3v7_100114.nc
- $DIN_LOC_ROOT/atm/cam/ocnfrac/domain.camocn.1.9x2.5_gx1v6_090403.nc
- $DIN_LOC_ROOT/atm/cam/ocnfrac/domain.camocn.0.9x1.25_gx1v6_090403.nc
- $DIN_LOC_ROOT/share/domains/domain.ocn.fv0.9x1.25_gx1v7.151020.nc
- $DIN_LOC_ROOT/atm/cam/ocnfrac/domain.camocn.0.47x0.63_gx1v6_090408.nc
- $DIN_LOC_ROOT/atm/cam/ocnfrac/domain.camocn.0.23x0.31_gx1v6_101108.nc
-
-
-
-
-
- 0
- 2016
+ 84585
@@ -868,19 +709,19 @@
- TRUE
+ TRUE
- 36.6
+ 36.6
- 262.5
+ 262.5
diff --git a/cime_config/testdefs/testlist_cam.xml b/cime_config/testdefs/testlist_cam.xml
index 4918a3b0df..38697fd45b 100644
--- a/cime_config/testdefs/testlist_cam.xml
+++ b/cime_config/testdefs/testlist_cam.xml
@@ -66,6 +66,14 @@
+
+
+
+
+
+
+
+
diff --git a/cime_config/testdefs/testmods_dirs/cam/aerocom/shell_commands b/cime_config/testdefs/testmods_dirs/cam/aerocom/shell_commands
new file mode 100644
index 0000000000..448f0dff8f
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/cam/aerocom/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange ROF_NCPL=\$ATM_NCPL
+./xmlchange GLC_NCPL=\$ATM_NCPL
+./xmlchange CAM_AEROCOM=TRUE
\ No newline at end of file
diff --git a/cime_config/testdefs/testmods_dirs/cam/aerocom/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/aerocom/user_nl_cam
new file mode 100644
index 0000000000..031b858464
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/cam/aerocom/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'
+fincl2='ATMEINT:I','qv_pre_PBL:I','ql_pre_PBL:I','qi_pre_PBL:I','uten_PBL:I','vten_PBL:I','qvten_PBL:I','qlten_PBL','qiten_PBL','BC_AcondTend:I','BC_NcondTend:I','BC_AIcondTend:I','BC_AXcondTend:I','BC_NIcondTend:I','OM_AIcondTend:I','OM_NIcondTend:I','SO4_A1condTend:I','SOA_A1condTend:I','SO4_NAcondTend:I','SOA_NAcondTend:I','FSUS_DRF:I'
diff --git a/cime_config/testdefs/testmods_dirs/cam/aerocom/user_nl_clm b/cime_config/testdefs/testmods_dirs/cam/aerocom/user_nl_clm
new file mode 100644
index 0000000000..0d83b5367b
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/cam/aerocom/user_nl_clm
@@ -0,0 +1,27 @@
+!----------------------------------------------------------------------------------
+! 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/usermods_dirs/cmip6_noresm/SourceMods/src.cam/preprocessorDefinitions.h b/cime_config/usermods_dirs/cmip6_noresm/SourceMods/src.cam/preprocessorDefinitions.h
deleted file mode 100755
index 3803258bdf..0000000000
--- a/cime_config/usermods_dirs/cmip6_noresm/SourceMods/src.cam/preprocessorDefinitions.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#define AEROCOM
-#define AEROFFL
diff --git a/cime_config/usermods_dirs/cmip6_noresm_fsst_hifreq_xaer/SourceMods/src.cam/preprocessorDefinitions.h b/cime_config/usermods_dirs/cmip6_noresm_fsst_hifreq_xaer/SourceMods/src.cam/preprocessorDefinitions.h
deleted file mode 100755
index 3803258bdf..0000000000
--- a/cime_config/usermods_dirs/cmip6_noresm_fsst_hifreq_xaer/SourceMods/src.cam/preprocessorDefinitions.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#define AEROCOM
-#define AEROFFL
diff --git a/cime_config/usermods_dirs/cmip6_noresm_fsst_xaer/SourceMods/src.cam/preprocessorDefinitions.h b/cime_config/usermods_dirs/cmip6_noresm_fsst_xaer/SourceMods/src.cam/preprocessorDefinitions.h
deleted file mode 100755
index 3803258bdf..0000000000
--- a/cime_config/usermods_dirs/cmip6_noresm_fsst_xaer/SourceMods/src.cam/preprocessorDefinitions.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#define AEROCOM
-#define AEROFFL
diff --git a/src/NorESM/cam_diagnostics.F90 b/src/NorESM/cam_diagnostics.F90
index 15ebbab3c6..f58ca9491f 100644
--- a/src/NorESM/cam_diagnostics.F90
+++ b/src/NorESM/cam_diagnostics.F90
@@ -77,17 +77,17 @@ module cam_diagnostics
! Physics buffer indices
-integer :: psl_idx = 0
-integer :: relhum_idx = 0
-integer :: qcwat_idx = 0
-integer :: tcwat_idx = 0
-integer :: lcwat_idx = 0
-integer :: cld_idx = 0
-integer :: concld_idx = 0
-integer :: tke_idx = 0
-integer :: kvm_idx = 0
-integer :: kvh_idx = 0
-integer :: cush_idx = 0
+integer :: psl_idx = 0
+integer :: relhum_idx = 0
+integer :: qcwat_idx = 0
+integer :: tcwat_idx = 0
+integer :: lcwat_idx = 0
+integer :: cld_idx = 0
+integer :: concld_idx = 0
+integer :: tke_idx = 0
+integer :: kvm_idx = 0
+integer :: kvh_idx = 0
+integer :: cush_idx = 0
integer :: t_ttend_idx = 0
integer :: prec_dp_idx = 0
@@ -171,7 +171,7 @@ subroutine diag_register()
end subroutine diag_register
!==============================================================================
-
+
subroutine diag_init_dry(pbuf2d)
! Declare the history fields for which this module contains outfld calls.
@@ -181,7 +181,7 @@ subroutine diag_init_dry(pbuf2d)
use physics_buffer, only: pbuf_set_field
use tidal_diag, only: tidal_diag_init
#ifdef OSLO_AERO
- use oslo_aero_share, only: nbmodes
+ use oslo_aero_share, only: nbmodes
#endif
type(physics_buffer_desc), pointer, intent(in) :: pbuf2d(:,:)
@@ -317,14 +317,14 @@ subroutine diag_init_dry(pbuf2d)
call addfld ('ABSVIS ',horiz_only, 'A','unitless','Aerosol absorptive optical depth at 0.442-0.625um') ! CAM4-Oslo: 0.35-0.64um
call addfld ('AODVVOLC ',horiz_only, 'A','unitless','CMIP6 volcanic aerosol optical depth at 0.442-0.625um') ! CAM4-Oslo: 0.35-0.64um
call addfld ('ABSVVOLC ',horiz_only, 'A','unitless','CMIP6 volcanic aerosol absorptive optical depth at 0.442-0.625um') ! CAM4-Oslo: 0.35-0.64um
- call addfld ('CAODVIS ',horiz_only, 'A','unitless','Clear air aerosol optical depth')
+ call addfld ('CAODVIS ',horiz_only, 'A','unitless','Clear air aerosol optical depth')
call addfld ('CABSVIS ',horiz_only, 'A','unitless','Clear air aerosol absorptive optical depth')
call addfld ('CLDFREE ',horiz_only, 'A','unitless','Cloud free fraction wrt CAODVIS and CABSVIS')
call addfld ('DAYFOC ',horiz_only, 'A','unitless','Daylight fraction')
call addfld ('N_AER ',(/'lev'/), 'A', 'unitless','Aerosol number concentration')
- call addfld ('SSAVIS ',(/'lev'/), 'A','unitless','Aerosol single scattering albedo in visible wavelength band')
- call addfld ('ASYMMVIS',(/'lev'/), 'A','unitless','Aerosol assymetry factor in visible wavelength band')
- call addfld ('EXTVIS ',(/'lev'/), 'A','1/km ','Aerosol extinction')
+ call addfld ('SSAVIS ',(/'lev'/), 'A','unitless','Aerosol single scattering albedo in visible wavelength band')
+ call addfld ('ASYMMVIS',(/'lev'/), 'A','unitless','Aerosol assymetry factor in visible wavelength band')
+ call addfld ('EXTVIS ',(/'lev'/), 'A','1/km ','Aerosol extinction')
call addfld ('BVISVOLC ',(/'lev'/), 'A','1/km ','CMIP6 volcanic aerosol extinction at 0.442-0.625um')
! AEROFFL start
@@ -344,132 +344,132 @@ subroutine diag_init_dry(pbuf2d)
! AEROFFL end
if (do_aerocom) then
- call addfld ('AKCXS ',horiz_only, 'A','mg/m2 ','Scheme excess aerosol mass burden')
+ call addfld ('AKCXS ',horiz_only, 'A','mg/m2 ','Scheme excess aerosol mass burden')
call addfld ('PMTOT ',horiz_only, 'A','ug/m3 ','Aerosol PM, all sizes')
call addfld ('PM25 ',horiz_only, 'A','ug/m3 ','Aerosol PM2.5')
call addfld ('PM2P5 ',(/'lev'/), 'A','ug/m3 ','3D aerosol PM2.5')
call addfld ('MMRPM2P5',(/'lev'/), 'A','kg/kg ','3D aerosol PM2.5 mass mixing ratio')
call addfld ('MMRPM1 ',(/'lev'/), 'A','kg/kg ','3D aerosol PM1.0 mass mixing ratio')
- call addfld ('MMRPM2P5_SRF',horiz_only, 'A','kg/kg ','Aerosol PM2.5 mass mixing ratio in bottom layer')
+ call addfld ('MMRPM2P5_SRF',horiz_only, 'A','kg/kg ','Aerosol PM2.5 mass mixing ratio in bottom layer')
call addfld ('GRIDAREA',horiz_only, 'A','m2 ','Grid area for 1.9x2.5 horizontal resolution')
call addfld ('DAERH2O ',horiz_only, 'A', 'mg/m2 ','Aerosol water load')
call addfld ('MMR_AH2O',(/'lev'/), 'A', 'kg/kg ','Aerosol water mmr')
- call addfld ('ECDRYAER',(/'lev'/), 'A', 'kg/kg ','Dry aerosol extinction at 550nm')
- call addfld ('ABSDRYAE',(/'lev'/), 'A','m-1 ','Dry aerosol absorption at 550nm')
- call addfld ('ECDRY440',(/'lev'/), 'A','m-1 ','Dry aerosol extinction at 440nm')
- call addfld ('ABSDR440',(/'lev'/),'A','m-1 ','Dry aerosol absorption at 440nm')
- call addfld ('ECDRY870',(/'lev'/),'A','m-1 ','Dry aerosol extinction at 870nm')
- call addfld ('ABSDR870',(/'lev'/),'A','m-1 ','Dry aerosol absorption at 870nm')
- call addfld ('ASYMMDRY',(/'lev'/),'A','unitless','Dry asymmetry factor in visible wavelength band')
+ call addfld ('ECDRYAER',(/'lev'/), 'A', 'kg/kg ','Dry aerosol extinction at 550nm')
+ call addfld ('ABSDRYAE',(/'lev'/), 'A','m-1 ','Dry aerosol absorption at 550nm')
+ call addfld ('ECDRY440',(/'lev'/), 'A','m-1 ','Dry aerosol extinction at 440nm')
+ call addfld ('ABSDR440',(/'lev'/),'A','m-1 ','Dry aerosol absorption at 440nm')
+ call addfld ('ECDRY870',(/'lev'/),'A','m-1 ','Dry aerosol extinction at 870nm')
+ call addfld ('ABSDR870',(/'lev'/),'A','m-1 ','Dry aerosol absorption at 870nm')
+ call addfld ('ASYMMDRY',(/'lev'/),'A','unitless','Dry asymmetry factor in visible wavelength band')
call addfld ('ECDRYLT1',(/'lev'/),'A','m-1 ','Dry aerosol extinction at 550nm lt05')
call addfld ('ABSDRYBC',(/'lev'/),'A','m-1 ','Dry BC absorption at 550nm')
call addfld ('ABSDRYOC',(/'lev'/),'A','m-1 ','Dry OC absorption at 550nm')
call addfld ('ABSDRYSU',(/'lev'/),'A','m-1 ','Dry sulfate absorption at 550nm')
call addfld ('ABSDRYSS',(/'lev'/),'A','m-1 ','Dry sea-salt absorption at 550nm')
call addfld ('ABSDRYDU',(/'lev'/),'A','m-1 ','Dry dust absorption at 550nm')
- call addfld ('OD550DRY',horiz_only,'A','unitless','Dry aerosol optical depth at 550nm')
- call addfld ('AB550DRY',horiz_only, 'A','unitless','Dry aerosol absorptive optical depth at 550nm')
+ call addfld ('OD550DRY',horiz_only,'A','unitless','Dry aerosol optical depth at 550nm')
+ call addfld ('AB550DRY',horiz_only, 'A','unitless','Dry aerosol absorptive optical depth at 550nm')
call addfld ('DERLT05 ',horiz_only, 'A','um ','Effective aerosol dry radius<0.5um')
- call addfld ('DERGT05 ',horiz_only, 'A','um ','Effective aerosol dry radius>0.5um')
- call addfld ('DER ',horiz_only, 'A','um ','Effective aerosol dry radius')
- call addfld ('DOD440 ',horiz_only, 'A', 'unitless','Aerosol optical depth at 440nm')
- call addfld ('ABS440 ',horiz_only, 'A', 'unitless','Aerosol absorptive optical depth at 440nm')
- call addfld ('DOD500 ',horiz_only, 'A', 'unitless','Aerosol optical depth at 500nm')
- call addfld ('ABS500 ',horiz_only, 'A', 'unitless','Aerosol absorptive optical depth at 500nm')
- call addfld ('DOD550 ',horiz_only, 'A','unitless','Aerosol optical depth at 550nm')
- call addfld ('ABS550 ',horiz_only, 'A','unitless','Aerosol absorptive optical depth at 550nm')
- call addfld ('ABS550AL',horiz_only, 'A','unitless','Alt. aerosol absorptive optical depth at 550nm')
- call addfld ('DOD670 ',horiz_only, 'A','unitless','Aerosol optical depth at 670nm')
- call addfld ('ABS670 ',horiz_only, 'A','unitless','Aerosol absorptive optical depth at 670nm')
- call addfld ('DOD870 ',horiz_only, 'A','unitless','Aerosol optical depth at 870nm')
- call addfld ('ABS870 ',horiz_only, 'A','unitless','Aerosol absorptive optical depth at 870nm')
- call addfld ('DLOAD_MI',horiz_only, 'A','mg/m2 ','mineral aerosol load')
- call addfld ('DLOAD_SS',horiz_only, 'A','mg/m2 ','sea-salt aerosol load')
- call addfld ('DLOAD_S4',horiz_only, 'A','mg/m2 ','sulfate aerosol load')
- call addfld ('DLOAD_OC',horiz_only, 'A','mg/m2 ','OC aerosol load')
- call addfld ('DLOAD_BC',horiz_only, 'A','mg/m2 ','BC aerosol load')
-
- call addfld ('LOADBCAC',horiz_only, 'A','mg/m2 ','BC aerosol coag load')
- call addfld ('LOADBC0 ',horiz_only, 'A','mg/m2 ','BC aerosol mode 0 load')
- call addfld ('LOADBC2 ',horiz_only, 'A','mg/m2 ','BC aerosol mode 2 load')
- call addfld ('LOADBC4 ',horiz_only, 'A','mg/m2 ','BC aerosol mode 4 load')
- call addfld ('LOADBC12',horiz_only, 'A','mg/m2 ','BC aerosol mode 12 load')
- call addfld ('LOADBC14',horiz_only, 'A','mg/m2 ','BC aerosol mode 14 load')
- call addfld ('LOADOCAC',horiz_only, 'A','mg/m2 ','OC aerosol coag load')
- call addfld ('LOADOC3 ',horiz_only, 'A','mg/m2 ','OC aerosol mode 3 load')
- call addfld ('LOADOC4 ',horiz_only, 'A','mg/m2 ','OC aerosol mode 4 load')
- call addfld ('LOADOC13',horiz_only, 'A','mg/m2 ','OC aerosol mode 13 load')
- call addfld ('LOADOC14',horiz_only, 'A','mg/m2 ','OC aerosol mode 14 load')
+ call addfld ('DERGT05 ',horiz_only, 'A','um ','Effective aerosol dry radius>0.5um')
+ call addfld ('DER ',horiz_only, 'A','um ','Effective aerosol dry radius')
+ call addfld ('DOD440 ',horiz_only, 'A', 'unitless','Aerosol optical depth at 440nm')
+ call addfld ('ABS440 ',horiz_only, 'A', 'unitless','Aerosol absorptive optical depth at 440nm')
+ call addfld ('DOD500 ',horiz_only, 'A', 'unitless','Aerosol optical depth at 500nm')
+ call addfld ('ABS500 ',horiz_only, 'A', 'unitless','Aerosol absorptive optical depth at 500nm')
+ call addfld ('DOD550 ',horiz_only, 'A','unitless','Aerosol optical depth at 550nm')
+ call addfld ('ABS550 ',horiz_only, 'A','unitless','Aerosol absorptive optical depth at 550nm')
+ call addfld ('ABS550AL',horiz_only, 'A','unitless','Alt. aerosol absorptive optical depth at 550nm')
+ call addfld ('DOD670 ',horiz_only, 'A','unitless','Aerosol optical depth at 670nm')
+ call addfld ('ABS670 ',horiz_only, 'A','unitless','Aerosol absorptive optical depth at 670nm')
+ call addfld ('DOD870 ',horiz_only, 'A','unitless','Aerosol optical depth at 870nm')
+ call addfld ('ABS870 ',horiz_only, 'A','unitless','Aerosol absorptive optical depth at 870nm')
+ call addfld ('DLOAD_MI',horiz_only, 'A','mg/m2 ','mineral aerosol load')
+ call addfld ('DLOAD_SS',horiz_only, 'A','mg/m2 ','sea-salt aerosol load')
+ call addfld ('DLOAD_S4',horiz_only, 'A','mg/m2 ','sulfate aerosol load')
+ call addfld ('DLOAD_OC',horiz_only, 'A','mg/m2 ','OC aerosol load')
+ call addfld ('DLOAD_BC',horiz_only, 'A','mg/m2 ','BC aerosol load')
+
+ call addfld ('LOADBCAC',horiz_only, 'A','mg/m2 ','BC aerosol coag load')
+ call addfld ('LOADBC0 ',horiz_only, 'A','mg/m2 ','BC aerosol mode 0 load')
+ call addfld ('LOADBC2 ',horiz_only, 'A','mg/m2 ','BC aerosol mode 2 load')
+ call addfld ('LOADBC4 ',horiz_only, 'A','mg/m2 ','BC aerosol mode 4 load')
+ call addfld ('LOADBC12',horiz_only, 'A','mg/m2 ','BC aerosol mode 12 load')
+ call addfld ('LOADBC14',horiz_only, 'A','mg/m2 ','BC aerosol mode 14 load')
+ call addfld ('LOADOCAC',horiz_only, 'A','mg/m2 ','OC aerosol coag load')
+ call addfld ('LOADOC3 ',horiz_only, 'A','mg/m2 ','OC aerosol mode 3 load')
+ call addfld ('LOADOC4 ',horiz_only, 'A','mg/m2 ','OC aerosol mode 4 load')
+ call addfld ('LOADOC13',horiz_only, 'A','mg/m2 ','OC aerosol mode 13 load')
+ call addfld ('LOADOC14',horiz_only, 'A','mg/m2 ','OC aerosol mode 14 load')
!
- call addfld ('EC550AER',(/'lev'/),'A','m-1 ','aerosol extinction coefficient')
- call addfld ('ABS550_A',(/'lev'/),'A','m-1 ','aerosol absorption coefficient')
- call addfld ('BS550AER',(/'lev'/),'A','m-1 sr-1','aerosol backscatter coefficient')
+ call addfld ('EC550AER',(/'lev'/),'A','m-1 ','aerosol extinction coefficient')
+ call addfld ('ABS550_A',(/'lev'/),'A','m-1 ','aerosol absorption coefficient')
+ call addfld ('BS550AER',(/'lev'/),'A','m-1 sr-1','aerosol backscatter coefficient')
!
- call addfld ('EC550SO4',(/'lev'/),'A','m-1 ','SO4 aerosol extinction coefficient')
- call addfld ('EC550BC ',(/'lev'/),'A','m-1 ','BC aerosol extinction coefficient')
- call addfld ('EC550POM',(/'lev'/), 'A','m-1 ','POM aerosol extinction coefficient')
- call addfld ('EC550SS ',(/'lev'/), 'A','m-1 ','SS aerosol extinction coefficient')
- call addfld ('EC550DU ',(/'lev'/), 'A','m-1 ','DU aerosol extinction coefficient')
+ call addfld ('EC550SO4',(/'lev'/),'A','m-1 ','SO4 aerosol extinction coefficient')
+ call addfld ('EC550BC ',(/'lev'/),'A','m-1 ','BC aerosol extinction coefficient')
+ call addfld ('EC550POM',(/'lev'/), 'A','m-1 ','POM aerosol extinction coefficient')
+ call addfld ('EC550SS ',(/'lev'/), 'A','m-1 ','SS aerosol extinction coefficient')
+ call addfld ('EC550DU ',(/'lev'/), 'A','m-1 ','DU aerosol extinction coefficient')
!
- call addfld ('CDOD440 ',horiz_only, 'A','unitless','Clear air Aerosol optical depth at 440nm')
- call addfld ('CDOD550 ',horiz_only, 'A','unitless','Clear air Aerosol optical depth at 550nm')
- call addfld ('CABS550 ',horiz_only, 'A','unitless','Clear air Aerosol abs optical depth at 550nm')
- call addfld ('CABS550A ',horiz_only, 'A','unitless','Clear air Aerosol abs optical depth at 550nm')
- call addfld ('CDOD870 ' ,horiz_only, 'A','unitless','Clear air Aerosol optical depth at 870nm')
- call addfld ('A550_DU ' ,horiz_only, 'A','unitless', 'mineral abs. aerosol optical depth 550nm')
- call addfld ('A550_SS ' ,horiz_only, 'A','unitless','sea-salt abs aerosol optical depth 550nm')
- call addfld ('A550_SO4' ,horiz_only, 'A','unitless','SO4 aerosol abs. optical depth 550nm')
- call addfld ('A550_POM' ,horiz_only, 'A','unitless', 'OC abs. aerosol optical depth 550nm')
+ call addfld ('CDOD440 ',horiz_only, 'A','unitless','Clear air Aerosol optical depth at 440nm')
+ call addfld ('CDOD550 ',horiz_only, 'A','unitless','Clear air Aerosol optical depth at 550nm')
+ call addfld ('CABS550 ',horiz_only, 'A','unitless','Clear air Aerosol abs optical depth at 550nm')
+ call addfld ('CABS550A ',horiz_only, 'A','unitless','Clear air Aerosol abs optical depth at 550nm')
+ call addfld ('CDOD870 ' ,horiz_only, 'A','unitless','Clear air Aerosol optical depth at 870nm')
+ call addfld ('A550_DU ' ,horiz_only, 'A','unitless', 'mineral abs. aerosol optical depth 550nm')
+ call addfld ('A550_SS ' ,horiz_only, 'A','unitless','sea-salt abs aerosol optical depth 550nm')
+ call addfld ('A550_SO4' ,horiz_only, 'A','unitless','SO4 aerosol abs. optical depth 550nm')
+ call addfld ('A550_POM' ,horiz_only, 'A','unitless', 'OC abs. aerosol optical depth 550nm')
call addfld ('A550_BC ' ,horiz_only, 'A','unitless', 'BC abs. aerosol optical depth 550nm')
- call addfld ('D440_DU ',horiz_only, 'A','unitless','mineral aerosol optical depth 440nm')
- call addfld ('D440_SS ',horiz_only, 'A','unitless','sea-salt aerosol optical depth 440nm')
- call addfld ('D440_SO4',horiz_only, 'A','unitless','SO4 aerosol optical depth 440nm')
- call addfld ('D440_POM',horiz_only, 'A','unitless','OC aerosol optical depth 440nm')
- call addfld ('D440_BC ',horiz_only, 'A','unitless','BC aerosol optical depth 440nm')
- call addfld ('D500_DU ',horiz_only, 'A','unitless','mineral aerosol optical depth 500nm')
- call addfld ('D500_SS ',horiz_only, 'A','unitless','sea-salt aerosol optical depth 500nm')
- call addfld ('D500_SO4',horiz_only, 'A','unitless','SO4 aerosol optical depth 500nm')
- call addfld ('D500_POM',horiz_only, 'A','unitless','OC aerosol optical depth 500nm')
- call addfld ('D500_BC ',horiz_only, 'A','unitless','BC aerosol optical depth 500nm')
- call addfld ('D550_DU ',horiz_only, 'A','unitless','mineral aerosol optical depth 550nm')
- call addfld ('D550_SS ',horiz_only, 'A','unitless','sea-salt aerosol optical depth 550nm')
- call addfld ('D550_SO4',horiz_only, 'A','unitless','SO4 aerosol optical depth 550nm')
- call addfld ('D550_POM',horiz_only, 'A','unitless','OC aerosol optical depth 550nm')
- call addfld ('D550_BC ',horiz_only, 'A','unitless','BC aerosol optical depth 550nm')
- call addfld ('D670_DU ',horiz_only, 'A','unitless','mineral aerosol optical depth 670nm')
- call addfld ('D670_SS ',horiz_only, 'A','unitless','sea-salt aerosol optical depth 670nm')
- call addfld ('D670_SO4',horiz_only, 'A','unitless','SO4 aerosol optical depth 670nm')
- call addfld ('D670_POM',horiz_only, 'A','unitless','OC aerosol optical depth 670nm')
- call addfld ('D670_BC ',horiz_only, 'A','unitless','BC aerosol optical depth 670nm')
- call addfld ('D870_DU ',horiz_only, 'A','unitless','mineral aerosol optical depth 870nm')
- call addfld ('D870_SS ',horiz_only, 'A','unitless','sea-salt aerosol optical depth 870nm')
- call addfld ('D870_SO4',horiz_only, 'A','unitless','SO4 aerosol optical depth 870nm')
- call addfld ('D870_POM',horiz_only, 'A','unitless','OC aerosol optical depth 870nm')
- call addfld ('D870_BC ',horiz_only, 'A','unitless','BC aerosol optical depth 870nm')
- call addfld ('DLT_DUST',horiz_only, 'A','unitless','mineral aerosol optical depth 550nm lt05')
- call addfld ('DLT_SS ',horiz_only, 'A','unitless','sea-salt aerosol optical depth 550nm lt05')
- call addfld ('DLT_SO4 ',horiz_only, 'A','unitless','SO4 aerosol optical depth 550nm lt05')
- call addfld ('DLT_POM ',horiz_only, 'A','unitless','OC aerosol optical depth 550nm lt05')
- call addfld ('DLT_BC ',horiz_only, 'A','unitless','BC aerosol optical depth 550nm lt05')
- call addfld ('DGT_DUST',horiz_only, 'A','unitless','mineral aerosol optical depth 550nm gt05')
- call addfld ('DGT_SS ',horiz_only, 'A','unitless','sea-salt aerosol optical depth 550nm gt05')
- call addfld ('DGT_SO4 ',horiz_only, 'A','unitless','SO4 aerosol optical depth 550nm gt05')
- call addfld ('DGT_POM ',horiz_only, 'A','unitless','OC aerosol optical depth 550nm gt05')
- call addfld ('DGT_BC ',horiz_only, 'A','unitless','BC aerosol optical depth 550nm gt05')
+ call addfld ('D440_DU ',horiz_only, 'A','unitless','mineral aerosol optical depth 440nm')
+ call addfld ('D440_SS ',horiz_only, 'A','unitless','sea-salt aerosol optical depth 440nm')
+ call addfld ('D440_SO4',horiz_only, 'A','unitless','SO4 aerosol optical depth 440nm')
+ call addfld ('D440_POM',horiz_only, 'A','unitless','OC aerosol optical depth 440nm')
+ call addfld ('D440_BC ',horiz_only, 'A','unitless','BC aerosol optical depth 440nm')
+ call addfld ('D500_DU ',horiz_only, 'A','unitless','mineral aerosol optical depth 500nm')
+ call addfld ('D500_SS ',horiz_only, 'A','unitless','sea-salt aerosol optical depth 500nm')
+ call addfld ('D500_SO4',horiz_only, 'A','unitless','SO4 aerosol optical depth 500nm')
+ call addfld ('D500_POM',horiz_only, 'A','unitless','OC aerosol optical depth 500nm')
+ call addfld ('D500_BC ',horiz_only, 'A','unitless','BC aerosol optical depth 500nm')
+ call addfld ('D550_DU ',horiz_only, 'A','unitless','mineral aerosol optical depth 550nm')
+ call addfld ('D550_SS ',horiz_only, 'A','unitless','sea-salt aerosol optical depth 550nm')
+ call addfld ('D550_SO4',horiz_only, 'A','unitless','SO4 aerosol optical depth 550nm')
+ call addfld ('D550_POM',horiz_only, 'A','unitless','OC aerosol optical depth 550nm')
+ call addfld ('D550_BC ',horiz_only, 'A','unitless','BC aerosol optical depth 550nm')
+ call addfld ('D670_DU ',horiz_only, 'A','unitless','mineral aerosol optical depth 670nm')
+ call addfld ('D670_SS ',horiz_only, 'A','unitless','sea-salt aerosol optical depth 670nm')
+ call addfld ('D670_SO4',horiz_only, 'A','unitless','SO4 aerosol optical depth 670nm')
+ call addfld ('D670_POM',horiz_only, 'A','unitless','OC aerosol optical depth 670nm')
+ call addfld ('D670_BC ',horiz_only, 'A','unitless','BC aerosol optical depth 670nm')
+ call addfld ('D870_DU ',horiz_only, 'A','unitless','mineral aerosol optical depth 870nm')
+ call addfld ('D870_SS ',horiz_only, 'A','unitless','sea-salt aerosol optical depth 870nm')
+ call addfld ('D870_SO4',horiz_only, 'A','unitless','SO4 aerosol optical depth 870nm')
+ call addfld ('D870_POM',horiz_only, 'A','unitless','OC aerosol optical depth 870nm')
+ call addfld ('D870_BC ',horiz_only, 'A','unitless','BC aerosol optical depth 870nm')
+ call addfld ('DLT_DUST',horiz_only, 'A','unitless','mineral aerosol optical depth 550nm lt05')
+ call addfld ('DLT_SS ',horiz_only, 'A','unitless','sea-salt aerosol optical depth 550nm lt05')
+ call addfld ('DLT_SO4 ',horiz_only, 'A','unitless','SO4 aerosol optical depth 550nm lt05')
+ call addfld ('DLT_POM ',horiz_only, 'A','unitless','OC aerosol optical depth 550nm lt05')
+ call addfld ('DLT_BC ',horiz_only, 'A','unitless','BC aerosol optical depth 550nm lt05')
+ call addfld ('DGT_DUST',horiz_only, 'A','unitless','mineral aerosol optical depth 550nm gt05')
+ call addfld ('DGT_SS ',horiz_only, 'A','unitless','sea-salt aerosol optical depth 550nm gt05')
+ call addfld ('DGT_SO4 ',horiz_only, 'A','unitless','SO4 aerosol optical depth 550nm gt05')
+ call addfld ('DGT_POM ',horiz_only, 'A','unitless','OC aerosol optical depth 550nm gt05')
+ call addfld ('DGT_BC ',horiz_only, 'A','unitless','BC aerosol optical depth 550nm gt05')
call addfld ('AIRMASS ',horiz_only, 'A','kg/m2 ','Vertically integrated airmass') !akc6
- call addfld ('NNAT_0 ',(/'lev'/),'A','1/cm3 ','Aerosol mode 0 number concentration')
- call addfld ('NNAT_1 ',(/'lev'/),'A','1/cm3 ','Aerosol mode 1 number concentration')
- call addfld ('NNAT_2 ',(/'lev'/),'A','1/cm3 ','Aerosol mode 2 number concentration')
- call addfld ('NNAT_4 ',(/'lev'/),'A','1/cm3 ','Aerosol mode 4 number concentration')
- call addfld ('NNAT_5 ',(/'lev'/),'A','1/cm3 ','Aerosol mode 5 number concentration')
- call addfld ('NNAT_6 ',(/'lev'/),'A','1/cm3 ','Aerosol mode 6 number concentration')
- call addfld ('NNAT_7 ',(/'lev'/),'A','1/cm3 ','Aerosol mode 7 number concentration')
- call addfld ('NNAT_8 ',(/'lev'/),'A','1/cm3 ','Aerosol mode 8 number concentration')
- call addfld ('NNAT_9 ',(/'lev'/),'A','1/cm3 ','Aerosol mode 9 number concentration')
- call addfld ('NNAT_10 ',(/'lev'/),'A','1/cm3 ','Aerosol mode 10 number concentration')
- call addfld ('NNAT_12 ',(/'lev'/),'A','1/cm3 ','Aerosol mode 12 number concentration')
- call addfld ('NNAT_14 ',(/'lev'/),'A','1/cm3 ','Aerosol mode 14 number concentration')
- call addfld ('AIRMASSL',(/'lev'/),'A','kg/m2 ','Layer airmass')
+ call addfld ('NNAT_0 ',(/'lev'/),'A','1/cm3 ','Aerosol mode 0 number concentration')
+ call addfld ('NNAT_1 ',(/'lev'/),'A','1/cm3 ','Aerosol mode 1 number concentration')
+ call addfld ('NNAT_2 ',(/'lev'/),'A','1/cm3 ','Aerosol mode 2 number concentration')
+ call addfld ('NNAT_4 ',(/'lev'/),'A','1/cm3 ','Aerosol mode 4 number concentration')
+ call addfld ('NNAT_5 ',(/'lev'/),'A','1/cm3 ','Aerosol mode 5 number concentration')
+ call addfld ('NNAT_6 ',(/'lev'/),'A','1/cm3 ','Aerosol mode 6 number concentration')
+ call addfld ('NNAT_7 ',(/'lev'/),'A','1/cm3 ','Aerosol mode 7 number concentration')
+ call addfld ('NNAT_8 ',(/'lev'/),'A','1/cm3 ','Aerosol mode 8 number concentration')
+ call addfld ('NNAT_9 ',(/'lev'/),'A','1/cm3 ','Aerosol mode 9 number concentration')
+ call addfld ('NNAT_10 ',(/'lev'/),'A','1/cm3 ','Aerosol mode 10 number concentration')
+ call addfld ('NNAT_12 ',(/'lev'/),'A','1/cm3 ','Aerosol mode 12 number concentration')
+ call addfld ('NNAT_14 ',(/'lev'/),'A','1/cm3 ','Aerosol mode 14 number concentration')
+ call addfld ('AIRMASSL',(/'lev'/),'A','kg/m2 ','Layer airmass')
call addfld ('BETOTVIS',(/'lev'/),'A','1/km','Aerosol 3d extinction at 0.442-0.625') ! CAM4-Oslo: 0.35-0.64um
call addfld ('BATOTVIS',(/'lev'/),'A','1/km','Aerosol 3d absorption at 0.442-0.625') ! CAM4-Oslo: 0.35-0.64um
call addfld ('BATSW13 ',(/'lev'/),'A','1/km','Aerosol 3d SW absorption at 3.077-3.846um')
@@ -481,17 +481,17 @@ subroutine diag_init_dry(pbuf2d)
if(i.lt.10) modeString="0"//adjustl(modeString)
varName = "Camrel"//trim(modeString)
if(i.ne.3) call addfld(varName, (/'lev'/),'A','unitless', 'relative added mass for mode'//modeString)
- enddo
+ enddo
do i=1,nbmodes
modeString=" "
write(modeString,"(I2)"),i
if(i.lt.10) modeString="0"//adjustl(modeString)
varName = "Cxsrel"//trim(modeString)
if(i.ne.3) call addfld(varName, horiz_only, 'A', 'unitless', 'relative exessive added mass column for mode'//modeString)
- enddo
+ enddo
#endif
end if
-
+
if (history_amwg) then
call add_default ('PHIS ' , 1, ' ')
call add_default ('PS ' , 1, ' ')
@@ -541,7 +541,7 @@ subroutine diag_init_dry(pbuf2d)
! State after physics (FV)
call add_default ('TAP ' , history_budget_histfile_num, ' ')
call add_default ('UAP ' , history_budget_histfile_num, ' ')
- call add_default ('VAP ' , 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') ) then
call add_default ('TFIX ' , history_budget_histfile_num, ' ')
@@ -788,14 +788,14 @@ subroutine diag_init_dry(pbuf2d)
if(i.lt.10) modeString="0"//adjustl(modeString)
varName = "Camrel"//trim(modeString)
if(i.ne.3) call add_default(varName, 1, ' ')
- enddo
+ enddo
do i=1,nbmodes
modeString=" "
write(modeString,"(I2)"),i
if(i.lt.10) modeString="0"//adjustl(modeString)
varName = "Cxsrel"//trim(modeString)
if(i.ne.3) call add_default(varName, 1, ' ')
- enddo
+ enddo
#endif
end if
@@ -939,7 +939,7 @@ subroutine diag_init_moist(pbuf2d)
!AL
call addfld (dmetendnam(ixcldnc),(/ 'lev' /), 'A','#/kg/s ', &
trim(cnst_name(ixcldnc))//' dme adjustment tendency (FV) ')
- call addfld (dmetendnam(ixcldni),(/ 'lev' /), 'A','#/kg/s ', &
+ call addfld (dmetendnam(ixcldni),(/ 'lev' /), 'A','#/kg/s ', &
trim(cnst_name(ixcldni))//' dme adjustment tendency (FV) ')
!AL
end if
@@ -1370,7 +1370,7 @@ subroutine diag_phys_writeout_dry(state, pbuf, p_surf_t)
do m = 1, pcnst
if (cnst_cam_outfld(m)) then
- call outfld(cnst_name(m), state%q(1,1,m), pcols, lchnk)
+ call outfld(cnst_name(m), state%q(:,:,m), pcols, lchnk)
end if
end do
@@ -1563,9 +1563,9 @@ subroutine diag_phys_writeout_dry(state, pbuf, p_surf_t)
!
! Output U, V, T, P and Z at bottom level
!
- call outfld ('UBOT ', state%u(1,pver) , pcols, lchnk)
- call outfld ('VBOT ', state%v(1,pver) , pcols, lchnk)
- call outfld ('ZBOT ', state%zm(1,pver) , pcols, lchnk)
+ call outfld ('UBOT ', state%u(:,pver) , pcols, lchnk)
+ call outfld ('VBOT ', state%v(:,pver) , pcols, lchnk)
+ call outfld ('ZBOT ', state%zm(:,pver) , pcols, lchnk)
!! Boundary layer atmospheric stability, temperature, water vapor diagnostics
@@ -1701,13 +1701,13 @@ subroutine diag_phys_writeout_moist(state, pbuf, p_surf_t)
ncol = state%ncol
do m=1,pcnst
if ( cnst_cam_outfld(m) ) then
- call outfld(cnst_name(m),state%q(1,1,m),pcols ,lchnk )
+ call outfld(cnst_name(m),state%q(:,:,m),pcols ,lchnk )
end if
end do
if (co2_transport()) then
do m = 1,4
- call outfld(trim(cnst_name(c_i(m)))//'_BOT', state%q(1,pver,c_i(m)), pcols, lchnk)
+ call outfld(trim(cnst_name(c_i(m)))//'_BOT', state%q(:,pver,c_i(m)), pcols, lchnk)
end do
end if
@@ -1772,7 +1772,7 @@ subroutine diag_phys_writeout_moist(state, pbuf, p_surf_t)
ftem(:ncol,:) = state%q(:ncol,:,1)/ftem(:ncol,:)*100._r8
call outfld ('RHW ',ftem ,pcols ,lchnk )
end if
-
+
! Convert to RHI (ice)
do i=1,ncol
do k=1,pver
@@ -1813,7 +1813,7 @@ subroutine diag_phys_writeout_moist(state, pbuf, p_surf_t)
!
! Output Q at bottom level
!
- call outfld ('QBOT ', state%q(1,pver,1), pcols, lchnk)
+ call outfld ('QBOT ', state%q(:,pver,1), pcols, lchnk)
! Total energy of the atmospheric column for atmospheric heat storage calculations
@@ -1830,7 +1830,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
@@ -2155,7 +2155,7 @@ subroutine diag_surf (cam_in, cam_out, state, pbuf)
if (moist_physics) then
call outfld('SHFLX', cam_in%shf, pcols, lchnk)
call outfld('LHFLX', cam_in%lhf, pcols, lchnk)
- call outfld('QFLX', cam_in%cflx(1,1), pcols, lchnk)
+ call outfld('QFLX', cam_in%cflx(:,:), pcols, lchnk)
call outfld('TAUX', cam_in%wsx, pcols, lchnk)
call outfld('TAUY', cam_in%wsy, pcols, lchnk)
@@ -2530,16 +2530,16 @@ subroutine diag_phys_tend_writeout_moist(state, pbuf, tend, ztodt, &
!AL
if ( cnst_cam_outfld( 1) ) then
- call outfld (apcnst( 1), state%q(1,1, 1), pcols, lchnk)
+ call outfld (apcnst( 1), state%q(:,:, 1), pcols, lchnk)
end if
if (ixcldliq > 0) then
if (cnst_cam_outfld(ixcldliq)) then
- call outfld (apcnst(ixcldliq), state%q(1,1,ixcldliq), pcols, lchnk)
+ call outfld (apcnst(ixcldliq), state%q(:,:,ixcldliq), pcols, lchnk)
end if
end if
if (ixcldice > 0) then
if ( cnst_cam_outfld(ixcldice) ) then
- call outfld (apcnst(ixcldice), state%q(1,1,ixcldice), pcols, lchnk)
+ call outfld (apcnst(ixcldice), state%q(:,:,ixcldice), pcols, lchnk)
end if
end if
@@ -2711,16 +2711,16 @@ subroutine diag_state_b4_phys_write_moist (state)
call cnst_get_ind('CLDICE', ixcldice, abort=.false.)
if ( cnst_cam_outfld( 1) ) then
- call outfld (bpcnst( 1), state%q(1,1, 1), pcols, lchnk)
+ call outfld (bpcnst( 1), state%q(:,:, 1), pcols, lchnk)
end if
if (ixcldliq > 0) then
if (cnst_cam_outfld(ixcldliq)) then
- call outfld (bpcnst(ixcldliq), state%q(1,1,ixcldliq), pcols, lchnk)
+ call outfld (bpcnst(ixcldliq), state%q(:,:,ixcldliq), pcols, lchnk)
end if
end if
if (ixcldice > 0) then
if (cnst_cam_outfld(ixcldice)) then
- call outfld (bpcnst(ixcldice), state%q(1,1,ixcldice), pcols, lchnk)
+ call outfld (bpcnst(ixcldice), state%q(:,:,ixcldice), pcols, lchnk)
end if
end if
diff --git a/src/NorESM/micro_mg2_0.F90 b/src/NorESM/micro_mg2_0.F90
index 823058308e..7e2a64d0e0 100644
--- a/src/NorESM/micro_mg2_0.F90
+++ b/src/NorESM/micro_mg2_0.F90
@@ -12,23 +12,23 @@ module micro_mg2_0
!
! invoked in CAM by specifying -microphys=mg2.0
!
-! References:
+! References:
!
-! Gettelman, A. and H. Morrison, Advanced Two-Moment Microphysics for Global Models.
+! Gettelman, A. and H. Morrison, Advanced Two-Moment Microphysics for Global Models.
!
-! Part I: Off line tests and comparisons with other schemes.
+! Part I: Off line tests and comparisons with other schemes.
!
-! J. Climate, 28, 1268-1287. doi: 10.1175/JCLI-D-14-00102.1, 2015.
+! J. Climate, 28, 1268-1287. doi: 10.1175/JCLI-D-14-00102.1, 2015.
!
!
!
-! Gettelman, A., H. Morrison, S. Santos, P. Bogenschutz and P. H. Caldwell
+! Gettelman, A., H. Morrison, S. Santos, P. Bogenschutz and P. H. Caldwell
!
-! Advanced Two-Moment Microphysics for Global Models.
+! Advanced Two-Moment Microphysics for Global Models.
!
-! Part II: Global model solutions and Aerosol-Cloud Interactions.
+! Part II: Global model solutions and Aerosol-Cloud Interactions.
!
-! J. Climate, 28, 1288-1307. doi:10.1175/JCLI-D-14-00103.1 , 2015.
+! J. Climate, 28, 1288-1307. doi:10.1175/JCLI-D-14-00103.1 , 2015.
!
! for questions contact Hugh Morrison, Andrew Gettelman
! e-mail: morrison@ucar.edu, andrew@ucar.edu
@@ -176,8 +176,8 @@ module micro_mg2_0
! externally (kg)
real(r8), parameter :: mi0l_min = 4._r8/3._r8*pi*rhow*(4.e-6_r8)**3
-! Ice number sublimation parameter. Assume some decrease in ice number with sublimation if non-zero. Else, no decrease in number with sublimation.
- real(r8), parameter :: sublim_factor =0.0_r8 !number sublimation factor.
+! Ice number sublimation parameter. Assume some decrease in ice number with sublimation if non-zero. Else, no decrease in number with sublimation.
+ real(r8), parameter :: sublim_factor =0.0_r8 !number sublimation factor.
!=========================================================
@@ -403,7 +403,7 @@ subroutine micro_mg_tend ( &
drout2, dsout2, &
freqs, freqr, &
nfice, qcrat, &
- errstring, &
+ errstring, &
!AL right names?
nnuccctot, nnuccttot, npsacwstot, nsubctot, npratot, &
nprc1tot, ncsedtentot, nisedtentot, nmelttot, nhomotot, &
@@ -435,7 +435,7 @@ subroutine micro_mg_tend ( &
use micro_mg_utils, only: &
ice_deposition_sublimation, &
sb2001v2_liq_autoconversion,&
- sb2001v2_accre_cld_water_rain,&
+ sb2001v2_accre_cld_water_rain,&
kk2000_liq_autoconversion, &
ice_autoconversion, &
immersion_freezing, &
@@ -493,7 +493,7 @@ subroutine micro_mg_tend ( &
! (For example, in CAM, the last dimension is always size 4.)
real(r8), intent(in) :: rndst(:,:,:) ! radius of each dust bin, for contact freezing (from microp_aero_ts) (m)
real(r8), intent(in) :: nacon(:,:,:) ! number in each dust bin, for contact freezing (from microp_aero_ts) (1/m^3)
-
+
! output arguments
real(r8), intent(out) :: qcsinksum_rate1ord(mgncol,nlev) ! 1st order rate for
@@ -598,7 +598,7 @@ subroutine micro_mg_tend ( &
real(r8), intent(out) :: nnuccctot(mgncol,nlev) ! immersion freezing
real(r8), intent(out) :: nnuccttot(mgncol,nlev) ! contact freezing
real(r8), intent(out) :: npsacwstot(mgncol,nlev) ! accr. snow
- real(r8), intent(out) :: nsubctot(mgncol,nlev) ! evaporation of droplet
+ real(r8), intent(out) :: nsubctot(mgncol,nlev) ! evaporation of droplet
real(r8), intent(out) :: npratot(mgncol,nlev) ! accretion
real(r8), intent(out) :: nprc1tot(mgncol,nlev) ! autoconversion
real(r8), intent(out) :: ncsedtentot(mgncol,nlev) ! nqc sedimentation tendency
@@ -614,7 +614,7 @@ subroutine micro_mg_tend ( &
real(r8), intent(out) :: nnudeptot(mgncol,nlev) ! deposition?
real(r8), intent(out) :: npccntot(mgncol,nlev) ! droplet activation
real(r8), intent(out) :: nnuccdtot(mgncol,nlev) ! ni nucleation
- real(r8), intent(out) :: mnudeptot(mgncol,nlev) ! deposition (mass)
+ real(r8), intent(out) :: mnudeptot(mgncol,nlev) ! deposition (mass)
!
real(r8), intent(out) :: nctnszmx(mgncol,nlev) ! nc tuning: maximum slope (reduction of number)
real(r8), intent(out) :: nctnszmn(mgncol,nlev) ! nc tuning: minimum slope (increase of numer)
@@ -774,7 +774,7 @@ subroutine micro_mg_tend ( &
! bergeron process
real(r8) :: berg(mgncol,nlev) ! mass mixing ratio (cloud ice)
real(r8) :: bergs(mgncol,nlev) ! mass mixing ratio (snow)
-
+
! fallspeeds
! number-weighted
real(r8) :: uns(mgncol,nlev) ! snow
@@ -1037,7 +1037,7 @@ subroutine micro_mg_tend ( &
nnudeptot=0._r8
npccntot=0._r8
nnuccdtot=0._r8
- mnudeptot=0._r8
+ mnudeptot=0._r8
mnuccritot=0._r8
nnuccritot=0._r8
@@ -1260,7 +1260,7 @@ subroutine micro_mg_tend ( &
end if
end do
- end do
+ end do
do k=1,nlev
do i=1,mgncol
@@ -1297,7 +1297,7 @@ subroutine micro_mg_tend ( &
end if
end if
end do
- end do
+ end do
do k=1,nlev
do i=1,mgncol
@@ -1417,12 +1417,12 @@ subroutine micro_mg_tend ( &
call size_dist_param_basic(mg_ice_props, qiic(:,k), niic(:,k), &
lami(:,k), mgncol, n0=n0i(:,k))
-
- ! Alternative autoconversion
+
+ ! Alternative autoconversion
if (do_sb_physics) then
call sb2001v2_liq_autoconversion(pgam(:,k),qcic(1:mgncol,k),ncic(:,k), &
- qric(:,k),rho(:,k),relvar(:,k),prc(:,k),nprc(:,k),nprc1(:,k), mgncol)
- endif
+ qric(:,k),rho(:,k),relvar(:,k),prc(:,k),nprc(:,k),nprc1(:,k), mgncol)
+ endif
!.......................................................................
! Autoconversion of cloud ice to snow
@@ -1587,7 +1587,7 @@ subroutine micro_mg_tend ( &
if (do_sb_physics) then
call sb2001v2_accre_cld_water_rain(qcic(1:mgncol,k), ncic(:,k), qric(:,k), &
- rho(:,k), relvar(:,k), pra(:,k), npra(:,k), mgncol)
+ rho(:,k), relvar(:,k), pra(:,k), npra(:,k), mgncol)
else
call accrete_cloud_water_rain(microp_uniform, qric(:,k), qcic(1:mgncol,k), &
ncic(:,k), relvar(:,k), accre_enhan(:,k), pra(:,k), npra(:,k), mgncol)
@@ -2082,12 +2082,19 @@ subroutine micro_mg_tend ( &
! make sure that ni at advanced time step does not exceed
! maximum (existing N + source terms*dt), which is possible if mtime < deltat
! note that currently mtime = deltat
+
!================================================================
+ !shofer---
+ if (nnucct(i,k)+nnuccc(i,k)+nnudep(i,k) > 0._r8) then
+ nimax(i,k) = nimax(i,k)+(nnucct(i,k)+nnuccc(i,k)+nnudep(i,k))*lcldm(i,k)*deltat
+ end if
- if (do_cldice .and. nitend(i,k).gt.0._r8.and.ni(i,k)+nitend(i,k)*deltat.gt.nimax(i,k)) then
- nitncons(i,k) = nitncons(i,k) + nitend(i,k)-max(0._r8,(nimax(i,k)-ni(i,k))/deltat) !AL
+ if (do_cldice .and. (nitend(i,k) > 0._r8) .and. &
+ (ni(i,k) + (nitend(i,k)*deltat) > nimax(i,k))) then
+ nitncons(i,k) = nitncons(i,k) + nitend(i,k) - max(0._r8,(nimax(i,k)-ni(i,k))/deltat)
nitend(i,k)=max(0._r8,(nimax(i,k)-ni(i,k))/deltat)
end if
+ !shofer---
end do
@@ -2248,15 +2255,15 @@ subroutine micro_mg_tend ( &
! particles (blend over 18-20 um)
irad = 1.5_r8 / lami(i,k) * 1e6_r8
ifrac = min(1._r8, max(0._r8, (irad - 18._r8) / 2._r8))
-
+
if (ifrac .lt. 1._r8) then
- vtrmi(i,k) = ifrac * vtrmi(i,k) + &
+ vtrmi(i,k) = ifrac * vtrmi(i,k) + &
(1._r8 - ifrac) * &
min(ajn(i,k)*gamma_bj_plus4/(6._r8*lami(i,k)**bj), &
1.2_r8*rhof(i,k))
fi(i,k) = g*rho(i,k)*vtrmi(i,k)
- fni(i,k) = ifrac * fni(i,k) + &
+ fni(i,k) = ifrac * fni(i,k) + &
(1._r8 - ifrac) * &
g*rho(i,k)* &
min(ajn(i,k)*gamma_bj_plus1/lami(i,k)**bj,1.2_r8*rhof(i,k))
@@ -2824,8 +2831,8 @@ subroutine micro_mg_tend ( &
tlat(i,k)=tlat(i,k)+xlf*dum*dumc(i,k)/deltat
end if
end if
- enddo
- enddo
+ enddo
+ enddo
! remove any excess over-saturation, which is possible due to non-linearity when adding
! together all microphysical processes
!-----------------------------------------------------------------
@@ -2867,8 +2874,8 @@ subroutine micro_mg_tend ( &
qvres(i,k)=-dum
tlat(i,k)=tlat(i,k)+dum*(1._r8-dum1)*xxlv+dum*dum1*xxls
end if
- enddo
- enddo
+ enddo
+ enddo
end if
! calculate effective radius for pass to radiation code
diff --git a/src/NorESM/zm_conv_intr.F90 b/src/NorESM/zm_conv_intr.F90
index f070cf8a7b..8c1530cc04 100644
--- a/src/NorESM/zm_conv_intr.F90
+++ b/src/NorESM/zm_conv_intr.F90
@@ -8,7 +8,7 @@ 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
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
@@ -21,7 +21,7 @@ module zm_conv_intr
use perf_mod
use cam_logfile, only: iulog
use constituents, only: cnst_add
-
+
implicit none
private
save
@@ -67,19 +67,19 @@ module zm_conv_intr
real(r8) :: zmconv_ke_lnd = unset_r8
real(r8) :: zmconv_momcu = unset_r8
real(r8) :: zmconv_momcd = unset_r8
- integer :: zmconv_num_cin ! Number of negative buoyancy regions that are allowed
+ integer :: zmconv_num_cin ! Number of negative buoyancy regions that are allowed
! before the convection top and CAPE calculations are completed.
- logical :: zmconv_org ! Parameterization for sub-grid scale convective organization for the ZM deep
+ 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
! indices for fields in the physics buffer
- integer :: cld_idx = 0
- integer :: icwmrdp_idx = 0
- integer :: rprddp_idx = 0
- integer :: fracis_idx = 0
- integer :: nevapr_dpcu_idx = 0
+ integer :: cld_idx = 0
+ integer :: icwmrdp_idx = 0
+ integer :: rprddp_idx = 0
+ integer :: fracis_idx = 0
+ integer :: nevapr_dpcu_idx = 0
integer :: dgnum_idx = 0
integer :: nmodes
@@ -103,38 +103,38 @@ subroutine zm_conv_register
integer idx
- call pbuf_add_field('ZM_MU', 'physpkg', dtype_r8, (/pcols,pver/), zm_mu_idx)
- call pbuf_add_field('ZM_EU', 'physpkg', dtype_r8, (/pcols,pver/), zm_eu_idx)
- call pbuf_add_field('ZM_DU', 'physpkg', dtype_r8, (/pcols,pver/), zm_du_idx)
- call pbuf_add_field('ZM_MD', 'physpkg', dtype_r8, (/pcols,pver/), zm_md_idx)
- call pbuf_add_field('ZM_ED', 'physpkg', dtype_r8, (/pcols,pver/), zm_ed_idx)
+ call pbuf_add_field('ZM_MU', 'physpkg', dtype_r8, (/pcols,pver/), zm_mu_idx)
+ call pbuf_add_field('ZM_EU', 'physpkg', dtype_r8, (/pcols,pver/), zm_eu_idx)
+ call pbuf_add_field('ZM_DU', 'physpkg', dtype_r8, (/pcols,pver/), zm_du_idx)
+ call pbuf_add_field('ZM_MD', 'physpkg', dtype_r8, (/pcols,pver/), zm_md_idx)
+ call pbuf_add_field('ZM_ED', 'physpkg', dtype_r8, (/pcols,pver/), zm_ed_idx)
! wg layer thickness in mbs (between upper/lower interface).
- call pbuf_add_field('ZM_DP', 'physpkg', dtype_r8, (/pcols,pver/), zm_dp_idx)
+ call pbuf_add_field('ZM_DP', 'physpkg', dtype_r8, (/pcols,pver/), zm_dp_idx)
! wg layer thickness in mbs between lcl and maxi.
- call pbuf_add_field('ZM_DSUBCLD', 'physpkg', dtype_r8, (/pcols/), zm_dsubcld_idx)
+ call pbuf_add_field('ZM_DSUBCLD', 'physpkg', dtype_r8, (/pcols/), zm_dsubcld_idx)
! wg top level index of deep cumulus convection.
- call pbuf_add_field('ZM_JT', 'physpkg', dtype_i4, (/pcols/), zm_jt_idx)
+ call pbuf_add_field('ZM_JT', 'physpkg', dtype_i4, (/pcols/), zm_jt_idx)
! wg gathered values of maxi.
- call pbuf_add_field('ZM_MAXG', 'physpkg', dtype_i4, (/pcols/), zm_maxg_idx)
+ call pbuf_add_field('ZM_MAXG', 'physpkg', dtype_i4, (/pcols/), zm_maxg_idx)
! map gathered points to chunk index
- call pbuf_add_field('ZM_IDEEP', 'physpkg', dtype_i4, (/pcols/), zm_ideep_idx)
+ call pbuf_add_field('ZM_IDEEP', 'physpkg', dtype_i4, (/pcols/), zm_ideep_idx)
! Flux of precipitation from deep convection (kg/m2/s)
- call pbuf_add_field('DP_FLXPRC','global',dtype_r8,(/pcols,pverp/),dp_flxprc_idx)
+ call pbuf_add_field('DP_FLXPRC','global',dtype_r8,(/pcols,pverp/),dp_flxprc_idx)
-! Flux of snow from deep convection (kg/m2/s)
- call pbuf_add_field('DP_FLXSNW','global',dtype_r8,(/pcols,pverp/),dp_flxsnw_idx)
+! Flux of snow from deep convection (kg/m2/s)
+ call pbuf_add_field('DP_FLXSNW','global',dtype_r8,(/pcols,pverp/),dp_flxsnw_idx)
! deep gbm cloud liquid water (kg/kg)
- call pbuf_add_field('DP_CLDLIQ','global',dtype_r8,(/pcols,pver/), dp_cldliq_idx)
+ call pbuf_add_field('DP_CLDLIQ','global',dtype_r8,(/pcols,pver/), dp_cldliq_idx)
-! deep gbm cloud liquid water (kg/kg)
- call pbuf_add_field('DP_CLDICE','global',dtype_r8,(/pcols,pver/), dp_cldice_idx)
+! deep gbm cloud liquid water (kg/kg)
+ call pbuf_add_field('DP_CLDICE','global',dtype_r8,(/pcols,pver/), dp_cldice_idx)
call pbuf_add_field('ICWMRDP', 'physpkg',dtype_r8,(/pcols,pver/),icwmrdp_idx)
call pbuf_add_field('RPRDDP', 'physpkg',dtype_r8,(/pcols,pver/),rprddp_idx)
@@ -253,7 +253,7 @@ subroutine zm_conv_init(pref_edge)
allocate(aero(begchunk:endchunk))
-!
+!
! Register fields with the output buffer
!
@@ -270,13 +270,13 @@ subroutine zm_conv_init(pref_edge)
call addfld ('FZSNTZM', (/ 'lev' /), 'A', 'K/s','T tendency - Rain to snow conversion from Zhang convection')
call addfld ('EVSNTZM', (/ 'lev' /), 'A', 'K/s','T tendency - Snow to rain prod from Zhang convection')
call addfld ('EVAPQZM', (/ 'lev' /), 'A', 'kg/kg/s','Q tendency - Evaporation from Zhang-McFarlane moist convection')
-
+
call addfld ('ZMFLXPRC', (/ 'ilev' /), 'A', 'kg/m2/s','Flux of precipitation from ZM convection' )
call addfld ('ZMFLXSNW', (/ 'ilev' /), 'A', 'kg/m2/s','Flux of snow from ZM convection' )
call addfld ('ZMNTPRPD', (/ 'lev' /) , 'A', 'kg/kg/s','Net precipitation production from ZM convection')
call addfld ('ZMNTSNPD', (/ 'lev' /) , 'A', 'kg/kg/s','Net snow production from ZM convection' )
call addfld ('ZMEIHEAT', (/ 'lev' /) , 'A', 'W/kg' ,'Heating by ice and evaporation in ZM convection')
-
+
call addfld ('CMFMCDZM', (/ 'ilev' /), 'A', 'kg/m2/s','Convection mass flux from ZM deep ')
call addfld ('PRECCDZM', horiz_only, 'A', 'm/s','Convective precipitation rate from ZM deep')
@@ -284,7 +284,7 @@ subroutine zm_conv_init(pref_edge)
call addfld ('PCONVT', horiz_only , 'A', 'Pa' ,'convection top pressure')
call addfld ('CAPE', horiz_only, 'A', 'J/kg', 'Convectively available potential energy')
- call addfld ('FREQZM', horiz_only , 'A', 'fraction', 'Fractional occurance of ZM convection')
+ call addfld ('FREQZM', horiz_only , 'A', 'fraction', 'Fractional occurance of ZM convection')
call addfld ('ZMMTT', (/ 'lev' /), 'A', 'K/s', 'T tendency - ZM convective momentum transport')
call addfld ('ZMMTU', (/ 'lev' /), 'A', 'm/s2', 'U tendency - ZM convective momentum transport')
@@ -348,12 +348,12 @@ subroutine zm_conv_init(pref_edge)
end do
if ( limcnv == 0 ) limcnv = plevp
end if
-
+
if (masterproc) then
write(iulog,*)'ZM_CONV_INIT: Deep convection will be capped at intfc ',limcnv, &
' which is ',pref_edge(limcnv),' pascals'
end if
-
+
no_deep_pbl = phys_deepconv_pbl()
call zm_convi(limcnv,zmconv_c0_lnd, zmconv_c0_ocn, zmconv_ke, zmconv_ke_lnd, &
zmconv_momcu, zmconv_momcd, zmconv_num_cin, zmconv_org, &
@@ -373,7 +373,7 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
rliq ,rice ,ztodt , &
jctop ,jcbot , &
state ,ptend_all ,landfrac, pbuf)
-
+
use cam_history, only: outfld
use physics_types, only: physics_state, physics_ptend
@@ -398,7 +398,7 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
real(r8), intent(in) :: ztodt ! 2 delta t (model time increment)
real(r8), intent(in) :: pblh(pcols) ! Planetary boundary layer height
real(r8), intent(in) :: tpert(pcols) ! Thermal temperature excess
- real(r8), intent(in) :: landfrac(pcols) ! RBN - Landfrac
+ real(r8), intent(in) :: landfrac(pcols) ! RBN - Landfrac
real(r8), intent(out) :: mcon(pcols,pverp) ! Convective mass flux--m sub c
real(r8), intent(out) :: pflx(pcols,pverp) ! scattered precip flux at each level
@@ -435,7 +435,7 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
! physics buffer fields
real(r8), pointer, dimension(:) :: prec ! total precipitation
- real(r8), pointer, dimension(:) :: snow ! snow from ZM convection
+ real(r8), pointer, dimension(:) :: snow ! snow from ZM convection
real(r8), pointer, dimension(:,:) :: cld
real(r8), pointer, dimension(:,:) :: ql ! wg grid slice of cloud liquid water.
real(r8), pointer, dimension(:,:) :: rprd ! rain production rate
@@ -452,16 +452,16 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
real(r8), pointer :: lambdadpcu(:,:) ! slope of cloud liquid size distr
real(r8), pointer :: mudpcu(:,:) ! width parameter of droplet size distr
- real(r8), pointer :: mu(:,:) ! (pcols,pver)
- real(r8), pointer :: eu(:,:) ! (pcols,pver)
- real(r8), pointer :: du(:,:) ! (pcols,pver)
- real(r8), pointer :: md(:,:) ! (pcols,pver)
- real(r8), pointer :: ed(:,:) ! (pcols,pver)
- real(r8), pointer :: dp(:,:) ! (pcols,pver)
- real(r8), pointer :: dsubcld(:) ! (pcols)
- integer, pointer :: jt(:) ! (pcols)
- integer, pointer :: maxg(:) ! (pcols)
- integer, pointer :: ideep(:) ! (pcols)
+ real(r8), pointer :: mu(:,:) ! (pcols,pver)
+ real(r8), pointer :: eu(:,:) ! (pcols,pver)
+ real(r8), pointer :: du(:,:) ! (pcols,pver)
+ real(r8), pointer :: md(:,:) ! (pcols,pver)
+ real(r8), pointer :: ed(:,:) ! (pcols,pver)
+ real(r8), pointer :: dp(:,:) ! (pcols,pver)
+ real(r8), pointer :: dsubcld(:) ! (pcols)
+ integer, pointer :: jt(:) ! (pcols)
+ integer, pointer :: maxg(:) ! (pcols)
+ integer, pointer :: ideep(:) ! (pcols)
integer :: lengath
real(r8) :: jctop(pcols) ! o row of top-of-deep-convection indices passed out.
@@ -490,7 +490,7 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
logical :: l_windt(2)
real(r8) :: tfinal1, tfinal2
integer :: ii
-
+
real(r8),pointer :: zm_org2d(:,:)
real(r8),pointer :: orgt(:,:), org(:,:)
@@ -554,7 +554,7 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
conv%dcape(pcols) )
end if
- ftem = 0._r8
+ ftem = 0._r8
mu_out(:,:) = 0._r8
md_out(:,:) = 0._r8
wind_tends(:ncol,:pver,:) = 0.0_r8
@@ -637,7 +637,7 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
if (zmconv_org) then
allocate(zm_org2d(pcols,pver))
- org => state%q(:,:,ixorg)
+ org => state%q(:,:,ixorg)
orgt => ptend_loc%q(:,:,ixorg)
endif
@@ -656,12 +656,9 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
dif, dnlf, dnif, conv, &
aero(lchnk), rice)
-! lengath = count(ideep > 0)
-
call outfld('CAPE', cape, pcols, lchnk) ! RBN - CAPE output
- !call outfld('EURT', eurt, pcols, lchnk) !+tht: entr.rate 2D
- call outfld('EURT', eurt(1,1), pcols, lchnk) !+tht: entr.rate 3D
+ call outfld('EURT', eurt, pcols, lchnk) !+tht: entr.rate 3D
!
! Output fractional occurance of ZM convection
@@ -693,7 +690,7 @@ 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 outfld('ZMDQ ',ptend_loc%q(:,:,1) ,pcols ,lchnk )
call t_stopf ('zm_convr')
call outfld('DIFZM' ,dif ,pcols, lchnk)
@@ -718,7 +715,7 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
! add tendency from this process to tendencies from other processes
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, ztodt)
! initialize ptend for next process
@@ -752,13 +749,13 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
prec, snow, ntprprd, ntsnprd , flxprec, flxsnow, conv%sprd)
evapcdp(:ncol,:pver) = ptend_loc%q(:ncol,:pver,1)
-
+
if (zmconv_org) then
ptend_loc%q(:ncol,:pver,ixorg) = min(1._r8,max(0._r8,(50._r8*1000._r8*1000._r8*abs(evapcdp(:ncol,:pver))) &
-(state%q(:ncol,:pver,ixorg)/10800._r8)))
- ptend_loc%q(:ncol,:pver,ixorg) = (ptend_loc%q(:ncol,:pver,ixorg) - state%q(:ncol,:pver,ixorg))/ztodt
- endif
-
+ ptend_loc%q(:ncol,:pver,ixorg) = (ptend_loc%q(:ncol,:pver,ixorg) - state%q(:ncol,:pver,ixorg))/ztodt
+ endif
+
!
! Write out variables from zm_conv_evap
!
@@ -768,7 +765,7 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
call outfld('FZSNTZM ',ftem ,pcols ,lchnk )
ftem(:ncol,:pver) = tend_s_snwevmlt(:ncol,:pver)/cpair
call outfld('EVSNTZM ',ftem ,pcols ,lchnk )
- call outfld('EVAPQZM ',ptend_loc%q(1,1,1) ,pcols ,lchnk )
+ call outfld('EVAPQZM ',ptend_loc%q(:,:,1) ,pcols ,lchnk )
call outfld('ZMFLXPRC', flxprec, pcols, lchnk)
call outfld('ZMFLXSNW', flxsnow, pcols, lchnk)
call outfld('ZMNTPRPD', ntprprd, pcols, lchnk)
@@ -785,7 +782,7 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
! add tendency from this process to tend from other processes here
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, ztodt)
@@ -797,7 +794,7 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
winds(:ncol,:pver,1) = state1%u(:ncol,:pver)
winds(:ncol,:pver,2) = state1%v(:ncol,:pver)
-
+
l_windt(1) = .true.
l_windt(2) = .true.
@@ -806,16 +803,16 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
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 )
+ nstep, wind_tends, pguall, pgdall, icwu, icwd, ztodt, seten )
call t_stopf ('momtran')
ptend_loc%u(:ncol,:pver) = wind_tends(:ncol,:pver,1)
ptend_loc%v(:ncol,:pver) = wind_tends(:ncol,:pver,2)
- ptend_loc%s(:ncol,:pver) = seten(:ncol,:pver)
+ ptend_loc%s(:ncol,:pver) = seten(:ncol,:pver)
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, ztodt)
ftem(:ncol,:pver) = seten(:ncol,:pver)/cpair
@@ -824,20 +821,20 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
call outfld('ZM_ORG2D', zm_org2d, pcols, lchnk)
endif
call outfld('ZMMTT', ftem , pcols, lchnk)
- call outfld('ZMMTU', wind_tends(1,1,1), pcols, lchnk)
- call outfld('ZMMTV', wind_tends(1,1,2), pcols, lchnk)
-
+ call outfld('ZMMTU', wind_tends(:,:,1), pcols, lchnk)
+ call outfld('ZMMTV', wind_tends(:,:,2), pcols, lchnk)
+
! Output apparent force from pressure gradient
- call outfld('ZMUPGU', pguall(1,1,1), pcols, lchnk)
- call outfld('ZMUPGD', pgdall(1,1,1), pcols, lchnk)
- call outfld('ZMVPGU', pguall(1,1,2), pcols, lchnk)
- call outfld('ZMVPGD', pgdall(1,1,2), pcols, lchnk)
+ call outfld('ZMUPGU', pguall(:,:,1), pcols, lchnk)
+ call outfld('ZMUPGD', pgdall(:,:,1), pcols, lchnk)
+ call outfld('ZMVPGU', pguall(:,:,2), pcols, lchnk)
+ call outfld('ZMVPGD', pgdall(:,:,2), pcols, lchnk)
! Output in-cloud winds
- call outfld('ZMICUU', icwu(1,1,1), pcols, lchnk)
- call outfld('ZMICUD', icwd(1,1,1), pcols, lchnk)
- call outfld('ZMICVU', icwu(1,1,2), pcols, lchnk)
- call outfld('ZMICVD', icwd(1,1,2), pcols, lchnk)
+ call outfld('ZMICUU', icwu(:,:,1), pcols, lchnk)
+ call outfld('ZMICUD', icwd(:,:,1), pcols, lchnk)
+ call outfld('ZMICVU', icwu(:,:,2), pcols, lchnk)
+ call outfld('ZMICVD', icwd(:,:,2), pcols, lchnk)
end if
@@ -862,8 +859,8 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , &
nstep, fracis, ptend_loc%q, fake_dpdry, ztodt)
call t_stopf ('convtran1')
- call outfld('ZMDICE ',ptend_loc%q(1,1,ixcldice) ,pcols ,lchnk )
- call outfld('ZMDLIQ ',ptend_loc%q(1,1,ixcldliq) ,pcols ,lchnk )
+ call outfld('ZMDICE ',ptend_loc%q(:,:,ixcldice) ,pcols ,lchnk )
+ call outfld('ZMDLIQ ',ptend_loc%q(:,:,ixcldliq) ,pcols ,lchnk )
! add tendency from this process to tend from other processes here
call physics_ptend_sum(ptend_loc,ptend_all, ncol)
@@ -941,11 +938,11 @@ subroutine zm_conv_tend_2( state, ptend, ztodt, pbuf)
use time_manager, only: get_nstep
use physics_buffer, only: pbuf_get_index, pbuf_get_field, physics_buffer_desc
use constituents, only: pcnst, cnst_is_convtran2
-
+
! Arguments
type(physics_state), intent(in ) :: state ! Physics state variables
type(physics_ptend), intent(out) :: ptend ! indivdual parameterization tendencies
-
+
type(physics_buffer_desc), pointer :: pbuf(:)
real(r8), intent(in) :: ztodt ! 2 delta t (model time increment)
@@ -957,18 +954,18 @@ subroutine zm_conv_tend_2( state, ptend, ztodt, pbuf)
real(r8), dimension(pcols,pver) :: dpdry
- ! physics buffer fields
+ ! physics buffer fields
real(r8), pointer :: fracis(:,:,:) ! fraction of transported species that are insoluble
- real(r8), pointer :: mu(:,:) ! (pcols,pver)
- real(r8), pointer :: eu(:,:) ! (pcols,pver)
- real(r8), pointer :: du(:,:) ! (pcols,pver)
- real(r8), pointer :: md(:,:) ! (pcols,pver)
- real(r8), pointer :: ed(:,:) ! (pcols,pver)
- real(r8), pointer :: dp(:,:) ! (pcols,pver)
- real(r8), pointer :: dsubcld(:) ! (pcols)
- integer, pointer :: jt(:) ! (pcols)
- integer, pointer :: maxg(:) ! (pcols)
- integer, pointer :: ideep(:) ! (pcols)
+ real(r8), pointer :: mu(:,:) ! (pcols,pver)
+ real(r8), pointer :: eu(:,:) ! (pcols,pver)
+ real(r8), pointer :: du(:,:) ! (pcols,pver)
+ real(r8), pointer :: md(:,:) ! (pcols,pver)
+ real(r8), pointer :: ed(:,:) ! (pcols,pver)
+ real(r8), pointer :: dp(:,:) ! (pcols,pver)
+ real(r8), pointer :: dsubcld(:) ! (pcols)
+ integer, pointer :: jt(:) ! (pcols)
+ integer, pointer :: maxg(:) ! (pcols)
+ integer, pointer :: ideep(:) ! (pcols)
!-----------------------------------------------------------------------------------
@@ -1025,7 +1022,7 @@ subroutine zm_conv_micro_init()
integer :: i
- !
+ !
! Register fields with the output buffer
!
call addfld ('ICIMRDP', (/ 'lev' /), 'A','kg/kg', 'Deep Convection in-cloud ice mixing ratio ')
diff --git a/src/physics/cam/cam_diagnostics.F90 b/src/physics/cam/cam_diagnostics.F90
index 0ef3a86f54..9aff68ca04 100644
--- a/src/physics/cam/cam_diagnostics.F90
+++ b/src/physics/cam/cam_diagnostics.F90
@@ -78,17 +78,17 @@ module cam_diagnostics
! Physics buffer indices
-integer :: psl_idx = 0
-integer :: relhum_idx = 0
-integer :: qcwat_idx = 0
-integer :: tcwat_idx = 0
-integer :: lcwat_idx = 0
-integer :: cld_idx = 0
-integer :: concld_idx = 0
-integer :: tke_idx = 0
-integer :: kvm_idx = 0
-integer :: kvh_idx = 0
-integer :: cush_idx = 0
+integer :: psl_idx = 0
+integer :: relhum_idx = 0
+integer :: qcwat_idx = 0
+integer :: tcwat_idx = 0
+integer :: lcwat_idx = 0
+integer :: cld_idx = 0
+integer :: concld_idx = 0
+integer :: tke_idx = 0
+integer :: kvm_idx = 0
+integer :: kvh_idx = 0
+integer :: cush_idx = 0
integer :: t_ttend_idx = 0
integer :: prec_dp_idx = 0
@@ -166,7 +166,7 @@ subroutine diag_register()
end subroutine diag_register
!==============================================================================
-
+
subroutine diag_init_dry(pbuf2d)
! Declare the history fields for which this module contains outfld calls.
@@ -341,7 +341,7 @@ subroutine diag_init_dry(pbuf2d)
! State after physics (FV)
call add_default ('TAP ' , history_budget_histfile_num, ' ')
call add_default ('UAP ' , history_budget_histfile_num, ' ')
- call add_default ('VAP ' , 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') ) then
call add_default ('TFIX ' , history_budget_histfile_num, ' ')
@@ -965,7 +965,7 @@ subroutine diag_phys_writeout_dry(state, pbuf, p_surf_t)
do m = 1, pcnst
if (cnst_cam_outfld(m)) then
- call outfld(cnst_name(m), state%q(1,1,m), pcols, lchnk)
+ call outfld(cnst_name(m), state%q(:,:,m), pcols, lchnk)
end if
end do
@@ -1145,9 +1145,9 @@ subroutine diag_phys_writeout_dry(state, pbuf, p_surf_t)
!
! Output U, V, T, P and Z at bottom level
!
- call outfld ('UBOT ', state%u(1,pver) , pcols, lchnk)
- call outfld ('VBOT ', state%v(1,pver) , pcols, lchnk)
- call outfld ('ZBOT ', state%zm(1,pver) , pcols, lchnk)
+ call outfld ('UBOT ', state%u(:,pver) , pcols, lchnk)
+ call outfld ('VBOT ', state%v(:,pver) , pcols, lchnk)
+ call outfld ('ZBOT ', state%zm(:,pver) , pcols, lchnk)
!! Boundary layer atmospheric stability, temperature, water vapor diagnostics
@@ -1284,7 +1284,7 @@ subroutine diag_phys_writeout_moist(state, pbuf, p_surf_t)
if (co2_transport()) then
do m = 1,4
- call outfld(trim(cnst_name(c_i(m)))//'_BOT', state%q(1,pver,c_i(m)), pcols, lchnk)
+ call outfld(trim(cnst_name(c_i(m)))//'_BOT', state%q(:,pver,c_i(m)), pcols, lchnk)
end do
end if
@@ -1379,7 +1379,7 @@ subroutine diag_phys_writeout_moist(state, pbuf, p_surf_t)
!
! Output Q at bottom level
!
- call outfld ('QBOT ', state%q(1,pver,1), pcols, lchnk)
+ call outfld ('QBOT ', state%q(:,pver,1), pcols, lchnk)
! Total energy of the atmospheric column for atmospheric heat storage calculations
@@ -1419,11 +1419,11 @@ subroutine diag_phys_writeout_moist(state, pbuf, p_surf_t)
hist_fld_active('THE9251000') .or. &
hist_fld_active('THE8501000') .or. &
hist_fld_active('THE7001000')) then
- call vertinterp(ncol, pcols, pver, state%pmid, 100000._r8, state%q(1,1,1), p_surf_q1)
+ call vertinterp(ncol, pcols, pver, state%pmid, 100000._r8, state%q(:,:,1), p_surf_q1)
end if
if (hist_fld_active('THE9251000')) then
- call vertinterp(ncol, pcols, pver, state%pmid, 92500._r8, state%q(1,1,1), p_surf_q2)
+ call vertinterp(ncol, pcols, pver, state%pmid, 92500._r8, state%q(:,:,1), p_surf_q2)
end if
!!! at 1000 mb and 925 mb
@@ -1450,7 +1450,7 @@ subroutine diag_phys_writeout_moist(state, pbuf, p_surf_t)
!!! at 1000 mb and 850 mb
if (hist_fld_active('THE8501000')) then
- call vertinterp(ncol, pcols, pver, state%pmid, 85000._r8, state%q(1,1,1), p_surf_q2)
+ call vertinterp(ncol, pcols, pver, state%pmid, 85000._r8, state%q(:,:,1), p_surf_q2)
p_surf = ((p_surf_t(:, surf_085000)*(1000.0_r8/850.0_r8)**cappa) * &
exp((2500000.0_r8*p_surf_q2)/(1004.0_r8*p_surf_t(:, surf_085000)))) - &
(p_surf_t(:,surf_100000)*(1.0_r8)**cappa)*exp((2500000.0_r8*p_surf_q1)/(1004.0_r8*p_surf_t(:,surf_100000)))
@@ -1465,7 +1465,7 @@ subroutine diag_phys_writeout_moist(state, pbuf, p_surf_t)
!!! at 1000 mb and 700 mb
if (hist_fld_active('THE7001000')) then
- call vertinterp(ncol, pcols, pver, state%pmid, 70000._r8, state%q(1,1,1), p_surf_q2)
+ call vertinterp(ncol, pcols, pver, state%pmid, 70000._r8, state%q(:,:,1), p_surf_q2)
p_surf = ((p_surf_t(:, surf_070000)*(1000.0_r8/700.0_r8)**cappa) * &
exp((2500000.0_r8*p_surf_q2)/(1004.0_r8*p_surf_t(:, surf_070000)))) - &
(p_surf_t(:,surf_100000)*(1.0_r8)**cappa)*exp((2500000.0_r8*p_surf_q1)/(1004.0_r8*p_surf_t(:,surf_100000)))
@@ -1721,7 +1721,7 @@ subroutine diag_surf (cam_in, cam_out, state, pbuf)
if (moist_physics) then
call outfld('SHFLX', cam_in%shf, pcols, lchnk)
call outfld('LHFLX', cam_in%lhf, pcols, lchnk)
- call outfld('QFLX', cam_in%cflx(1,1), pcols, lchnk)
+ call outfld('QFLX', cam_in%cflx(:,:), pcols, lchnk)
call outfld('TAUX', cam_in%wsx, pcols, lchnk)
call outfld('TAUY', cam_in%wsy, pcols, lchnk)
@@ -2083,16 +2083,16 @@ subroutine diag_phys_tend_writeout_moist(state, pbuf, tend, ztodt, &
call cnst_get_ind('CLDICE', ixcldice, abort=.false.)
if ( cnst_cam_outfld( 1) ) then
- call outfld (apcnst( 1), state%q(1,1, 1), pcols, lchnk)
+ call outfld (apcnst( 1), state%q(:,:, 1), pcols, lchnk)
end if
if (ixcldliq > 0) then
if (cnst_cam_outfld(ixcldliq)) then
- call outfld (apcnst(ixcldliq), state%q(1,1,ixcldliq), pcols, lchnk)
+ call outfld (apcnst(ixcldliq), state%q(:,:,ixcldliq), pcols, lchnk)
end if
end if
if (ixcldice > 0) then
if ( cnst_cam_outfld(ixcldice) ) then
- call outfld (apcnst(ixcldice), state%q(1,1,ixcldice), pcols, lchnk)
+ call outfld (apcnst(ixcldice), state%q(:,:,ixcldice), pcols, lchnk)
end if
end if
@@ -2174,6 +2174,7 @@ subroutine diag_phys_tend_writeout(state, pbuf, tend, ztodt, &
real(r8), intent(in) :: cldiceini (pcols,pver) ! tracer fields at beginning of physics
real(r8) , intent(in), optional ::eflx (pcols ) !tht: surface sensible heat flux assoc.with mass adj.
real(r8) , intent(in), optional ::dsema(pcols ) !tht: column enthalpy tendency assoc. with mass adj.
+ real(r8) , intent(inout), optional :: tmp_t(pcols,pver) !tht: holds last physics_updated T (FV)
!-----------------------------------------------------------------------
@@ -2237,16 +2238,16 @@ subroutine diag_state_b4_phys_write_moist (state)
call cnst_get_ind('CLDICE', ixcldice, abort=.false.)
if ( cnst_cam_outfld( 1) ) then
- call outfld (bpcnst( 1), state%q(1,1, 1), pcols, lchnk)
+ call outfld (bpcnst( 1), state%q(:,:, 1), pcols, lchnk)
end if
if (ixcldliq > 0) then
if (cnst_cam_outfld(ixcldliq)) then
- call outfld (bpcnst(ixcldliq), state%q(1,1,ixcldliq), pcols, lchnk)
+ call outfld (bpcnst(ixcldliq), state%q(:,:,ixcldliq), pcols, lchnk)
end if
end if
if (ixcldice > 0) then
if (cnst_cam_outfld(ixcldice)) then
- call outfld (bpcnst(ixcldice), state%q(1,1,ixcldice), pcols, lchnk)
+ call outfld (bpcnst(ixcldice), state%q(:,:,ixcldice), pcols, lchnk)
end if
end if
diff --git a/src/physics/cam/convect_shallow.F90 b/src/physics/cam/convect_shallow.F90
index f4f40d7d50..f854b4394f 100644
--- a/src/physics/cam/convect_shallow.F90
+++ b/src/physics/cam/convect_shallow.F90
@@ -19,19 +19,19 @@ module convect_shallow
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 +40,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 +84,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 +95,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 +110,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 +154,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 +163,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
@@ -222,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' )
@@ -287,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
@@ -347,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
@@ -358,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
@@ -382,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
@@ -393,7 +393,7 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
! --------------- !
- ! Local Variables !
+ ! Local Variables !
! --------------- !
integer :: i, k, m
integer :: n, x
@@ -433,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
@@ -443,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
@@ -477,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
@@ -554,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
@@ -566,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
@@ -577,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)
@@ -588,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 , &
@@ -607,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
@@ -627,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
@@ -672,7 +672,7 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
end select
- ! --------------------------------------------------------!
+ ! --------------------------------------------------------!
! Calculate fractional occurance of shallow convection !
! --------------------------------------------------------!
@@ -697,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 +707,28 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
if( cnt2(i) < cnt(i)) cnt(i) = cnt2(i)
if( cnb2(i) > cnb(i)) cnb(i) = cnb2(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 )
@@ -740,9 +740,9 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
call outfld( 'ICWMRSH ', icwmr , pcols , lchnk )
call outfld( 'CMFDT ', ftem , pcols , lchnk )
- call outfld( 'CMFDQ ', ptend_loc%q(1,1,1) , pcols , lchnk )
- call outfld( 'CMFDICE', ptend_loc%q(1,1,ixcldice) , pcols , lchnk )
- call outfld( 'CMFDLIQ', ptend_loc%q(1,1,ixcldliq) , pcols , lchnk )
+ call outfld( 'CMFDQ ', ptend_loc%q(:,:,1) , pcols , lchnk )
+ call outfld( 'CMFDICE', ptend_loc%q(:,:,ixcldice) , pcols , lchnk )
+ call outfld( 'CMFDLIQ', ptend_loc%q(:,:,ixcldliq) , pcols , lchnk )
call outfld( 'CMFMC' , cmfmc , pcols , lchnk )
call outfld( 'QC' , qc2 , pcols , lchnk )
call outfld( 'CMFDQR' , rprdsh , pcols , lchnk )
@@ -752,12 +752,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
@@ -794,8 +794,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 )
@@ -825,8 +825,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 )
@@ -867,7 +867,7 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
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%s, tend_s_snwprd, tend_s_snwevmlt, &
ptend_loc%q(:pcols,:pver,1), &
rprdsh, cld, ztodt, &
precc, snow, ntprprd, ntsnprd , flxprec, flxsnow )
@@ -884,7 +884,7 @@ subroutine convect_shallow_tend( ztodt , cmfmc , &
call outfld( 'FZSNTCM ' , ftem , pcols, lchnk )
ftem(:ncol,:pver) = tend_s_snwevmlt(:ncol,:pver) / cpair
call outfld( 'EVSNTCM ' , ftem , pcols, lchnk )
- call outfld( 'EVAPQCM ' , ptend_loc%q(1,1,1) , pcols, lchnk )
+ call outfld( 'EVAPQCM ' , ptend_loc%q(:,:,1) , pcols, lchnk )
call outfld( 'PRECSH ' , precc , pcols, lchnk )
call outfld( 'HKFLXPRC' , flxprec , pcols, lchnk )
call outfld( 'HKFLXSNW' , flxsnow , pcols, lchnk )
@@ -892,7 +892,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/ndrop_bam.F90 b/src/physics/cam/ndrop_bam.F90
index 6cd8231356..a48c277b00 100644
--- a/src/physics/cam/ndrop_bam.F90
+++ b/src/physics/cam/ndrop_bam.F90
@@ -73,10 +73,10 @@ subroutine ndrop_bam_init
use phys_control, only: phys_getopts
- !-----------------------------------------------------------------------
- !
+ !-----------------------------------------------------------------------
+ !
! Initialize constants for droplet activation by bulk aerosols
- !
+ !
!-----------------------------------------------------------------------
integer :: l, m, iaer
@@ -172,7 +172,7 @@ subroutine ndrop_bam_init
! Skip aerosols that don't have a dispersion defined.
if (dispersion_aer(m) == 0._r8) cycle
-
+
alogsig(m) = log(dispersion_aer(m))
exp45logsig(m) = exp(4.5_r8*alogsig(m)*alogsig(m))
argfactor(m) = 2._r8/(3._r8*sqrt(2._r8)*alogsig(m))
@@ -316,7 +316,7 @@ subroutine ndrop_bam_run( &
smc(m) = smcrit(m) ! only for prescribed size dist
if (hygro_aer(m) > 1.e-10_r8) then ! loop only if variable size dist
- smc(m) = 2._r8*aten*sqrt(aten/(27._r8*hygro_aer(m)*amcubeloc(m)))
+ smc(m) = 2._r8*aten*sqrt(aten/(27._r8*hygro_aer(m)*amcubeloc(m)))
else
smc(m) = 100._r8
endif
@@ -397,7 +397,7 @@ subroutine ndrop_bam_ccn(lchnk, ncol, maerosol, naer2)
if (m == idxsul) then
! Lohmann treatment for sulfate has variable size distribution
do i = 1, ncol
- if (naer2(i,k,m) > 0._r8) then
+ if (naer2(i,k,m) > 0._r8) then
amcubesulfate(i) = amcubefactor(m)*maerosol(i,k,m)/(naer2(i,k,m))
smcritsulfate(i) = smcritfactor(m)/sqrt(amcubesulfate(i))
else
@@ -433,7 +433,7 @@ subroutine ndrop_bam_ccn(lchnk, ncol, maerosol, naer2)
end do ! level
do l = 1, psat
- call outfld(ccn_name(l), ccn(1,1,l), pcols, lchnk)
+ call outfld(ccn_name(l), ccn(:,:,l), pcols, lchnk)
end do
do l = 1, naer_all
@@ -489,9 +489,9 @@ subroutine maxsat(zeta, eta, nmode, smc, smax)
sum=1.e20_r8
endif
enddo
-
+
smax=1._r8/sqrt(sum)
-
+
end subroutine maxsat
!===============================================================================
diff --git a/src/physics/cam/physpkg.F90 b/src/physics/cam/physpkg.F90
index 35ef4aa6ba..842f57c34b 100644
--- a/src/physics/cam/physpkg.F90
+++ b/src/physics/cam/physpkg.F90
@@ -1316,7 +1316,7 @@ subroutine tphysac (ztodt, cam_in, &
real(r8), pointer, dimension(:,:) :: dtcore
real(r8), pointer, dimension(:,:) :: ast ! relative humidity cloud fraction
- !tht: variables for dme_energy_adjust
+ !tht: variables for dme_energy_adjust
real(r8):: eflx(pcols), dsema(pcols)
logical, parameter:: ohf_adjust =.true. ! condensates have surface specific enthalpy
@@ -1626,8 +1626,8 @@ subroutine tphysac (ztodt, cam_in, &
!+tht
!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, tmp_q, tmp_t, tmp_cldliq, tmp_cldice, &
- qini, cldliqini, cldiceini, eflx, dsema)
+ call diag_phys_tend_writeout (state, pbuf, tend, ztodt, tmp_q, tmp_cldliq, tmp_cldice, &
+ qini, cldliqini, cldiceini, eflx=eflx, dsema=dsema, tmp_t=tmp_t)
!-tht
call clybry_fam_set( ncol, lchnk, map2chm, state%q, pbuf )
diff --git a/src/physics/cam/physpkg.F90.beta07 b/src/physics/cam/physpkg.F90.beta07
deleted file mode 100644
index 42828cf8df..0000000000
--- a/src/physics/cam/physpkg.F90.beta07
+++ /dev/null
@@ -1,2351 +0,0 @@
-module physpkg
- !-----------------------------------------------------------------------
- ! Purpose:
- !
- ! Provides the interface to CAM physics package
- !
- ! Revision history:
- ! Aug 2005, E. B. Kluzek, Creation of module from physpkg subroutine
- ! 2005-10-17 B. Eaton Add contents of inti.F90 to phys_init(). Add
- ! initialization of grid info in phys_state.
- ! Nov 2010 A. Gettelman Put micro/macro physics into separate routines
- !-----------------------------------------------------------------------
-
- use shr_kind_mod, only: r8 => shr_kind_r8
- use spmd_utils, only: masterproc
- use physconst, only: latvap, latice, rh2o
- 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,&
- physics_state_alloc, physics_state_dealloc, physics_tend_alloc, physics_tend_dealloc
- 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 camsrfexch, only: cam_out_t, cam_in_t
-
- 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
- use flux_avg, only: flux_avg_init
- use infnan, only: posinf, assignment(=)
- use perf_mod
- use cam_logfile, only: iulog
- use camsrfexch, only: cam_export
-
- 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
-
- implicit none
- private
- save
-
- ! Public methods
- public phys_register ! was initindx - register physics methods
- public phys_init ! Public initialization method
- public phys_run1 ! First phase of the public run method
- public phys_run2 ! Second phase of the public run method
- public phys_final ! Public finalization method
-
- ! Private module data
-
- ! Physics package options
- character(len=16) :: shallow_scheme
- character(len=16) :: macrop_scheme
- character(len=16) :: microp_scheme
- integer :: cld_macmic_num_steps ! Number of macro/micro substeps
- logical :: do_clubb_sgs
- logical :: use_subcol_microp ! if true, use subcolumns in microphysics
- 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
-
- ! Physics buffer index
- integer :: teout_idx = 0
-
- integer :: landm_idx = 0
- integer :: sgh_idx = 0
- integer :: sgh30_idx = 0
-
- integer :: qini_idx = 0
- integer :: cldliqini_idx = 0
- integer :: cldiceini_idx = 0
-
- integer :: prec_str_idx = 0
- integer :: snow_str_idx = 0
- integer :: prec_sed_idx = 0
- integer :: snow_sed_idx = 0
- integer :: prec_pcw_idx = 0
- integer :: snow_pcw_idx = 0
- integer :: prec_dp_idx = 0
- integer :: snow_dp_idx = 0
- integer :: prec_sh_idx = 0
- integer :: snow_sh_idx = 0
- integer :: dlfzm_idx = 0 ! detrained convective cloud water mixing ratio.
-
-!=======================================================================
-contains
-!=======================================================================
-
- subroutine phys_register
- !-----------------------------------------------------------------------
- !
- ! Purpose: Register constituents and physics buffer fields.
- !
- ! Author: CSM Contact: M. Vertenstein, Aug. 1997
- ! B.A. Boville, Oct 2001
- ! A. Gettelman, Nov 2010 - put micro/macro physics into separate routines
- !
- !-----------------------------------------------------------------------
- use cam_abortutils, only: endrun
- use physics_buffer, only: pbuf_init_time
- 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 cam_control_mod, only: moist_physics
- use chemistry, only: chem_register
- use cloud_fraction, only: cldfrc_register
- use rk_stratiform, only: rk_stratiform_register
- use microp_driver, only: microp_driver_register
- use microp_aero, only: microp_aero_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 tracers, only: tracers_register
- use check_energy, only: check_energy_register
- use carma_intr, only: carma_register
- use cam3_aero_data, only: cam3_aero_data_on, cam3_aero_data_register
- use cam3_ozone_data, only: cam3_ozone_data_on, cam3_ozone_data_register
- use ghg_data, only: ghg_data_register
- use vertical_diffusion, only: vd_register
- use convect_deep, only: convect_deep_register
- use convect_shallow, only: convect_shallow_register
- use radiation, only: radiation_register
- use co2_cycle, only: co2_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
- use prescribed_aero, only: prescribed_aero_register
- use prescribed_ghg, only: prescribed_ghg_register
- use sslt_rebin, only: sslt_rebin_register
- use aoa_tracers, only: aoa_tracers_register
- use aircraft_emit, only: aircraft_emit_register
- use cam_diagnostics, only: diag_register
- use cloud_diagnostics, only: cloud_diagnostics_register
- use cospsimulator_intr, only: cospsimulator_intr_register
- use rad_constituents, only: rad_cnst_get_info ! Added to query if it is a modal aero sim or not
- use subcol, only: subcol_register
- use subcol_utils, only: is_subcol_on
- use dyn_comp, only: dyn_register
- use spcam_drivers, only: spcam_register
- use offline_driver, only: offline_driver_reg
-
- !---------------------------Local variables-----------------------------
- !
- integer :: m ! loop index
- integer :: mm ! constituent index
- integer :: nmodes
- !-----------------------------------------------------------------------
-
- ! Get physics options
- call phys_getopts(shallow_scheme_out = shallow_scheme, &
- macrop_scheme_out = macrop_scheme, &
- microp_scheme_out = microp_scheme, &
- cld_macmic_num_steps_out = cld_macmic_num_steps, &
- do_clubb_sgs_out = do_clubb_sgs, &
- use_subcol_microp_out = use_subcol_microp, &
- state_debug_checks_out = state_debug_checks)
-
- ! Initialize dyn_time_lvls
- call pbuf_init_time()
-
- ! Register the subcol scheme
- call subcol_register()
-
- ! Register water vapor.
- ! ***** N.B. ***** This must be the first call to cnst_add so that
- ! water vapor is constituent 1.
- if (moist_physics) then
- call cnst_add('Q', mwh2o, cpwv, 1.E-12_r8, mm, &
- longname='Specific humidity', readiv=.true., is_convtran1=.true.)
- else
- call cnst_add('Q', mwh2o, cpwv, 0.0_r8, mm, &
- longname='Specific humidity', readiv=.false., is_convtran1=.true.)
- end if
-
- ! Topography file fields.
- call pbuf_add_field('LANDM', 'global', dtype_r8, (/pcols/), landm_idx)
- call pbuf_add_field('SGH', 'global', dtype_r8, (/pcols/), sgh_idx)
- call pbuf_add_field('SGH30', 'global', dtype_r8, (/pcols/), sgh30_idx)
-
- ! Fields for physics package diagnostics
- 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)
-
- ! check energy package
- call check_energy_register
-
- ! If using a simple physics option (e.g., held_suarez, adiabatic),
- ! the normal CAM physics parameterizations are not called.
- if (moist_physics) then
-
- ! register fluxes for saving across time
- if (phys_do_flux_avg()) call flux_avg_register()
-
- call cldfrc_register()
-
- ! cloud water
- if( microp_scheme == 'RK' ) then
- call rk_stratiform_register()
- elseif( microp_scheme == 'MG' ) then
- if (.not. do_clubb_sgs) call macrop_driver_register()
- call microp_aero_register()
- call microp_driver_register()
- end if
-
- ! Register CLUBB_SGS here
- if (do_clubb_sgs) call clubb_register_cam()
-
-
- call pbuf_add_field('PREC_STR', 'physpkg',dtype_r8,(/pcols/),prec_str_idx)
- call pbuf_add_field('SNOW_STR', 'physpkg',dtype_r8,(/pcols/),snow_str_idx)
- call pbuf_add_field('PREC_PCW', 'physpkg',dtype_r8,(/pcols/),prec_pcw_idx)
- call pbuf_add_field('SNOW_PCW', 'physpkg',dtype_r8,(/pcols/),snow_pcw_idx)
- call pbuf_add_field('PREC_SED', 'physpkg',dtype_r8,(/pcols/),prec_sed_idx)
- call pbuf_add_field('SNOW_SED', 'physpkg',dtype_r8,(/pcols/),snow_sed_idx)
- if (is_subcol_on()) then
- call pbuf_register_subcol('PREC_STR', 'phys_register', prec_str_idx)
- call pbuf_register_subcol('SNOW_STR', 'phys_register', snow_str_idx)
- call pbuf_register_subcol('PREC_PCW', 'phys_register', prec_pcw_idx)
- call pbuf_register_subcol('SNOW_PCW', 'phys_register', snow_pcw_idx)
- call pbuf_register_subcol('PREC_SED', 'phys_register', prec_sed_idx)
- call pbuf_register_subcol('SNOW_SED', 'phys_register', snow_sed_idx)
- end if
-
- ! Who should add FRACIS?
- ! -- It does not seem that aero_intr should add it since FRACIS is used in convection
- ! even if there are no prognostic aerosols ... so do it here for now
- call pbuf_add_field('FRACIS','physpkg',dtype_r8,(/pcols,pver,pcnst/),m)
-
- call conv_water_register()
-
- ! Determine whether its a 'modal' aerosol simulation or not
- call rad_cnst_get_info(0, nmodes=nmodes)
- clim_modal_aero = (nmodes > 0)
-
- if (clim_modal_aero) then
- call modal_aero_calcsize_reg()
- call modal_aero_wateruptake_reg()
- endif
-
- ! register chemical constituents including aerosols ...
- call chem_register()
-
- ! co2 constituents
- call co2_register()
-
- ! register data model ozone with pbuf
- if (cam3_ozone_data_on) then
- call cam3_ozone_data_register()
- end if
- call prescribed_volcaero_register()
- call prescribed_strataero_register()
- call prescribed_ozone_register()
- call prescribed_aero_register()
- call prescribed_ghg_register()
- call sslt_rebin_register
-
- ! CAM3 prescribed aerosols
- if (cam3_aero_data_on) then
- call cam3_aero_data_register()
- end if
-
- ! register various data model gasses with pbuf
- call ghg_data_register()
-
- ! carma microphysics
- !
- call carma_register()
-
- ! Register iondrag variables with pbuf
- call iondrag_register()
-
- ! Register ionosphere variables with pbuf if mode set to ionosphere
- if( waccmx_is('ionosphere') ) then
- call waccmx_phys_ion_elec_temp_reg()
- endif
-
- call aircraft_emit_register()
-
- ! deep convection
- call convect_deep_register
-
- ! shallow convection
- call convect_shallow_register
-
-
- call spcam_register
-
- ! radiation
- call radiation_register
- call cloud_diagnostics_register
-
- ! COSP
- call cospsimulator_intr_register
-
- ! vertical diffusion
- call vd_register()
- else
- ! held_suarez/adiabatic physics option should be in simple_physics
- call endrun('phys_register: moist_physics configuration error')
- end if
-
- ! Register diagnostics PBUF
- call diag_register()
-
- ! Register age of air tracers
- call aoa_tracers_register()
-
- ! Register test tracers
- call tracers_register()
-
- call dyn_register()
-
- ! All tracers registered, check that the dimensions are correct
- call cnst_chk_dim()
-
- ! ***NOTE*** No registering constituents after the call to cnst_chk_dim.
-
- call offline_driver_reg()
-
- 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 cam_initfiles, only: initial_file_get_id, topo_file_get_id
- use cam_grid_support, only: cam_grid_check, cam_grid_id
- use cam_grid_support, only: cam_grid_get_dim_names
- use pio, only: file_desc_t
- use ncdio_atm, only: infld
- use dycore, only: dycore_is
- use polar_avg, only: polar_average
- use short_lived_species, only: initialize_short_lived_species
- use cam_control_mod, only: aqua_planet
- use waccmx_phys_intr, only: waccmx_phys_ion_elec_temp_inidat
-
- type(cam_out_t), intent(inout) :: cam_out(begchunk:endchunk)
- type(physics_buffer_desc), pointer :: pbuf2d(:,:)
- integer :: lchnk, m, n, i, k, 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
-
- logical :: found=.false., found2=.false.
- integer :: ierr
- character(len=8) :: dim1name, dim2name
- integer :: ixcldice, ixcldliq
- integer :: grid_id ! grid ID for data mapping
- nullify(tptr,tptr_2,tptr3d,tptr3d_2)
-
- fh_ini => initial_file_get_id()
- fh_topo => topo_file_get_id()
-
- ! dynamics variables are handled in dyn_init - here we read variables needed for physics
- ! but not dynamics
-
- grid_id = cam_grid_id('physgrid')
- if (.not. cam_grid_check(grid_id)) then
- call endrun(trim(subname)//': Internal error, no "physgrid" grid')
- end if
- call cam_grid_get_dim_names(grid_id, dim1name, dim2name)
-
- allocate(tptr(1:pcols,begchunk:endchunk))
-
- if (associated(fh_topo) .and. .not. aqua_planet) then
- call infld('SGH', fh_topo, dim1name, dim2name, 1, pcols, begchunk, endchunk, &
- tptr, found, gridname='physgrid')
- if(.not. found) call endrun('ERROR: SGH not found on topo file')
-
- call pbuf_set_field(pbuf2d, sgh_idx, tptr)
-
- allocate(tptr_2(1:pcols,begchunk:endchunk))
- call infld('SGH30', fh_topo, dim1name, dim2name, 1, pcols, begchunk, endchunk, &
- tptr_2, found, gridname='physgrid')
- if(found) then
- call pbuf_set_field(pbuf2d, sgh30_idx, tptr_2)
- else
- if (masterproc) write(iulog,*) 'Warning: Error reading SGH30 from topo file.'
- if (masterproc) write(iulog,*) 'The field SGH30 will be filled using data from SGH.'
- call pbuf_set_field(pbuf2d, sgh30_idx, tptr)
- end if
-
- deallocate(tptr_2)
-
- call infld('LANDM_COSLAT', fh_topo, dim1name, dim2name, 1, pcols, begchunk, endchunk, &
- tptr, found, gridname='physgrid')
-
- if(.not.found) call endrun(' ERROR: LANDM_COSLAT not found on topo dataset.')
-
- call pbuf_set_field(pbuf2d, landm_idx, tptr)
-
- else
- call pbuf_set_field(pbuf2d, sgh_idx, 0._r8)
- call pbuf_set_field(pbuf2d, sgh30_idx, 0._r8)
- call pbuf_set_field(pbuf2d, landm_idx, 0._r8)
- end if
-
- call infld('PBLH', fh_ini, dim1name, dim2name, 1, pcols, begchunk, endchunk, &
- tptr(:,:), found, gridname='physgrid')
- if(.not. found) then
- tptr(:,:) = 0._r8
- if (masterproc) write(iulog,*) 'PBLH initialized to 0.'
- end if
- pblh_idx = pbuf_get_index('pblh')
-
- call pbuf_set_field(pbuf2d, pblh_idx, tptr)
-
- call infld('TPERT', fh_ini, dim1name, dim2name, 1, pcols, begchunk, endchunk, &
- tptr(:,:), found, gridname='physgrid')
- if(.not. found) then
- tptr(:,:) = 0._r8
- if (masterproc) write(iulog,*) 'TPERT initialized to 0.'
- end if
- tpert_idx = pbuf_get_index( 'tpert')
- call pbuf_set_field(pbuf2d, tpert_idx, tptr)
-
- fieldname='QPERT'
- qpert_idx = pbuf_get_index( 'qpert',ierr)
- if (qpert_idx > 0) then
- call infld(fieldname, fh_ini, dim1name, dim2name, 1, pcols, begchunk, endchunk, &
- tptr, found, gridname='physgrid')
- if(.not. found) then
- tptr=0_r8
- if (masterproc) write(iulog,*) trim(fieldname), ' initialized to 0.'
- end if
-
- allocate(tptr3d_2(pcols,pcnst,begchunk:endchunk))
- tptr3d_2 = 0_r8
- tptr3d_2(:,1,:) = tptr(:,:)
-
- call pbuf_set_field(pbuf2d, qpert_idx, tptr3d_2)
- deallocate(tptr3d_2)
- end if
-
- fieldname='CUSH'
- m = pbuf_get_index('cush', ierr)
- if (m > 0) then
- call infld(fieldname, fh_ini, dim1name, dim2name, 1, pcols, begchunk, endchunk, &
- tptr, found, gridname='physgrid')
- if(.not.found) then
- if(masterproc) write(iulog,*) trim(fieldname), ' initialized to 1000.'
- tptr=1000._r8
- end if
- do n=1,dyn_time_lvls
- call pbuf_set_field(pbuf2d, m, tptr, start=(/1,n/), kount=(/pcols,1/))
- end do
- deallocate(tptr)
- end if
-
- do lchnk=begchunk,endchunk
- cam_out(lchnk)%tbot(:) = posinf
- end do
-
- !
- ! 3-D fields
- !
-
- allocate(tptr3d(pcols,pver,begchunk:endchunk))
-
- fieldname='CLOUD'
- m = pbuf_get_index('CLD')
- call infld(fieldname, fh_ini, dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, &
- tptr3d, found, gridname='physgrid')
- if(found) then
- do n = 1, dyn_time_lvls
- call pbuf_set_field(pbuf2d, m, tptr3d, (/1,1,n/),(/pcols,pver,1/))
- end do
- else
- call pbuf_set_field(pbuf2d, m, 0._r8)
- if (masterproc) write(iulog,*) trim(fieldname), ' initialized to 0.'
- end if
-
- fieldname='QCWAT'
- m = pbuf_get_index(fieldname,ierr)
- if (m > 0) then
- call infld(fieldname, fh_ini, dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, &
- tptr3d, found, gridname='physgrid')
- if(.not. found) then
- call infld('Q',fh_ini,dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, &
- tptr3d, found, gridname='physgrid')
- if (found) then
- if (masterproc) write(iulog,*) trim(fieldname), ' initialized with Q'
- if(dycore_is('LR')) call polar_average(pver, tptr3d)
- else
- call endrun(' '//trim(subname)//' Error: Q must be on Initial File')
- end if
- end if
- do n = 1, dyn_time_lvls
- call pbuf_set_field(pbuf2d, m, tptr3d, (/1,1,n/),(/pcols,pver,1/))
- end do
- end if
-
- fieldname = 'ICCWAT'
- m = pbuf_get_index(fieldname, ierr)
- if (m > 0) then
- call infld(fieldname, fh_ini, dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, &
- tptr3d, found, gridname='physgrid')
- if(found) then
- do n = 1, dyn_time_lvls
- call pbuf_set_field(pbuf2d, m, tptr3d, (/1,1,n/),(/pcols,pver,1/))
- end do
- else
- call cnst_get_ind('CLDICE', ixcldice)
- call infld('CLDICE',fh_ini,dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, &
- tptr3d, found, gridname='physgrid')
- if(found) then
- do n = 1, dyn_time_lvls
- call pbuf_set_field(pbuf2d, m, tptr3d, (/1,1,n/),(/pcols,pver,1/))
- end do
- else
- call pbuf_set_field(pbuf2d, m, 0._r8)
- end if
- if (masterproc) then
- if (found) then
- write(iulog,*) trim(fieldname), ' initialized with CLDICE'
- else
- write(iulog,*) trim(fieldname), ' initialized to 0.0'
- end if
- end if
- end if
- end if
-
- fieldname = 'LCWAT'
- m = pbuf_get_index(fieldname,ierr)
- if (m > 0) then
- call infld(fieldname, fh_ini, dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, &
- tptr3d, found, gridname='physgrid')
- if(found) then
- do n = 1, dyn_time_lvls
- call pbuf_set_field(pbuf2d, m, tptr3d, (/1,1,n/),(/pcols,pver,1/))
- end do
- else
- allocate(tptr3d_2(pcols,pver,begchunk:endchunk))
- call cnst_get_ind('CLDICE', ixcldice)
- call cnst_get_ind('CLDLIQ', ixcldliq)
- call infld('CLDICE',fh_ini,dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, &
- tptr3d, found, gridname='physgrid')
- call infld('CLDLIQ',fh_ini,dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, &
- tptr3d_2, found2, gridname='physgrid')
- if(found .and. found2) then
- do lchnk = begchunk, endchunk
- ncol = get_ncols_p(lchnk)
- tptr3d(:ncol,:,lchnk)=tptr3d(:ncol,:,lchnk)+tptr3d_2(:ncol,:,lchnk)
- end do
- if (masterproc) write(iulog,*) trim(fieldname), ' initialized with CLDICE + CLDLIQ'
- else if (found) then ! Data already loaded in tptr3d
- if (masterproc) write(iulog,*) trim(fieldname), ' initialized with CLDICE only'
- else if (found2) then
- tptr3d(:,:,:)=tptr3d_2(:,:,:)
- if (masterproc) write(iulog,*) trim(fieldname), ' initialized with CLDLIQ only'
- end if
-
- if (found .or. found2) then
- do n = 1, dyn_time_lvls
- call pbuf_set_field(pbuf2d, m, tptr3d, (/1,1,n/),(/pcols,pver,1/))
- end do
- if(dycore_is('LR')) call polar_average(pver, tptr3d)
- else
- call pbuf_set_field(pbuf2d, m, 0._r8)
- if (masterproc) write(iulog,*) trim(fieldname), ' initialized to 0.0'
- end if
- deallocate(tptr3d_2)
- end if
- end if
-
- deallocate(tptr3d)
- allocate(tptr3d(pcols,pver,begchunk:endchunk))
-
- fieldname = 'TCWAT'
- m = pbuf_get_index(fieldname,ierr)
- if (m > 0) then
- call infld(fieldname, fh_ini, dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, &
- tptr3d, found, gridname='physgrid')
- if(.not.found) then
- call infld('T', fh_ini, dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, &
- tptr3d, found, gridname='physgrid')
- if(dycore_is('LR')) call polar_average(pver, tptr3d)
- if (masterproc) write(iulog,*) trim(fieldname), ' initialized with T'
- end if
- do n = 1, dyn_time_lvls
- call pbuf_set_field(pbuf2d, m, tptr3d, (/1,1,n/),(/pcols,pver,1/))
- end do
- end if
-
- deallocate(tptr3d)
- allocate(tptr3d(pcols,pverp,begchunk:endchunk))
-
- fieldname = 'TKE'
- m = pbuf_get_index( 'tke')
- call infld(fieldname, fh_ini, dim1name, 'ilev', dim2name, 1, pcols, 1, pverp, begchunk, endchunk, &
- tptr3d, found, gridname='physgrid')
- if (found) then
- call pbuf_set_field(pbuf2d, m, tptr3d)
- else
- call pbuf_set_field(pbuf2d, m, 0.01_r8)
- if (masterproc) write(iulog,*) trim(fieldname), ' initialized to 0.01'
- end if
-
-
- fieldname = 'KVM'
- m = pbuf_get_index('kvm')
- call infld(fieldname, fh_ini, dim1name, 'ilev', dim2name, 1, pcols, 1, pverp, begchunk, endchunk, &
- tptr3d, found, gridname='physgrid')
- if (found) then
- call pbuf_set_field(pbuf2d, m, tptr3d)
- else
- call pbuf_set_field(pbuf2d, m, 0._r8)
- if (masterproc) write(iulog,*) trim(fieldname), ' initialized to 0.'
- end if
-
-
- fieldname = 'KVH'
- m = pbuf_get_index('kvh')
- call infld(fieldname, fh_ini, dim1name, 'ilev', dim2name, 1, pcols, 1, pverp, begchunk, endchunk, &
- tptr3d, found, gridname='physgrid')
- if (found) then
- call pbuf_set_field(pbuf2d, m, tptr3d)
- else
- call pbuf_set_field(pbuf2d, m, 0._r8)
- if (masterproc) write(iulog,*) trim(fieldname), ' initialized to 0.'
- end if
-
- deallocate(tptr3d)
- allocate(tptr3d(pcols,pver,begchunk:endchunk))
-
- fieldname = 'CONCLD'
- m = pbuf_get_index('CONCLD',ierr)
- if (m > 0) then
- call infld(fieldname, fh_ini, dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, &
- tptr3d, found, gridname='physgrid')
- if(found) then
- do n = 1, dyn_time_lvls
- call pbuf_set_field(pbuf2d, m, tptr3d, (/1,1,n/),(/pcols,pver,1/))
- end do
- else
- call pbuf_set_field(pbuf2d, m, 0._r8)
- if (masterproc) write(iulog,*) trim(fieldname), ' initialized to 0.'
- end if
-
- deallocate (tptr3d)
- end if
-
- call initialize_short_lived_species(fh_ini, pbuf2d)
-
- !---------------------------------------------------------------------------------
- ! If needed, get ion and electron temperature fields from initial condition file
- !---------------------------------------------------------------------------------
-
- call waccmx_phys_ion_elec_temp_inidat(fh_ini,pbuf2d)
-
- end subroutine phys_inidat
-
-
- subroutine phys_init( phys_state, phys_tend, pbuf2d, cam_out )
-
- !-----------------------------------------------------------------------
- !
- ! Initialization of physics package.
- !
- !-----------------------------------------------------------------------
-
- 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, physconst_init
- use ref_pres, only: pref_edge, pref_mid
-
- use carma_intr, only: carma_init
- use cam_control_mod, only: initial_run
- use check_energy, only: check_energy_init
- use chemistry, only: chem_init
- use prescribed_ozone, only: prescribed_ozone_init
- use prescribed_ghg, only: prescribed_ghg_init
- use prescribed_aero, only: prescribed_aero_init
- use aerodep_flx, only: aerodep_flx_init
- use aircraft_emit, only: aircraft_emit_init
- use prescribed_volcaero,only: prescribed_volcaero_init
- use prescribed_strataero,only: prescribed_strataero_init
- use cloud_fraction, only: cldfrc_init
- use cldfrc2m, only: cldfrc2m_init
- use co2_cycle, only: co2_init, co2_transport
- use convect_deep, only: convect_deep_init
- use convect_shallow, only: convect_shallow_init
- use cam_diagnostics, only: diag_init
- use gw_drag, only: gw_init
- use cam3_aero_data, only: cam3_aero_data_on, cam3_aero_data_init
- use cam3_ozone_data, only: cam3_ozone_data_on, cam3_ozone_data_init
- use radheat, only: radheat_init
- use radiation, only: radiation_init
- use cloud_diagnostics, only: cloud_diagnostics_init
- use rk_stratiform, only: rk_stratiform_init
- use wv_saturation, only: wv_sat_init
- use microp_driver, only: microp_driver_init
- use microp_aero, only: microp_aero_init
- use macrop_driver, only: macrop_driver_init
- use conv_water, only: conv_water_init
- use spcam_drivers, only: spcam_init
- use tracers, only: tracers_init
- use aoa_tracers, only: aoa_tracers_init
- use rayleigh_friction, only: rayleigh_friction_init
- 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 iondrag, only: iondrag_init, do_waccm_ions
-#if ( defined OFFLINE_DYN )
- use metdata, only: metdata_phys_init
-#endif
- use epp_ionization, only: epp_ionization_init, epp_ionization_active
- use waccmx_phys_intr, only: waccmx_phys_ion_elec_temp_init ! Initialization of ionosphere module (WACCM-X)
- use waccmx_phys_intr, only: waccmx_phys_mspd_init ! Initialization of major species diffusion module (WACCM-X)
- use clubb_intr, only: clubb_ini_cam
- use sslt_rebin, only: sslt_rebin_init
- use tropopause, only: tropopause_init
- use solar_data, only: solar_data_init
- use dadadj_cam, only: dadadj_init
- use cam_abortutils, only: endrun
-
- ! Input/output arguments
- type(physics_state), pointer :: phys_state(:)
- type(physics_tend ), pointer :: phys_tend(:)
- type(physics_buffer_desc), pointer :: pbuf2d(:,:)
-
- type(cam_out_t),intent(inout) :: cam_out(begchunk:endchunk)
-
- ! local variables
- integer :: lchnk
- integer :: ierr
-
- !-----------------------------------------------------------------------
-
- call physics_type_alloc(phys_state, phys_tend, begchunk, endchunk, pcols)
-
- do lchnk = begchunk, endchunk
- call physics_state_set_grid(lchnk, phys_state(lchnk))
- end do
-
- !-------------------------------------------------------------------------------------------
- ! Initialize any variables in physconst which are not temporally and/or spatially constant
- !-------------------------------------------------------------------------------------------
- call physconst_init()
-
- ! Initialize debugging a physics column
- call phys_debug_init()
-
- call pbuf_initialize(pbuf2d)
-
- ! Initialize subcol scheme
- call subcol_init(pbuf2d)
-
- ! diag_init makes addfld calls for dynamics fields that are output from
- ! the physics decomposition
- call diag_init(pbuf2d)
-
- call check_energy_init()
-
- call tracers_init()
-
- ! age of air tracers
- call aoa_tracers_init()
-
- teout_idx = pbuf_get_index( 'TEOUT')
-
- ! adiabatic or ideal physics should be only used if in simple_physics
- if (adiabatic .or. ideal_phys) then
- if (adiabatic) then
- call endrun('phys_init: adiabatic configuration error')
- else
- call endrun('phys_init: ideal_phys configuration error')
- end if
- end if
-
- if (initial_run) then
- call phys_inidat(cam_out, pbuf2d)
- end if
-
- ! wv_saturation is relatively independent of everything else and
- ! low level, so init it early. Must at least do this before radiation.
- call wv_sat_init
-
- ! CAM3 prescribed aerosols
- if (cam3_aero_data_on) call cam3_aero_data_init(phys_state)
-
- ! Initialize rad constituents and their properties
- call rad_cnst_init()
- call aer_rad_props_init()
-
- ! initialize carma
- call carma_init()
-
- ! solar irradiance data modules
- call solar_data_init()
-
- ! Prognostic chemistry.
- call chem_init(phys_state,pbuf2d)
-
- ! Prescribed tracers
- call prescribed_ozone_init()
- call prescribed_ghg_init()
- call prescribed_aero_init()
- call aerodep_flx_init()
- call aircraft_emit_init()
- call prescribed_volcaero_init()
- call prescribed_strataero_init()
-
- ! co2 cycle
- if (co2_transport()) then
- call co2_init()
- end if
-
- ! CAM3 prescribed ozone
- if (cam3_ozone_data_on) call cam3_ozone_data_init(phys_state)
-
- call gw_init()
-
- call rayleigh_friction_init()
-
- call pbl_utils_init(gravit, karman, cpair, rair, zvir)
- call vertical_diffusion_init(pbuf2d)
-
- if ( waccmx_is('ionosphere') .or. waccmx_is('neutral') ) then
- call waccmx_phys_mspd_init ()
- ! Initialization of ionosphere module if mode set to ionosphere
- if( waccmx_is('ionosphere') ) then
- call waccmx_phys_ion_elec_temp_init(pbuf2d)
- endif
- endif
-
- call radiation_init(pbuf2d)
-
- call cloud_diagnostics_init()
-
- call radheat_init(pref_mid)
-
- call convect_shallow_init(pref_edge, pbuf2d)
-
- call cldfrc_init()
- call cldfrc2m_init()
-
- call convect_deep_init(pref_edge)
-
- if( microp_scheme == 'RK' ) then
- call rk_stratiform_init()
- elseif( microp_scheme == 'MG' ) then
- if (.not. do_clubb_sgs) call macrop_driver_init(pbuf2d)
- call microp_aero_init()
- call microp_driver_init(pbuf2d)
- call conv_water_init
- elseif( microp_scheme == 'SPCAM_m2005') then
- call conv_water_init
- end if
-
-
- ! initiate CLUBB within CAM
- if (do_clubb_sgs) call clubb_ini_cam(pbuf2d)
-
- call spcam_init(pbuf2d)
-
- call qbo_init
-
- call iondrag_init(pref_mid)
- ! Geomagnetic module -- after iondrag_init
- if (epp_ionization_active) then
- call epp_ionization_init()
- endif
-
-#if ( defined OFFLINE_DYN )
- call metdata_phys_init()
-#endif
- call sslt_rebin_init()
- call tropopause_init()
- call dadadj_init()
-
- prec_dp_idx = pbuf_get_index('PREC_DP')
- snow_dp_idx = pbuf_get_index('SNOW_DP')
- prec_sh_idx = pbuf_get_index('PREC_SH')
- snow_sh_idx = pbuf_get_index('SNOW_SH')
-
- dlfzm_idx = pbuf_get_index('DLFZM', ierr)
-
- call phys_getopts(prog_modal_aero_out=prog_modal_aero)
-
- if (clim_modal_aero) then
-
- ! If climate calculations are affected by prescribed modal aerosols, the
- ! the initialization routine for the dry mode radius calculation is called
- ! here. For prognostic MAM the initialization is called from
- ! modal_aero_initialize
- if (.not. prog_modal_aero) then
- call modal_aero_calcsize_init(pbuf2d)
- endif
-
- call modal_aero_wateruptake_init(pbuf2d)
-
- end if
-
- end subroutine phys_init
-
- !
- !-----------------------------------------------------------------------
- !
-
- subroutine phys_run1(phys_state, ztodt, phys_tend, pbuf2d, cam_in, cam_out)
- !-----------------------------------------------------------------------
- !
- ! Purpose:
- ! First part of atmospheric physics package before updating of surface models
- !
- !-----------------------------------------------------------------------
- use time_manager, only: get_nstep
- use cam_diagnostics,only: diag_allocate, diag_physvar_ic
- use check_energy, only: check_energy_gmean
- use phys_control, only: phys_getopts
- use spcam_drivers, only: tphysbc_spcam
- use spmd_utils, only: mpicom
- use physics_buffer, only: physics_buffer_desc, pbuf_get_chunk, pbuf_allocate
-#if (defined BFB_CAM_SCAM_IOP )
- use cam_history, only: outfld
-#endif
- use cam_abortutils, only: endrun
-#if ( defined OFFLINE_DYN )
- use metdata, only: get_met_srf1
-#endif
- !
- ! Input arguments
- !
- real(r8), intent(in) :: ztodt ! physics time step unless nstep=0
- !
- ! Input/Output 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, dimension(:,:) :: pbuf2d
- type(cam_in_t), dimension(begchunk:endchunk) :: cam_in
- type(cam_out_t), dimension(begchunk:endchunk) :: 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(:)
-
- call t_startf ('physpkg_st1')
- nstep = get_nstep()
-
-#if ( defined OFFLINE_DYN )
- !
- ! if offline mode set SNOWH and TS for micro-phys
- !
- call get_met_srf1( cam_in )
-#endif
-
- ! The following initialization depends on the import state (cam_in)
- ! being initialized. This isn't true when cam_init is called, so need
- ! to postpone this initialization to here.
- if (nstep == 0 .and. phys_do_flux_avg()) call flux_avg_init(cam_in, pbuf2d)
-
- ! Compute total energy of input state and previous output state
- call t_startf ('chk_en_gmean')
- 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()
-
- !-----------------------------------------------------------------------
- ! Advance time information
- !-----------------------------------------------------------------------
-
- call phys_timestep_init(phys_state, cam_in, cam_out, pbuf2d)
-
- call t_stopf ('physpkg_st1')
-
-#ifdef TRACER_CHECK
- call gmean_mass ('before tphysbc DRY', phys_state)
-#endif
-
-
- !-----------------------------------------------------------------------
- ! Tendency physics before flux coupler invocation
- !-----------------------------------------------------------------------
- !
-
-#if (defined BFB_CAM_SCAM_IOP )
- do c=begchunk, endchunk
- call outfld('Tg',cam_in(c)%ts,pcols ,c )
- end do
-#endif
-
- call t_barrierf('sync_bc_physics', mpicom)
- call t_startf ('bc_physics')
- call t_adj_detailf(+1)
-
- call phys_getopts( use_spcam_out = use_spcam)
-
-!$OMP PARALLEL DO PRIVATE (C, phys_buffer_chunk)
- do c=begchunk, endchunk
- !
- ! Output physics terms to IC file
- !
- phys_buffer_chunk => pbuf_get_chunk(pbuf2d, c)
-
- call t_startf ('diag_physvar_ic')
- call diag_physvar_ic ( c, phys_buffer_chunk, cam_out(c), cam_in(c) )
- call t_stopf ('diag_physvar_ic')
-
- if (use_spcam) then
- call tphysbc_spcam (ztodt, phys_state(c), &
- phys_tend(c), phys_buffer_chunk, &
- cam_out(c), cam_in(c) )
- else
- call tphysbc (ztodt, phys_state(c), &
- phys_tend(c), phys_buffer_chunk, &
- cam_out(c), cam_in(c) )
- end if
-
- end do
-
- call t_adj_detailf(-1)
- call t_stopf ('bc_physics')
-
- ! Don't call the rest in CRM mode
- if(single_column.and.scm_crm_mode) return
-
-#ifdef TRACER_CHECK
- call gmean_mass ('between DRY', phys_state)
-#endif
-
- end subroutine phys_run1
-
- !
- !-----------------------------------------------------------------------
- !
-
- subroutine phys_run2(phys_state, ztodt, phys_tend, pbuf2d, cam_out, &
- cam_in )
- !-----------------------------------------------------------------------
- !
- ! Purpose:
- ! Second part of atmospheric physics package after updating of surface models
- !
- !-----------------------------------------------------------------------
- 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
-#if ( defined OFFLINE_DYN )
- use metdata, only: get_met_srf2
-#endif
- !
- ! Input arguments
- !
- real(r8), intent(in) :: ztodt ! physics time step unless nstep=0
- !
- ! Input/Output 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, dimension(:,:) :: pbuf2d
-
- type(cam_out_t), intent(inout), dimension(begchunk:endchunk) :: cam_out
- type(cam_in_t), intent(inout), dimension(begchunk:endchunk) :: cam_in
- !
- !-----------------------------------------------------------------------
- !---------------------------Local workspace-----------------------------
- !
- integer :: c ! chunk index
- integer :: ncol ! number of columns
- type(physics_buffer_desc),pointer, dimension(:) :: phys_buffer_chunk
- !
- ! If exit condition just return
- !
-
- if(single_column.and.scm_crm_mode) return
-
- !-----------------------------------------------------------------------
- ! Tendency physics after coupler
- ! Not necessary at terminal timestep.
- !-----------------------------------------------------------------------
- !
-#if ( defined OFFLINE_DYN )
- !
- ! if offline mode set SHFLX QFLX TAUX TAUY for vert diffusion
- !
- call get_met_srf2( cam_in )
-#endif
- ! Set lightning production of NO
- call t_startf ('lightning_no_prod')
- call lightning_no_prod( phys_state, pbuf2d, cam_in )
- call t_stopf ('lightning_no_prod')
-
- call t_barrierf('sync_ac_physics', mpicom)
- call t_startf ('ac_physics')
- call t_adj_detailf(+1)
-
-!$OMP PARALLEL DO PRIVATE (C, NCOL, phys_buffer_chunk)
-
- do c=begchunk,endchunk
- ncol = get_ncols_p(c)
- phys_buffer_chunk => pbuf_get_chunk(pbuf2d, c)
- !
- ! surface diagnostics for history files
- !
- call t_startf('diag_surf')
- call diag_surf(cam_in(c), cam_out(c), phys_state(c), phys_buffer_chunk)
- call t_stopf('diag_surf')
-
- call tphysac(ztodt, cam_in(c), &
- cam_out(c), &
- phys_state(c), phys_tend(c), phys_buffer_chunk)
- end do ! Chunk loop
-
- call t_adj_detailf(-1)
- call t_stopf('ac_physics')
-
-#ifdef TRACER_CHECK
- call gmean_mass ('after tphysac FV:WET)', phys_state)
-#endif
-
- call t_startf ('carma_accumulate_stats')
- call carma_accumulate_stats()
- call t_stopf ('carma_accumulate_stats')
-
- call t_startf ('physpkg_st2')
- call pbuf_deallocate(pbuf2d, 'physpkg')
-
- call pbuf_update_tim_idx()
- call diag_deallocate()
- call t_stopf ('physpkg_st2')
-
- end subroutine phys_run2
-
- !
- !-----------------------------------------------------------------------
- !
-
- subroutine phys_final( phys_state, phys_tend, pbuf2d )
- use physics_buffer, only : physics_buffer_desc, pbuf_deallocate
- use chemistry, only : chem_final
- use carma_intr, only : carma_final
- use wv_saturation, only : wv_sat_final
- !-----------------------------------------------------------------------
- !
- ! Purpose:
- ! Finalization of physics package
- !
- !-----------------------------------------------------------------------
- ! Input/output arguments
- type(physics_state), pointer :: phys_state(:)
- type(physics_tend ), pointer :: phys_tend(:)
- type(physics_buffer_desc), pointer :: pbuf2d(:,:)
-
- if(associated(pbuf2d)) then
- call pbuf_deallocate(pbuf2d,'global')
- deallocate(pbuf2d)
- end if
- deallocate(phys_state)
- deallocate(phys_tend)
- call chem_final
- call carma_final
- call wv_sat_final
-
- end subroutine phys_final
-
-
- subroutine tphysac (ztodt, cam_in, &
- cam_out, state, tend, pbuf)
- !-----------------------------------------------------------------------
- !
- ! Tendency physics after coupling to land, sea, and ice models.
- !
- ! Computes the following:
- !
- ! o Aerosol Emission at Surface
- ! o Source-Sink for Advected Tracers
- ! o Symmetric Turbulence Scheme - Vertical Diffusion
- ! o Rayleigh Friction
- ! o Dry Deposition of Aerosol
- ! o Enforce Charge Neutrality ( Only for WACCM )
- ! o Gravity Wave Drag
- ! o QBO Relaxation ( Only for WACCM )
- ! o Ion Drag ( Only for WACCM )
- ! o Scale Dry Mass Energy
- !-----------------------------------------------------------------------
- use physics_buffer, only: physics_buffer_desc, pbuf_set_field, pbuf_get_index, pbuf_get_field, pbuf_old_tim_idx
- use shr_kind_mod, only: r8 => shr_kind_r8
- use chemistry, only: chem_is_active, chem_timestep_tend, chem_emissions
- use cam_diagnostics, only: diag_phys_tend_writeout
- use gw_drag, only: gw_tend
- use vertical_diffusion, only: vertical_diffusion_tend
- use rayleigh_friction, only: rayleigh_friction_tend
- use constituents, only: cnst_get_ind
- use physics_types, only: physics_state, physics_tend, physics_ptend, physics_update, &
- physics_dme_adjust, set_dry_to_wet, physics_state_check
- use waccmx_phys_intr, only: waccmx_phys_mspd_tend ! WACCM-X major diffusion
- use waccmx_phys_intr, only: waccmx_phys_ion_elec_temp_tend ! WACCM-X
- use aoa_tracers, only: aoa_tracers_timestep_tend
- use physconst, only: rhoh2o, latvap,latice
- 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
- use check_energy, only: check_tracers_data, check_tracers_init, check_tracers_chng
- use time_manager, only: get_nstep
- use cam_abortutils, only: endrun
- use dycore, only: dycore_is
- use cam_control_mod, only: aqua_planet
- use mo_gas_phase_chemdr,only: map2chm
- use clybry_fam, only: clybry_fam_set
- use charge_neutrality, only: charge_balance
- use qbo, only: qbo_relax
- use iondrag, only: iondrag_calc, do_waccm_ions
- use perf_mod
- use flux_avg, only: flux_avg_run
- use unicon_cam, only: unicon_cam_org_diags
-
- !
- ! Arguments
- !
- real(r8), intent(in) :: ztodt ! Two times model timestep (2 delta-t)
-
- type(cam_in_t), intent(inout) :: cam_in
- type(cam_out_t), intent(inout) :: cam_out
- type(physics_state), intent(inout) :: state
- type(physics_tend ), intent(inout) :: tend
- type(physics_buffer_desc), pointer :: pbuf(:)
-
-
- type(check_tracers_data):: tracerint ! tracer mass integrals and cummulative boundary fluxes
-
- !
- !---------------------------Local workspace-----------------------------
- !
- type(physics_ptend) :: ptend ! indivdual parameterization tendencies
-
- 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.
-
- 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_t (pcols,pver) !tht: tmp space
-
- ! physics buffer fields for total energy and mass adjustment
- integer itim_old, ifld
-
- real(r8), pointer, dimension(:,:) :: cld
- real(r8), pointer, dimension(:,:) :: qini
- real(r8), pointer, dimension(:,:) :: cldliqini
- real(r8), pointer, dimension(:,:) :: cldiceini
- real(r8), pointer, dimension(:,:) :: dtcore
- real(r8), pointer, dimension(:,:) :: ast ! relative humidity cloud fraction
-
- !tht: variables for dme_energy_adjust
- real(r8):: eflx(pcols), dsema(pcols)
- logical, parameter:: ohf_adjust =.true. ! condensates have surface specific enthalpy
-
- !-----------------------------------------------------------------------
- lchnk = state%lchnk
- ncol = state%ncol
-
- nstep = get_nstep()
-
- ! Adjust the surface fluxes to reduce instabilities in near sfc layer
- if (phys_do_flux_avg()) then
- call flux_avg_run(state, cam_in, pbuf, nstep, ztodt)
- endif
-
- ! Validate the physics state.
- if (state_debug_checks) &
- call physics_state_check(state, name="before tphysac")
-
- call t_startf('tphysac_init')
- ! Associate pointers with physics buffer fields
- itim_old = pbuf_old_tim_idx()
-
-
- ifld = pbuf_get_index('DTCORE')
- call pbuf_get_field(pbuf, ifld, dtcore, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) )
-
- call pbuf_get_field(pbuf, qini_idx, qini)
- call pbuf_get_field(pbuf, cldliqini_idx, cldliqini)
- call pbuf_get_field(pbuf, cldiceini_idx, cldiceini)
-
- ifld = pbuf_get_index('CLD')
- call pbuf_get_field(pbuf, ifld, cld, start=(/1,1,itim_old/),kount=(/pcols,pver,1/))
-
- ifld = pbuf_get_index('AST')
- call pbuf_get_field(pbuf, ifld, ast, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) )
-
- !
- ! accumulate fluxes into net flux array for spectral dycores
- ! jrm Include latent heat of fusion for snow
- !
- do i=1,ncol
- tend%flx_net(i) = tend%flx_net(i) + cam_in%shf(i) + (cam_out%precc(i) &
- + cam_out%precl(i))*latvap*rhoh2o &
- + (cam_out%precsc(i) + cam_out%precsl(i))*latice*rhoh2o
- end do
-
- ! emissions of aerosols and gas-phase chemistry constituents at surface
- call chem_emissions( state, cam_in )
-
- if (carma_do_emission) then
- ! carma emissions
- call carma_emission_tend (state, ptend, cam_in, ztodt)
- call physics_update(state, ptend, ztodt, tend)
- end if
-
- ! get nstep and zero array for energy checker
- zero = 0._r8
- nstep = get_nstep()
- call check_tracers_init(state, tracerint)
-
- ! Check if latent heat flux exceeds the total moisture content of the
- ! lowest model layer, thereby creating negative moisture.
-
- call qneg4('TPHYSAC ' ,lchnk ,ncol ,ztodt , &
- state%q(1,pver,1),state%rpdel(1,pver) ,cam_in%shf , &
- cam_in%lhf , cam_in%cflx )
-
- call t_stopf('tphysac_init')
- !===================================================
- ! Source/sink terms for advected tracers.
- !===================================================
- call t_startf('adv_tracer_src_snk')
- ! Test tracers
-
- call aoa_tracers_timestep_tend(state, ptend, cam_in%cflx, cam_in%landfrac, ztodt)
- call physics_update(state, ptend, ztodt, tend)
- call check_tracers_chng(state, tracerint, "aoa_tracers_timestep_tend", nstep, ztodt, &
- cam_in%cflx)
-
- !===================================================
- ! Chemistry and MAM calculation
- ! MAM core aerosol conversion process is performed in the below 'chem_timestep_tend'.
- ! In addition, surface flux of aerosol species other than 'dust' and 'sea salt', and
- ! elevated emission of aerosol species are treated in 'chem_timestep_tend' before
- ! Gas chemistry and MAM core aerosol conversion.
- ! Note that surface flux is not added into the atmosphere, but elevated emission is
- ! added into the atmosphere as tendency.
- !===================================================
- if (chem_is_active()) then
- call chem_timestep_tend(state, ptend, cam_in, cam_out, ztodt, &
- pbuf, fh2o=fh2o)
-
- call physics_update(state, ptend, ztodt, tend)
- call check_energy_chng(state, tend, "chem", nstep, ztodt, fh2o, zero, zero, zero)
- call check_tracers_chng(state, tracerint, "chem_timestep_tend", nstep, ztodt, &
- cam_in%cflx)
- end if
- call t_stopf('adv_tracer_src_snk')
-
- !===================================================
- ! Vertical diffusion/pbl calculation
- ! Call vertical diffusion code (pbl, free atmosphere and molecular)
- !===================================================
-
- call t_startf('vertical_diffusion_tend')
- call vertical_diffusion_tend (ztodt ,state , cam_in, &
- surfric ,obklen ,ptend ,ast ,pbuf )
-
- !------------------------------------------
- ! Call major diffusion for extended model
- !------------------------------------------
- if ( waccmx_is('ionosphere') .or. waccmx_is('neutral') ) then
- call waccmx_phys_mspd_tend (ztodt ,state ,ptend)
- endif
-
- call physics_update(state, ptend, ztodt, tend)
-
- call t_stopf ('vertical_diffusion_tend')
-
- !===================================================
- ! Rayleigh friction calculation
- !===================================================
- call t_startf('rayleigh_friction')
- call rayleigh_friction_tend( ztodt, state, ptend)
- call physics_update(state, ptend, ztodt, tend)
- call t_stopf('rayleigh_friction')
-
- if (do_clubb_sgs) then
- call check_energy_chng(state, tend, "vdiff", nstep, ztodt, zero, zero, zero, zero)
- else
- call check_energy_chng(state, tend, "vdiff", nstep, ztodt, cam_in%cflx(:,1), zero, &
- zero, cam_in%shf)
- endif
-
- call check_tracers_chng(state, tracerint, "vdiff", nstep, ztodt, cam_in%cflx)
-
- ! aerosol dry deposition processes
- call t_startf('aero_drydep')
- call aero_model_drydep( state, pbuf, obklen, surfric, cam_in, ztodt, cam_out, ptend )
- call physics_update(state, ptend, ztodt, tend)
- call t_stopf('aero_drydep')
-
- ! CARMA microphysics
- !
- ! NOTE: This does both the timestep_tend for CARMA aerosols as well as doing the dry
- ! deposition for CARMA aerosols. It needs to follow vertical_diffusion_tend, so that
- ! obklen and surfric have been calculated. It needs to follow aero_model_drydep, so
- ! that cam_out%xxxdryxxx fields have already been set for CAM aerosols and cam_out
- ! can be added to for CARMA aerosols.
- if (carma_do_aerosol) then
- call t_startf('carma_timestep_tend')
- call carma_timestep_tend(state, cam_in, cam_out, ptend, ztodt, pbuf, obklen=obklen, ustar=surfric)
- call physics_update(state, ptend, ztodt, tend)
-
- call check_energy_chng(state, tend, "carma_tend", nstep, ztodt, zero, zero, zero, zero)
- call t_stopf('carma_timestep_tend')
- end if
-
-
- !---------------------------------------------------------------------------------
- ! ... enforce charge neutrality
- !---------------------------------------------------------------------------------
- call charge_balance(state, pbuf)
-
- !===================================================
- ! Gravity wave drag
- !===================================================
- call t_startf('gw_tend')
-
- call gw_tend(state, pbuf, ztodt, ptend, cam_in, flx_heat)
-
- call physics_update(state, ptend, ztodt, tend)
- ! Check energy integrals
- call check_energy_chng(state, tend, "gwdrag", nstep, ztodt, zero, &
- zero, zero, flx_heat)
- call t_stopf('gw_tend')
-
- ! QBO relaxation
- call qbo_relax(state, pbuf, ptend)
- call physics_update(state, ptend, ztodt, tend)
- ! Check energy integrals
- call check_energy_chng(state, tend, "qborelax", nstep, ztodt, zero, zero, zero, zero)
-
- ! Ion drag calculation
- call t_startf ( 'iondrag' )
-
- if ( do_waccm_ions ) then
- call iondrag_calc( lchnk, ncol, state, ptend, pbuf, ztodt )
- else
- call iondrag_calc( lchnk, ncol, state, ptend)
- endif
- !----------------------------------------------------------------------------
- ! Call ionosphere routines for extended model if mode is set to ionosphere
- !----------------------------------------------------------------------------
- if( waccmx_is('ionosphere') ) then
- call waccmx_phys_ion_elec_temp_tend(state, ptend, pbuf, ztodt)
- endif
-
- call physics_update(state, ptend, ztodt, tend)
-
- !---------------------------------------------------------------------------------
- ! Enforce charge neutrality after O+ change from ionos_tend
- !---------------------------------------------------------------------------------
- if( waccmx_is('ionosphere') ) then
- call charge_balance(state, pbuf)
- endif
-
- ! Check energy integrals
- call check_energy_chng(state, tend, "iondrag", nstep, ztodt, zero, zero, zero, zero)
-
- call t_stopf ( 'iondrag' )
-
- !-------------- Energy budget checks vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
-
- ! Save total energy for global fixer in next timestep (FV and SE dycores)
- call pbuf_set_field(pbuf, teout_idx, state%te_cur, (/1,itim_old/),(/pcols,1/))
-
- if (shallow_scheme .eq. 'UNICON') then
-
- ! ------------------------------------------------------------------------
- ! Insert the organization-related heterogeneities computed inside the
- ! UNICON into the tracer arrays here before performing advection.
- ! This is necessary to prevent any modifications of organization-related
- ! heterogeneities by non convection-advection process, such as
- ! dry and wet deposition of aerosols, MAM, etc.
- ! Again, note that only UNICON and advection schemes are allowed to
- ! changes to organization at this stage, although we can include the
- ! effects of other physical processes in future.
- ! ------------------------------------------------------------------------
-
- call unicon_cam_org_diags(state, pbuf)
-
- end if
- !
- ! 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 ( dycore_is('LR') .or. dycore_is('SE')) 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_t (:ncol,:pver) = state%t(:ncol,:pver)
- 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)
-
- !call physics_dme_adjust(state, tend, qini, ztodt)
- call physics_dme_adjust(state, tend, qini, ztodt, eflx, dsema, &
- ohf_adjust, cam_in%ocnfrac, cam_in%sst, cam_in%ts) !tht
-
-!!! 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)
-
- ! store T in buffer for use in computing dynamics T-tendency in next timestep
- do k = 1,pver
- dtcore(:ncol,k) = state%t(:ncol,k)
- end do
-
- !-------------- Energy budget checks ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
- if (aqua_planet) then
- labort = .false.
- do i=1,ncol
- if (cam_in%ocnfrac(i) /= 1._r8) labort = .true.
- end do
- if (labort) then
- call endrun ('TPHYSAC error: grid contains non-ocean point')
- 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, tmp_q, tmp_t, tmp_cldliq, tmp_cldice, &
- qini, cldliqini, cldiceini, eflx, dsema) !tht
-
- call clybry_fam_set( ncol, lchnk, map2chm, state%q, pbuf )
-
- end subroutine tphysac
-
- subroutine tphysbc (ztodt, state, &
- tend, pbuf, &
- cam_out, cam_in )
- !-----------------------------------------------------------------------
- !
- ! Purpose:
- ! Evaluate and apply physical processes that are calculated BEFORE
- ! coupling to land, sea, and ice models.
- !
- ! Processes currently included are:
- !
- ! o Resetting Negative Tracers to Positive
- ! o Global Mean Total Energy Fixer
- ! o Dry Adjustment
- ! o Asymmetric Turbulence Scheme : Deep Convection & Shallow Convection
- ! o Stratiform Macro-Microphysics
- ! o Wet Scavenging of Aerosol
- ! o Radiation
- !
- ! Method:
- !
- ! Each parameterization should be implemented with this sequence of calls:
- ! 1) Call physics interface
- ! 2) Check energy
- ! 3) Call physics_update
- ! See Interface to Column Physics and Chemistry Packages
- ! http://www.ccsm.ucar.edu/models/atm-cam/docs/phys-interface/index.html
- !
- !-----------------------------------------------------------------------
-
- use physics_buffer, only: physics_buffer_desc, pbuf_get_field
- use physics_buffer, only: pbuf_get_index, pbuf_old_tim_idx
- use physics_buffer, only: col_type_subcol, dyn_time_lvls
- use shr_kind_mod, only: r8 => shr_kind_r8
-
- use dadadj_cam, only: dadadj_tend
- use rk_stratiform, only: rk_stratiform_tend
- use microp_driver, only: microp_driver_tend
- use microp_aero, only: microp_aero_run
- use macrop_driver, only: macrop_driver_tend
- use physics_types, only: physics_state, physics_tend, physics_ptend, &
- physics_update, physics_ptend_init, physics_ptend_sum, &
- physics_state_check, physics_ptend_scale
- use cam_diagnostics, only: diag_conv_tend_ini, diag_phys_writeout, diag_conv, diag_export, diag_state_b4_phys_write
- use cam_history, only: outfld
- use physconst, only: cpair, latvap
- use constituents, only: pcnst, qmin, cnst_get_ind
- 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 dycore, only: dycore_is
- use aero_model, only: aero_model_wetdep
- use carma_intr, only: carma_wetdep_tend, carma_timestep_tend
- use carma_flags_mod, only: carma_do_detrain, carma_do_cldice, carma_do_cldliq, carma_do_wetdep
- use radiation, only: radiation_tend
- use cloud_diagnostics, only: cloud_diagnostics_calc
- use perf_mod
- use mo_gas_phase_chemdr,only: map2chm
- use clybry_fam, only: clybry_fam_adj
- use clubb_intr, only: clubb_tend_cam
- use sslt_rebin, only: sslt_rebin_adv
- use tropopause, only: tropopause_output
- use cam_abortutils, only: endrun
- use subcol, only: subcol_gen, subcol_ptend_avg
- use subcol_utils, only: subcol_ptend_copy, is_subcol_on
-
- ! Arguments
-
- real(r8), intent(in) :: ztodt ! 2 delta t (model time increment)
-
- type(physics_state), intent(inout) :: state
- type(physics_tend ), intent(inout) :: tend
- type(physics_buffer_desc), pointer :: pbuf(:)
-
- type(cam_out_t), intent(inout) :: cam_out
- type(cam_in_t), intent(in) :: cam_in
-
-
- !
- !---------------------------Local workspace-----------------------------
- !
-
- type(physics_ptend) :: ptend ! indivdual parameterization tendencies
- type(physics_state) :: state_sc ! state for sub-columns
- type(physics_ptend) :: ptend_sc ! ptend for sub-columns
- type(physics_ptend) :: ptend_aero ! ptend for microp_aero
- type(physics_ptend) :: ptend_aero_sc ! ptend for microp_aero on sub-columns
- type(physics_tend) :: tend_sc ! tend for sub-columns
-
- integer :: nstep ! current timestep number
-
- real(r8) :: net_flx(pcols)
-
- real(r8) :: zdu(pcols,pver) ! detraining mass flux from deep convection
- real(r8) :: cmfmc(pcols,pverp) ! Convective mass flux--m sub c
-
- real(r8) cmfcme(pcols,pver) ! cmf condensation - evaporation
-
- real(r8) dlf(pcols,pver) ! Detraining cld H20 from shallow + deep convections
- real(r8) dlf2(pcols,pver) ! Detraining cld H20 from shallow convections
- real(r8) pflx(pcols,pverp) ! Conv rain flux thru out btm of lev
-
- integer lchnk ! chunk identifier
- integer ncol ! number of atmospheric columns
-
- integer :: i ! column indicex
- integer :: ixcldice, ixcldliq ! constituent indices for cloud liquid and ice water.
- ! for macro/micro co-substepping
- integer :: macmic_it ! iteration variables
- real(r8) :: cld_macmic_ztodt ! modified timestep
- ! physics buffer fields to compute tendencies for stratiform package
- integer itim_old, ifld
- real(r8), pointer, dimension(:,:) :: cld ! cloud fraction
-
-
- ! physics buffer fields for total energy and mass adjustment
- real(r8), pointer, dimension(: ) :: teout
- real(r8), pointer, dimension(:,:) :: qini
- real(r8), pointer, dimension(:,:) :: cldliqini
- real(r8), pointer, dimension(:,:) :: cldiceini
- real(r8), pointer, dimension(:,:) :: dtcore
-
- real(r8), pointer, dimension(:,:,:) :: fracis ! fraction of transported species that are insoluble
-
- real(r8), pointer :: dlfzm(:,:) ! ZM detrained convective cloud water mixing ratio.
-
- ! convective precipitation variables
- real(r8),pointer :: prec_dp(:) ! total precipitation from ZM convection
- real(r8),pointer :: snow_dp(:) ! snow from ZM convection
- real(r8),pointer :: prec_sh(:) ! total precipitation from Hack convection
- real(r8),pointer :: snow_sh(:) ! snow from Hack convection
-
- ! carma precipitation variables
- real(r8) :: prec_sed_carma(pcols) ! total precip from cloud sedimentation (CARMA)
- real(r8) :: snow_sed_carma(pcols) ! snow from cloud ice sedimentation (CARMA)
-
- ! stratiform precipitation variables
- real(r8),pointer :: prec_str(:) ! sfc flux of precip from stratiform (m/s)
- real(r8),pointer :: snow_str(:) ! sfc flux of snow from stratiform (m/s)
- real(r8),pointer :: prec_str_sc(:) ! sfc flux of precip from stratiform (m/s) -- for subcolumns
- real(r8),pointer :: snow_str_sc(:) ! sfc flux of snow from stratiform (m/s) -- for subcolumns
- real(r8),pointer :: prec_pcw(:) ! total precip from prognostic cloud scheme
- real(r8),pointer :: snow_pcw(:) ! snow from prognostic cloud scheme
- real(r8),pointer :: prec_sed(:) ! total precip from cloud sedimentation
- real(r8),pointer :: snow_sed(:) ! snow from cloud ice sedimentation
-
- ! Local copies for substepping
- real(r8) :: prec_pcw_macmic(pcols)
- real(r8) :: snow_pcw_macmic(pcols)
- real(r8) :: prec_sed_macmic(pcols)
- real(r8) :: snow_sed_macmic(pcols)
-
- ! energy checking variables
- real(r8) :: zero(pcols) ! array of zeros
- real(r8) :: zero_sc(pcols*psubcols) ! array of zeros
- real(r8) :: rliq(pcols) ! vertical integral of liquid not yet in q(ixcldliq)
- real(r8) :: rice(pcols) ! vertical integral of ice not yet in q(ixcldice)
- real(r8) :: rliq2(pcols) ! vertical integral of liquid from shallow scheme
- real(r8) :: det_s (pcols) ! vertical integral of detrained static energy from ice
- real(r8) :: det_ice(pcols) ! vertical integral of detrained ice
- real(r8) :: flx_cnd(pcols)
- real(r8) :: flx_heat(pcols)
- 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')
-
- zero = 0._r8
- zero_tracers(:,:) = 0._r8
- zero_sc(:) = 0._r8
-
- lchnk = state%lchnk
- ncol = state%ncol
-
- nstep = get_nstep()
-
- ! Associate pointers with physics buffer fields
- itim_old = pbuf_old_tim_idx()
- ifld = pbuf_get_index('CLD')
- call pbuf_get_field(pbuf, ifld, cld, (/1,1,itim_old/),(/pcols,pver,1/))
-
- call pbuf_get_field(pbuf, teout_idx, teout, (/1,itim_old/), (/pcols,1/))
-
- call pbuf_get_field(pbuf, qini_idx, qini)
- call pbuf_get_field(pbuf, cldliqini_idx, cldliqini)
- call pbuf_get_field(pbuf, cldiceini_idx, cldiceini)
-
- ifld = pbuf_get_index('DTCORE')
- call pbuf_get_field(pbuf, ifld, dtcore, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) )
-
- ifld = pbuf_get_index('FRACIS')
- call pbuf_get_field(pbuf, ifld, fracis, start=(/1,1,1/), kount=(/pcols, pver, pcnst/) )
- fracis (:ncol,:,1:pcnst) = 1._r8
-
- ! Set physics tendencies to 0
- tend %dTdt(:ncol,:pver) = 0._r8
- tend %dudt(:ncol,:pver) = 0._r8
- tend %dvdt(:ncol,:pver) = 0._r8
-
- ! Verify state coming from the dynamics
- if (state_debug_checks) &
- call physics_state_check(state, name="before tphysbc (dycore?)")
-
- call clybry_fam_adj( ncol, lchnk, map2chm, state%q, pbuf )
-
- ! Since clybry_fam_adj operates directly on the tracers, and has no
- ! physics_update call, re-run qneg3.
-
- call qneg3('TPHYSBCc',lchnk ,ncol ,pcols ,pver , &
- 1, pcnst, qmin ,state%q )
-
- ! Validate output of clybry_fam_adj.
- if (state_debug_checks) &
- call physics_state_check(state, name="clybry_fam_adj")
-
- !
- ! Dump out "before physics" state
- !
- call diag_state_b4_phys_write (state)
-
- ! compute mass integrals of input tracers state
- call check_tracers_init(state, tracerint)
-
- call t_stopf('bc_init')
-
- !===================================================
- ! Global mean total energy fixer
- !===================================================
- call t_startf('energy_fixer')
-
- if (dycore_is('LR') .or. dycore_is('SE')) 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
- ! Save state for convective tendency calculations.
- call diag_conv_tend_ini(state, pbuf)
-
- call cnst_get_ind('CLDLIQ', ixcldliq)
- call cnst_get_ind('CLDICE', ixcldice)
- qini (:ncol,:pver) = state%q(:ncol,:pver, 1)
- cldliqini(:ncol,:pver) = state%q(:ncol,:pver,ixcldliq)
- cldiceini(:ncol,:pver) = state%q(:ncol,:pver,ixcldice)
-
- call outfld('TEOUT', teout , pcols, lchnk )
- call outfld('TEINP', state%te_ini, pcols, lchnk )
- call outfld('TEFIX', state%te_cur, pcols, lchnk )
-
- ! T tendency due to dynamics
- if( nstep > dyn_time_lvls-1 ) then
- dtcore(:ncol,:pver) = (state%t(:ncol,:pver) - dtcore(:ncol,:pver))/ztodt
- call outfld( 'DTCORE', dtcore, pcols, lchnk )
- end if
-
- call t_stopf('energy_fixer')
- !
- !===================================================
- ! Dry adjustment
- ! This code block is not a good example of interfacing a parameterization
- !===================================================
- call t_startf('dry_adjustment')
-
- call dadadj_tend(ztodt, state, ptend)
-
- call physics_update(state, ptend, ztodt, tend)
-
- call t_stopf('dry_adjustment')
-
- !===================================================
- ! Moist convection
- !===================================================
- call t_startf('moist_convection')
-
- call t_startf ('convect_deep_tend')
-
- call convect_deep_tend( &
- cmfmc, cmfcme, &
- pflx, zdu, &
- rliq, rice, &
- ztodt, &
- state, ptend, cam_in%landfrac, pbuf)
-
- call physics_update(state, ptend, ztodt, tend)
-
- call t_stopf('convect_deep_tend')
-
- call pbuf_get_field(pbuf, prec_dp_idx, prec_dp )
- call pbuf_get_field(pbuf, snow_dp_idx, snow_dp )
- call pbuf_get_field(pbuf, prec_sh_idx, prec_sh )
- call pbuf_get_field(pbuf, snow_sh_idx, snow_sh )
- call pbuf_get_field(pbuf, prec_str_idx, prec_str )
- call pbuf_get_field(pbuf, snow_str_idx, snow_str )
- call pbuf_get_field(pbuf, prec_sed_idx, prec_sed )
- call pbuf_get_field(pbuf, snow_sed_idx, snow_sed )
- call pbuf_get_field(pbuf, prec_pcw_idx, prec_pcw )
- call pbuf_get_field(pbuf, snow_pcw_idx, snow_pcw )
-
- if (use_subcol_microp) then
- call pbuf_get_field(pbuf, prec_str_idx, prec_str_sc, col_type=col_type_subcol)
- call pbuf_get_field(pbuf, snow_str_idx, snow_str_sc, col_type=col_type_subcol)
- end if
-
- ! Check energy integrals, including "reserved liquid"
- flx_cnd(:ncol) = prec_dp(:ncol) + rliq(:ncol)
- snow_dp(:ncol) = snow_dp(:ncol) + rice(:ncol)
- call check_energy_chng(state, tend, "convect_deep", nstep, ztodt, zero, flx_cnd, snow_dp, zero)
- snow_dp(:ncol) = snow_dp(:ncol) - rice(:ncol)
-
- !
- ! Call Hack (1994) convection scheme to deal with shallow/mid-level convection
- !
- call t_startf ('convect_shallow_tend')
-
- if (dlfzm_idx > 0) then
- call pbuf_get_field(pbuf, dlfzm_idx, dlfzm)
- dlf(:ncol,:) = dlfzm(:ncol,:)
- else
- dlf(:,:) = 0._r8
- end if
-
- call convect_shallow_tend (ztodt , cmfmc, &
- dlf , dlf2 , rliq , rliq2, &
- state , ptend , pbuf, cam_in)
- call t_stopf ('convect_shallow_tend')
-
- call physics_update(state, ptend, ztodt, tend)
-
- flx_cnd(:ncol) = prec_sh(:ncol) + rliq2(:ncol)
- call check_energy_chng(state, tend, "convect_shallow", nstep, ztodt, zero, flx_cnd, snow_sh, zero)
-
- call check_tracers_chng(state, tracerint, "convect_shallow", nstep, ztodt, zero_tracers)
-
- call t_stopf('moist_convection')
-
- ! Rebin the 4-bin version of sea salt into bins for coarse and accumulation
- ! modes that correspond to the available optics data. This is only necessary
- ! for CAM-RT. But it's done here so that the microphysics code which is called
- ! from the stratiform interface has access to the same aerosols as the radiation
- ! code.
- call sslt_rebin_adv(pbuf, state)
-
- !===================================================
- ! Calculate tendencies from CARMA bin microphysics.
- !===================================================
- !
- ! If CARMA is doing detrainment, then on output, rliq no longer represents water reserved
- ! for detrainment, but instead represents potential snow fall. The mass and number of the
- ! snow are stored in the physics buffer and will be incorporated by the MG microphysics.
- !
- ! Currently CARMA cloud microphysics is only supported with the MG microphysics.
- call t_startf('carma_timestep_tend')
-
- if (carma_do_cldice .or. carma_do_cldliq) then
- call carma_timestep_tend(state, cam_in, cam_out, ptend, ztodt, pbuf, dlf=dlf, rliq=rliq, &
- prec_str=prec_str, snow_str=snow_str, prec_sed=prec_sed_carma, snow_sed=snow_sed_carma)
- call physics_update(state, ptend, ztodt, tend)
-
- ! Before the detrainment, the reserved condensate is all liquid, but if CARMA is doing
- ! detrainment, then the reserved condensate is snow.
- if (carma_do_detrain) then
- call check_energy_chng(state, tend, "carma_tend", nstep, ztodt, zero, prec_str+rliq, snow_str+rliq, zero)
- else
- call check_energy_chng(state, tend, "carma_tend", nstep, ztodt, zero, prec_str, snow_str, zero)
- end if
- end if
-
- call t_stopf('carma_timestep_tend')
-
- if( microp_scheme == 'RK' ) then
-
- !===================================================
- ! Calculate stratiform tendency (sedimentation, detrain, cloud fraction and microphysics )
- !===================================================
- call t_startf('rk_stratiform_tend')
-
- call rk_stratiform_tend(state, ptend, pbuf, ztodt, &
- cam_in%icefrac, cam_in%landfrac, cam_in%ocnfrac, &
- cam_in%snowhland, & ! sediment
- dlf, dlf2, & ! detrain
- rliq , & ! check energy after detrain
- cmfmc, &
- cam_in%ts, cam_in%sst, zdu)
-
- call physics_update(state, ptend, ztodt, tend)
- call check_energy_chng(state, tend, "cldwat_tend", nstep, ztodt, zero, prec_str, snow_str, zero)
-
- call t_stopf('rk_stratiform_tend')
-
- elseif( microp_scheme == 'MG' ) then
- ! Start co-substepping of macrophysics and microphysics
- cld_macmic_ztodt = ztodt/cld_macmic_num_steps
-
- ! Clear precip fields that should accumulate.
- prec_sed_macmic = 0._r8
- snow_sed_macmic = 0._r8
- prec_pcw_macmic = 0._r8
- snow_pcw_macmic = 0._r8
-
- do macmic_it = 1, cld_macmic_num_steps
-
- !===================================================
- ! Calculate macrophysical tendency (sedimentation, detrain, cloud fraction)
- !===================================================
-
- call t_startf('macrop_tend')
-
- ! don't call Park macrophysics if CLUBB is called
- if (macrop_scheme .ne. 'CLUBB_SGS') then
-
- call macrop_driver_tend( &
- state, ptend, cld_macmic_ztodt, &
- cam_in%landfrac, cam_in%ocnfrac, cam_in%snowhland, & ! sediment
- dlf, dlf2, & ! detrain
- cmfmc, &
- cam_in%ts, cam_in%sst, zdu, &
- pbuf, det_s, det_ice)
-
- ! Since we "added" the reserved liquid back in this routine, we need
- ! to account for it in the energy checker
- flx_cnd(:ncol) = -1._r8*rliq(:ncol)
- flx_heat(:ncol) = det_s(:ncol)
-
- ! Unfortunately, physics_update does not know what time period
- ! "tend" is supposed to cover, and therefore can't update it
- ! with substeps correctly. For now, work around this by scaling
- ! ptend down by the number of substeps, then applying it for
- ! the full time (ztodt).
- call physics_ptend_scale(ptend, 1._r8/cld_macmic_num_steps, ncol)
- call physics_update(state, ptend, ztodt, tend)
- call check_energy_chng(state, tend, "macrop_tend", nstep, ztodt, &
- zero, flx_cnd(:ncol)/cld_macmic_num_steps, &
- det_ice(:ncol)/cld_macmic_num_steps, &
- flx_heat(:ncol)/cld_macmic_num_steps)
-
- else ! Calculate CLUBB macrophysics
-
- ! =====================================================
- ! CLUBB call (PBL, shallow convection, macrophysics)
- ! =====================================================
-
- call clubb_tend_cam(state,ptend,pbuf,cld_macmic_ztodt,&
- cmfmc, cam_in, macmic_it, cld_macmic_num_steps, &
- dlf, det_s, det_ice)
-
- ! Since we "added" the reserved liquid back in this routine, we need
- ! to account for it in the energy checker
- flx_cnd(:ncol) = -1._r8*rliq(:ncol)
- flx_heat(:ncol) = cam_in%shf(:ncol) + det_s(:ncol)
-
- ! Unfortunately, physics_update does not know what time period
- ! "tend" is supposed to cover, and therefore can't update it
- ! with substeps correctly. For now, work around this by scaling
- ! ptend down by the number of substeps, then applying it for
- ! the full time (ztodt).
- call physics_ptend_scale(ptend, 1._r8/cld_macmic_num_steps, ncol)
- ! Update physics tendencies and copy state to state_eq, because that is
- ! input for microphysics
- call physics_update(state, ptend, ztodt, tend)
- call check_energy_chng(state, tend, "clubb_tend", nstep, ztodt, &
- cam_in%lhf(:ncol)/latvap/cld_macmic_num_steps, &
- flx_cnd(:ncol)/cld_macmic_num_steps, &
- det_ice(:ncol)/cld_macmic_num_steps, &
- flx_heat(:ncol)/cld_macmic_num_steps)
-
- endif
-
- call t_stopf('macrop_tend')
-
- !===================================================
- ! Calculate cloud microphysics
- !===================================================
-
- if (is_subcol_on()) then
- ! Allocate sub-column structures.
- call physics_state_alloc(state_sc, lchnk, psubcols*pcols)
- call physics_tend_alloc(tend_sc, psubcols*pcols)
-
- ! Generate sub-columns using the requested scheme
- call subcol_gen(state, tend, state_sc, tend_sc, pbuf)
-
- !Initialize check energy for subcolumns
- call check_energy_timestep_init(state_sc, tend_sc, pbuf, col_type_subcol)
- end if
-
- call t_startf('microp_aero_run')
- call microp_aero_run(state, ptend_aero, cld_macmic_ztodt, pbuf)
- call t_stopf('microp_aero_run')
-
- call t_startf('microp_tend')
-
- if (use_subcol_microp) then
- call microp_driver_tend(state_sc, ptend_sc, cld_macmic_ztodt, pbuf)
-
- ! Average the sub-column ptend for use in gridded update - will not contain ptend_aero
- call subcol_ptend_avg(ptend_sc, state_sc%ngrdcol, lchnk, ptend)
-
- ! Copy ptend_aero field to one dimensioned by sub-columns before summing with ptend
- call subcol_ptend_copy(ptend_aero, state_sc, ptend_aero_sc)
- call physics_ptend_sum(ptend_aero_sc, ptend_sc, state_sc%ncol)
- call physics_ptend_dealloc(ptend_aero_sc)
-
- ! Have to scale and apply for full timestep to get tend right
- ! (see above note for macrophysics).
- call physics_ptend_scale(ptend_sc, 1._r8/cld_macmic_num_steps, ncol)
-
- call physics_update (state_sc, ptend_sc, ztodt, tend_sc)
- call check_energy_chng(state_sc, tend_sc, "microp_tend_subcol", &
- nstep, ztodt, zero_sc, &
- prec_str_sc(:state_sc%ncol)/cld_macmic_num_steps, &
- snow_str_sc(:state_sc%ncol)/cld_macmic_num_steps, zero_sc)
-
- call physics_state_dealloc(state_sc)
- call physics_tend_dealloc(tend_sc)
- call physics_ptend_dealloc(ptend_sc)
- else
- call microp_driver_tend(state, ptend, cld_macmic_ztodt, pbuf)
- end if
- ! combine aero and micro tendencies for the grid
- call physics_ptend_sum(ptend_aero, ptend, ncol)
- call physics_ptend_dealloc(ptend_aero)
-
- ! Have to scale and apply for full timestep to get tend right
- ! (see above note for macrophysics).
- call physics_ptend_scale(ptend, 1._r8/cld_macmic_num_steps, ncol)
-
- call physics_update (state, ptend, ztodt, tend)
- call check_energy_chng(state, tend, "microp_tend", nstep, ztodt, &
- zero, prec_str(:ncol)/cld_macmic_num_steps, &
- snow_str(:ncol)/cld_macmic_num_steps, zero)
-
- call t_stopf('microp_tend')
- prec_sed_macmic(:ncol) = prec_sed_macmic(:ncol) + prec_sed(:ncol)
- snow_sed_macmic(:ncol) = snow_sed_macmic(:ncol) + snow_sed(:ncol)
- prec_pcw_macmic(:ncol) = prec_pcw_macmic(:ncol) + prec_pcw(:ncol)
- snow_pcw_macmic(:ncol) = snow_pcw_macmic(:ncol) + snow_pcw(:ncol)
-
- end do ! end substepping over macrophysics/microphysics
-
- prec_sed(:ncol) = prec_sed_macmic(:ncol)/cld_macmic_num_steps
- snow_sed(:ncol) = snow_sed_macmic(:ncol)/cld_macmic_num_steps
- prec_pcw(:ncol) = prec_pcw_macmic(:ncol)/cld_macmic_num_steps
- snow_pcw(:ncol) = snow_pcw_macmic(:ncol)/cld_macmic_num_steps
- prec_str(:ncol) = prec_pcw(:ncol) + prec_sed(:ncol)
- snow_str(:ncol) = snow_pcw(:ncol) + snow_sed(:ncol)
-
- endif
-
- ! Add the precipitation from CARMA to the precipitation from stratiform.
- if (carma_do_cldice .or. carma_do_cldliq) then
- prec_sed(:ncol) = prec_sed(:ncol) + prec_sed_carma(:ncol)
- snow_sed(:ncol) = snow_sed(:ncol) + snow_sed_carma(:ncol)
- end if
-
- if ( .not. deep_scheme_does_scav_trans() ) then
-
- ! -------------------------------------------------------------------------------
- ! 1. Wet Scavenging of Aerosols by Convective and Stratiform Precipitation.
- ! 2. Convective Transport of Non-Water Aerosol Species.
- !
- ! . Aerosol wet chemistry determines scavenging fractions, and transformations
- ! . Then do convective transport of all trace species except qv,ql,qi.
- ! . We needed to do the scavenging first to determine the interstitial fraction.
- ! . When UNICON is used as unified convection, we should still perform
- ! wet scavenging but not 'convect_deep_tend2'.
- ! -------------------------------------------------------------------------------
-
- call t_startf('bc_aerosols')
- if (clim_modal_aero .and. .not. prog_modal_aero) then
- call modal_aero_calcsize_diag(state, pbuf)
- call modal_aero_wateruptake_dr(state, pbuf)
- endif
- call aero_model_wetdep( state, ztodt, dlf, cam_out, ptend, pbuf)
- call physics_update(state, ptend, ztodt, tend)
-
-
- if (carma_do_wetdep) then
- ! CARMA wet deposition
- !
- ! NOTE: It needs to follow aero_model_wetdep, so that cam_out%xxxwetxxx
- ! fields have already been set for CAM aerosols and cam_out can be added
- ! to for CARMA aerosols.
- call t_startf ('carma_wetdep_tend')
- call carma_wetdep_tend(state, ptend, ztodt, pbuf, dlf, cam_out)
- call physics_update(state, ptend, ztodt, tend)
- call t_stopf ('carma_wetdep_tend')
- end if
-
- call t_startf ('convect_deep_tend2')
- call convect_deep_tend_2( state, ptend, ztodt, pbuf )
- call physics_update(state, ptend, ztodt, tend)
- call t_stopf ('convect_deep_tend2')
-
- ! check tracer integrals
- call check_tracers_chng(state, tracerint, "cmfmca", nstep, ztodt, zero_tracers)
-
- call t_stopf('bc_aerosols')
-
- endif
-
- !===================================================
- ! Moist physical parameteriztions complete:
- ! send dynamical variables, and derived variables to history file
- !===================================================
-
- call t_startf('bc_history_write')
- call diag_phys_writeout(state, cam_out%psl)
- call diag_conv(state, ztodt, pbuf)
-
- call t_stopf('bc_history_write')
-
- !===================================================
- ! Write cloud diagnostics on history file
- !===================================================
-
- call t_startf('bc_cld_diag_history_write')
-
- call cloud_diagnostics_calc(state, pbuf)
-
- call t_stopf('bc_cld_diag_history_write')
-
- !===================================================
- ! Radiation computations
- !===================================================
- call t_startf('radiation')
-
-
- call radiation_tend( &
- state, ptend, pbuf, cam_out, cam_in, net_flx)
-
- ! Set net flux used by spectral dycores
- do i=1,ncol
- tend%flx_net(i) = net_flx(i)
- end do
- call physics_update(state, ptend, ztodt, tend)
- call check_energy_chng(state, tend, "radheat", nstep, ztodt, zero, zero, zero, net_flx)
-
- call t_stopf('radiation')
-
- ! Diagnose the location of the tropopause and its location to the history file(s).
- call t_startf('tropopause')
- call tropopause_output(state)
- call t_stopf('tropopause')
-
- ! Save atmospheric fields to force surface models
- call t_startf('cam_export')
- call cam_export (state,cam_out,pbuf)
- call t_stopf('cam_export')
-
- ! Write export state to history file
- call t_startf('diag_export')
- call diag_export(cam_out)
- call t_stopf('diag_export')
-
- end subroutine tphysbc
-
-subroutine phys_timestep_init(phys_state, cam_in, cam_out, pbuf2d)
-!-----------------------------------------------------------------------------------
-!
-! Purpose: The place for parameterizations to call per timestep initializations.
-! Generally this is used to update time interpolated fields from boundary
-! 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
- use physics_buffer, only: physics_buffer_desc
- use carma_intr, only: carma_timestep_init
- use ghg_data, only: ghg_data_timestep_init
- use cam3_aero_data, only: cam3_aero_data_on, cam3_aero_data_timestep_init
- use cam3_ozone_data, only: cam3_ozone_data_on, cam3_ozone_data_timestep_init
- use aoa_tracers, only: aoa_tracers_timestep_init
- use vertical_diffusion, only: vertical_diffusion_ts_init
- use radheat, only: radheat_timestep_init
- use solar_data, only: solar_data_advance
- use qbo, only: qbo_timestep_init
- use iondrag, only: do_waccm_ions, iondrag_timestep_init
- use perf_mod
-
- use prescribed_ozone, only: prescribed_ozone_adv
- use prescribed_ghg, only: prescribed_ghg_adv
- use prescribed_aero, only: prescribed_aero_adv
- use aerodep_flx, only: aerodep_flx_adv
- use aircraft_emit, only: aircraft_emit_adv
- use prescribed_volcaero, only: prescribed_volcaero_adv
- use prescribed_strataero,only: prescribed_strataero_adv
- use mo_apex, only: mo_apex_init
- use epp_ionization, only: epp_ionization_active
- use iop_forcing, only: scam_use_iop_srf
- use waccmx_phys_intr, only: waccmx_phys_ion_elec_temp_stepinit
-
- implicit none
-
- type(physics_state), intent(inout), dimension(begchunk:endchunk) :: phys_state
- type(cam_in_t), intent(inout), dimension(begchunk:endchunk) :: cam_in
- type(cam_out_t), intent(inout), dimension(begchunk:endchunk) :: cam_out
-
- type(physics_buffer_desc), pointer :: pbuf2d(:,:)
-
- !-----------------------------------------------------------------------------
-
- if (single_column) call scam_use_iop_srf(cam_in)
-
- ! update geomagnetic coordinates
- if (epp_ionization_active .or. do_waccm_ions) then
- call mo_apex_init(phys_state)
- endif
-
- ! Chemistry surface values
- call chem_surfvals_set()
-
- ! Solar irradiance
- call solar_data_advance()
-
- ! Time interpolate for chemistry.
- call chem_timestep_init(phys_state, pbuf2d)
-
- ! Prescribed tracers
- call prescribed_ozone_adv(phys_state, pbuf2d)
- call prescribed_ghg_adv(phys_state, pbuf2d)
- call prescribed_aero_adv(phys_state, pbuf2d)
- call aircraft_emit_adv(phys_state, pbuf2d)
- call prescribed_volcaero_adv(phys_state, pbuf2d)
- call prescribed_strataero_adv(phys_state, pbuf2d)
-
- ! prescribed aerosol deposition fluxes
- call aerodep_flx_adv(phys_state, pbuf2d, cam_out)
-
- ! CAM3 prescribed aerosol masses
- if (cam3_aero_data_on) call cam3_aero_data_timestep_init(pbuf2d, phys_state)
-
- ! CAM3 prescribed ozone data
- if (cam3_ozone_data_on) call cam3_ozone_data_timestep_init(pbuf2d, phys_state)
-
- ! Time interpolate data models of gasses in pbuf2d
- call ghg_data_timestep_init(pbuf2d, phys_state)
-
- ! Upper atmosphere radiative processes
- call radheat_timestep_init(phys_state, pbuf2d)
-
- ! Time interpolate for vertical diffusion upper boundary condition
- call vertical_diffusion_ts_init(pbuf2d, phys_state)
-
- !----------------------------------------------------------------------
- ! update QBO data for this time step
- !----------------------------------------------------------------------
- call qbo_timestep_init
-
- call iondrag_timestep_init()
-
- !----------------------------------------------------------------------
- ! update waccmx Te / Ti module
- !----------------------------------------------------------------------
- call waccmx_phys_ion_elec_temp_stepinit()
-
- call carma_timestep_init()
-
- ! age of air tracers
- call aoa_tracers_timestep_init(phys_state)
-
-end subroutine phys_timestep_init
-
-end module physpkg
diff --git a/src/physics/cam/vertical_diffusion.F90 b/src/physics/cam/vertical_diffusion.F90
index 3fa31560d1..ee9b2f1ce1 100644
--- a/src/physics/cam/vertical_diffusion.F90
+++ b/src/physics/cam/vertical_diffusion.F90
@@ -1067,9 +1067,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 )
@@ -1158,7 +1158,7 @@ subroutine vertical_diffusion_tend( &
p_dry , state%t , rhoi_dry, ztodt , taux , &
tauy , shflux , cflux , &
kvh , kvm , kvq , cgs , cgh , &
- state%zi , ksrftms , dragblj , &
+ state%zi , ksrftms , dragblj , &
qmincg , fieldlist_dry , fieldlist_molec,&
u_tmp , v_tmp , q_tmp , s_tmp , &
tautmsx_temp , tautmsy_temp , dtk_temp , topflx_temp , errstring , &
@@ -1417,12 +1417,11 @@ subroutine vertical_diffusion_tend( &
call outfld( 'uflx_cg_PBL' , uflx_cg, pcols, lchnk )
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 )
@@ -1458,7 +1457,7 @@ subroutine vertical_diffusion_tend( &
call outfld( 'DUV' , ptend%u, pcols, lchnk )
call outfld( 'DVV' , ptend%v, pcols, lchnk )
do m = 1, pcnst
- call outfld( vdiffnam(m) , ptend%q(1,1,m), pcols, lchnk )
+ call outfld( vdiffnam(m) , ptend%q(:,:,m), pcols, lchnk )
end do
if( do_molec_diff ) then
call outfld( 'TTPXMLC' , topflx, pcols, lchnk )
diff --git a/src/physics/spcam/spcam_drivers.F90 b/src/physics/spcam/spcam_drivers.F90
index 2c850286df..aad6cd79ac 100644
--- a/src/physics/spcam/spcam_drivers.F90
+++ b/src/physics/spcam/spcam_drivers.F90
@@ -1189,7 +1189,7 @@ subroutine spcam_radiation_finalize_m2005(cam_in, state, pbuf, rad_avgdata, cam_
call outfld('SOLLD'//' ',rad_avgdata%solld_m(:) ,pcols,lchnk)
call outfld('FSN200'//' ',rad_avgdata%fsn200_m(:),pcols,lchnk)
call outfld('FSN200C'//' ',rad_avgdata%fsn200c_m(:),pcols,lchnk)
- call outfld('SWCF'//' ',rad_avgdata%fsntoa_m(:)-rad_avgdata%fsntoac_m(:) ,pcols,lchnk)
+ call outfld('SWCF'//' ',rad_avgdata%fsntoa_m(:)-rad_avgdata%fsntoac_m(:) ,ncol,lchnk)
call outfld('FSNR'//' ',rad_avgdata%fsnr_m(:) ,pcols,lchnk)
do i = 1, nnite
diff --git a/src/physics/waccm/mo_aurora.F90 b/src/physics/waccm/mo_aurora.F90
index ac754294d1..68b7fd9aa7 100644
--- a/src/physics/waccm/mo_aurora.F90
+++ b/src/physics/waccm/mo_aurora.F90
@@ -5,7 +5,7 @@ module mo_aurora
! Auroral oval parameterization. See reference:
! R.G. Roble, E.C. Ridley
! An auroral model for the NCAR thermospheric general circulation model (TGCM)
-! Annales Geophysicae,5A, (6), 369-382, 1987.
+! Annales Geophysicae,5A, (6), 369-382, 1987.
!
! The aurora oval is a circle in auroral circle coordinates. Auroral circle
! coordinates are offset from magnetic coordinates by offa degrees (radians)
@@ -46,7 +46,7 @@ module mo_aurora
! 1) sub aurora_cons called once per time step from advance.
! 2) sub aurora called from dynamics, inside parallel latitude scan.
! 3) subs aurora_cusp and aurora_heat called from sub aurora.
-! 4) sub aurora_ions called from sub aurora.
+! 4) sub aurora_ions called from sub aurora.
!
!-----------------------------------------------------------------------
@@ -71,7 +71,7 @@ module mo_aurora
private
public :: aurora_inti, aurora_timestep_init, aurora
public :: aurora_register
-
+
integer, parameter :: isouth = 1
integer, parameter :: inorth = 2
@@ -143,7 +143,7 @@ module mo_aurora
contains
-
+
!----------------------------------------------------------------------
!----------------------------------------------------------------------
subroutine aurora_register
@@ -342,9 +342,9 @@ subroutine aurora_timestep_init( )
!-----------------------------------------------------------------------
rh = (h2 - h1) / (h1 + h2)
- h0 = 0.5_r8 * (h1 + h2) * d2r
-
-
+ h0 = 0.5_r8 * (h1 + h2) * d2r
+
+
! roth = MLT of max width of aurora in hours
! rote = MLT of max energy flux of aurora in hours
@@ -471,14 +471,14 @@ 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(:,lchnk), pcols, lchnk )
+ call outfld( 'ALATM', r2d*alatm(:,lchnk), pcols, lchnk )
if (indxQTe>0) then
call pbuf_get_field(pbuf, indxQTe, qteaur)
qteaur(:) = 0._r8
endif
-
+
!-----------------------------------------------------------------------
! aurora is active for columns poleward of 30 deg
!-----------------------------------------------------------------------
@@ -496,7 +496,7 @@ subroutine aurora_prod( tn, o2, o1, mbar, rlats, &
do i = 1,ncol
if( do_aurora(i) ) then
dlat_aur(i) = alatm(i,lchnk)
- dlon_aur(i) = alonm(i,lchnk) + rotation ! rotate it
+ dlon_aur(i) = alonm(i,lchnk) + rotation ! rotate it
if( dlon_aur(i) > pi ) then
dlon_aur(i) = dlon_aur(i) - twopi
else if( dlon_aur(i) < -pi ) then
@@ -654,7 +654,7 @@ subroutine aurora_hrate( tn, mbar, rlats, &
do i = 1,ncol
if( do_aurora(i) ) then
dlat_aur(i) = alatm(i,lchnk)
- dlon_aur(i) = alonm(i,lchnk) + rotation ! rotate it
+ dlon_aur(i) = alonm(i,lchnk) + rotation ! rotate it
if( dlon_aur(i) > pi ) then
dlon_aur(i) = dlon_aur(i) - twopi
else if( dlon_aur(i) < -pi ) then
@@ -709,7 +709,7 @@ subroutine aurora_hrate( tn, mbar, rlats, &
call aurora_heat( flux, flux2, alfa, alfa2, &
drizl, do_aurora, hemis, &
alon, colat, ncol, pbuf )
-
+
!-----------------------------------------------------------------------
! ... auroral additions to ionization rates
!-----------------------------------------------------------------------
@@ -758,7 +758,7 @@ subroutine aurora_cusp( cusp, do_aurora, hemis, colat, alon, ncol )
cusp(:) = 0._r8
endwhere
- end subroutine aurora_cusp
+ end subroutine aurora_cusp
subroutine aurora_heat( flux, flux2, alfa, alfa2, &
drizl, do_aurora, hemis, &
@@ -767,7 +767,7 @@ subroutine aurora_heat( flux, flux2, alfa, alfa2, &
! ... calculate alfa, flux, and drizzle
!-----------------------------------------------------------------------
use physics_buffer,only: physics_buffer_desc,pbuf_get_field
-
+
implicit none
!-----------------------------------------------------------------------
@@ -793,12 +793,12 @@ subroutine aurora_heat( flux, flux2, alfa, alfa2, &
halfwidth, & ! oval half-width
wrk, & ! temp wrk array
dtheta ! latitudinal variation (Gaussian)
- real(r8) :: ekev
+ real(r8) :: ekev
real(r8), pointer :: amie_efxg(:) ! Pointer to pbuf AMIE energy flux (mW m-2)
real(r8), pointer :: amie_kevg(:) ! Pointer to pbuf AMIE mean energy (keV)
real(r8), pointer :: qteaur(:) ! for electron temperature
integer :: n
-
+
!-----------------------------------------------------------------------
! Low-energy protons:
!
@@ -845,7 +845,7 @@ subroutine aurora_heat( flux, flux2, alfa, alfa2, &
endwhere
!-----------------------------------------------------------------------
-! ... for electron temperature (used in settei):
+! ... for electron temperature (used in settei):
!-----------------------------------------------------------------------
if (indxQTe>0) then
call pbuf_get_field(pbuf, indxQTe, qteaur)
@@ -949,14 +949,14 @@ subroutine aurora_ions( drizl, cusp, alfa1, alfa2, &
real(r8) :: wrk(ncol,pver)
real(r8), pointer :: aurIPRateSum(:,:) ! Pointer to pbuf auroral ion production sum for O2+,O+,N2+ (s-1 cm-3)
-
+
qia(:) = 0._r8
wrk(:,:) = 0._r8
!-----------------------------------------------------------
- ! Point to production rates array in physics buffer where
- ! rates will be stored for ionosphere module access. Also,
- ! initialize rates to zero before column loop since only
+ ! Point to production rates array in physics buffer where
+ ! rates will be stored for ionosphere module access. Also,
+ ! initialize rates to zero before column loop since only
! daylight values are filled
!-----------------------------------------------------------
if (indxAIPRS>0) then
@@ -1036,15 +1036,15 @@ subroutine aurora_ions( drizl, cusp, alfa1, alfa2, &
end do level_loop
!----------------------------------------------------------------
- ! Store the sum of the ion production rates in pbuf to be used
- ! in the ionosx module
+ ! Store the sum of the ion production rates in pbuf to be used
+ ! in the ionosx module
!----------------------------------------------------------------
if (indxAIPRS>0) then
-
- aurIPRateSum(1:ncol,1:pver) = wrk(1:ncol,1:pver)
-
+
+ aurIPRateSum(1:ncol,1:pver) = wrk(1:ncol,1:pver)
+
endif
-
+
call outfld( 'QSUM', wrk, ncol, lchnk )
end subroutine aurora_ions
@@ -1160,9 +1160,9 @@ subroutine aion( si, so, do_aurora, ncol )
!-----------------------------------------------------------------------
! Calculates integrated f(x) needed for total auroral ionization.
! See equations (10-12) in Roble,1987.
-! Coefficients for equation (12) of Roble,1987 are in variable cc
+! Coefficients for equation (12) of Roble,1987 are in variable cc
! (revised since 1987):
-! Uses the identity x**y = exp(y*ln(x)) for performance
+! Uses the identity x**y = exp(y*ln(x)) for performance
! (fewer (1/2) trancendental functions are required).
!------------------------------------------------------------------------